News for hackers. Stuff that matters.
Re:Fork is not my favourite syscall by majewsky on Friday January 05, 2018 @06:27AM (#16077966)
> You're talking about the C library function clone().

Huh? I saw that the manpage for clone() is in section 2, which AFAIK means it's kernel API, whereas C library functions are usually in section 3. Am I mistaken?

Even syscalls(2) refers to clone(2) in its list of syscalls.

Re:Fork is not my favourite syscall by tialaramex on Friday January 05, 2018 @12:33PM (#16080035)
Yeah, no.

You are correct that the manual section 2 is "for" system calls, but in practice today these are just the lowest level of the C library, and not the actual system calls.

My copy of the clone(2) manual page hints at this by commenting /* For the prototype of the raw system call, see NOTES */

and more explicitly in its body text by saying "The main text describes the wrapper function; the differences for the raw system call are described toward the end of this page."

Other modern stuff is the same way, the section 2 documentation is describing what an ordinary C programmer needs to know, but if you're say, implementing the C standard library or writing a compiler for a language that runs on the bare metal you need to read the kernel documentation which is not provided as manual pages.