Subject: IMPORTANT: _POSIX_SOURCE and struct stat lossage
To: NetBSD/Alpha Users <port-alpha@NetBSD.ORG>
From: Curt Sampson <cjs@portal.ca>
List: port-alpha
Date: 01/03/1998 18:52:43
It appears we have a fairly major bug in the 1.3 release of the
alpha. This also exists in current, although we are working on a
fix.
>From the note I've just added to the LAST_MINUTE file of the 1.3
release:
There is a serious bug in sys/stat.h that causes the alignment
of struct stat to change when _POSIX_SOURCE is defined, which in
turn causes some of the return values from stat/fstat/lastat to
appear to be bogus. (This affects only the alpha.) We are working
on a fix for this. In the meantime, if you compile a program that
appears to get wrong the size or time, or possibly other attributes,
of a file, you are probably being affected by this.
I discovered this when doing an X build; the patch to fix this for
X is as follows:
Index: include/Xosdefs.h
===================================================================
RCS file: /cvsroot/xsrc/xc/include/Xosdefs.h,v
retrieving revision 1.1.1.2
diff -u -u -r1.1.1.2 Xosdefs.h
--- Xosdefs.h 1997/06/30 12:45:20 1.1.1.2
+++ Xosdefs.h 1998/01/04 02:48:22
@@ -106,6 +106,10 @@
#endif
#endif
+#if defined(__NetBSD__) && defined(__alpha__)
+#define X_NOT_POSIX /* get around struct stat alignment lossage */
+#endif
+
#ifdef WIN32
#ifndef _POSIX_
#define X_NOT_POSIX
cjs
Curt Sampson cjs@portal.ca Info at http://www.portal.ca/
Internet Portal Services, Inc. Through infinite mist, software reverberates
Vancouver, BC (604) 257-9400 In code possess'd of invisible folly.