The Linux Programming Interface
Threads: Further Details 697 33.8 Exercises 33-1. Write a program to demonstrate that different threads in the same process can ...
...
PROCESS GROUPS, SESSIONS, AND JOB CONTROL Process groups and sessions form a two-level hierarchical relationship between pro- ce ...
700 Chapter 34 another process group. The process group leader need not be the last member of a process group. A session is a co ...
Process Groups, Sessions, and Job Control 701 Figure 34-1 shows the process group and session relationships between the various ...
702 Chapter 34 If the value returned by getpgrp() matches the caller’s process ID, this process is the leader of its process gro ...
Process Groups, Sessions, and Job Control 703 Using setpgid() in a job-control shell The restriction that a process may not chan ...
704 Chapter 34 Things are slightly more complex than shown in Listing 34-1, since, when creating the processes for a pipeline, t ...
Process Groups, Sessions, and Job Control 705 On a few UNIX implementations (e.g., HP-UX 11), getsid() can be used to retrieve t ...
706 Chapter 34 As can be seen from the output, the process successfully places itself in a new pro- cess group within a new sess ...
Process Groups, Sessions, and Job Control 707 If a process has a controlling terminal, opening the special file /dev/tty obtains ...
708 Chapter 34 The ctermid() function returns the controlling terminal’s pathname in two different ways: via the function result ...
Process Groups, Sessions, and Job Control 709 The tcsetpgrp() function changes the foreground process group for a terminal. If t ...
710 Chapter 34 The SIGHUP signal also finds other uses. In Section 34.7.4, we’ll see that SIGHUP is generated when a process gro ...
Process Groups, Sessions, and Job Control 711 int main(int argc, char *argv[]) { pid_t childPid; struct sigaction sa; setbuf(std ...
712 Chapter 34 When we examine diffgroup.log, we find the following output, indicating that when the shell received SIGHUP, it d ...
Process Groups, Sessions, and Job Control 713 int main(int argc, char *argv[]) { pid_t parentPid, childPid; int j; struct sigact ...
714 Chapter 34 SIGHUP when the terminal window is closed. After closing the terminal window, we find the following lines in the ...
Process Groups, Sessions, and Job Control 715 Each job that is placed in the background is assigned a unique job number by the s ...
716 Chapter 34 We can stop a background job by sending it a SIGSTOP signal: $ kill -STOP %1 [1]+ Stopped grep -r SIGHUP /usr/src ...
«
33
34
35
36
37
38
39
40
41
42
»
Free download pdf