| author | |
| committer | |
| log | 75d6d4c3f20423eede8ecaf7bcc4eaa501c1af9d |
| tree | 3123352e95386733edebf61e495d4c198f3d789e |
| parent | 35329b510c26efdc95fdb79a041d8e0b04381126 |
| signature |
* getrandom was added in glibc 2.25
https://sourceware.org/bugzilla/show_bug.cgi?id=17252
* copy_file_range was added in glibc 2.27
https://sourceware.org/git/?p=glibc.git;a=commit;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f
* threads.h should not exist for glibc < 2.28
* single_threaded.h should not exist for glibc < 2.35
* Apply suggestions from code review
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
* 2.35 instead of 35
* before 2.35 instead of 2.34 and before
---------
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>4 files changed, 22 insertions(+), 0 deletions(-)
lib/libc/include/generic-glibc/sys/random.h+5| ... | ... | @@ -29,6 +29,9 @@ |
| 29 | 29 | |
| 30 | 30 | __BEGIN_DECLS |
| 31 | 31 | |
| 32 | // zig patch: getrandom and getentropy were added in glibc 2.25 | |
| 33 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25) || __GLIBC__ > 2 | |
| 34 | ||
| 32 | 35 | /* Write LENGTH bytes of randomness starting at BUFFER. Return the |
| 33 | 36 | number of bytes written, or -1 on error. */ |
| 34 | 37 | ssize_t getrandom (void *__buffer, size_t __length, |
| ... | ... | @@ -40,6 +43,8 @@ ssize_t getrandom (void *__buffer, size_t __length, |
| 40 | 43 | int getentropy (void *__buffer, size_t __length) __wur |
| 41 | 44 | __attr_access ((__write_only__, 1, 2)); |
| 42 | 45 | |
| 46 | #endif /* glibc 2.25 or later */ | |
| 47 | ||
| 43 | 48 | __END_DECLS |
| 44 | 49 | |
| 45 | 50 | #endif /* _SYS_RANDOM_H */ |
| \ No newline at end of file |
lib/libc/include/generic-glibc/sys/single_threaded.h+5| ... | ... | @@ -16,6 +16,11 @@ |
| 16 | 16 | License along with the GNU C Library; if not, see |
| 17 | 17 | <https://www.gnu.org/licenses/>. */ |
| 18 | 18 | |
| 19 | // zig patch: sys/single_threaded.h header was added in glibc 2.35 | |
| 20 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ < 35 | |
| 21 | #error "sys/single_threaded.h did not exist before glibc 2.35" | |
| 22 | #endif /* error for glibc before 2.35 */ | |
| 23 | ||
| 19 | 24 | #ifndef _SYS_SINGLE_THREADED_H |
| 20 | 25 | #define _SYS_SINGLE_THREADED_H |
| 21 | 26 |
lib/libc/include/generic-glibc/threads.h+6| ... | ... | @@ -16,6 +16,12 @@ |
| 16 | 16 | License along with the GNU C Library; if not, see |
| 17 | 17 | <https://www.gnu.org/licenses/>. */ |
| 18 | 18 | |
| 19 | ||
| 20 | // zig patch: threads header was added in glibc 2.28 | |
| 21 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ < 28 | |
| 22 | #error "threads.h did not exist before glibc 2.28" | |
| 23 | #endif /* error for glibc before 2.28 */ | |
| 24 | ||
| 19 | 25 | #ifndef _THREADS_H |
| 20 | 26 | #define _THREADS_H	1 |
| 21 | 27 |
lib/libc/include/generic-glibc/unistd.h+6| ... | ... | @@ -1138,10 +1138,16 @@ extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur; |
| 1138 | 1138 | while (__result == -1L && errno == EINTR);			 \ |
| 1139 | 1139 | __result; })) |
| 1140 | 1140 | |
| 1141 | // zig patch: copy_file_range was added in glibc 2.27 | |
| 1142 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 27) || __GLIBC__ > 2 | |
| 1143 | ||
| 1141 | 1144 | /* Copy LENGTH bytes from INFD to OUTFD. */ |
| 1142 | 1145 | ssize_t copy_file_range (int __infd, __off64_t *__pinoff, |
| 1143 | 1146 | 			 int __outfd, __off64_t *__poutoff, |
| 1144 | 1147 | 			 size_t __length, unsigned int __flags); |
| 1148 | ||
| 1149 | #endif /* glibc 2.27 or later */ | |
| 1150 | ||
| 1145 | 1151 | #endif /* __USE_GNU */ |
| 1146 | 1152 | |
| 1147 | 1153 | #if defined __USE_POSIX199309 || defined __USE_UNIX98 |