This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[Q] ENOMEM returned by sigsuspend()
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: [Q] ENOMEM returned by sigsuspend()
- From: Bharadwaj Yadavalli <bharadwaj dot yadavalli at compaq dot com>
- Date: Thu, 27 Sep 2001 15:09:51 -0400
- Reply-To: Bharadwaj Yadavalli <bharadwaj dot yadavalli at compaq dot com>
In one of the programs that I am working on now on Linux/Alpha, I have
installed a signal handler (for SIG36) that takes three arguments (by
setting one of the sa_flags to SA_SIGINFO). This signal handler
suspends itself via sigsuspend() after copying the context out of its
third argument. I have also set an alternate signal stack. I do not
have any flags set in the stack_t argument passed to sigaltstack()
(i.e., ss_flags = 0) but have the ss_sp correctly malloc'd and ss_size
correctly set. (I am not very sure why I should not set SS_ONSTACK
here but setting it gave an "Invalid argument" error... but that is
possibly an aside.)
Well into the execution, sigsuspend() call in the signal handler fails
with a ENOMEM (Cannot allocate memory) error. The signal handler has
successfully suspended the thread and was successfully resumed several
times earlier in the program execution.
With this background, I have the following question: Does anyone know
why sigsuspend fails with ENOMEM error and care to point me to the
source of the problem? The man page of sigsuspend() does not list
ENOMEM as a possible error. Which memory is insufficient? Signal stack?
User stack?
Thanks a lot for your help,
Bharadwaj