From owner-freebsd-current Wed Jan 19 8:57:49 2000 Delivered-To: freebsd-current@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 88FC915185 for ; Wed, 19 Jan 2000 08:57:47 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id LAA29895; Wed, 19 Jan 2000 11:57:45 -0500 (EST) (envelope-from wollman) Date: Wed, 19 Jan 2000 11:57:45 -0500 (EST) From: Garrett Wollman Message-Id: <200001191657.LAA29895@khavrinen.lcs.mit.edu> To: asami@cs.berkeley.edu (Satoshi Asami) Cc: current@FreeBSD.ORG Subject: sigisempty? In-Reply-To: <200001191503.HAA04869@silvia.hip.berkeley.edu> References: <200001191503.HAA04869@silvia.hip.berkeley.edu> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < How do I test if sigset_t is empty in -current? The xview sources > have this macro: > #define sigisempty(s) (!(*(s))) > which is ok for the old sigset_t (unsigned int) but obviously won't > work for the new one since it's a struct. int sigisempty(sigset_t *my_sigset) { static sigset_t empty_ss; static int emptied; if (!emptied) { sigemptyset(&empty_ss); emptied++; } return (memcmp(my_sigset, &empty_ss, sizeof empty_ss) == 0); } -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