OS X System Calls, BSD Edition

Last weekend I was playing with system calls on OS X and I found out that there is not much resources out there covering them with full and up-to-date information. Of course it is not a big problem, since XNU is open sourced you can find the syscalls you are looking for via greppin’, ctaggin’, et cetera but it is a PITA. Also, with j00ru’s Windows system call tables and myriad of lists for Linux syscalls this situation is simply unacceptable. Therefore, I have spent the rest of the weekend parsing XNU sources for system calls instead of playing with them. This resulted in the following reference list:

As implied by the name, for the moment I have focused on BSD system calls but in the near future I also plan to cover MACH traps (however I think I will skip machine dependent calls and diagnostic calls). When generating the BSD syscalls list I have decided to build upon syscalls.master file from XNU instead of a live-system version /usr/include/sys/syscalls.h because it provides more information (i.e. #ifdefs). With regard to arguments keep in mind that OS X 64-bit follows the standard AMD64 ABI calling convention, you can read about it at Mac Developer Library and if you are curious how to use it in practice check out Dustin’s post.

Feedback, ideas, bugs, et cetera — give me a shout.