mirror of
git://git.musl-libc.org/musl
synced 2024-11-27 03:53:58 +08:00
246f1c8114
originally the namespace-infringing "large file support" interfaces
were included as part of glibc-ABI-compat, with the intent that they
not be used for linking, since our off_t is and always has been
unconditionally 64-bit and since we usually do not aim to support
nonstandard interfaces when there is an equivalent standard interface.
unfortunately, having the symbols present and available for linking
caused configure scripts to detect them and attempt to use them
without declarations, producing all the expected ill effects that
entails.
as a result, commit 2dd8d5e1b8
was made
to prevent this, using macros to redirect the LFS64 names to the
standard names, conditional on _GNU_SOURCE or _LARGEFILE64_SOURCE.
however, this has turned out to be a source of further problems,
especially since g++ defines _GNU_SOURCE by default. in particular,
the presence of these names as macros breaks a lot of valid code.
this commit removes all the LFS64 symbols and replaces them with a
mechanism in the dynamic linker symbol lookup failure path to retry
with the spurious "64" removed from the symbol name. in the future,
if/when the rest of glibc-ABI-compat is moved out of libc, this can be
removed.
16 lines
291 B
C
16 lines
291 B
C
#include "time32.h"
|
|
#include <time.h>
|
|
#include <string.h>
|
|
#include <sys/stat.h>
|
|
#include <stddef.h>
|
|
|
|
struct stat32;
|
|
|
|
int __fstat_time32(int fd, struct stat32 *restrict st32)
|
|
{
|
|
struct stat st;
|
|
int r = fstat(fd, &st);
|
|
if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
|
|
return r;
|
|
}
|