This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] add 64 bit off_t for linux/i686 (and maybe some others)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bud Davis <bdavis at gcc dot gnu dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Mon, 5 Jul 2004 02:38:42 -0400
- Subject: Re: [gfortran] add 64 bit off_t for linux/i686 (and maybe some others)
- References: <1088991007.3627.8.camel@localhost.localdomain>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Jul 04, 2004 at 08:30:07PM -0500, Bud Davis wrote:
> 2004-07-04 Bud Davis <bdavis9659@comcast.net>
>
> * configure.ac: Add check for LFS support.
> * configure: Regenerate
> + # Check for LFS support
> + AC_TRY_LINK(
> + [#include <unistd.h>],
> + [fopen64("t", "w");
> + lseek64(1, 0, SEEK_CUR);],
> + [AC_DEFINE([_FILE_OFFSET_BITS],[64],["Define to 64 if LFS is supported"] )])
> +
This is a bad test.
-D_FILE_OFFSET_BITS=64 makes fopen, lseek etc. transparently 64-bit, while
whether *64 alternatives exist is a matter of a different macro in glibc
(-D_LARGEFILE64_SOURCE). Also, fopen64 is prototyped in stdio.h, not
unistd.h.
You should IMHO use AC_SYS_LARGEFILE autoconf macro instead.
Jakub