System call trapping using ptrace.

Hello experts,

I am trying to trap system calls using ptrace available on Salaris. How to get the system call number which I am going to trap.
In Linux I have done like below:
ptrace(PTRACE_PEEKUSER, pid,
4 * ORIG_EAX, NULL);

where PTRACE_PEEKUSER : is the request, this specifies the kind of action.
pid : child pid
4 * ORIG_EAX : This is the address part, and
NULL : data part.

The above ptrace call will return syscall number. So how can I do it on Solaris ? Is there any alternative registers in Solaries ?
help would be greatly appreciated !!!
Thanks in advance,
--
Patel.

I think ptrace is no longer supported in 64 bit Solaris and is a hack on 32 bit.

You might want to use /proc interface instead and PCSENTRY or perhaps dtrace, depending on your goals.