From fa70fd20878e402610c263f129266593d31a0376 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 26 Feb 2016 18:22:07 +1100 Subject: POSIX User clean up. --- posix_users/process_creation_and_execution.rst | 235 +++++++++++++++---------- 1 file changed, 140 insertions(+), 95 deletions(-) (limited to 'posix_users/process_creation_and_execution.rst') diff --git a/posix_users/process_creation_and_execution.rst b/posix_users/process_creation_and_execution.rst index 7ba4588..5701c44 100644 --- a/posix_users/process_creation_and_execution.rst +++ b/posix_users/process_creation_and_execution.rst @@ -1,66 +1,68 @@ +.. COMMENT: COPYRIGHT (c) 1988-2002. +.. COMMENT: On-Line Applications Research Corporation (OAR). +.. COMMENT: All rights reserved. + Process Creation and Execution Manager ###################################### Introduction ============ -The process creation and execution manager provides the -functionality associated with the creation and termination -of processes. +The process creation and execution manager provides the functionality +associated with the creation and termination of processes. The directives provided by the process creation and execution manager are: -- ``fork`` - Create a Process +- fork_ - Create a Process -- ``execl`` - Execute a File +- execl_ - Execute a File -- ``execv`` - Execute a File +- execv_ - Execute a File -- ``execle`` - Execute a File +- execle_ - Execute a File -- ``execve`` - Execute a File +- execve_ - Execute a File -- ``execlp`` - Execute a File +- execlp_ - Execute a File -- ``execvp`` - Execute a File +- execvp_ - Execute a File -- ``pthread_atfork`` - Register Fork Handlers +- pthread_atfork_ - Register Fork Handlers -- ``wait`` - Wait for Process Termination +- wait_ - Wait for Process Termination -- ``waitpid`` - Wait for Process Termination +- waitpid_ - Wait for Process Termination -- ``_exit`` - Terminate a Process +- `_exit`_ - Terminate a Process Background ========== -POSIX process functionality can not be completely -supported by RTEMS. This is because RTEMS provides no memory -protection and implements a *single process, multi-threaded -execution model*. In this light, RTEMS provides none of the -routines that are associated with the creation of new processes. -However, since the entire RTEMS application (e.g. executable) -is logically a single POSIX process, RTEMS is able to provide -implementations of many operations on processes. The rule of -thumb is that those routines provide a meaningful result. -For example, ``getpid()`` returns the node number. +POSIX process functionality can not be completely supported by RTEMS. This is +because RTEMS provides no memory protection and implements a *single process, +multi-threaded execution model*. In this light, RTEMS provides none of the +routines that are associated with the creation of new processes. However, +since the entire RTEMS application (e.g. executable) is logically a single +POSIX process, RTEMS is able to provide implementations of many operations on +processes. The rule of thumb is that those routines provide a meaningful +result. For example, ``getpid()`` returns the node number. Operations ========== -The only functionality method defined by this manager which is -supported by RTEMS is the ``_exit`` service. The -implementation of ``_exit`` shuts the application down and -is equivalent to invoking either ``exit`` or``rtems_shutdown_executive``. +The only functionality method defined by this manager which is supported by +RTEMS is the ``_exit`` service. The implementation of ``_exit`` shuts the +application down and is equivalent to invoking either ``exit`` or +``rtems_shutdown_executive``. Directives ========== This section details the process creation and execution manager's directives. -A subsection is dedicated to each of this manager's directives -and describes the calling sequence, related constants, usage, -and status codes. +A subsection is dedicated to each of this manager's directives and describes +the calling sequence, related constants, usage, and status codes. + +.. _fork: fork - Create a Process ----------------------- @@ -69,15 +71,18 @@ fork - Create a Process **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c #include int fork( void ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -87,6 +92,8 @@ This routine is not supported by RTEMS. NONE +.. _execl: + execl - Execute a File ---------------------- .. index:: execl @@ -94,18 +101,21 @@ execl - Execute a File **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int execl( - const char \*path, - const char \*arg, - ... + const char *path, + const char *arg, + ... ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -115,6 +125,8 @@ This routine is not supported by RTEMS. NONE +.. _execv: + execv - Execute a File ---------------------- .. index:: execv @@ -122,18 +134,21 @@ execv - Execute a File **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int execv( - const char \*path, - char const \*argv[], - ... + const char *path, + char const *argv[], + ... ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -143,6 +158,8 @@ This routine is not supported by RTEMS. NONE +.. _execle: + execle - Execute a File ----------------------- .. index:: execle @@ -150,18 +167,21 @@ execle - Execute a File **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int execle( - const char \*path, - const char \*arg, - ... + const char *path, + const char *arg, + ... ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -171,6 +191,8 @@ This routine is not supported by RTEMS. NONE +.. _execve: + execve - Execute a File ----------------------- .. index:: execve @@ -178,18 +200,21 @@ execve - Execute a File **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int execve( - const char \*path, - char \*const argv[], - char \*const envp[] + const char *path, + char *const argv[], + char *const envp[] ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -199,6 +224,8 @@ This routine is not supported by RTEMS. NONE +.. _execlp: + execlp - Execute a File ----------------------- .. index:: execlp @@ -206,18 +233,21 @@ execlp - Execute a File **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int execlp( - const char \*file, - const char \*arg, - ... + const char *file, + const char *arg, + ... ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -227,6 +257,8 @@ This routine is not supported by RTEMS. NONE +.. _execvp: + execvp - Execute a File ----------------------- .. index:: execvp @@ -234,18 +266,21 @@ execvp - Execute a File **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int execvp( - const char \*file, - char \*const argv[] - ... + const char *file, + char *const argv[], + ... ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -255,6 +290,8 @@ This routine is not supported by RTEMS. NONE +.. _pthread_atfork: + pthread_atfork - Register Fork Handlers --------------------------------------- .. index:: pthread_atfork @@ -262,19 +299,22 @@ pthread_atfork - Register Fork Handlers **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c #include int pthread_atfork( - void (\*prepare)(void), - void (\*parent)(void), - void (\*child)(void) + void (*prepare)(void), + void (*parent)(void), + void (*child)(void) ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -284,6 +324,8 @@ This routine is not supported by RTEMS. NONE +.. _wait: + wait - Wait for Process Termination ----------------------------------- .. index:: wait @@ -291,18 +333,21 @@ wait - Wait for Process Termination **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c #include #include int wait( - int \*stat_loc + int *stat_loc ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -312,6 +357,8 @@ This routine is not supported by RTEMS. NONE +.. _waitpid: + waitpid - Wait for Process Termination -------------------------------------- .. index:: waitpid @@ -319,18 +366,21 @@ waitpid - Wait for Process Termination **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c int wait( - pid_t pid, - int \*stat_loc, - int options + pid_t pid, + int *stat_loc, + int options ); **STATUS CODES:** -*ENOSYS* - This routine is not supported by RTEMS. +.. list-table:: + :class: rtems-table + + * - ``ENOSYS`` + - This routine is not supported by RTEMS. **DESCRIPTION:** @@ -340,6 +390,8 @@ This routine is not supported by RTEMS. NONE +.. _\_exit: + _exit - Terminate a Process --------------------------- .. index:: _exit @@ -347,10 +399,10 @@ _exit - Terminate a Process **CALLING SEQUENCE:** -.. code:: c +.. code-block:: c void _exit( - int status + int status ); **STATUS CODES:** @@ -365,10 +417,3 @@ The ``_exit()`` function terminates the calling process. In RTEMS, a process is equivalent to the entire application on a single processor. Invoking this service terminates the application. - -.. COMMENT: COPYRIGHT (c) 1988-2002. - -.. COMMENT: On-Line Applications Research Corporation (OAR). - -.. COMMENT: All rights reserved. - -- cgit v1.2.3