setpgid
Setpgid is a POSIX-compatible system call used to set the process group ID (PGID) of a process. A process group is a collection of one or more processes that share terminal control and job-control semantics, enabling shells to manage pipelines and background tasks.
Prototype and headers: int setpgid(pid_t pid, pid_t pgid); typically declared in unistd.h. The function returns 0
Parameters and behavior: The target process is specified by pid. If pid is 0, the calling process
Usage and context: setpgid is commonly used in job control and shell implementations. By assigning processes
See also: setsid, tcsetpgrp, getpgid, getpgrp, setpgrp (older variant).