<<On Mon, 6 Sep 1999 10:51:41 -0400 (EDT), Peter Dufault <[EMAIL PROTECTED]> said:
> /* Now just insert the macros to make this work...
> */
I'd be inclined to make sigemptyset() and sigfillset(), at a minimum,
functions only (not macros).
I'd define sigaddset something like this (function version):
int
sigaddset(sigset_t *ss, int sig)
{
int index, bit;
/*
* Since most programs ignore the return value of sigaddset(),
* we really do want to abort here rather than simply returning
* an error. This assertion ensures that we never act on an
* uninitialized sigset_t.
*/
assert(ss->sigset_size == sizeof *ss);
if (sig < 1 || sig > NSIG) {
errno = EINVAL;
return 1;
}
sig--;
index = sig / (CHAR_BIT * sizeof ss->sigset_bits[0]);
bit = sig % (CHAR_BIT * sizeof ss->sigset_bits[0]);
ss->sigset_bits[index] |= (1 << bit);
return 0;
}
I actually don't see any reason to have sigaddset be defined as a
macro at all -- any program which calls it frequently enough to make a
difference is doing something wrong.
-GAWollman
--
Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same
[EMAIL PROTECTED] | O Siem / The fires of freedom
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message