04-22-2004
sigwait system call in UNIX signal
Hi Everybody,
I have gone through man of sigwait and new to UNIX signals. Could anyone explain me about the following lines mentioned in sigwait man help ?
"The selection of a signal in set is independent of the signal
mask of the calling thread or LWP. This means a thread or
LWP can synchronously wait for signals that are being
blocked by the signal mask of the calling thread or LWP."
What is the difference between sigsuspend and sigwait system call as both system call blocks the process till the signal arrives ?
Regards
Dinesh
10 More Discussions You Might Find Interesting
1. IP Networking
hi
is there any system call by which ip routing table can be accessed. (1 Reply)
Discussion started by: vinodkumar
1 Replies
2. UNIX for Advanced & Expert Users
Hi,
Ho do I differentiate system call from library call?
for example if I am using chmod , how do I find out if it is a system call or library call?
Thanks
Muru (2 Replies)
Discussion started by: muru
2 Replies
3. UNIX for Dummies Questions & Answers
Hell Sir,
This is chanikya
Is there any System call which behaves just like fork but i dont want to return back two times to the calling func.
In the following ex iam creating a child process in the called func but the ex prints two times IN MAIN.
ex :-
calling()
{
fork();
}
... (2 Replies)
Discussion started by: chanikya
2 Replies
4. Programming
Hi,
I have a daq program that runs in an infinite loop until it receives SIGINT. A handler catches the signal and sets a flag to stop the while loop. After the loop some things have to be cleaned up.
The problem is that I want my main while loop to wait until the next full second begins, to... (2 Replies)
Discussion started by: soeckel
2 Replies
5. Programming
#include <pthread.h>
#include <signal.h>
...
sigset_t mask;
int err,signo;
err=sigwait(&mask,&signo);
switch(signo){
case SIGINT:
...
}
when I compile above code under solaris 10,it raise following error:
error: too many arguments to function 'sigwait'
I look up signal... (4 Replies)
Discussion started by: konvalo
4 Replies
6. Programming
I have a cgi script which is called after certain time interval, which has this:
system ("ls -l /tmp/cgic* | grep -v \"cgicsave.env\" | awk '{print $5}'");
During the execution of this script,the output is 0 sometimes. But due to this the system call is not working at all and doesnt o/p... (2 Replies)
Discussion started by: xs2punit
2 Replies
7. Programming
After an extensive search, I haven't found a definitive answer to my question. "And what is your question you frackking noob", you may ask. Ok, here goes: When using sigwait to wait for SIGUSR1 or SIGUSR2, can you have it trigger a signal handler? The following code did NOT, and the example I got... (2 Replies)
Discussion started by: bcfd36
2 Replies
8. Programming
Hi,
The UNIX system call inside the COBOL program is doing
the specified command correctly.
MOVE W080-UNZIP-FILE-COMMAND TO W080-OUTPUT-COMMAND
CALL "SYSTEM" USING W080-OUTPUT-COMMAND
RETURNING W080-SYS-CALL-STATUS
BUT The problem is, the following keeps on showing on the log file... (2 Replies)
Discussion started by: joyAV
2 Replies
9. AIX
Hi,
I am running a remote shell from site A to site B, where both are AIX. The remote shell starts other application, and when it finishes, it returns to the site A.
The problem is that I am receiving an error signal 11 and system core error 50 - segmentation fault.
Does anyone know if there are... (6 Replies)
Discussion started by: brjohnsmith
6 Replies
10. Programming
Hi @ll :)
I have a problem with my code but first a short description:
1. I have one signal call SIGUSR1
2. In the signal I try to use nanosleep and now:
When I put kill -SIGUSR1 pid --> sometimes works fine, sometimes returns me an error with ,,Interrupt system call", sometimes I got... (5 Replies)
Discussion started by: mattdj
5 Replies
LEARN ABOUT CENTOS
sigwait
SIGWAIT(3) Linux Programmer's Manual SIGWAIT(3)
NAME
sigwait - wait for a signal
SYNOPSIS
#include <signal.h>
int sigwait(const sigset_t *set, int *sig);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
sigwait(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
DESCRIPTION
The sigwait() function suspends execution of the calling thread until one of the signals specified in the signal set set becomes pending.
The function accepts the signal (removes it from the pending list of signals), and returns the signal number in sig.
The operation of sigwait() is the same as sigwaitinfo(2), except that:
* sigwait() returns only the signal number, rather than a siginfo_t structure describing the signal.
* The return values of the two functions are different.
RETURN VALUE
On success, sigwait() returns 0. On error, it returns a positive error number (listed in ERRORS).
ERRORS
EINVAL set contains an invalid signal number.
CONFORMING TO
POSIX.1-2001.
NOTES
sigwait() is implemented using sigtimedwait(2).
EXAMPLE
See pthread_sigmask(3).
SEE ALSO
sigaction(2), signalfd(2), sigpending(2), sigsuspend(2), sigwaitinfo(2), sigsetops(3), signal(7)
COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2012-07-21 SIGWAIT(3)