posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_MULTI_PROCESS

POSIX Multi-Process option group. More...

Files

file  times.h
 POSIX process CPU time accounting (<sys/times.h>)
 

Functions

int pthread_atfork (void(*prepare)(void), void(*parent)(void), void(*child)(void))
 Register fork handlers to be called around fork().
 
clock_t times (struct tms *buf)
 Get the process and child process times.
 
FUNC_NORETURN void _exit (int status)
 Terminate the calling process without calling atexit() handlers.
 
int execl (const char *path, const char *arg0,...)
 Replace the process image with a new program (argument list form).
 
int execle (const char *path, const char *arg0,...)
 Replace process image with a new program plus environment (argument list form).
 
int execlp (const char *file, const char *arg0,...)
 Replace process image using PATH search (argument list form).
 
int execv (const char *path, char *const argv[])
 Replace process image with a new program (vector form).
 
int execve (const char *path, char *const argv[], char *const envp[])
 Replace process image with a new program plus environment (vector form).
 
int execvp (const char *file, char *const argv[])
 Replace process image using PATH search (vector form).
 
int fexecve (int fd, char *const argv[], char *const envp[])
 Replace process image using an open file descriptor (vector form).
 
pid_t fork (void)
 Create a child process.
 
gid_t getegid (void)
 Get the effective group ID of the calling process.
 
uid_t geteuid (void)
 Get the effective user ID of the calling process.
 
gid_t getgid (void)
 Get the real group ID of the calling process.
 
int getgroups (int gidsetsize, gid_t grouplist[])
 Get the supplementary group IDs of the calling process.
 
char * getlogin (void)
 Get the login name of the user.
 
pid_t getpgid (pid_t pid)
 Get the process group ID of a process.
 
pid_t getpgrp (void)
 Get the process group ID of the calling process.
 
pid_t getpid (void)
 Get the process ID of the calling process.
 
pid_t getppid (void)
 Get the process ID of the parent of the calling process.
 
pid_t getsid (pid_t pid)
 Get the session ID of a process.
 
uid_t getuid (void)
 Get the real user ID of the calling process.
 
int nice (int incr)
 Change the scheduling priority of the calling process (XSI extension).
 
int setegid (gid_t gid)
 Set the effective group ID of the calling process.
 
int seteuid (uid_t uid)
 Set the effective user ID of the calling process.
 
int setgid (gid_t gid)
 Set the real group ID of the calling process.
 
int setpgid (pid_t pid, pid_t pgid)
 Set the process group ID for a process.
 
pid_t setpgrp (void)
 Set the process group ID to the process ID of the calling process (obsolescent).
 
pid_t setsid (void)
 Create a new session and set the process group ID.
 
int setuid (uid_t uid)
 Set the real user ID of the calling process.
 
unsigned int sleep (unsigned int seconds)
 Suspend execution for at least the specified number of seconds.
 
pid_t tcgetpgrp (int fildes)
 Get the process group ID of the foreground process group of the terminal.
 
int tcsetpgrp (int fildes, pid_t pgid_id)
 Set the foreground process group ID of a terminal.
 
int usleep (useconds_t useconds)
 Suspend execution for at least the specified number of microseconds (obsolescent).
 

Detailed Description

POSIX Multi-Process option group.

Covers fork(), exec*(), _exit(), getpid(), getppid(), getpgid(), setpgid(), setsid(), getsid(), getuid(), setuid(), getgid(), setgid(), sleep(), tcgetpgrp(), tcsetpgrp(), and related process-control functions.

Function Documentation

◆ _exit()

FUNC_NORETURN void _exit ( int  status)

Terminate the calling process without calling atexit() handlers.

◆ execl()

int execl ( const char *  path,
const char *  arg0,
  ... 
)

