System call trapping using ptrace.


 
Thread Tools Search this Thread
Operating Systems Solaris System call trapping using ptrace.
# 1  
Old 06-11-2009
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.

Last edited by vbe; 06-11-2009 at 03:00 PM.. Reason: Attemps to rm nondesired URL: Follow the rules...
# 2  
Old 06-11-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

2. Programming

need help with system call

hi everyone i wrote a system call and compiled the kernel succesfully... my system call is in a file in the kernel folder named my_syscall1.c (kernel/my_syscall1.c) the header file for this system call i added it in the folder include like this include/my_syscall1/my_syscall1.h my problem is... (2 Replies)
Discussion started by: demis87
2 Replies

3. Programming

system call

I have a cgi script which is called after certain time interval, which has this: system ("ls -l /tmp/cgic* | grep -v \"cgicsave.env\" | awk '{print $5}'"); During the execution of this script,the output is 0 sometimes. But due to this the system call is not working at all and doesnt o/p... (2 Replies)
Discussion started by: xs2punit
2 Replies

4. Programming

C:system call

Hi I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process. I'm reading that i should use the tms struct: clock_t times(struct tms *buf); struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies

5. Shell Programming and Scripting

system call

Hi, How to write a system calls in a script ? > cd $HOME > ls -ltr thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies

6. Shell Programming and Scripting

trapping errors from a sub call

I want to trap any errors from a backup database script and send an email when an error occurs. I can trap command errors and send an email in the following code. My problem occurs if an error occurs in the Maxl script, /opt/hyperion/AnalyticServices/bin/essmsh < MaxlScript.msh..., that is called... (0 Replies)
Discussion started by: t_coop
0 Replies

7. Programming

Help required with using system() call

Hi, I try to write a C program which lists the output of a paticular command with all the available options (a to z) for the command in the directory of execution. This program will generate the output if the option exists for the particular command else it will display some message saying... (9 Replies)
Discussion started by: ramkrix
9 Replies

8. Programming

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

9. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

10. Programming

semclt system call ???

hi mates, What is the : semctl system call for? any example will be helpful and be appreciated. cya and thanx abdul (2 Replies)
Discussion started by: abdul
2 Replies
Login or Register to Ask a Question