Date: Mon, 6 Sep 1999 11:38:20 -0400 (EDT) From: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> To: Peter Dufault <dufault@hda.com> Cc: marcel@scc.nl (Marcel Moolenaar), current@FreeBSD.ORG Subject: Re: (P)review: sigset_t for more than 32 signals Message-ID: <199909061538.LAA03225@khavrinen.lcs.mit.edu> In-Reply-To: <199909061451.KAA07461@hda.hda.com> References: <37D3CB2D.10485299@scc.nl> <199909061451.KAA07461@hda.hda.com>
next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 6 Sep 1999 10:51:41 -0400 (EDT), Peter Dufault <dufault@hda.com> 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 wollman@lcs.mit.edu | 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909061538.LAA03225>