The UNIX and Linux Forums  

Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-12-2006
jonas.gabriel jonas.gabriel is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 17
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);
b)signal handler

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);
}
c)sigqueue

Code:
tmp=sigqueue(getppid(),SIGUSR1,vsig);
Can anybody find an error

Last edited by jonas.gabriel; 12-12-2006 at 05:48 AM..
 

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0