12 SYSTEM AND PROCESS INFORMATION 223 12.1
The /proc File System................................................................................................. 223
12.1.1
Obtaining Information About a Process: /proc/
PID
................................... 224
12.1.2
System Information Under /proc.............................................................. 226
12.1.3
Accessing /proc Files ............................................................................ 226
12.2
System Identification:
uname()
.................................................................................... 229
12.3
Summary.................................................................................................................. 231
12.4
Exercises .................................................................................................................. 231
13 FILE I/O BUFFERING 233 13.1
Kernel Buffering of File I/O: The Buffer Cache .............................................................. 233
13.2
Buffering in the
stdio
Library ....................................................................................... 237
13.3
Controlling Kernel Buffering of File I/O ........................................................................ 239
13.4
Summary of I/O Buffering .......................................................................................... 243
13.5
Advising the Kernel About I/O Patterns........................................................................ 244
13.6
Bypassing the Buffer Cache: Direct I/O........................................................................ 246
13.7
Mixing Library Functions and System Calls for File I/O .................................................. 248
13.8
Summary.................................................................................................................. 249
13.9
Exercises .................................................................................................................. 250