POSIX Processes

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • pid_t getpid(void);
  • pid_t getppid(void);
  • pid_t fork(void);
  • pid_t waitpid(pid_t pid, int *wstatus, int options);
  • int execv(const char *path, char *const argv[]);

Parameters

Function, Parameter(s), Return ValueDescription
fork()function name
nonen/a
Returns PID, 0, or -1The calling process receives the PID of the newly create process or -1 on failure. The child (the newly created process) receive 0. In case of failure set errno to either EAGAIN or ENOMEM
--
execv()function name
const char *pathString containing name of to executable (might inlcude path)
char *const argv[]Array of string pointer as arguments
Returns -1 on failureOn success this function does not return.
--


Got any POSIX Question?