tcsetpgrp(3)


NAME

   tcgetpgrp, tcsetpgrp - get and set terminal foreground process group

SYNOPSIS

   #include <unistd.h>

   pid_t tcgetpgrp(int fd);

   int tcsetpgrp(int fd, pid_t pgrp);

DESCRIPTION

   The function tcgetpgrp() returns the process group ID of the foreground
   process group on the terminal associated  to  fd,  which  must  be  the
   controlling terminal of the calling process.

   The  function tcsetpgrp() makes the process group with process group ID
   pgrp the foreground process group on the  terminal  associated  to  fd,
   which  must  be  the  controlling  terminal of the calling process, and
   still be associated  with  its  session.   Moreover,  pgrp  must  be  a
   (nonempty)  process  group belonging to the same session as the calling
   process.

   If tcsetpgrp() is called by a member of a background process  group  in
   its  session,  and  the  calling  process  is  not blocking or ignoring
   SIGTTOU, a SIGTTOU signal is sent to all  members  of  this  background
   process group.

RETURN VALUE

   When  fd refers to the controlling terminal of the calling process, the
   function tcgetpgrp() will return the foreground  process  group  ID  of
   that terminal if there is one, and some value larger than 1 that is not
   presently a process group ID otherwise.  When fd does not refer to  the
   controlling  terminal of the calling process, -1 is returned, and errno
   is set appropriately.

   When successful, tcsetpgrp() returns 0.  Otherwise, it returns -1,  and
   errno is set appropriately.

ERRORS

   EBADF  fd is not a valid file descriptor.

   EINVAL pgrp has an unsupported value.

   ENOTTY The  calling process does not have a controlling terminal, or it
          has one but it is not described by fd, or, for tcsetpgrp(), this
          controlling terminal is no longer associated with the session of
          the calling process.

   EPERM  pgrp has a supported value, but is not the process group ID of a
          process in the same session as the calling process.

ATTRIBUTES

   For   an   explanation   of   the  terms  used  in  this  section,  see
   attributes(7).

   ┌─────────────────────────┬───────────────┬─────────┐
   │InterfaceAttributeValue   │
   ├─────────────────────────┼───────────────┼─────────┤
   │tcgetpgrp(), tcsetpgrp() │ Thread safety │ MT-Safe │
   └─────────────────────────┴───────────────┴─────────┘

CONFORMING TO

   POSIX.1-2001, POSIX.1-2008.

NOTES

   These functions are implemented via the TIOCGPGRP and TIOCSPGRP ioctls.

   History
   The ioctls appeared in 4.2BSD.  The functions are POSIX inventions.

SEE ALSO

   setpgid(2), setsid(2), credentials(7)

COLOPHON

   This page is part of release 4.09 of the Linux  man-pages  project.   A
   description  of  the project, information about reporting bugs, and the
   latest    version    of    this    page,    can     be     found     at
   https://www.kernel.org/doc/man-pages/.


More Linux Commands

manpages/gtester.1.html
gtester(1) - test running utility - Linux manual page.......
gtester is a utility to run unit tests that have been written using the GLib test framework. When called with the -o option, gtester writes an XML report of the

manpages/XFetchName.3.html
XFetchName(3) - set or read a window's WM_NAME property.....
The XSetWMName convenience function calls XSetTextProperty to set the WM_NAME property. The XGetWMName convenience function calls XGetTextProperty to obtain the

manpages/regexp.n.html
regexp(n) - Match a regular expression against a string.....
Determines whether the regular expression exp matches part or all of string and returns 1 if it does, 0 if it does not, unless -inline is specified (see below).

manpages/CIRCLEQ_REMOVE.3.html
CIRCLEQ_REMOVE(3) implementations of lists, tail queues, and
These macros define and operate on three types of data structures: lists, tail queues, and circular queues. All three structures support the following functiona

manpages/gnutls_x509_crl_list_import2.3.html
gnutls_x509_crl_list_import2(3) - API function (Man Page)...
gnutls_x509_crl_list_import2.3 - This function will convert the given PEM encoded CRL list to the native gnutls_x509_crl_t format. The output will be stored in

manpages/glTexCoord1dv.3gl.html
glTexCoord1dv(3gl) - set the current texture coordinates....
glTexCoord specifies texture coordinates in one, two, three, or four dimensions. glTexCoord1 sets the current texture coordinates to (s, 0, 0, 1); a call to glT

manpages/xine-remote.1.html
xine-remote(1) a small tool to connect xine remote control s
This manual page documents briefly the xine-remote tool. xine-remote can replace a raw telnet connection to a xine remote control server. It use the readline fa

manpages/pktopbm.1.html
pktopbm(1) - convert packed (PK) format font into PBM.......
This program is part of Netpbm(1) pktopbm reads a packed (PK) font file as input, and produces PBM images as output. If the filename - is used for any of the fi

manpages/get_wstr.3ncurses.html
get_wstr(3ncurses) - get an array of wide characters from a
The effect of get_wstr is as though a series of calls to get_wch were made, until a newline, other end-of-line, or end-of-file condition is processed. An end-of

manpages/Tcl_UtfToExternal.3.html
Tcl_UtfToExternal(3) - procedures for creating and using enc
Tcl_GetEncoding finds an encoding given its name. The name may refer to a built-in Tcl encoding, a user-defined encoding registered by calling Tcl_CreateEncodin

manpages/Unicode::Collate::CJK::Stroke.3pm.html
Unicode::Collate::CJK::Stroke(3pm) - weighting CJK Unified I
Unicode::Collate::CJK::Stroke provides weightStroke(), that is adequate for overrideCJK of Unicode::Collate and makes tailoring of CJK Unified Ideographs in the

manpages/glMultiTexCoord4dvARB.3gl.html
glMultiTexCoord4dvARB(3gl) - set the current texture coordin
glMultiTexCoordARB specifies texture coordinates in one, two, three, or four dimensions. glMultiTexCoord1ARB sets the current texture coordinates to (s, 0, 0, 1





We can't live, work or learn in freedom unless the software we use is free.