mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 23:36:04 +00:00
fix(preload): 32-bit x86 programs get correct large-file stat, open, write and lock results (#2592)
The session preload is also built for i386 and preloaded into every 32-bit x86 program under FEX. There it aliased fstat64, ftruncate64, pwrite64, fallocate64, posix_fallocate64, open64, openat64 and fcntl64 to their 32-bit hooks, which on i386 take a different struct layout or argument size. fstat64 returned a size with garbage high bits, so libdbus rejected a valid 33-byte /etc/machine-id as too large and aborted the program. The aliases now exist only where off_t is off64_t; on i386 the 64-bit calls reach their own glibc functions, keeping the open and lock hooks.
This commit is contained in:
1 parent
9b5d7870a3
commit
a20528c62b
4 files changed
+243
-26
No files matched your search
@@ -356,7 +356,8 @@ static void flush_summary(void) {
|
||||
if (n > 0 && (size_t)n < sizeof(line)) append_line(line, (size_t)n);
|
||||
}
|
||||
|
||||
#if defined(__USE_LARGEFILE64)
|
||||
#if defined(__USE_LARGEFILE64) && defined(__OFF_T_MATCHES_OFF64_T)
|
||||
_Static_assert(sizeof(struct stat) == sizeof(struct stat64), "stat64 alias needs one layout");
|
||||
int fallocate64(int fd, int mode, off64_t offset, off64_t length) __attribute__((alias("fallocate")));
|
||||
int posix_fallocate64(int fd, off64_t offset, off64_t length) __attribute__((alias("posix_fallocate")));
|
||||
ssize_t pwrite64(int fd, const void *buffer, size_t count, off64_t offset) __attribute__((alias("pwrite")));
|
||||
|
||||
Reference in new issue
Block a user