Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Apr 1995 15:21:21 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@FreeBSD.org
Subject:   Re: aspfilter & stdin
Message-ID:  <199504300521.PAA14142@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> FreeBSD 2.0 introduces something new, which made this necessary:
>> 
>> #ifdef __FreeBSD__

>NOOO!

>I'm not sure which systems define the 2nd parameter of lseek() to
>be off_t.  Anyway, from /usr/ports/GUIDELINES:

>0.2 The preferred way to tell 4.3BSD/Reno and newer versions of the BSD code
>    apart is by using the "BSD" macro defined in <sys/param.h>.  Hopefully that
>    file is already included; if not, add the code:

>*   #ifdef _HAVE_PARAM_H
>*   #include <sys/param.h>
>*   #endif
>...

NOOOOOOO !:-)

All POSIX systems declare the 2nd parameter of lseek() to be off_t.
To decide if the system is POSIX, you can try

#include <sys/types.h>
#include <unistd.h>

#ifdef _POSIX_VERSION
...

This may fail if <sys/types.h> or <unistd.h> doesn't exist, or if the
system defines _POSIX_VERSION but isn't POSIX.  Something like gnu
autoconfig is required to build and run test programs that decide if
the headers exists and if lseek() exists and works.

Bruce



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