tcgetpgrp3
Get foreground process group id
Usage
#include <unistd.h>
pid_t
tcgetpgrp(int fildes);
Library
Standard C Library (libc, -lc)
Overview
The tcgetpgrp() function returns the value of the process group ID of the foreground process group associated with the terminal device. If there is no foreground process group, tcgetpgrp() returns an invalid process ID.
Errors
If an error occurs, tcgetpgrp() returns -1 and the global variable errno is set to indicate the error, as follows:
- [EBADF]
-
The fildes argument is not a valid file descriptor.
- [ENOTTY]
-
The calling process does not have a controlling terminal or the underlying terminal device represented by fildes is not the controlling terminal.
Legacy synopsis
#include <sys/types.h> #include <unistd.h>
The include file ⟨sys/types.h⟩ is necessary.
Releases
163 releases since Mac OS X 10.0; the text changed 2 times.