Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

setpgid(2)

setsid(2)

tcsetpgrp(3C)

termio(7)

tcgetpgrp(3C)

NAME

tcgetpgrp() − get foreground process group id

SYNOPSIS

#include <unistd.h>

pid_t tcgetpgrp(int fildes);

DESCRIPTION

tcgetpgrp() returns the value of the process group ID of the foreground process group associated with the terminal referenced by fildes. tcgetpgrp() is allowed from a process that is a member of a background process group (see termio(7)); however, the information can be subsequently changed by a process that is a member of a foreground process group.

RETURN VALUE

Upon successful completion, tcgetpgrp() returns the value of the process group ID of the foreground process group associated with the terminal referenced by fildes. Otherwise, tcgetpgrp() returns a value of −1 and sets errno to indicate the error. 

ERRORS

tcgetpgrp() fails if any of the following conditions are encountered:

[EACCES] The file associated with fildes is the controlling terminal of the calling process, however, there is no foreground process group defined for the controlling terminal. 

[EBADF] fildes is not a valid file descriptor. 

[ENOTTY] The file associated with fildes is not the controlling terminal or the calling process does not have a controlling terminal. 

WARNING

The error EACCES, which is returned if the controlling terminal has no foreground process group, might not be returned in future releases, depending on the course taken by the POSIX standard.  Portable applications therefore should not rely on this error condition. 

SEE ALSO

setpgid(2), setsid(2), tcsetpgrp(3C), termio(7). 

STANDARDS CONFORMANCE

tcgetpgrp(): AES, XPG3, XPG4, FIPS 151-2, POSIX.1

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

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