LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-16-2004, 09:35 AM   #1
beginner16
Member
 
Registered: Nov 2003
Posts: 33

Rep: Reputation: 15
Question about Signal set


hi

In function sigaddset (sigset_t *set,int sogno) signal set has a type sigset_t, but macro sigmask() returns signal set as an int number.

I assume sigset_t is just an integer?But still,why are there two different type names used for signal set?

Couldn't sigset_t on some system also be a struct ?

thank you
 
Old 01-16-2004, 11:58 AM   #2
the_dayi
LQ Newbie
 
Registered: Oct 2002
Location: istanbul
Distribution: redhat
Posts: 16

Rep: Reputation: 0
...sigmask obsolete by sigprocmask...

check : http://www.die.net/doc/linux/man/man2/sigmask.2.html
 
Old 01-16-2004, 12:18 PM   #3
beginner16
Member
 
Registered: Nov 2003
Posts: 33

Original Poster
Rep: Reputation: 15
hi

I need to know sigmask() cos some older apps still use it and cos I can retrieve an int mask value for individual signal.

sigprocmask() uses sigset_t type for signal mask and if you look at my previous question you will see that I have no idea what kind of type sigset_t is ,nor do I know how to extract mask value for individual signal and see what it is

thank you
 
Old 01-16-2004, 02:30 PM   #4
the_dayi
LQ Newbie
 
Registered: Oct 2002
Location: istanbul
Distribution: redhat
Posts: 16

Rep: Reputation: 0
you can check sigset_t
at : http://fxr.watson.org/fxr/source/sys/_sigset.h#L57

and you can control the individual values with sigismember()

..take your time and read all the man pages concerning the posix signal lib.
 
Old 01-17-2004, 05:55 AM   #5
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
sigset_t is an unsigned long...
atleast that is how sigset_t is typedef'd as in sys/signal.h

MACRO doesnot return anything as it is not a function but plain code replacement and it uses sigset_t (check out the sigmask macro definition in signal.h) ...
so there is no discrepancy here ...

this is so because there are 32 signals and hence each bit representing one signal ..(on a 64 bit architecture also ... i am sure some provisions are made to keep it working seamlessly)

on a 32 bit system (except windows) int is same size as long...(4 bytes)

hope it helped
 
Old 01-17-2004, 08:16 AM   #6
beginner16
Member
 
Registered: Nov 2003
Posts: 33

Original Poster
Rep: Reputation: 15
This is not really rellated to the this subject,but I noticed that many of types defined in header files have their name prefixed with '_'. But man pages always ommit '_' from their name.

For example,in signal.h there is type definition for _signalhandler_t,but in "man signal" you will notice name signalhandler_t with '_' ommited.

What is going on?

thank you for helping me and for the links
 
  


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
squid stops due to signal 6 and signal 25 simplyrahul Linux - Software 3 05-28-2011 01:05 AM
signal() question. JanusPaul Programming 6 12-03-2004 09:42 AM
Question on how to set this up... kith *BSD 2 11-17-2004 04:15 PM
Signal 6: Unknown Signal <=> Error with MAYA4.X under Linux SOLVED!!!! Faeroon Linux - Software 9 05-09-2003 01:57 PM
Signal: 6 (Unknown Signal) - Problems running a program Faeroon Linux - Software 86 01-14-2003 12:08 AM

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

All times are GMT -5. The time now is 06:37 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