Understanding Linux Man Page Section Numbers: What sleep(3) and read(2) Actually Mean
By
thunderbong
An everything bagel for the brain. Substantive, layered, well-seasoned.
Summary
The article explains the meaning of numbers in Linux man page titles (like sleep(3) or read(2)), which indicate manual sections. The author discovered this after a code review comment pointed out that 'man 2 basename' was incorrect since basename is a library call, not a system call. The man(1) page reveals that section 1 is for executable programs, section 2 for system calls, section 3 for library calls, and so on, clarifying that basename(3) is the correct reference as it's a libc library function.
Key quotes
· 4 pulledThe table below shows the section numbers of the manual followed by the types of pages they contain.
1 Executable programs or shell commands 2 System calls (functions provided by the kernel) 3 Library calls (functions within program libraries)
So my colleague was right and the code should have read // behaves like man 3 basename as basename(3) is a libc library call.
I've always seen the numbers in sleep(3) and read(2) and idly wondered what they meant, but never actually bothered to look them up.
You might also wanna read
Claude Code on the Web: Cloud-Based Development Environment Documentation
This documentation page covers Claude Code on the web, Anthropic's cloud-based development environment at claude.ai/code. It explains how cl
How to Install Ubuntu Server 26.04 on Raspberry Pi: A Step-by-Step Guide
A practical guide for installing Ubuntu Server 26.04 on Raspberry Pi models. The article covers using Raspberry Pi Imager or direct download
Flatpak to require systemd in next major version, dropping support for alternative init systems
Flatpak, a universal Linux app distribution system that previously prided itself on being distribution-agnostic (including support for non-s
Omarchy is not a Linux distribution — it's Arch Linux with DHH's personal dotfiles
The article criticizes omarchy, a project by DHH that markets itself as a Linux distribution. The author argues omarchy is not a true distro
Understanding the Linux TTY Subsystem: History, Architecture, and Implementation
A comprehensive technical deep-dive into the TTY (teletype) subsystem in Linux and UNIX systems. The article traces the historical origins o
linusakesson.net·12d agoGentoo Linux addresses Copy Fail, Dirty Frag, and Fragnesia kernel privilege escalation vulnerabilities
The article reports on a series of recently discovered Linux kernel privilege escalation vulnerabilities — Copy Fail, Dirty Frag, and Fragne
