Chapter 14. Advanced I/O

Introduction

This chapter covers numerous topics and functions that we lump under the term advanced I/O: nonblocking I/O, record locking, System V STREAMS, I/O multiplexing (the select and poll functions), the readv and writev functions, and memory-mapped I/O (mmap). We need to cover these topics before describing interprocess communication in Chapter 15, Chapter 17, and many of the examples in later chapters.

Nonblocking I/O

In Section 10.5, we said that the system calls are divided into two categories: the “slow” ones and all the others. The slow system calls are those that can block forever. They include

  • Reads that can block the caller forever if data isn’t present with certain file types (pipes, terminal devices, and network ...

Get Advanced Programming in the UNIX® Environment: Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.