Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

34. Process Groups, Sessions, and Job Co... > Controlling Terminals and Controllin...

Controlling Terminals and Controlling Processes

All of the processes in a session may have a (single) controlling terminal. Upon creation, a session has no controlling terminal; the controlling terminal is established when the session leader first opens a terminal that is not already the controlling terminal for a session, unless the O_NOCTTY flag is specified when calling open(). A terminal may be the controlling terminal for at most one session.

Note

SUSv3 specifies the function tcgetsid(int fd) (prototyped in <termios.h>), which returns the ID of the session associated with the controlling terminal specified by fd. This function is provided in glibc (where it is implemented using the ioctl() TIOCGSID operation).


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint