Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2002 02:38:56 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alexander Kabaev <ak03@gte.com>
Cc:        freebsd-current@freebsd.org, <wollman@freebsd.org>
Subject:   Re: sys/stat.h and _POSIX_SOURCE
Message-ID:  <20020626021810.V27555-100000@gamplex.bde.org>
In-Reply-To: <20020625113221.609f5b73.ak03@gte.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 25 Jun 2002, Alexander Kabaev wrote:

> The last commit to sys/sys/stat.h made by Kirk broke compilation of
> _POSIX_SOURCE programs. It uses sizeof(struct timespec) to pad the
> st_createtimespec field to 16 bytes, but struct timespec is not visible
> when _POSIX_SOURCE is defined.

Oops.  The patch was supposed to fix _POSIX_SOURCE problems as well as
the things mentioned in the log message, but added this new one.

The correct fix probably involves using <sys/_timespec.h> in the
_POSIX_SOURCE case and <sys/timespec.h> in the !_POSIX_SOURCE case.
I already use the latter (instead of <sys/time.h>) locally.  I had
hoped to completely avoid using the former because it's better to have
actual struct members named st_[acm]time than #defines of these names
as __st_[acm]timespec.__tv_sec.  The latter is bad for debugging and
might not be standards conformant.

Bruce


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?20020626021810.V27555-100000>