Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 902274e

Browse files
committed
Fixes issue #15000: support the odd x32 abi on posixsubprocess's system call.
2 parents 9844993 + 58f07a9 commit 902274e

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ Library
5555
- Issue #14963: Convert contextlib.ExitStack.__exit__ to use an iterative
5656
algorithm (Patch by Alon Horev)
5757

58+
Extension Modules
59+
-----------------
60+
61+
- Issue #15000: Support the "unique" x32 architecture in _posixsubprocess.c.
62+
5863
Tests
5964
-----
6065

Modules/_posixsubprocess.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,15 @@ _close_fds_by_brute_force(int start_fd, int end_fd, PyObject *py_fds_to_keep)
177177
* chooses to break compatibility with all existing binaries. Highly Unlikely.
178178
*/
179179
struct linux_dirent {
180+
#if defined(__x86_64__) && defined(__ILP32__)
181+
/* Support the wacky x32 ABI (fake 32-bit userspace speaking to x86_64
182+
* kernel interfaces) - https://sites.google.com/site/x32abi/ */
183+
unsigned long long d_ino;
184+
unsigned long long d_off;
185+
#else
180186
unsigned long d_ino; /* Inode number */
181187
unsigned long d_off; /* Offset to next linux_dirent */
188+
#endif
182189
unsigned short d_reclen; /* Length of this linux_dirent */
183190
char d_name[256]; /* Filename (null-terminated) */
184191
};

0 commit comments

Comments
 (0)