Title: Linux useful system calls and Library functions
1 Linux useful system calls and Library
functions Selected from Chapters 1 to 5 from the
book Inter-process Communications in Linux The
Nooks Crannies, by John Shapley Gray, Prentice
Hall, 2003
2Linux useful system calls and Library functions
3 Programs and Processes
Chapter 1
4Managing Failures
PROGRAMS AND PROCESSES
Figure 1.5. Explanation of the summary table
format.
5Managing Failures
PROGRAMS AND PROCESSES
6Managing Failures
PROGRAMS AND PROCESSES
Table 1.2. Summary of the strerror Library
Function.
7Managing Failures
PROGRAMS AND PROCESSES
8Creating a Process
PROGRAMS AND PROCESSES
9Creating a Process
PROGRAMS AND PROCESSES
Table 1.3. Summary of the fork System Call.
10Creating a Process
PROGRAMS AND PROCESSES
11Creating a Process
PROGRAMS AND PROCESSES
Table 1.4. fork Error Messages.
12 Processing Environment
Chapter 2
13Process ID
PROCESSING ENVIRONMENT
Table 2.1. Summary of the getpid System Call.
14Process ID
PROCESSING ENVIRONMENT
15Parent Process ID
PROCESSING ENVIRONMENT
16Process ID
PROCESSING ENVIRONMENT
Table 2.2. Summary of the getppid System Call.
17Parent Process ID
PROCESSING ENVIRONMENT
18Process Group ID
PROCESSING ENVIRONMENT
19Process Group ID
PROCESSING ENVIRONMENT
Table 2.3. Summary of the getpgid System Call.
20Process Group ID
PROCESSING ENVIRONMENT
21Process Group ID
PROCESSING ENVIRONMENT
Table 2.4. getpgid Error Messages.
22Process Group ID
PROCESSING ENVIRONMENT
23Process Group ID
PROCESSING ENVIRONMENT
Table 2.5. Summary of the setpgid System Call.
24Process Group ID
PROCESSING ENVIRONMENT
25Process Group ID
PROCESSING ENVIRONMENT
26Process Group ID
PROCESSING ENVIRONMENT
. Table 2.6. setpgid Error Messages
27Real and Effective User and Group IDs
PROCESSING ENVIRONMENT
28Real and Effective User and Group IDs
PROCESSING ENVIRONMENT
Table 2.7. Summary of User/Group Real and
Effective ID Calls System.
29File Information
PROCESSING ENVIRONMENT
30File Information
PROCESSING ENVIRONMENT
Table 2.8. Summary of the stat System Calls.
31File Information
PROCESSING ENVIRONMENT
32File Information
PROCESSING ENVIRONMENT
33File Information
PROCESSING ENVIRONMENT
. Table 2.9. stat Error Messages
34File Information
PROCESSING ENVIRONMENT
. Table 2.9. stat Error Messages
35File Information
PROCESSING ENVIRONMENT
36File Information
PROCESSING ENVIRONMENT
Table 2.10. Summary of the chmod/fchmod System
Calls.
37File Information
PROCESSING ENVIRONMENT
38File Information
PROCESSING ENVIRONMENT
39File Information
PROCESSING ENVIRONMENT
. Table 2.11. chmod/fchmod Error Messages
40File Information
PROCESSING ENVIRONMENT
. Table 2.11. chmod/fchmod Error Messages
41File Information
PROCESSING ENVIRONMENT
. Table 2.11. chmod/fchmod Error Messages
42File Information
PROCESSING ENVIRONMENT
43File Information
PROCESSING ENVIRONMENT
Table 2.12. Summary of the umask System Call.
44File Information
PROCESSING ENVIRONMENT
45File Information
PROCESSING ENVIRONMENT
Table 2.13. Summary of the getcwd Library
Function.
46File Information
PROCESSING ENVIRONMENT
47File Information
PROCESSING ENVIRONMENT
. Table 2.14. getcwd Error Messages
48File Information
PROCESSING ENVIRONMENT
49File Information
PROCESSING ENVIRONMENT
Table 2.15. Summary of the chdir/fchdir System
Calls
50File Information
PROCESSING ENVIRONMENT
51File Information
PROCESSING ENVIRONMENT
. Table 2.16. chdir/fchdir Error Messages
52File Information
PROCESSING ENVIRONMENT
Table 2.16. chdir/fchdir Error Messages.
53Process Resource Limits
PROCESSING ENVIRONMENT
54Process Resource Limits
PROCESSING ENVIRONMENT
Table 2.17. Summary of the ulimit System Call.
55Process Resource Limits
PROCESSING ENVIRONMENT
56Process Resource Limits
PROCESSING ENVIRONMENT
57Process Resource Limits
PROCESSING ENVIRONMENT
.Table 2.18. ulimit Error Messages
58Process Resource Limits
PROCESSING ENVIRONMENT
59Process Resource Limits
PROCESSING ENVIRONMENT
Table 2.19. Summary of the getrlimit/setrlimit
System Calls.
60Process Resource Limits
PROCESSING ENVIRONMENT
61Process Resource Limits
PROCESSING ENVIRONMENT
. Table 2.20. getrlimit/setrlimit Error Messages
62Process Resource Limits
PROCESSING ENVIRONMENT
63Process Resource Limits
PROCESSING ENVIRONMENT
Table 2.21. Summary of the sysconf Library
Function.
64Process Resource Limits
PROCESSING ENVIRONMENT
65Command-Line Values
PROCESSING ENVIRONMENT
Table 2.22. Summary of the getopt Library
Function.
66Command-Line Values
PROCESSING ENVIRONMENT
67Environment Variables
PROCESSING ENVIRONMENT
68Environment Variables
PROCESSING ENVIRONMENT
Table 2.23. Summary of the getenv Library
Function.
69Environment Variables
PROCESSING ENVIRONMENT
Table 2.24. Summary of the putenv Library
Function.
70The /proc Filesystem
PROCESSING ENVIRONMENT
71The /proc Filesystem
PROCESSING ENVIRONMENT
Table 2.25. Summary of the readlinkSystem Call.
72The /proc Filesystem
PROCESSING ENVIRONMENT
73The /proc Filesystem
PROCESSING ENVIRONMENT
. Table 2.26. readlink Error Messages
74The /proc Filesystem
PROCESSING ENVIRONMENT
Table 2.26. readlink Error Messages.
75 Using Processes
Chapter 3
76execlp
USING PROCESSES
77execlp
USING PROCESSES
Table 3.3. Summary of the execlp Library Function.
78execlp
USING PROCESSES
79execlp
USING PROCESSES
. Table 3.4. exec Error Messages
80execlp
USING PROCESSES
. Table 3.4. exec Error Messages
81execlp
USING PROCESSES
. Table 3.4. exec Error Messages
82execlp
USING PROCESSES
. Table 3.4. exec Error Messages
83execvp
USING PROCESSES
84execvp
USING PROCESSES
Table 3.5. Summary of the execvp System Call.
85execvp
USING PROCESSES
86execvp
USING PROCESSES
87Ending a Process
USING PROCESSES
88Ending a Process
USING PROCESSES
Table 3.6. Summary of the exit Library Function.
89Ending a Process
USING PROCESSES
90Ending a Process
USING PROCESSES
91Ending a Process
USING PROCESSES
Table 3.7. Summary of the atexit Library Function.
92Ending a Process
USING PROCESSES
93Ending a Process
USING PROCESSES
Table 3.8. Summary of the _exit System Call.
94Ending a Process
USING PROCESSES
95Ending a Process
USING PROCESSES
96Ending a Process
USING PROCESSES
97Waiting on Processes
USING PROCESSES
98Waiting on Processes
USING PROCESSES
Table 3.9. Summary of the wait System Call.
99Waiting on Processes
USING PROCESSES
100Waiting on Processes
USING PROCESSES
101Waiting on Processes
USING PROCESSES
102Waiting on Processes
USING PROCESSES
Table 3.11. Summary of the waitpid System Call.
103Waiting on Processes
USING PROCESSES
104Waiting on Processes
USING PROCESSES
. Table 3.12. Interpretation of pid Values by
waitpid
105Waiting on Processes
USING PROCESSES
106Waiting on Processes
USING PROCESSES
. Table 3.13. Flag Values for waitpid
107Waiting on Processes
USING PROCESSES
108Waiting on Processes
USING PROCESSES
. Table 3.14. waitpid Error Messages
109Waiting on Processes
USING PROCESSES
110Waiting on Processes
USING PROCESSES
Table 3.15. Summary of the wait3/wait4 Library
Functions.
111Waiting on Processes
USING PROCESSES
112Waiting on Processes
USING PROCESSES
113Waiting on Processes
USING PROCESSES
. Table 3.16. Option Flag Values for wait3/wait4
114Waiting on Processes
USING PROCESSES
115Waiting on Processes
USING PROCESSES
. Table 3.17. wait3/wait4 Error Messages
116 Primitive Communications
Chapter 4
117Lock Files
PRIMITIVE COMMUNICATIONS
Table 4.1. Summary of the creat System Call.
118Lock Files
PRIMITIVE COMMUNICATIONS
. Table 4.2. creat Error Messages
119Lock Files
PRIMITIVE COMMUNICATIONS
. Table 4.2. creat Error Messages
120Lock Files
PRIMITIVE COMMUNICATIONS
. Table 4.2. creat Error Messages
121Lock Files
PRIMITIVE COMMUNICATIONS
Table 4.3. Summary of the sleep Library Function.
122Lock Files
PRIMITIVE COMMUNICATIONS
Table 4.4. Summary of the unlink System Call.
123Lock Files
PRIMITIVE COMMUNICATIONS
. Table 4.5. unlink error messages
124Lock Files
PRIMITIVE COMMUNICATIONS
. Table 4.5. unlink error messages
125Lock Files
PRIMITIVE COMMUNICATIONS
. Table 4.5. unlink error messages
126Locking Files
PRIMITIVE COMMUNICATIONS
Table 4.6. Summary of the fcntl System Call.
127Locking Files
PRIMITIVE COMMUNICATIONS
.Table 4.7. Lock-Specific Defined Constants Used
with the fcntl System Call
128Locking Files
PRIMITIVE COMMUNICATIONS
. Table 4.8. Defined Constants Used in the flock
l_type Member
129Locking Files
PRIMITIVE COMMUNICATIONS
. Table 4.9. fcntl Error Messages Relating to
Locking
130Locking Files
PRIMITIVE COMMUNICATIONS
. Table 4.9. fcntl Error Messages Relating to
Locking
131Locking Files
PRIMITIVE COMMUNICATIONS
Table 4.10. Summary of the lockf Library Call
132Locking Files
PRIMITIVE COMMUNICATIONS
. Table 4.11. Defined cmd Constants
133Locking Files
PRIMITIVE COMMUNICATIONS
. Table 4.12. lockf error messages
134More About Signals
PRIMITIVE COMMUNICATIONS
Table 4.14. Summary of the kill System Call.
135More About Signals
PRIMITIVE COMMUNICATIONS
. Table 4.15. Interpretation of pid values by the
kill System Call
136More About Signals
PRIMITIVE COMMUNICATIONS
. Table 4.16. kill Error Messages
137More About Signals
PRIMITIVE COMMUNICATIONS
Table 4.17. Summary of the alarm System Call.
138More About Signals
PRIMITIVE COMMUNICATIONS
Table 4.18. Summary of the pause Library Function.
139Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
Table 4.19. Summary of the signal System Call.
140Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
Table 4.20. Summary of the sigaction System Call.
141Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
Table 4.21. Summary of the isatty Library
Function.
142Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
. Table 4.22. sa_flags Constants
143Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
Table 4.23. Summary of the sigprocmask,
sigpending, and sigsuspend System Call.
144Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
. Table 4.24. sigprocmask, sigpending, and
sigsuspend Error Message
145Signal and Signal Management Calls
PRIMITIVE COMMUNICATIONS
. Table 4.25. Defined how Constants
146 Pipes
Chapter 5
147Introduction
PIPES
Table 5.1. Summary of the write System Call.
148Introduction
PIPES
Table 5.3. Summary of the read System Call.
149Unnamed Pipes
PIPES
Table 5.5. Summary of the pipe System Call.
150Unnamed Pipes
PIPES
Table 5.7. Summary of the dup System Call.
151Unnamed Pipes
PIPES
Table 5.8. Summary of the dup2 System Call.
152Unnamed Pipes
PIPES
Table 5.10. Summary of the popen Library Function.
153Unnamed Pipes
PIPES
Table 5.11. Summary of the pclose Library
Function.
154Unnamed Pipes
- Exp 5.1 See the example of using unnamed pipes
with read and write calls - Exp 5.2 See the example of using unnamed pipes
with dup2 system call
155Named Pipes
PIPES
Table 5.12. Summary of the mknod System Call.
156Named Pipes
PIPES
Table 5.15. Summary of the mkfifo Library
Function.