xref: /original-bsd/lib/libc/gen/tcgetpgrp.3 (revision e59fb703)
Copyright (c) 1991 The Regents of the University of California.
All rights reserved.

%sccs.include.redist.roff%

@(#)tcgetpgrp.3 1.1 (Berkeley) 09/26/91

"Get Foreground Process Group ID"

"Function: tcgetpgrp()"

"Synopsis"

#include <sys/types.h>

pid_t tcgetpgrp(int fildes);

"Description"

The tcgetpgrp() function shall return the value of the process group ID of the foreground process group associated with the terminal.

"Returns"

Upon successful completion, tcgetpgrp() returns the process group ID of the foreground process group associated with the terminal. If there is no foreground process group, tcgetpgrp() shall return a value greater than 1 that does not match the process group ID of any existing process group. Otherwise, a value of -1 is returned and errno is set to indicate the error.

"Errors"

If any of the following conditions occur, the tcgetpgrp() function shall return -1 and set errno to the corresponding value:

 [EBADF] The fildes argument is not a valid file descriptor.

 [ENOSYS] The tcgetpgrp() function is not supported in this
 implementation.

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