
System Call Arguments
When a system call requires arguments, these arguments have to be delivered in an OS-
dependent manner. For example, FreeBSD expects that the arguments are placed on the
stack, whereas Linux expects the arguments to be placed in registers.To find out how to
use a system call in assembly, first look at the system call’s man page to get more infor-
mation about the system call’s function, required arguments, and return values.
To illustrate how system calls have to be used on Linux and FreeBSD systems, we
will discuss an example exit system call implementation for FreeBSD and Linux.
Example 8.6 shows a Linux system call argument.