Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

getpgrp(2)

setsid(2P)

tcsetpgrp(3P)




setpgid(2P) setpgid(2P)
NAME setpgid - set process group ID for job control SYNOPSIS int setpgid(pid, pgid) pid_t pid, pgid; DESCRIPTION setpgid is used to join an existing process group or to create a new process group within the session of the calling process. The process group ID of a session group leader cannot be changed. The process group ID of the process specified by pid is set to pgid. If pid or pgid is 0, the process ID of the calling process is used. STATUS MESSAEGS AND VALUES On successful completion, setpgid returns a value of 0. Otherwise, a value of -1 is returned and errno is set to indicate the error. If any of the following conditions occur, setpgid returns -1 and sets errno to the corresponding value: EACCES pid matches the process ID of a child process of the calling process and the child has successfully executed one of the exec functions. EINVAL The value of pgid is less than 0 or exceeds {PID_MAX}. EPERM The process indicated by pid is a session group leader.
The value of pid is valid but matches the process ID of
a child of the calling process and the child process is
not in the same session as the calling process. The
value of pgid does not match the process ID of the
process indicated by pid and there is no process with a
process group ID that matches the value of pgid in the
same session as the calling process.
ESRCH
pid does not match the process ID of the calling
process or of a child process of the calling process.
SEE ALSO
exec(2), getpgrp(2), setsid(2P), tcsetpgrp(3P)
January 1992 1

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026