Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 1999 12:16:35 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Peter Wemm <peter@netplex.com.au>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/gen getcwd.c 
Message-ID:  <199909281616.MAA14508@khavrinen.lcs.mit.edu>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

Replying to my own message....

<<On Tue, 28 Sep 1999 22:44:03 +0800, Peter Wemm <peter@netplex.com.au> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909281616.MAA14508>