There are other issues with the syscall(2) interface too, like having to split up 64 bit arguments manually on 32 bit architectures.
And the documentation in man(2) is very schizophrenic, as it is sometimes about the syscall and sometimes about the glibc interface or quirks. Ideally there should be entries in man 2 and man 3 for some more calls (or all of them?).
Sometimes glibc makes very odd decisions, like caching the output of getpid() so it returns the incorrect value if you call clone(2) yourself.
Sometimes however there can be useful bug fixes, and lots of compatibility wrappers which are useful. But again documentation in man 3 would be useful...
Posted Jan 30, 2013 16:30 UTC (Wed) by glandium (subscriber, #46059)
[Link]
> There are other issues with the syscall(2) interface too, like having to split up 64 bit arguments manually on 32 bit architectures.
Or having to handle different ways to pass arguments for syscalls with a lot of them on some architectures.
Glibc and the kernel user-space API
Posted Jan 31, 2013 0:09 UTC (Thu) by mkerrisk (subscriber, #1978)
[Link]
And the documentation in man(2) is very schizophrenic, as it is sometimes about the syscall and sometimes about the glibc interface or quirks. Ideally there should be entries in man 2 and man 3 for some more calls (or all of them?).
There's some relevant thoughts about this
here.
The main point is that the user shouldn't (as far as I am concerned) need to consult two pages to get the information they need.
Glibc and the kernel user-space API
Posted Jan 31, 2013 15:22 UTC (Thu) by paulj (subscriber, #341)
[Link]
Yeah, there really ought to be a separate section (2s?) to document the actual kernel syscall.
Glibc and the kernel user-space API
Posted Feb 1, 2013 6:17 UTC (Fri) by vapier (subscriber, #15768)
[Link]
section 2 is the standard location for syscalls (or rather, for the ABI the kernel provides). but the contention isn't the location, it's splitting information across two pages for end developers (section 2 and section 3). mkerrisk posted a link that explains a bit more.
Glibc and the kernel user-space API
Posted Feb 1, 2013 11:37 UTC (Fri) by paulj (subscriber, #341)
[Link]
I'm aware what sections 2 and 3 are traditionally for. However, you can have "sub-sections", indicated by a letter suffix on the section. E.g. several sections have POSIX specific sub-sections. Compare "man 1 sh" to "man 1p sh", or "man nan" to "man 3p nan".
There's no reason you couldn't have a "k" sub-section (so "2k" and/or "3k"), to document kernel specific things about programming interfaces. There's no reason why you can't have *both* a glibc and Linux kernel specific version for a man-page.
Glibc and the kernel user-space API
Posted Feb 2, 2013 22:19 UTC (Sat) by vapier (subscriber, #15768)
[Link]
using subsections instead of the proper (and already standardized) main sections doesn't address the stated concern in any way