SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
int setpgid(pid_t pid, pid_t pgid);
DESCRIPTION
The
PARAMETERS
- pid
-
Is the process to set. If zero, the current process ID is used.
- pgid
-
Is the new process group ID. If zero, the process group ID of pid is used.
RETURN VALUES
If successful,
- EACCES
-
The value of pid matches the process ID of a child process of the calling process, and the child process has successfully executed one of the
exec() functions. - EINVAL
-
The value of pgid is less than 0 or is greater than or equal to PID_MAX.
- EPERM
-
pgid does not match the process ID of the process indicated by the pid parameter, and there is no process with a process group ID that matches pgid in the same session as the calling process.
The process that pid indicates is a session leader.
The value of pid is valid but matches the process ID of a child process of the calling process, and the child process is not in the same session as the calling process.
- ESRCH
-
The value of pid does not match the process ID of the calling process or of a child process of the calling process.
CONFORMANCE
POSIX.1 (1996)
MULTITHREAD SAFETY LEVEL
Async-signal-safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
execl() ,execle() ,execlp() ,execv() ,execve() ,execvp() ,fork() ,getpgid() ,getpid() ,getsid() ,setpgrp() ,setsid() ,tcsetpgrp()
PTC MKS Toolkit 10.5 Documentation Build 40.