what is diff b/w wait3() and wait4() system call


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers what is diff b/w wait3() and wait4() system call
# 1  
Old 08-03-2007
what is diff b/w wait3() and wait4() system call

helo,
i read man pages but still confuse about
wait3() and wait4() stystem call
what is exact diff b/w wait3() and wait4() system call
and what is diff b/w waitpid() and wait3() and wait4()
Regards,
Amit
# 2  
Old 08-03-2007
The difference between the wait3() and wait4() seems to be quite obvious. wait4() allows you to specify a pid to wait for. Of course, you can give various values in the pid field which will modify the behaviour of the function.
In other words, difference between wait3 and wait4 is similar to the difference between wait and waitpid.

The difference between wait and wait3 or waitpid and wait4 is that wait3 and wait4 accept an additional argument. This is the struct rusage, that returns a summary of the system resources used by the child process. According to the man page, the only resources currentlyu reported are the user time and system time used.
 
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. Shell Programming and Scripting

System terminating diff command before job completed

I'm running diff at the command prompt against two very large text files (>1GB) and system kills the process and replys back "Terminated" after 15 seconds. I believe a system parameter needs to be adjusted but can't figure it out. I'm running Red Hat 4.1.2-46, 2.6.18-028stab089.1 Thanks... (4 Replies)
Discussion started by: azpetef
4 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. Shell Programming and Scripting

Call single function multiple times diff set of parameters

Okay, not sure if it can be done, I would think it could be done and I'm just having a hard time with it. fun_close_wait(){ ipVar="${1} ${2}" portVar=`cat "${5}" | cut -d' ' -f 1` for ip in $ipVar do for port in $portVar do netstatVar=`netstat -n | grep... (4 Replies)
Discussion started by: cbo0485
4 Replies

5. 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

6. 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

7. Solaris

diff b/w /etc/system and user profile..

Hi Everybody, Can somebody tell me the difference between /etc/system and user profile???? (2 Replies)
Discussion started by: tirupathiraju_t
2 Replies

8. Programming

wait4

hello again! i have the following code, int main() { struct rusage rusage; for(int i=0;i<100;i++) { pid=fork(); if(pid==0)execl("","",NULL); else if(pid>0) { wait4(pid,&status,0,&rusage); printf("%lu.%06lu\n",rusage.ru_utime.tv_sec,rusage.ru_utime.tv_usec); } else... (3 Replies)
Discussion started by: nicos
3 Replies

9. Programming

c system call

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

10. 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
Login or Register to Ask a Question