Skip to Content
Linux System Programming, 2nd Edition
book

Linux System Programming, 2nd Edition

by Robert Love
May 2013
Intermediate to advanced content levelIntermediate to advanced
456 pages
11h 56m
English
O'Reilly Media, Inc.
Content preview from Linux System Programming, 2nd Edition

Chapter 4. Advanced File I/O

In Chapter 2, we looked at the basic I/O system calls in Linux. These calls form not only the basis of file I/O, but also the foundation of virtually all communication on Linux. In Chapter 3, we looked at how user-space buffering is often needed on top of the basic I/O system calls, and we studied a specific user-space buffering solution, C’s standard I/O library. In this chapter, we’ll look at the advanced I/O system calls that Linux provides:

Scatter/gather I/O
Allows a single call to read from or write data to many buffers at once; useful for bunching together fields of different data structures to form one I/O transaction.
Epoll
Improves on the poll() and select() system calls described in Chapter 2; useful when hundreds of file descriptors need to be polled from a single thread.
Memory-mapped I/O
Maps a file into memory, allowing file I/O to occur via simple memory manipulation; useful for certain patterns of I/O.
File advice
Allows a process to provide hints to the kernel on the process’s intended uses for a file; can result in improved I/O performance.
Asynchronous I/O
Allows a process to issue I/O requests without waiting for them to complete; useful for juggling heavy I/O workloads without the use of threads.

The chapter will conclude with a discussion of performance considerations and the kernel’s I/O subsystems.

Scatter/Gather I/O

Scatter/gather I/O is a method of input and output where a single system call writes to a vector of buffers ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming

Linux System Programming

Robert Love
Linux Kernel Programming

Linux Kernel Programming

Kaiwan N. Billimoria

Publisher Resources

ISBN: 9781449341527Errata Page