Subject: Re: /usr/include/zconf.h uses HAVE_UNISTD_H
To: None <itojun@iijlab.net, tech-userlevel@netbsd.org>
From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
List: tech-userlevel
Date: 10/13/1999 10:49:33
On Wed, Oct 13, 1999 at 03:56:17PM +0900, itojun@iijlab.net wrote:
> /usr/include/zconf.h always use HAVE_UNISTD_H, and it would affect
> definition of z_off_t (defined to off_t when HAVE_UNISTD_H is defined,
> long when not defined). Is it safe? I believe not every program
> defines HAVE_UNISTD_H.
Uhm... as far as I understand (and I only had one cup of coffee this morning):
Our OS offset type _is_ off_t, and our OS provides a unistd.h that
defines or uses it. "long" is wrong (well, it would happen to work on
our LP64 machines, for the time being). So, as long as libz and friends
use z_off_t where our system calls use offsets, using off_t is
mandatory!
Programs that don't use the function prototypes in unistd.h are
guaranteed to fail horribly... I discovered this the hard way when a
certain, now defunct, pop3 server (among other stuff) started to refuse
to delete messages after being upgraded to NetBSD-1.0. In fact, it
would double all messages in each session, and add (on top of that) the
undeleted ones. popper didn't use prototypes, and didn't check
ftruncate() return codes.
Regards,
Ignatios
--
* Progress (n.): The process through which Usenet has evolved from
smart people in front of dumb terminals to dumb people in front of
smart terminals. -- obs@burnout.demon.co.uk (obscurity)