2. Process Creation and Execution Manager¶
2.1. Introduction¶
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
- execl - Execute a File
- execv - Execute a File
- execle - Execute a File
- execve - Execute a File
- execlp - Execute a File
- execvp - Execute a File
- pthread_atfork - Register Fork Handlers
- wait - Wait for Process Termination
- waitpid - Wait for Process Termination
- _exit - Terminate a Process
2.2. 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.
2.3. 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
.
2.4. 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.
2.4.1. fork - Create a Process¶
CALLING SEQUENCE:
#include <sys/types.h>
int fork( void );
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.2. execl - Execute a File¶
CALLING SEQUENCE:
int execl(
const char *path,
const char *arg,
...
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.3. execv - Execute a File¶
CALLING SEQUENCE:
int execv(
const char *path,
char const *argv[],
...
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.4. execle - Execute a File¶
CALLING SEQUENCE:
int execle(
const char *path,
const char *arg,
...
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.5. execve - Execute a File¶
CALLING SEQUENCE:
int execve(
const char *path,
char *const argv[],
char *const envp[]
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.6. execlp - Execute a File¶
CALLING SEQUENCE:
int execlp(
const char *file,
const char *arg,
...
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.7. execvp - Execute a File¶
CALLING SEQUENCE:
int execvp(
const char *file,
char *const argv[],
...
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.8. pthread_atfork - Register Fork Handlers¶
CALLING SEQUENCE:
#include <sys/types.h>
int pthread_atfork(
void (*prepare)(void),
void (*parent)(void),
void (*child)(void)
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.9. wait - Wait for Process Termination¶
CALLING SEQUENCE:
#include <sys/types.h>
#include <sys/wait.h>
int wait(
int *stat_loc
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.10. waitpid - Wait for Process Termination¶
CALLING SEQUENCE:
int wait(
pid_t pid,
int *stat_loc,
int options
);
STATUS CODES:
ENOSYS |
This routine is not supported by RTEMS. |
DESCRIPTION:
This routine is not supported by RTEMS.
NOTES:
NONE
2.4.11. _exit - Terminate a Process¶
CALLING SEQUENCE:
void _exit(
int status
);
STATUS CODES:
NONE
DESCRIPTION:
The _exit()
function terminates the calling process.
NOTES:
In RTEMS, a process is equivalent to the entire application on a single processor. Invoking this service terminates the application.