musl - and menchmarking libc
Rich Felker
dalias@aerifal.cx
Thu Sep 6 02:29:00 GMT 2012
On Thu, Sep 06, 2012 at 12:46:46AM +0000, Joseph S. Myers wrote:
> > Step 2 is necessary to support conforming applications which declare
> > LFS64-affected functions themselves rather than including the
> > associated header (which, per ISO C and POSIX, is completely valid to
> > do).
>
> The LFS functions are not part of POSIX, and ISO C and POSIX only allow
> declaring the functions yourself if the function prototype purely involves
> built-in C types rather than typedefs from standard headers, which also
> excludes most but not all of these functions.
I'm talking about -D_FILE_OFFSET_BITS=64, not -D_LARGEFILE64_SOURCE.
The former is advertised by glibc as one of the POSIX compilation
environments, one that provides _POSIX_V6_ILP32_OFFBIG, and it's the
only compilation environment provided that any modern application
should be using on a 32-bit machine. However, it's not actually a
POSIX conforming environment since you can't reliably use these
interfaces without including the headers that do the redirection
(you'll instead call the 32-bit versions with the wrong prototypes,
thus invoking UB), and since even when you do include the headers, you
will pull in external symbol name pollution in the namespace reserved
for the application.
Rich
More information about the Libc-alpha
mailing list