04-09-2018
I think you better put the 60 second supervision into the child code, i.e. replace the system() with code that installs such a signal / -handler and execve() so it directly receives the signal.
Then in the parent code, you just need to waitpid().
But, to be honest, I do not have much practical experience with such C code...
This User Gave Thanks to MadeInGermany For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I connect to a Sun Box through telnet but it timed out in couple of minutes.
Advance thanks for any idea...help... (2 Replies)
Discussion started by: s_aamir
2 Replies
2. UNIX for Dummies Questions & Answers
Hello,
How can I set up events to be executed at a certain time? And do I need some kind of privilege such as being in cron group? (2 Replies)
Discussion started by: rayne
2 Replies
3. Programming
Is there any way in which I can make my wait signal to wait for a specified time for child job to complete. And if that time is over, the program gets out of the wait signal to process other things (4 Replies)
Discussion started by: anjul_thegreat
4 Replies
4. UNIX for Dummies Questions & Answers
Hi guys,
I love unix....but i also hate it :)
I want to write a script that will pause in the middle ask for user input, but if no input is given i want the script to continue anyway.
Say ask a question and give 1 min to answer and if no answer at all the script continues. (2 Replies)
Discussion started by: Noob e
2 Replies
5. UNIX for Advanced & Expert Users
It is possible for me to obtain the Inode of the path name using
ls -i <pathname> command
Can anyone tell me how its implemented... (3 Replies)
Discussion started by: ganapathy.psgit
3 Replies
6. UNIX for Advanced & Expert Users
hey i have to implement copy command in parallel in c language.
i dont know how to create a new directory in destination.
if anything u know related to this help me (1 Reply)
Discussion started by: rajsekhar28
1 Replies
7. Solaris
I have Ultra 45 Sun solaris box with Solaris 10 installed.
My problem is when i boot the unix box, i got the message:
What does this message meant?
then it does not continue to boot successfully.
Please help. Thanks in advance. (5 Replies)
Discussion started by: etcpasswd
5 Replies
8. Solaris
I HAVE A PERL SCRIPT WHICH RCP files from one server to another. The script is not having any issues for years and it is running for more than 3 years . Last week it had failed with error "Command timed out " error. Please help me out (3 Replies)
Discussion started by: praviper
3 Replies
9. Linux
Hi,
I am trying to execute a program with pipes to run a few basic commands by forking children. When I try to run commands in the child process without pipe, I am unable to run the command as execv fails. However for commands that are given with pipes execute successfully.
for example:... (1 Reply)
Discussion started by: mmurali2
1 Replies
10. Shell Programming and Scripting
I want to know about the time command flow of execution.
I have a doubt in the time calculation for the command execution.
Whether the real time is sum of (time taken to open the unix window + execute the command given infront of the "time" command + close the unix window)
or Just the time... (1 Reply)
Discussion started by: sateesh Solapur
1 Replies
SYSTEM(3) BSD Library Functions Manual SYSTEM(3)
NAME
system -- pass a command to the shell
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
int
system(const char *command);
DESCRIPTION
The system() function hands the argument command to the command interpreter sh(1). The calling process waits for the shell to finish execut-
ing the command, ignoring SIGINT and SIGQUIT, and blocking SIGCHLD.
If command is a NULL pointer, system() will return non-zero if the command interpreter sh(1) is available, and zero if it is not.
RETURN VALUES
The system() function returns the exit status of the shell as returned by waitpid(2), or -1 if an error occurred when invoking fork(2) or
waitpid(2). A return value of 127 means the execution of the shell failed.
SEE ALSO
sh(1), execve(2), fork(2), waitpid(2), popen(3)
STANDARDS
The system() function conforms to ISO/IEC 9899:1990 (``ISO C90'') and is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
BSD
June 4, 1993 BSD