Replace the process image with a new program (argument list form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execl.html

◆ execle()

int execle ( const char *  path,
const char *  arg0,
  ... 
)

Replace process image with a new program plus environment (argument list form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execle.html

◆ execlp()

int execlp ( const char *  file,
const char *  arg0,
  ... 
)

Replace process image using PATH search (argument list form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execlp.html

◆ execv()

int execv ( const char *  path,
char *const  argv[] 
)

Replace process image with a new program (vector form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execv.html

◆ execve()

int execve ( const char *  path,
char *const  argv[],
char *const  envp[] 
)

Replace process image with a new program plus environment (vector form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execve.html

◆ execvp()

int execvp ( const char *  file,
char *const  argv[] 
)

Replace process image using PATH search (vector form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html

◆ fexecve()

int fexecve ( int  fd,
char *const  argv[],
char *const  envp[] 
)

Replace process image using an open file descriptor (vector form).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html

◆ fork()

pid_t fork ( void  )

◆ getegid()

gid_t getegid ( void  )

Get the effective group ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getegid.html

◆ geteuid()

uid_t geteuid ( void  )

Get the effective user ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/geteuid.html

◆ getgid()

gid_t getgid ( void  )

Get the real group ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getgid.html

◆ getgroups()

int getgroups ( int  gidsetsize,
gid_t  grouplist[] 
)

Get the supplementary group IDs of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getgroups.html

◆ getlogin()

char * getlogin ( void  )

◆ getpgid()

pid_t getpgid ( pid_t  pid)

Get the process group ID of a process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgid.html

◆ getpgrp()

pid_t getpgrp ( void  )

Get the process group ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgrp.html

◆ getpid()

pid_t getpid ( void  )

Get the process ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html

◆ getppid()

pid_t getppid ( void  )

Get the process ID of the parent of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getppid.html

◆ getsid()

pid_t getsid ( pid_t  pid)

◆ getuid()

uid_t getuid ( void  )

Get the real user ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getuid.html

◆ nice()

int nice ( int  incr)

Change the scheduling priority of the calling process (XSI extension).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/nice.html

◆ pthread_atfork()

int pthread_atfork ( void(*)(void)  prepare,
void(*)(void)  parent,
void(*)(void)  child 
)

Register fork handlers to be called around fork().

Parameters
prepareHandler called in the parent before fork().
parentHandler called in the parent after fork().
childHandler called in the child after fork().
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_atfork.html

◆ setegid()

int setegid ( gid_t  gid)

Set the effective group ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setegid.html

◆ seteuid()

int seteuid ( uid_t  uid)

Set the effective user ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/seteuid.html

◆ setgid()

int setgid ( gid_t  gid)

Set the real group ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setgid.html

◆ setpgid()

int setpgid ( pid_t  pid,
pid_t  pgid 
)

Set the process group ID for a process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgid.html

◆ setpgrp()

pid_t setpgrp ( void  )

Set the process group ID to the process ID of the calling process (obsolescent).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgrp.html

◆ setsid()

pid_t setsid ( void  )

Create a new session and set the process group ID.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsid.html

◆ setuid()

int setuid ( uid_t  uid)

Set the real user ID of the calling process.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setuid.html

◆ sleep()

unsigned int sleep ( unsigned int  seconds)

Suspend execution for at least the specified number of seconds.

◆ tcgetpgrp()

pid_t tcgetpgrp ( int  fildes)

Get the process group ID of the foreground process group of the terminal.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetpgrp.html

◆ tcsetpgrp()

int tcsetpgrp ( int  fildes,
pid_t  pgid_id 
)

Set the foreground process group ID of a terminal.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetpgrp.html

◆ times()

clock_t times ( struct tms buf)

Get the process and child process times.

Parameters
bufOutput: filled with CPU times for the calling process.
Returns
Elapsed real time in clock ticks since an arbitrary epoch, or (clock_t)-1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/times.html

◆ usleep()

int usleep ( useconds_t  useconds)

Suspend execution for at least the specified number of microseconds (obsolescent).

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/usleep.html