Sponsored Content
Top Forums UNIX for Advanced & Expert Users Command timed out implementation Post 303015649 by MadeInGermany on Monday 9th of April 2018 01:27:35 PM
Old 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

Connection Timed out

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

timed commands

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

Timed wait?

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

Timed read command

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

Implementation of ls - i command

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

implementation of copy command in parallel

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/O timed out

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

RCP command timed out

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

Shell implementation - Command not found

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

UNIX time command implementation

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
wait.h(3HEAD)							      Headers							     wait.h(3HEAD)

NAME
wait.h, wait - wait status SYNOPSIS
#include <sys/wait.h> DESCRIPTION
When a process waits for status from its children using either the wait(3C) or waitpid(3C) function, the status returned can be evaluated with the following macros, defined in <sys/wait.h>. These macros evaluate to integral expressions. The stat argument to these macros is the integer value returned from wait() or waitpid(). WCOREDUMP(stat) If the value of WIFSIGNALED (stat) is non-zero, this macro evaluates to a non-zero value if a core image of the terminated child was created. WEXITSTATUS(stat) If the value of WIFEXITED(stat) is non-zero, this macro evaluates to the exit code that the child process passed to _exit() (see exit(2)) or exit(3C), or the value that the child process returned from main. WIFCONTINUED(stat) Evaluates to a non-zero value if status was returned for a child process that has continued. WIFEXITED(stat) Evaluates to a non-zero value if status was returned for a child process that terminated normally. WIFSIGNALED(stat) Evaluates to a non-zero value if status was returned for a child process that terminated due to the receipt of a signal. WIFSTOPPED(stat) Evaluates to a non-zero value if status was returned for a child process that is currently stopped. WSTOPSIG(stat) If the value of WIFSTOPPED(stat) is non-zero, this macro evaluates to the number of the signal that caused the child process to stop. WTERMSIG(stat) If the value of WIFSIGNALED(stat) is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process. The <sys/wait.h> header defines the symbolic constants listed below for use with waitpid(3C). WNOHANG Do not hang if no status is available; return immediately. WUNTRACED Report status of stopped child process. The symbolic constants listed below are defined as possible values for the options argument to waitid(2). WEXITED Wait for processes that have exited. WSTOPPED Status is returned for any child that has stopped upon receipt of a signal. WCONTINUED Status is returned for any child that was stopped and has been continued. WNOHANG Return immediately if there are no children to wait for. WNOWAIT Keep the process whose status is returned in infop in a waitable state. The type idtype_t is defined as an enumeration type whose possible values include the following: P_ALL P_PID P_PGID The id_t and pid_t types are defined as described in <sys/types.h>. The siginfo_t type is defined as described in <signal.h>. The rusage structure is defined as described in <sys/resource.h>. Inclusion of the <sys/wait.h> header can also make visible all symbols from <signal.h> and <sys/resource.h>. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
exit(2), waitid(2), exit(3C), wait(3C), waitpid(3C),attributes(5), standards(5) SunOS 5.10 10 Sep 2004 wait.h(3HEAD)
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy