1,885
edits
Changes
Syscalls
,→Syscall information, numbers, and arguments
== Syscall information, numbers, and arguments ==
=== Documentation ===
A list of syscalls can be found in the manpage for <code>syscalls(2)</code> (note: this is different from the manpage for <code>syscall(2)</code> which is a generic syscall wrapper). View this with the command <code>man 2 syscalls</code>
Documentation for the C wrappers for most syscalls can be found in the manpage for that wrapper, usually in section 2 of the manual (e.g., <code>write(2)</code>, which is accessed using the command <code>man 2 write</code>).
=== Syscall numbers ===
This documents that the ''write'' syscall takes three arguments: the file descriptor, a pointer to the message buffer, and the message size, and returns the number of bytes written or -1 if there was an error.
== Using the syscall number macro definitions in asm code ==