The Linux Programming Interface
Process Groups, Sessions, and Job Control 717 We can then see the output of the job by bringing it into the foreground: $ fg dat ...
718 Chapter 34 order to be able to carry out these actions, the terminal driver must also record the session ID (controlling pro ...
Process Groups, Sessions, and Job Control 719 The program in Listing 34-5 performs the following steps: z On startup, the progra ...
720 Chapter 34 q if (getpid() == getpgrp()) /* If process group leader */ fprintf(stderr, "Terminal FG process group: %ld\n", (l ...
Process Groups, Sessions, and Job Control 721 The following shell session demonstrates the use of the program in Listing 34-5. W ...
722 Chapter 34 Now all members of the process group are stopped. The output indicates that pro- cess group 1228 was the foregrou ...
Process Groups, Sessions, and Job Control 723 can use the wait status value returned by wait() or waitpid() to determine which s ...
724 Chapter 34 Note that the SIGTSTP handler may interrupt certain blocking system calls (as described in Section 21.5). This po ...
Process Groups, Sessions, and Job Control 725 /* Only establish handler for SIGTSTP if it is not being ignored */ if (sigaction( ...
726 Chapter 34 Suppose that we include this code in a program executed from the shell. Figure 34-3 shows the state of processes ...
Process Groups, Sessions, and Job Control 727 Since the shell did not create the child process, it is not aware of the child’s e ...
728 Chapter 34 process group becoming orphaned, the signal handler is invoked, and it displays the child’s process ID and the si ...
Process Groups, Sessions, and Job Control 729 r raise(SIGSTOP); } else { / Wait for signal / alarm(60); / So we die if not SIGHU ...
730 Chapter 34 Orphaned process groups and the SIGTSTP, SIGTTIN, and SIGTTOU signals Orphaned process groups also affect the sem ...
Process Groups, Sessions, and Job Control 731 whereby a SIGHUP signal is delivered to many other processes. First, if the contro ...
732 Chapter 34 34-4. Modify the program in Listing 34-4 (disc_SIGHUP.c) to verify that, if the controlling process doesn’t termi ...
PROCESS PRIORITIES AND SCHEDULING This chapter discusses various system calls and process attributes that determine when and whi ...
734 Chapter 35 Under the round-robin time-sharing algorithm, processes can’t exercise direct control over when and for how long ...
Process Priorities and Scheduling 735 Retrieving and modifying priorities The getpriority() and setpriority() system calls allow ...
736 Chapter 35 A privileged (CAP_SYS_NICE) process can change the priority of any process. An unprivileged process may change it ...
«
34
35
36
37
38
39
40
41
42
43
»
Free download pdf