1.\" Copyright (c) 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)tcgetpgrp.3 5.1 (Berkeley) 02/02/92 7.\" 8.Dd Jun 11, 1991 9.Dt TCGETPGRP 10.Os 11.Sh NAME 12.Nm tcgetpgrp 13.LP 14.B "Get Foreground Process Group ID" 15.LP 16.B "Function: tcgetpgrp()" 17.LP 18.B "Synopsis" 19.LP 20.nf 21#include <sys/types.h> 22 23pid_t tcgetpgrp(int fildes); 24.fi 25.LP 26.B "Description" 27.LP 28The tcgetpgrp() function shall return the value of the process 29group ID of the foreground process group associated with the 30terminal. 31.LP 32.B "Returns" 33.LP 34Upon successful completion, tcgetpgrp() returns the process group ID of 35the foreground process group associated with the terminal. If there is 36no foreground process group, tcgetpgrp() shall return a value greater 37than 1 that does not match the process group ID of any existing process 38group. Otherwise, a value of -1 is returned and errno is set to indicate 39the error. 40.LP 41.B "Errors" 42.LP 43If any of the following conditions occur, the tcgetpgrp() function shall 44return -1 and set errno to the corresponding value: 45.nf 46 [EBADF] The fildes argument is not a valid file descriptor. 47 48 [ENOSYS] The tcgetpgrp() function is not supported in this 49 implementation. 50 51 [ENOTTY] The calling process does not have a controlling terminal 52 or the file is not the controlling terminal. 53.fi 54