Operating System - HP-UX
1833758 Members
2805 Online
110063 Solutions
New Discussion

can't get correct siginfo after the sigwaitinfo() returns

 
wangshan_1
Occasional Advisor

can't get correct siginfo after the sigwaitinfo() returns

Hi,
We have a HP_UX 11.20 based on Itanium machine. A
piece of code is :

sigset_t mysig_to_wait;
siginfo_t mysig_info;
char data[10];

sigemptyset(&mysig_to_wait);
sigaddset(&mysig_to_wait, SIGPOLL);
sigprocmask(SIG_BLOCK, &mysig_to_wait, NULL);

acb.aio_fildes = 0;
acb.aio_offset = 0;
acb.aio_buf = (void*)data;
acb.aio_nbytes = 5;
acb.aio_sigevent.sigev_notify = SIGEV_SIGNAL;
acb.aio_sigevent.sigev_signo = SIGPOLL;
acb.aio_sigevent.sigev_sigval_int = 10;

aio_read(&acb);
ret = sigwaitinfo(&mysig_to_wait, &mysig_info);
printf("fd is %d\n", mysig_info.si_fd);
printf("sigval is %d\n", mysig_info.si_value.sival_int);
printf("signo is %d\n", mysig_info.si_signo);

printf("data is %s\n", data);

with input:
hello
with output:
fd is 0
sigval is 0
signo is 0
data is hello

the function sigwaitinfo() does get the signal
but the siginfo structure doesn't get any
signal information.

Thanks in advance!
-Wangshan


You can lose anything but freedom
2 REPLIES 2
Hartmut Lang
Trusted Contributor

Re: can't get correct siginfo after the sigwaitinfo() returns

Did you check the value of "ret" after the call
"ret = sigwaitinfo(&mysig_to_wait, &mysig_info);" ?

If ret is "-1", it will indicate an error (and errno will be set).

Hardy
wangshan_1
Occasional Advisor

Re: can't get correct siginfo after the sigwaitinfo() returns

the return value is right. It is the value of sig number ...

Thanks

Yale
You can lose anything but freedom