I started to learn socket programming for C / C++ and examining the man pages for functions like bind, listen etc.
While I was navigating between man pages, I noticed there are situations that there are multiple man pages for the same system call, e.g. socket()
http://man7.org/linux/man-pages/man2/socket.2.html
http://man7.org/linux/man-pages/man3/socket.3p.html
http://man7.org/linux/man-pages/man7/socket.7.html
Among these manuals, what comes up at my linux box is the first one (socket(2)).
I noticed that one with the 3p suffix is titled "POSIX programmer's manual" and rest two are titled "Linux programmer's manual". Function prototypes and usages are the same (as far as I understood).
My question is: What is the purpose of two different versions of Linux Programmer's Manuals for the same system call, and what does the number between the paranthesis means (socket(2), socket(3p), socket(7))?
Man pages are organized in sections, each section have its own topic. Check out the manpage for man
, try run man man
, it lists all the sections available:
For the socket
example, "socket(2)" is the system call provided by the operating system kernel, "socket(3)" is the POSIX interface provided by the library, "socket(7)" is a general documents on the topic of socket. You can see that all three have different content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With