truss - trace system calls and signals
truss [-DhpR] [-S nsteps] [-o outfile] [--] arg ...
The truss(1) utility traces system calls and signals while it runs. Unless the -o option is given, these are written to standard error. You must specify one or more args. Normally, the arg is the argument vector of a command to trace. If the -p option is given, you can supply a list of process identifiers (IDs) as the args.
The truss(1) takes the following options:
The truss(1) utility exits with status 0 for success, and >0 if an error occurred.
To follow the system calls for an ls(1) command:
$ truss ls /bin/truss
tracing pid 8323077
isatty(1) isatty returned 0
ioctl() ioctl returned 0
getids() getids returned 0
stat() stat returned 0
fstat(1, 0x2540588) fstat returned 0
isatty(1) isatty returned 0
isatty(1) isatty returned 0
write(1, 0x830C60, 22) /bin/truss
write returned 22 0x16
exit(0) process has exited
In this case, all calls returned 0.
gdb(1)
pstat(1)