问题
I'm looking through the syscalls.master file here but it isn't at all documented. Does documentation for the syscalls exist? If not, why not?
By documentation I mean an actual explanation of what each syscall does and the meanings of the arguments it takes.
回答1:
Apple's position is that the system libraries are the API and stable ABI, syscalls are not. They discourage their direct use, as they can change from release to release of the OS.
So, the best documentation you'll see is the man pages in section 2 or, in some cases, the headers in /usr/include. Of course, you can also look at the XNU sources for the implementations of the syscalls to see how they work.
Note that many of the system calls in syscalls.master are for internal use only and have no documentation. Also, syscalls.master contains only the Unix syscalls, not, for example, the Mach syscalls.
来源:https://stackoverflow.com/questions/53107045/where-are-the-osx-xnu-syscalls-actually-documented