Where are some lists of system calls on UNIX?
This wasn\'t my original question, but thanks anyway :)
For the official, authoritative IEEE Std. 1003.1 / Single UNIX Specification (UNIX 2004) manpages, see:
A full list of functions (system interfaces) may be found under "System Interfaces" or at the link. I would also like to use this as an opportunity to plug my Development / Coding Search custom search engine, which includes and is heavily biased towards the Single UNIX Specification / IEEE Std. 1003.1. For example, a standard search for fopen, close, unix, etc. have promotions taken out to ensure that results from the authoritative documentation are at the very top. Adding "man" in front of a query heavily weights the result in favor of the IEEE Std. 1003.1 man page as in man find, man free, man inttypes.h, etc., although most queries should favor IEEE Std. 1003.1 even without adding "man" (if it isn't, type bad query and tell me).
Read The Fine Manual. For system calls, start with
man 2 intro
That's how I got started in UNIX. We didn't have no fancy internet back then ...
man 2 syscalls
Aside from that, you can look in /usr/include/sys/syscall.h (which on my system merely #includes /usr/include/bits/syscall.h). That's generated at libc build time from kernel syscall list.
You can also grep the Linux kernel source for SYSCALL_DEFINE. (I'm not a BSD expert, but I think the equivalent in FreeBSD is SYSCALL_MODULE)
In most environments, ls /usr/man/2/
will do the trick, although it could be /usr/local/man
or /usr/share/man
or even /usr/local/share/man
.
EDIT: There might even be a MANPATH
environment variable pointing you to the right place.
http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html
http://www.metasploit.com/users/opcode/syscalls.html
In FreeBSD, the best place to look for what the system calls are is in the file /usr/src/sys/sys/syscall.h. This is on FreeBSD 9.0