I was reading about system calls and encountered system calls in the form open(2) , read(2),write(2) and others. I am trying to find whats 2 in the paranthesis. First I thought its the flag settings but its not the flags i found out. Please help me understand this. Please bear with me if the question is too silly.
Thanks
The “2” refers to the section of the Unix manual. Section 2 is for system calls. Section 3 is for library calls. The distinction has become somewhat arbitrary for certain calls, which used to be system calls (essentially direct calls to the kernel) but are now (at least on some versions of Unix) library functions that do significant work before calling the kernel.
Check out the Wikipedia page about “man pages” for more.