LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2009, 05:48 PM   #1
wtruong
Member
 
Registered: May 2009
Distribution: ubuntu
Posts: 35

Rep: Reputation: 16
Masking all real time signals with sigaddset( )


To create a signal mask with C:

#include <signal.h>

sigset_t sig_mask;
sigemptyset(&sig_mask);
sigaddset(&sig_mask,SIGINT);


Now here is my question:
Is there a way to mask real time signals SIGRTMIN+1 to SIGRTMAX-1 all at once without doing:

for(int i = SIGRTMIN+1; i < SIGRTMAX; i++)
{
sigaddset(&sig_mask,i);
}

Thanks
 
Old 12-08-2009, 02:21 AM   #2
wtruong
Member
 
Registered: May 2009
Distribution: ubuntu
Posts: 35

Original Poster
Rep: Reputation: 16
bump
 
Old 12-08-2009, 03:16 AM   #3
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
There are some #define macros in signal.h that give you bitwise operations on signal masks (since they are really just a set of bits). However, this doesn't save you any code unless you are doing this particular set more than once (since you still have to cycle through to create the bit set in a portable way before you can or it in).
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
real time signals work under gdb, not when run normally?? lel4866 Linux - Networking 10 07-07-2008 01:31 PM
LXer: Real-time garbage collection with Real-time Java LXer Syndicated Linux News 0 05-05-2007 12:16 PM
LXer: Real-time Linux gains real-time JVM LXer Syndicated Linux News 0 10-12-2006 10:54 AM
Real Time Signals getting EPERM warrenpatrick Programming 4 08-25-2006 09:29 AM
real-time signals cause program termination miles_christian Programming 2 08-21-2006 10:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration