Changeset 433 for trunk/kernel/syscalls/syscalls.h
- Timestamp:
- Feb 14, 2018, 3:40:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/syscalls.h
r421 r433 171 171 /****************************************************************************************** 172 172 * [10] This function implement the exit system call terminating a POSIX process. 173 * In the present implementation, this function implements actually the _exit(): 174 * - it does not flush open ourput steams. 175 * - it does not close open streams. 173 176 ****************************************************************************************** 174 177 * @ status : terminaison status (not used in present implementation). … … 421 424 422 425 /****************************************************************************************** 423 * [34] This function implements the "kill" system call .426 * [34] This function implements the "kill" system call on the kernel side. 424 427 * It register the signal defined by the <sig_id> argument in all thread descriptors 425 428 * of a target process identified by the <pid> argument. This is done in all clusters … … 432 435 ****************************************************************************************** 433 436 * @ pid : target process identifier. 434 * @ sig_id : index defining the signal type (from 1 to 31).437 * @ sig_id : index defining the signal type. 435 438 * @ return 0 if success / returns -1 if failure. 436 439 *****************************************************************************************/ … … 439 442 440 443 /****************************************************************************************** 441 * [35] This function implements the "getpid" system call .444 * [35] This function implements the "getpid" system call on the kernel side. 442 445 ****************************************************************************************** 443 446 * @ returns the process PID for the calling thread. … … 446 449 447 450 /****************************************************************************************** 448 * [36] This function implement the "fork" system call .449 * The calling process descriptor (parent process), and the associated thread descriptor are450 * replicated in the same cluster as the calling thread, but the new process (child process)451 * is registered in another target cluster, that is the new process owner.452 * The child process and the associated main thread will be migrated to the target cluster453 * later, when the child process makes an "exec" or any other system call... TODO [AG]451 * [36] This function implement the "fork" system call on the kernel side. 452 * The calling process descriptor (parent process), and the associated thread descriptor 453 * are replicated in a - likely - remote cluster, that becomes the child process owner. 454 * The child process get a new PID, and is linked to the parent PID. The child process 455 * inherit from its parent the memory image, and all open files (including the TXT). 456 * The child process becomes the TXT terminal owner. 454 457 * The target cluster depends on the "fork_user" flag and "fork_cxy" variable that can be 455 458 * stored in the calling thread descriptor by the specific fork_place() system call. 456 * If not, the sys_fork()function makes a query to the DQDT to select the target cluster.459 * If not, the kernel function makes a query to the DQDT to select the target cluster. 457 460 ****************************************************************************************** 458 461 * @ if success, returns child process PID to parent, and return O to child. … … 462 465 463 466 /****************************************************************************************** 464 * [37] This function implement the "exec" system call , that creates a new process465 * descriptor.466 * It is executed in the client cluster, but the new process descriptor and the main467 * thread are created in a server cluster, that is generally another cluster.468 * - if the server_cluster is the client cluster, it calls directly the process_make_exec()469 * function to create a new process, and launch a new thread in local cluster.470 * - if the target_cluster is remote, it calls the rpc_process_exec_client() to execute471 * process_signedmake_exec() on the remote cluster.472 * In both case this function build an exec_info_t structure containing all informations473 * required to build the new process descriptor and the associated thread.474 * Finally, the calling process and thread are deleted.467 * [37] This function implement the "exec" system call on the kernel side. 468 * It creates, in the same cluster as the calling thread, a new process descriptor, 469 * and a new associated main thread descriptor, executing a new memory image defined 470 * by the <filename> argument. This new process inherit from the old process the PID 471 * and the PPID, as well as all open files (including the TXT). 472 * The old process descriptor, and all its threads are blocked, and marked for deletion. 473 * Therefore the exec syscall does not return to the calling thread in case of success. 474 * This function build an exec_info_t structure containing the new process arguments, 475 * as defined by the <arv> argument, and the new process environment variables, 476 * as defined by the <envp> argument. 477 * TODO : the <argv> and <envp> arguments are not supported yet (both must be NULL). 475 478 ****************************************************************************************** 476 479 * @ filename : string pointer on .elf filename (pointer in user space) 477 480 * @ argv : array of strings on process arguments (pointers in user space) 478 481 * @ envp : array of strings on environment variables (pointers in user space) 479 * @ returns Oif success / returns -1 if failure.482 * @ does not return if success / returns -1 if failure. 480 483 *****************************************************************************************/ 481 484 int sys_exec( char * filename, … … 495 498 496 499 /****************************************************************************************** 497 * [39] This blocking function wait a change of a child process state. A changecan be:498 * - a termination of child following a child exit.499 * - a termination of child following a SIGKILL signal.500 * [39] This blocking function waits a change of a child process state, that can be: 501 * - a termination of child following a process_make_exit(). 502 * - a termination of child following a process_make_kill(). 500 503 * - a blocking of child following a SIGSTOP signal. 501 * It returns the PID of the involved child process, after storing in the memory slot 502 * pointed by the <status> argument relevant information on the child state change. 504 * In case of a multi-thread process, this function must be called by the main thread 505 * runningin the reference cluster. 506 * When a change has been observed, it returns the PID of the child process, and stores 507 * in the <status> argument relevant information on the child state change. 503 508 * The following macros can be used to extract information from status: 504 509 * - WIFEXITED(status) : is true if the child process terminated with an exit(). … … 506 511 * - WIFSTOPPED(status) : is true if the child process is stopped by a signal. 507 512 * - WEXITSTATUS(status) : returns the low-order 8 bits of the exit() argument. 508 * A status of 0 indicates a normal termination.509 513 * If a parent process terminates without waiting for all child processes to terminate, 510 514 * the remaining child processes are attached to the init process. 511 ****************************************************************************************** 512 * @ status : pointer on the child PID status. 513 * @ return child PID if success / return -1 if failure. 515 * WARNING: negative values for the <pid> argument are not supported. 516 ****************************************************************************************** 517 * @ searched_pid : searched child process identifier. 518 * @ status : [out] child termination status. 519 * @ return child PID if success / return -1 if searched PID not found. 514 520 *****************************************************************************************/ 515 521 int sys_wait( uint32_t * status );
Note: See TracChangeset
for help on using the changeset viewer.