Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tcgetpgrp - get foreground process group ID

&pagelevel(4)&pagelevel

Syntax

#include <unistd.h>

Optional
#include <sys/types.h> (End)

pid_t tcgetpgrp(int fildes); 

Description

tcgetpgrp() returns the value of the foreground process group ID associated with the terminal.

If there is no foreground process group, tcgetpgrp() returns a value greater than 1 that does not match the process group ID of any existing process group.

tcgetpgrp() is allowed from a process that is a member of a background process group; however, the information may be subsequently changed by a process that is a member of a foreground process group.

Return val.

Value of the foreground process group ID associated with the terminal


if successful.

-1

if an error occurs. errno is set to indicate the error.

Errors

tcgetpgrp() will fail if:

 

EBADF

fildes is not a valid file descriptor.

 

Extension 

 

 

EINVAL

An attempt was made to access a BS2000 file. (End)

 

ENOTTY

The calling process does not have a controlling terminal, or the file is not the controlling terminal.

See also

setsid(), setpgid(), tcsetpgrp(), sys/types.h, unistd.h.