From owner-cvs-all Tue Sep 28 9:19:14 1999 Delivered-To: cvs-all@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 2C04E15623; Tue, 28 Sep 1999 09:19:09 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id MAA14508; Tue, 28 Sep 1999 12:16:35 -0400 (EDT) (envelope-from wollman) Date: Tue, 28 Sep 1999 12:16:35 -0400 (EDT) From: Garrett Wollman Message-Id: <199909281616.MAA14508@khavrinen.lcs.mit.edu> To: Peter Wemm Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/gen getcwd.c In-Reply-To: <199909281607.MAA14467@khavrinen.lcs.mit.edu> References: <199909281324.GAA08484@freefall.freebsd.org> <19990928144403.3155A1CC1@overcee.netplex.com.au> <199909281607.MAA14467@khavrinen.lcs.mit.edu> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Replying to my own message.... < said: >> Hmm.. my experience on other systems suggests sigactions should be >> pre-bzeroed (or memset) for portability reasons. This is required on some >> OS's as there are hidden fields in there, and doesn't require modifying the >> whole tree when a new field is added or changed to struct sigaction. > Those other systems are broken. POSIX requires that only those fields > defined by the standard need be initialized. Furthermore, since POSIX is built on top of the portable Standard C environment, bzero(), or its Standard counterpart memset(), would never be sufficient to portably initialize a structure. The only way to do so portably is: static struct foo null_foo; struct foo foo; foo = null_foo; -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 cvs-all" in the body of the message