Commit 10bc047
committed
gh-153400: Add syscall fallbacks for copy_file_range/memfd_create
glibc only grew copy_file_range() and memfd_create() in 2.27, and we compile
the os functions out when the libc we build against doesn't have them. That
loses them for good in a redistributable built against an older glibc, such
as the python-build-standalone builds targeting glibc 2.17, even when the
kernel it runs on implements the syscalls.
Keep calling the libc wrappers when they are available, so we don't lose
their symbol versioning and _FORTIFY_SOURCE checks, and issue the syscall
directly when they aren't. If the syscall number is missing as well, the
functions are still left out. pidfd_open() and pidfd_getfd() already use raw
syscalls, so nothing changes for them.
Include <sys/syscall.h> whenever it exists rather than only when the
getrandom() syscall was detected, since __NR_* is now needed for more than
getrandom().
Signed-off-by: Daan De Meyer <daan@amutable.com>1 parent b4db948 commit 10bc047
4 files changed
Lines changed: 51 additions & 15 deletions
File tree
- Doc/library
- Misc/NEWS.d/next/Library
- Modules
- clinic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | | - | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1018 | 1022 | | |
1019 | 1023 | | |
1020 | 1024 | | |
| |||
4400 | 4404 | | |
4401 | 4405 | | |
4402 | 4406 | | |
4403 | | - | |
| 4407 | + | |
4404 | 4408 | | |
4405 | 4409 | | |
4406 | 4410 | | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
4407 | 4415 | | |
4408 | 4416 | | |
4409 | 4417 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
210 | 224 | | |
211 | 225 | | |
212 | 226 | | |
| |||
13044 | 13058 | | |
13045 | 13059 | | |
13046 | 13060 | | |
13047 | | - | |
| 13061 | + | |
13048 | 13062 | | |
13049 | 13063 | | |
13050 | 13064 | | |
| |||
13096 | 13110 | | |
13097 | 13111 | | |
13098 | 13112 | | |
| 13113 | + | |
13099 | 13114 | | |
| 13115 | + | |
| 13116 | + | |
| 13117 | + | |
| 13118 | + | |
| 13119 | + | |
13100 | 13120 | | |
13101 | 13121 | | |
13102 | 13122 | | |
| |||
13106 | 13126 | | |
13107 | 13127 | | |
13108 | 13128 | | |
13109 | | - | |
| 13129 | + | |
13110 | 13130 | | |
13111 | 13131 | | |
13112 | 13132 | | |
| |||
15808 | 15828 | | |
15809 | 15829 | | |
15810 | 15830 | | |
15811 | | - | |
| 15831 | + | |
15812 | 15832 | | |
15813 | 15833 | | |
15814 | 15834 | | |
| |||
15824 | 15844 | | |
15825 | 15845 | | |
15826 | 15846 | | |
| 15847 | + | |
15827 | 15848 | | |
| 15849 | + | |
| 15850 | + | |
| 15851 | + | |
15828 | 15852 | | |
15829 | 15853 | | |
15830 | 15854 | | |
| |||
18433 | 18457 | | |
18434 | 18458 | | |
18435 | 18459 | | |
18436 | | - | |
| 18460 | + | |
18437 | 18461 | | |
18438 | 18462 | | |
18439 | 18463 | | |
| |||
18481 | 18505 | | |
18482 | 18506 | | |
18483 | 18507 | | |
18484 | | - | |
| 18508 | + | |
18485 | 18509 | | |
18486 | 18510 | | |
18487 | 18511 | | |
| |||
18737 | 18761 | | |
18738 | 18762 | | |
18739 | 18763 | | |
18740 | | - | |
| 18764 | + | |
18741 | 18765 | | |
18742 | 18766 | | |
18743 | 18767 | | |
| |||
0 commit comments