Hopefully, 1 month delay is not too long for an answer:
The main thing is this: just before a signal handler is called, subsequent signals on that same signal are blocked. The return function from a signal handler is "special" in that it unblocks that mask. I'm not sure where this is documented, but you can demonstrated it by adding a couple of printf("%x\n",siggetmask()); calls, in the signal handler, and right after the alarm() call. But because your signal handler does a longjmp instead of a return, the signal mask never gets reset.
Or, to do it "by hand", you can do this in your signal handler (or on return from it):
All you need to do is set savemask=1 when you declare it. Then things will work the way you intended. This tells the setlongjmp() call to restore the original signal mask when it does the jump -- in effect, emulating the normal return-from-signal code.
There is also a problem mixing SIGALRM and wait(). From the wait(3) man page:
Last edited by otheus; 02-03-2009 at 12:03 PM..
Reason: added sigprocmask()
Hi,
when I execute a script on unix AIX, I've got an error message:
"Execution: 85328 Signal d'alarme".
If I edit this file with "vi", I ve got the same error after a while (about 1 minute).
If I try with another user I still have the problem.
But if I rename this file, no problem.
My... (5 Replies)
Hello
I have a server HP ES40 with unix 5.1B, and if i open from Start-Programs-IN Tools-GUI/pfmalarm/Alarm-start monitoring , I receive this error message "IOR : STRING IS TOO LONG ! MAXIMUM SIZE = 1024"
Anybody heard about this error?
Thanks
Alin (0 Replies)
Hey,
I want to ask a simple Question....
How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (1 Reply)
Hey,
I want to ask a simple Question....
How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (16 Replies)
Hi members, I am working in WebSphere in Unix environment. we are working with 500 odd servers and most of the times processes got down. Can i have any shell script through whih some popup with alarm get raised whenever some server get down. kindly help.. Thanks Rishi (1 Reply)
I'm writing a function right now, and I want to set an alarm to avoid a timeout, here's the general idea of my code:
int amt = -2;
alarm(10);
amt = read(fd, &t->buf, TASKBUFSIZ - tailpos); //do a read
when the alarm goes off, i want to check the value of "amt"
... (1 Reply)
Hi All,
I am monitoring batch Processes running in UNIX environment.
I use PuTTy to monitor the process running.
I have to continuously monitor and look on the screen if some error has come or not.
If an error comes FAILURE word is displayed instead of SUCCESS as shown below on the... (2 Replies)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
In the bash below I am trying to run the script entire script including the ....(which is a bunch of code) and then in the run function if the user response is y (line in bold). then start processing from execute function. Basically, goto the # extract folder for variable filename line and start... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT MINIX
sigprocm
SIGPROCMASK(2) System Calls Manual SIGPROCMASK(2)NAME
sigprocmask - manipulate the signal mask
SYNOPSIS
#include <signal.h>
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
DESCRIPTION
Sigprocmask() examines or manipulates the signal mask. This mask is the set of signals that are currently blocked. The how argument
determines the action that must be performed. In all cases the signal set referenced by oset, if not NULL, will be used to receive the old
signal mask. The set argument, if not NULL, will be used to set or modify the current signal mask.
How can be one of:
SIG_BLOCK Add the signals referenced by set to the mask.
SIG_UNBLOCK Remove the signals referenced by set from the mask.
SIG_SETMASK Set the signal mask to the set referenced by set.
The value of how is ignored if set is NULL.
SEE ALSO sigaction(2), sigpending(2), sigsuspend(2), sigset(3).
DIAGNOSTICS
Returns 0 on success and -1 on error. The error code is EFAULT for a bad set or oset address, or EINVAL for a bad how argument.
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
SIGPROCMASK(2)