From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii)
Subject: Re: [Q] parameter passing & return values of system call
Date: 1999/07/20 [thread overview]
Message-ID: <7n24kv$gh8@ds2.acs.ucalgary.ca> (raw)
In-Reply-To: emZCMcm0#GA.162@news.thrunet.com
Kim, Hyunchul (kimhc@inzen.com) wrote:
: I'm writing a program which examines the system calls of other processes.
: With "/proc" file system and some ioctl calls(),
: I succeeded for it to make another process stop when system call.
: But I don't know how to get the parameters of the system call and
: return value or error flag of it.
Syscall number is in the register 0 (of gregset_t.regs obtained by
PIOCSREG). Syscall parameters are in the registers 16 to 19 (decimal).
Return code OR error code is in the register 0 (and, I guess, also 1
if you are doing pipe() - but I had not checked this). The meaning of
the return code is given by the value of the register 19: zero means
successful completion (with the return code in reg. 0); non-zero is
error condition, with errno value in reg. 0.
Regards,
/Serge.P
--
home page: http://www.cobalt.chem.ucalgary.ca/ps/
prev parent reply other threads:[~1999-07-20 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-20 4:00 [Q] parameter passing & return values of system call Kim, Hyunchul
1999-07-20 4:00 ` Serguei Patchkovskii [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox