1*61111Sbostic.\" Copyright (c) 1991, 1993 2*61111Sbostic.\" The Regents of the University of California. All rights reserved. 351200Smarc.\" 451200Smarc.\" %sccs.include.redist.roff% 551200Smarc.\" 6*61111Sbostic.\" @(#)tcgetpgrp.3 8.1 (Berkeley) 06/04/93 751200Smarc.\" 852295Sbostic.Dd "" 952295Sbostic.Dt TCGETPGRP 3 1052280Smarc.Os 1152280Smarc.Sh NAME 1252280Smarc.Nm tcgetpgrp 1352295Sbostic.Nd get foreground process group ID 1452295Sbostic.Sh SYNOPSIS 1552295Sbostic.Fd #include <sys/types.h> 1653069Sbostic.Fd #include <unistd.h> 1752295Sbostic.Ft pid_t 1852295Sbostic.Fn tcgetpgrp "int fd" 1952295Sbostic.Sh DESCRIPTION 2052295SbosticThe 2152295Sbostic.Nm tcgetpgrp 2252295Sbosticfunction returns the value of the process group ID of the foreground 2352295Sbosticprocess group associated with the terminal device. 2452295SbosticIf there is no foreground process group, 2552295Sbostic.Nm tcgetpgrp 2652295Sbosticreturns an invalid process ID. 2752295Sbostic.Sh ERRORS 2852295SbosticIf an error occurs, 2952295Sbostic.Nm tcgetpgrp 3052295Sbosticreturns -1 and the global variable 3152295Sbostic.Va errno 3252295Sbosticis set to indicate the error, as follows: 3352295Sbostic.Bl -tag -width Er 3452295Sbostic.It Bq Er EBADF 3552295SbosticThe 3652295Sbostic.Fa fd 3752295Sbosticargument is not a valid file descriptor. 3852295Sbostic.It Bq Er ENOTTY 3952295SbosticThe calling process does not have a controlling terminal or the 4052295Sbosticunderlying terminal device represented by 4152295Sbostic.Fa fd 4252295Sbosticis not the controlling terminal. 4352295Sbostic.El 4452295Sbostic.Sh SEE ALSO 4552295Sbostic.Xr setpgid 3 , 4652295Sbostic.Xr setsid 2 , 4752295Sbostic.Xr tcsetpgrp 3 4852295Sbostic.Sh STANDARDS 4952295SbosticThe 5052295Sbostic.Nm tcgetpgrp 5152295Sbosticfunction is expected to be compliant with the 5252295Sbostic.St -p1003.1-88 5352295Sbosticspecification. 54