$ perl -e 'alarm(5); system("sleep 10; echo awoke")'
Alarm clock
$ awoke
system was interupted, but the command kept executing.
| [reply] [d/l] |
Depends on what is meant by "system call".
If it's system call, it's a call to the OS, like sysread, in which case alarm works exactly as required.
If it's "system() call", then things are different: system() forks a process, executes whatever's specified (different for single/multiple arguments), waits until the command is completed and then returns. It won't kill the spawned process, that's why it will run until the end.
| [reply] [d/l] [select] |
oh, yes, it does look like I misread the OP.
| [reply] |
it is a "system() call", how can I kill this after a certain amount of time...will alarm work per the other responses...
Your help is greatly appreciated.
| [reply] |