xref: /csrg-svn/lib/libc/gen/tcgetpgrp.3 (revision 52280)
151200Smarc.\" Copyright (c) 1991 The Regents of the University of California.
251200Smarc.\" All rights reserved.
351200Smarc.\"
451200Smarc.\" %sccs.include.redist.roff%
551200Smarc.\"
6*52280Smarc.\"	@(#)tcgetpgrp.3	5.1 (Berkeley) 02/02/92
751200Smarc.\"
8*52280Smarc.Dd Jun 11, 1991
9*52280Smarc.Dt TCGETPGRP
10*52280Smarc.Os
11*52280Smarc.Sh NAME
12*52280Smarc.Nm tcgetpgrp
1351200Smarc.LP
1451200Smarc.B "Get Foreground Process Group ID"
1551200Smarc.LP
1651200Smarc.B "Function:  tcgetpgrp()"
1751200Smarc.LP
1851200Smarc.B "Synopsis"
1951200Smarc.LP
2051200Smarc.nf
2151200Smarc#include <sys/types.h>
2251200Smarc
2351200Smarcpid_t tcgetpgrp(int fildes);
2451200Smarc.fi
2551200Smarc.LP
2651200Smarc.B "Description"
2751200Smarc.LP
2851200SmarcThe tcgetpgrp() function shall return the value of the process
2951200Smarcgroup ID of the foreground process group associated with the
3051200Smarcterminal.
3151200Smarc.LP
3251200Smarc.B "Returns"
3351200Smarc.LP
3451200SmarcUpon successful completion, tcgetpgrp() returns the process group ID of
3551200Smarcthe foreground process group associated with the terminal.  If there is
3651200Smarcno foreground process group, tcgetpgrp() shall return a value greater
3751200Smarcthan 1 that does not match the process group ID of any existing process
3851200Smarcgroup.  Otherwise, a value of -1 is returned and errno is set to indicate
3951200Smarcthe error.
4051200Smarc.LP
4151200Smarc.B "Errors"
4251200Smarc.LP
4351200SmarcIf any of the following conditions occur, the tcgetpgrp() function shall
4451200Smarcreturn -1 and set errno to the corresponding value:
4551200Smarc.nf
4651200Smarc   [EBADF]       The fildes argument is not a valid file descriptor.
4751200Smarc
4851200Smarc   [ENOSYS]      The tcgetpgrp() function is not supported in this
4951200Smarc                 implementation.
5051200Smarc
5151200Smarc   [ENOTTY]      The calling process does not have a controlling terminal
5251200Smarc                 or the file is not the controlling terminal.
5351200Smarc.fi
54