By consulting various scattered tutorials and books, I've been able to learn that the 64-bit Linux "exit" system call is 60, and the status value is moved to
edi. Similarly, "write" has call number 1, and the file descriptor must be passed to
However, it seems very hard to find information about the other system calls. For example, this table shows the relevant registers for each call, but in e.g.
sys_chmod, a value of type
mode_t must be moved to
rsi. Where does one find the different integer values that can be passed as arguments?
man 2 chmod doesn't appear to have them, and
greping through header files in /usr/include hasn't been helpful.
In general, how does one go about finding a consistent reference for low-level details like these? Are they considered useless, since the same functionality can generally be performed with C rather than assembly? I'm reading the AMD64 developer manuals, which are helpful for conceptual understanding, but those won't help me with Linux system calls.