Sponsored Content
Top Forums Programming Linux fork, execv, wait question Post 302733083 by jim mcnamara on Monday 19th of November 2012 06:18:51 PM
Old 11-19-2012
Please post this in the homework forum. Thank you.
 

10 More Discussions You Might Find Interesting

1. Programming

simple fork question

When executing this simple program: #include <unistd.h> void main() { int f; printf("\n Parent procces ID=%d\n",getpid()); f=fork(); if(f==0) { printf("\n Child process ID=%d father=%d\n",getpid(),getppid()); } ... (2 Replies)
Discussion started by: bb666
2 Replies

2. AIX

Question on High I/O Wait

Hi Group, We have 4 p590 with AIX 5.2 and ML06. The servers are connected to the external SAN (hitachi drives). When running the vmstat or topas command, I see that there is a high I/O wait. It sometimes crosses 90% and the average is over 55%. The server is expeiencing high performance... (0 Replies)
Discussion started by: brookingsd
0 Replies

3. UNIX for Dummies Questions & Answers

How can i use fork,sleep,wait and write in a process with father and son..??

Hi.. I was unable to do (gcc code) which refers to the fork,wait,sleep and write.. what i want to do: A process of father create (fork) a son and will sleep 90 seconds..After this, son process create a grandchild and will sleep 60 seconds..Grandchild process will sleep for 30 seconds..After... (3 Replies)
Discussion started by: gumlucin
3 Replies

4. Red Hat

Fork wait in background process - large delay

hi all, We are trying to run a process in the background and in the process we call fork ;and wait for the child process to finish .We find that the died = wait(&status); happens after 10 seconds randomly and sometimes completes in time (within 1 sec) This behavior is seen only when the... (0 Replies)
Discussion started by: vishnu.priya
0 Replies

5. Red Hat

Fork wait in background process - large delay

hi all, We are trying to run a process in the background and in the process we call fork ;and wait for the child process to finish .We find that the died = wait(&status); happens after 10 seconds randomly and sometimes completes in time (within 1 sec) This behavior is seen only when the... (1 Reply)
Discussion started by: vishnu.priya
1 Replies

6. Shell Programming and Scripting

Question about wait

I have a shell script that i want to run and then wait 30 minutes before running the rest of the script. When I google the "wait" command, it seems to work for waiting for child processes or some pid to stop. How do I wait for 30 minutes before continuing? (2 Replies)
Discussion started by: guessingo
2 Replies

7. Programming

Beginners question about fork

Hi everyone: I'm developing a dynamic library for notifications, this library is used for a daemon that i've programmed, when something goes wrong the library should send an email to an administrator, but since sending an email is a non-vital process then it can fail (it should work as an... (4 Replies)
Discussion started by: edgarvm
4 Replies

8. Programming

multiple fork() question

I writing a program that forks three times but only on the parent process. The three children processes then produces output in order. 1, 2, 3. I am confused on how to do this. I have tried multiple if and else if statements but the output does not come out right. How should I go about doing this? (1 Reply)
Discussion started by: TWhitt24
1 Replies

9. Programming

Newbie question on exec,fork, wait,pipe C

Hello everybody.I want to make clear that i am not going to ask from anybody to build my asignement but i have a big problem. I can't seem to find anywhere ONE good example on C about what i am trying to do:wall:.I think it is simple. All i ask is one example, even a link is fine. So, i want to... (1 Reply)
Discussion started by: Cuervo
1 Replies

10. Programming

question about fork

i'm experimenting fork function and i found this code #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <wait.h> #include <fcntl.h> #include <unistd.h> int main(void) { int fd; pid_t p; p = fork(); fork(); if (p>0) { fork();} fork(); fork();... (6 Replies)
Discussion started by: blob84
6 Replies
system(3S)																system(3S)

NAME
system() - issue a shell command SYNOPSIS
DESCRIPTION
executes the command specified by the string pointed to by command. The environment of the executed command is as if a child process were created using (see fork(2)), and the child process invoked the sh-posix(1) utility via a call to (see exec(2)) as follows: ignores the and signals, and blocks the signal, while waiting for the command to terminate. If this might cause the application to miss a signal that would have killed it, the application should examine the return value from and take whatever action is appropriate to the application if the command terminated due to receipt of a signal. does not affect the termination status of any child of the calling processes other than the process or processes it itself creates. does not return until the child process has terminated. APPLICATION USAGE
If the return value of is not -1, its value can be decoded through the use of the macros described in For convenience, these macros are also provided in Note that, while must ignore and and block while waiting for the child to terminate, the handling of signals in the executed command is as specified by fork(2) and exec(2). For example, if is being caught or is set to when is called, the child is started with handling set to Ignoring and in the parent process prevents coordination problems (such as two processes reading from the same terminal) when the executed command ignores or catches one of the signals. RETURN VALUE
If command is null, returns non-zero. If command is not null, returns the termination status of the command language interpreter in the format specified by wait(2). The termi- nation status of the command language interpreter is as specified for sh-posix(1), except that if some error prevents the command language interpreter from executing after the child process is created, the return value from is as if the command language interpreter had termi- nated using If a child process cannot be created, or if the termination status for the command language interpreter cannot be obtained, returns -1 and sets to indicate the error. DIAGNOSTICS
forks to create a child process which, in turn, in order to execute string. If the fork fails, returns -1 and sets If the exec fails, returns the status value returned by (see wait(2)) for a process that terminates with a call of ERRORS
If errors are encountered, sets values as described by fork(2). FILES
SEE ALSO
sh(1), fork(2), exec(2), wait(2), thread_safety(5). STANDARDS CONFORMANCE
system(3S)
All times are GMT -4. The time now is 08:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy