Skip to content

POSIX I/O API Reference

This section collects common file-descriptor based APIs used throughout the labs.

These APIs are the foundation for Linux userspace programming, including character devices, pipes, sockets, event loop integration, and IPC.

APIs

API Purpose
open() Open a file, device node, FIFO, or special file and obtain a file descriptor.
read() Read bytes from a file descriptor.
write() Write bytes to a file descriptor.
close() Release a file descriptor.
fcntl() Query or modify file descriptor flags, such as O_NONBLOCK and FD_CLOEXEC.
pipe() Create a unidirectional byte-stream IPC channel.
dup() / dup2() Duplicate file descriptors.
errno Inspect the reason for a failed system call.

Learning Context

These APIs appear repeatedly in the labs:

  • userspace tests for character drivers
  • non-blocking I/O
  • poll() / epoll() integration
  • socket examples
  • IPC examples
  • driver debug tools