tcsetpgrp()

set process group ID of terminal foreground terminal process group 

Function


SYNOPSIS

#include <sys/types.h>

#include <termios.h>

int tcsetpgrp(int fildes, pid_t pgid);


DESCRIPTION

If the process has a controlling terminal, tcsetpgrp() sets the foreground process group ID associated with the terminal to the specified process group ID. The file associated with the specified file descriptor must be the controlling terminal of the calling process and the controlling terminal must be currently associated with the session of the calling process. The specified process group ID must match a process group ID of a process in the same session as the calling process.


PARAMETERS

fildes 

Specifies a file descriptor associated with the controlling terminal of the calling process.

pgid 

Specifies the process group ID to be used for the foreground process. pgid must match a process group ID of a process in the same session as the calling process.


RETURN VALUES

If successful, tcsetpgrp() returns a value of zero. Otherwise, it returns -1 and sets errno to indicate the error:

EBADF 

The fildes parameter is not a valid file descriptor.

EINVAL 

The device does not support the value of pgid.

ENOTTY 

The calling process does not have a controlling terminal, or the file is not the controlling terminal, or the controlling terminal is no longer associated with the session of the calling process.

EPERM 

The device supports the value of pgid, but it does not match the process group ID of a process in the same session as 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:
setpgid(), setsid(), tcgetpgrp()


PTC MKS Toolkit 10.3 Documentation Build 39.