Raunaq Kochar Raunaq Kochar - 2 months ago 8
C Question

What exactly does the '2' mean when someone writes read(2) while specifying the system call?

What does someone mean when they say read(2), or open(1)? What do the numbers in the brackets actually mean?

Edit:
Rephrased the title of the question.

Answer

The bracket is used to specify the section of man pages. Man pages are organized into different sections and that section number specifies what type of "thing" it is. From Wikipedia, a common organization of sections(on Research Unix, BSD, OS X and Linux) is like this:

1   General commands
2   System calls
3   Library functions, covering in particular the C standard library
4   Special files (usually devices, those found in /dev) and drivers
5   File formats and conventions
6   Games and screensavers
7   Miscellanea
8   System administration commands and daemons

For example, by read(2) it meant it is talking about OS system call read.