setpgrp()

set process group ID to process ID 

Function


SYNOPSIS

#include <sys/types.h>

#include <unistd.h>

pid_t setpgrp(void);


DESCRIPTION

If the process is not already a session leader, setpgrp() sets the process group ID of the calling process to the process ID of the calling process. If setpgrp() creates a new session, the new session has no controlling terminal.

The setpgrp() function has no affect when the calling process is a session group leader.


PARAMETERS

None.


RETURN VALUES

The setpgrp() function returns the value of the new process group ID.


CONFORMANCE

POSIX.1 (1996)


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

In Win32, detaching from controlling terminal means the following:

The returned process group ID is the Win32 process ID of the process group leader. Refer to Windows Concepts in the PTC MKS Toolkit UNIX to Windows Porting Guide for more information about process IDs.


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(), setpgid(), setsid(), tcsetpgrp()


PTC MKS Toolkit 10.4 Documentation Build 39.