[RFC] Make _FILE_OFFSET_BITS=64 default.

Paul Eggert eggert@cs.ucla.edu
Fri Mar 14 06:41:00 GMT 2014


Mike Frysinger wrote:
> i'm debating adding it to the next Gentoo glibc version to gather
> some actual data since no one seems to want to move w/out data, but no one
> wants to gather data either.

Joseph's message gave me pause, as I worry it's asking for an enormous 
task that can never truly said to be done.  Regardless, I took one step 
to do this, and exhaustively surveyed all libraries installed on my 
Fedora 20 host as part of my routine development for building coreutils, 
GNU Emacs, etc.  I found the following issues:

glibc's own fts.h refuses to compile if __USE_FILE_OFFSET64 is defined.

zlib's zlib.h attempts to work around the glibc problems with 
_FILE_OFFSET_BITS, and its workaround would need adjusting if glibc 
changed the default.

Several libraries use APIs that accept affected data types.  These 
libraries are all compiled with _FILE_OFFSET_BITS #defined to be 64, so 
the proposed change would be beneficial as it would fix any applications 
that are currently mistakenly compiled without defining 
_FILE_OFFSET_BITS to be 64.  These libraries are:

* fontconfig's fontconfig/fontconfig.h defines a function 
FcDirCacheLoadFile that accepts struct stat *

* gawk's gawkapi.h defines a type awk_input_buf_t that has a struct stat.

* glib's glib-2.0/glib/gstdio.h defines g_stat, g_lstat, GStatBuf, all 
of which use struct stat.

* Berkeley DB's libdb/db.h defines db_env_set_func_ftruncate, 
db_env_set_func_pread, db_env_set_func_pwrite, db_env_set_func_seek, all 
functions that accept functions that accept off_t arguments.

* libselinux's selinux/selinux.h defines a function 
matchpathcon_filespec_add that accepts an ino_t.

Here are the libraries I looked at as part of my inspection (these are 
Fedora 20 package names).

GConf2 ImageMagick OpenEXR alsa-lib at-spi2-atk atk bzip2 cairo 
cairo-gobject dbus dbus-glib expat fontconfig freetype gdbm gdk-pixbuf2 
ghostscript giflib glib2 glibc gnustep-base gnustep-gui gnutls gpm gtk3 
harfbuzz ilmbase jasper java-1.7.0-openjdk keyutils-libs krb5 lcms2 
libICE libSM libX11 libXau libXaw libXcomposite libXcursor libXdamage 
libXext libXfixes libXft libXi libXinerama libXmu libXpm libXrandr 
libXrender libXt libXxf86vm libacl libattr libcom_err libdb libdrm 
libicu libjpeg-turbo liblockfile libotf libpng librsvg2 libselinux 
libsepol libstdc++ libtasn1 libtiff libverto libwayland-client 
libwayland-cursor libwebp libxcb libxkbcommon libxml2 m17n-lib 
mesa-libEGL mesa-libGL mesa-libGLU ncurses openssl p11-kit pango pcre 
perl pixman systemtap-sdt valgrind wayland xorg-x11-proto xz zlib



More information about the Libc-alpha mailing list