Contents
Introduction
1 Generalities
1.1 Modules
Sys
and
Unix
1.2 Interface with the calling program
1.3 Error handling
1.4 Library functions
2 Files
2.1 The file system
2.2 File names and file descriptors
2.3 Meta-attributes, types and permissions
2.4 Operations on directories
2.5 Complete example: search in a file hierarchy
2.6 Opening a file
2.7 Reading and writing
2.8 Closing a descriptor
2.9 Complete example: file copy
2.10 The cost of system calls and buffers
2.11 Complete example: a small input/output library
2.12 Positioning
2.13 Operations specific to certain file types
2.14 Locks on files
2.15 Complete example: recursive copy of files
2.16 Complete example:
T
ape
AR
chive
3 Processes
3.1 Creation of processes
3.2 Complete Example: the command
leave
3.3 Awaiting the termination of a process
3.4 Launching a program
3.5 Complete example: a mini-shell
4 Signals
4.1 Default behavior
4.2 Using signals
4.3 Changing the effect of a signal
4.4 How to mask signals
4.5 Signals and system calls
4.6 The passage of time
4.7 Problems with signals
5 Classical inter-process communication: pipes
5.1 Pipes
5.2 Complete example: parallel sieve of Eratosthenes
5.3 Named pipes
5.4 Descriptor redirections
5.5 Complete example: composing
N
commands
5.6 Input/output multiplexing
5.7 Miscellaneous:
write
6 Modern communication: sockets
6.1 Sockets
6.2 Socket creation
6.3 Addresses
6.4 Connection to a server
6.5 Disconnecting sockets
6.6 Complete example: the universal client
6.7 Establishing a service
6.8 Tuning sockets
6.9 Complete example: the universal server
6.10 Communication in connectionless mode
6.11 Low level reads and writes
6.12 High-level primitives
6.13 Examples of protocols
6.14 Complete example:
http
requests
7 Threads
7.1 Introduction
7.2 Creation and termination of threads
7.3 Waiting
7.4 Synchronization among threads: locks
7.5 Complete example:
http
relay
7.6 Conditions
7.7 Event-based synchronous communication
7.8 Implementation details
Going further
References
Index