All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Understanding Linux Man Page Section Numbers: What sleep(3) and read(2) Actually Mean

By

thunderbong

1mo ago· 2 min readen

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 pulled
The 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.
Snippet from the RSS feed
If you do Linux systems programming, you will have likely pored over man pages, either on the command line or, my personal preference, using the excellent man7.org or linux.die.net. I’ve always seen the numbers in sleep(3) and read(2) and idly wondered wh

You might also wanna read