Ignore:
Timestamp:
Aug 25, 2018, 6:29:34 PM (6 years ago)
Author:
viala@…
Message:

[syscalls] add interface in implementation.

Add const where possible, fix protoypes to follow interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/syscalls.h

    r479 r506  
    3636struct mmap_attr_s;               // defined in vmm.h
    3737
     38// debug:
     39const char * syscall_str( uint32_t index );
     40
    3841/******************************************************************************************
    3942 * [0] This function terminates the execution of the calling user thread,
     
    7073 * @ return 0 if success / return -1 if failure.
    7174 *****************************************************************************************/
    72 int sys_thread_create( struct thread_s        * new_thread,
    73                        struct pthread_attr_s  * user_attr,
    74                        void                   * start_func,
    75                        void                   * start_args );
     75int sys_thread_create(
     76  struct thread_s             * new_thread,
     77  const struct pthread_attr_s * user_attr,
     78  const void                  * start_func,
     79  const void                  * start_args );
    7680
    7781/******************************************************************************************
     
    201205 * @ return file descriptor index in fd_array if success / return -1 if failure.
    202206 *****************************************************************************************/
    203 int sys_open( char    * pathname,
    204               uint32_t  flags,
    205               uint32_t  mode );
     207int sys_open( const char * pathname,
     208              uint32_t     flags,
     209              uint32_t     mode );
    206210
    207211/******************************************************************************************
     
    276280 * @ return 0 if success / returns -1 if failure.
    277281 *****************************************************************************************/
    278 int sys_unlink( char * pathname );
     282int sys_unlink( const char * pathname );
    279283
    280284/******************************************************************************************
     
    295299 * @ return 0 if success / returns -1 if failure.
    296300 *****************************************************************************************/
    297 int sys_chdir( char * pathname );
     301int sys_chdir( const char * pathname );
    298302
    299303/******************************************************************************************
     
    383387 * @ return 0 if success / returns -1 if failure.
    384388 *****************************************************************************************/
    385 int sys_rmdir( char * pathname );
     389int sys_rmdir( const char * pathname );
    386390
    387391/******************************************************************************************
     
    404408 * @ return 0 if success / returns -1 if failure.
    405409 *****************************************************************************************/
    406 int sys_chmod( char    * pathname,
    407                uint32_t   rights );
     410int sys_chmod( const char * pathname,
     411               uint32_t     rights );
    408412
    409413/******************************************************************************************
     
    490494 * @ does not return if success / returns -1 if failure.
    491495 *****************************************************************************************/
    492 int sys_exec( char  * filename,
    493               char ** argv,
    494               char ** envp );
     496int sys_exec( const char  * filename,
     497              char        ** argv,
     498              char        ** envp );
    495499
    496500/******************************************************************************************
     
    610614 * @ return 0 if success / return -1 if failure.
    611615 *****************************************************************************************/
    612 int sys_thread_wakeup( void );
     616int sys_thread_wakeup( trdid_t trdid );
    613617
    614618/******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.