mirror of
https://github.com/mid-kid/metroskrew.git
synced 2025-06-18 13:15:40 -04:00
Enable large file support
Apparently large file support also involves larger inodes. The lack of this causes problems in some environments (e.g. WSL2).
This commit is contained in:
parent
e206911879
commit
2486f1bc14
@ -528,7 +528,7 @@ DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
|
||||
|
||||
struct stat buf;
|
||||
if (fstat(uFile - 1, &buf) != 0) return INVALID_FILE_SIZE;
|
||||
DWORD res = buf.st_size;
|
||||
DWORD res = buf.st_size; // Windows seems to expect truncation
|
||||
TRACE("GetFileSize: res=%ld hFile=%d", res, uFile);
|
||||
return res;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ arch = '-march=i586'
|
||||
c_args_base = [
|
||||
arch,
|
||||
'-fno-PIC',
|
||||
'-U_FILE_OFFSET_BITS',
|
||||
'-U_FORTIFY_SOURCE'
|
||||
]
|
||||
|
||||
|
@ -1,22 +1,32 @@
|
||||
#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"); // GLIBC_2.15
|
||||
__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
|
||||
__asm__(".symver __xstat, __xstat@GLIBC_2.0");
|
||||
__asm__(".symver __fxstat, __fxstat@GLIBC_2.0");
|
||||
|
||||
#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); }
|
||||
extern int __fxstat(int, int, struct stat *);
|
||||
static inline int fstat(int fd, struct stat *statbuf)
|
||||
{ return __fxstat(3, fd, statbuf); }
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user