![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community. |
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing Carriage returns without loosing EOL | Majiktom | Shell Programming and Scripting | 2 | 03-08-2008 07:28 AM |
| replace ascii chars without loosing it. | braindrain | Shell Programming and Scripting | 4 | 02-01-2006 10:02 AM |
| How to install FreeBSD without loosing my data? | sualcavab | UNIX for Dummies Questions & Answers | 0 | 12-05-2005 04:02 AM |
| Linux without loosing Win9x | merlinpr | UNIX for Dummies Questions & Answers | 2 | 06-27-2001 03:48 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Loosing signals even with sigqueue
Hi everyone,
I have a process that forks many times.At a random time point the children must send a SIGUSR1 to the parent.To do that I'm using a pair of sigaction & sigqueue.However many signals are getting lost. Here are some code segments: a)sigaction Code:
sigset_t mask_set; /* used to set a signal masking set. */ sigfillset(&mask_set); struct sigaction act; act.sa_sigaction=catch_usr1; act.sa_mask=mask_set; act.sa_flags=SA_SIGINFO | SA_RESTART; sigaction(SIGUSR1,&act,NULL); Code:
void catch_usr1(int sig,siginfo_t *a,void *b )
{
sigcount++;
if (readers>0)
readers--;
else
writing=false;
printf("[LOG] Signal received. Readers now: %d Signal counter: %d\n",readers,sigcount);
fflush(stdout);
}
Code:
tmp=sigqueue(getppid(),SIGUSR1,vsig); Last edited by jonas.gabriel; 12-12-2006 at 05:48 AM.. |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|