I'm currently doin a simple program on how to use PTRACE library.
I've succeeded in knowing the system calls called whenever a UNIX command is invoked (let say "ls -l" will call system call SYS_open).
But I'm having trouble in finding out the arguments (or parameter list) for each system call made.
I read in http://www.cs.rit.edu/~hpb/Man/_Man_.../ptrace.2.html that this IS possible...
But I really had having hard time understanding the user structure.PTRACE_SYSCALL
... At this point the arguments to the system call may be inspected in the process user structure using the PTRACE_PEEKUSER request. The system call number is available in place of the 8th argument...
Does anyone know how to use it to extract the system call argument list?
Note that I'm not on Sun or BSD machine, so I can't use any of the <kvm.h> functions.