tcgetpgrp, tcsetpgrp - get and set terminal foreground process group


   #include <unistd.h>

   pid_t tcgetpgrp(int fd);

   int tcsetpgrp(int fd, pid_t pgrp);


   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

   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.


   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.


   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.


   For   an   explanation   of   the  terms  used  in  this  section,  see

   Interface                 Attribute      Value   
   tcgetpgrp(), tcsetpgrp()  Thread safety  MT-Safe 


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


   These functions are implemented via the TIOCGPGRP and TIOCSPGRP ioctls.

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


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


   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

More Linux Commands

FcLangSetDestroy(3) - destroy a langset object (Man Page)...
FcLangSetDestroy destroys a FcLangSet object, freeing all memory associated with it. VERSION Fontconfig version 2.8.0 FcLangSetDestroy.3 (Library - Linux manual

Tk_Fill3DPolygon(3) - draw borders with three-dimensional ap
These procedures provide facilities for drawing window borders in a way that produces a three-dimensional appearance. Tk_Alloc3DBorderFromObj allocates colors a

SDL_JoystickGetBall(3) - Get relative trackball motion......
Get the ball axis change. Trackballs can only return relative motion since the last call to SDL_JoystickGetBall, these motion deltas a placed into dx and dy. RE

pcre16_fullinfo(3) Perl-compatible regular expressions......
This function returns information about a compiled pattern. Its arguments are: code Compiled regular expression extra Result of pcre[16|32]_study() or NULL what

pbmtox10bm(1) - convert a PBM image to an X11 bitmap........
pbmtox10bm was replaced in Netpbm 10.37 (December 2006) by pbmtoxbm(1) pbmtoxbm with the -x10 option is backward compatible with pbmtox10bm. pbmtoxbm also can g

wgetstr(3ncurses) - accept character strings from curses ter
The function getstr is equivalent to a series of calls to getch, until a newline or carriage return is received (the terminating character is not included in th

XtProcessUnlock(3) - lock and unlock process (Man Page).....
XtProcessLock is used to lock all process global data. XtProcessUnlock unlocks the process. SEE ALSO X Toolkit Intrinsics - C Language Interface Xlib - C Langua

gnutls_cipher_deinit(3) - API function - Linux manual page
This function will deinitialize all resources occupied by the given encryption context. SINCE 2.10.0 REPORTING BUGS Report bugs to &lt;;. GnuTLS

unshare(2) - disassociate parts of the process execution con
unshare() allows a process to disassociate parts of its execution context that are currently being shared with other processes. Part of the execution context, s

aclocal(1) - manual page for aclocal 1.11.1 - Linux man page
Generate aclocal.m4 by scanning or OPTIONS --automake-acdir=DIR directory holding automake-provided m4 files --system-acdir=DIR direct

MenuPopup(3) - map a pop-up (Library - Linux man page)......
The XtPopup function performs the following: * Calls XtCheckSubclass to ensure popup_shell is a subclass of Shell. * Generates an error if the shells popped_up

tk_bisque(n) - Modify the Tk color palette - Linux man page
The tk_setPalette procedure changes the color scheme for Tk. It does this by modifying the colors of existing widgets and by changing the option database so tha

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