metroskrew/meson/glibc_symver.h
mid-kid 2486f1bc14 Enable large file support
Apparently large file support also involves larger inodes. The lack of
this causes problems in some environments (e.g. WSL2).
2025-04-23 15:58:35 +02:00

33 lines
1.1 KiB
C

#ifdef __i386__
// Current target: GLIBC_2.2
// Tested with: GLIBC_2.36
// older version will try to execute files without shebangs as scripts,
// which is fine.
__asm__(".symver posix_spawn, posix_spawn@GLIBC_2.2"); // Upgraded in GLIBC_2.15
// older glibc had a single symbol to dispatch multiple types of stat
#ifndef __SANITIZE_ADDRESS__
#include <features.h>
#if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 33
struct stat;
extern int __xstat(int, const char *, struct stat *);
extern int __fxstat(int, int, struct stat *);
extern int __xstat64(int, const char *, struct stat *);
extern int __fxstat64(int, int, struct stat *);
#if _FILE_OFFSET_BITS == 64
static inline int stat(const char *path, struct stat *statbuf)
{ return __xstat64(3, path, statbuf); }
static inline int fstat(int fd, struct stat *statbuf)
{ return __fxstat64(3, fd, statbuf); }
#else
static inline int stat(const char *path, struct stat *statbuf)
{ return __xstat(3, path, statbuf); }
static inline int fstat(int fd, struct stat *statbuf)
{ return __fxstat(3, fd, statbuf); }
#endif
#endif
#endif
#endif