| author | |
| committer | |
| log | e2eabbbc5142f11defc56ad51cd5b8a5e97cdbda |
| tree | cc1127bc0a31d50e35d6200c3824cdbbe83f8ebc |
| parent | 8875efe54873b721cc3a6f6d83525b19d1c59ec3 |
| parent | 09c7f1bd7c4410948a984f2f155a6e36ff6279fd |
| signature |
update musl from v1.2.3 to v1.2.4241 files changed, 2889 insertions(+), 2526 deletions(-)
lib/libc/include/generic-musl/aio.h+1-1| ... | ... | @@ -49,7 +49,7 @@ int aio_fsync(int, struct aiocb *); |
| 49 | 49 | |
| 50 | 50 | int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict); |
| 51 | 51 | |
| 52 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 52 | #if defined(_LARGEFILE64_SOURCE) | |
| 53 | 53 | #define aiocb64 aiocb |
| 54 | 54 | #define aio_read64 aio_read |
| 55 | 55 | #define aio_write64 aio_write |
lib/libc/include/generic-musl/arpa/nameser.h+71| ... | ... | @@ -188,6 +188,36 @@ typedef enum __ns_type { |
| 188 | 188 | 	ns_t_sink = 40, |
| 189 | 189 | 	ns_t_opt = 41, |
| 190 | 190 | 	ns_t_apl = 42, |
| 191 | 	ns_t_ds = 43, | |
| 192 | 	ns_t_sshfp = 44, | |
| 193 | 	ns_t_ipseckey = 45, | |
| 194 | 	ns_t_rrsig = 46, | |
| 195 | 	ns_t_nsec = 47, | |
| 196 | 	ns_t_dnskey = 48, | |
| 197 | 	ns_t_dhcid = 49, | |
| 198 | 	ns_t_nsec3 = 50, | |
| 199 | 	ns_t_nsec3param = 51, | |
| 200 | 	ns_t_tlsa = 52, | |
| 201 | 	ns_t_smimea = 53, | |
| 202 | 	ns_t_hip = 55, | |
| 203 | 	ns_t_ninfo = 56, | |
| 204 | 	ns_t_rkey = 57, | |
| 205 | 	ns_t_talink = 58, | |
| 206 | 	ns_t_cds = 59, | |
| 207 | 	ns_t_cdnskey = 60, | |
| 208 | 	ns_t_openpgpkey = 61, | |
| 209 | 	ns_t_csync = 62, | |
| 210 | 	ns_t_spf = 99, | |
| 211 | 	ns_t_uinfo = 100, | |
| 212 | 	ns_t_uid = 101, | |
| 213 | 	ns_t_gid = 102, | |
| 214 | 	ns_t_unspec = 103, | |
| 215 | 	ns_t_nid = 104, | |
| 216 | 	ns_t_l32 = 105, | |
| 217 | 	ns_t_l64 = 106, | |
| 218 | 	ns_t_lp = 107, | |
| 219 | 	ns_t_eui48 = 108, | |
| 220 | 	ns_t_eui64 = 109, | |
| 191 | 221 | 	ns_t_tkey = 249, |
| 192 | 222 | 	ns_t_tsig = 250, |
| 193 | 223 | 	ns_t_ixfr = 251, |
| ... | ... | @@ -196,6 +226,11 @@ typedef enum __ns_type { |
| 196 | 226 | 	ns_t_maila = 254, |
| 197 | 227 | 	ns_t_any = 255, |
| 198 | 228 | 	ns_t_zxfr = 256, |
| 229 | 	ns_t_uri = 256, | |
| 230 | 	ns_t_caa = 257, | |
| 231 | 	ns_t_avc = 258, | |
| 232 | 	ns_t_ta = 32768, | |
| 233 | 	ns_t_dlv = 32769, | |
| 199 | 234 | 	ns_t_max = 65536 |
| 200 | 235 | } ns_type; |
| 201 | 236 | |
| ... | ... | @@ -430,12 +465,48 @@ typedef struct { |
| 430 | 465 | #define T_NAPTR		ns_t_naptr |
| 431 | 466 | #define T_A6		ns_t_a6 |
| 432 | 467 | #define T_DNAME		ns_t_dname |
| 468 | #define T_DS		ns_t_ds | |
| 469 | #define T_SSHFP		ns_t_sshfp | |
| 470 | #define T_IPSECKEY	ns_t_ipseckey | |
| 471 | #define T_RRSIG		ns_t_rrsig | |
| 472 | #define T_NSEC		ns_t_nsec | |
| 473 | #define T_DNSKEY	ns_t_dnskey | |
| 474 | #define T_DHCID		ns_t_dhcid | |
| 475 | #define T_NSEC3		ns_t_nsec3 | |
| 476 | #define T_NSEC3PARAM	ns_t_nsec3param | |
| 477 | #define T_TLSA		ns_t_tlsa | |
| 478 | #define T_SMIMEA	ns_t_smimea | |
| 479 | #define T_HIP		ns_t_hip | |
| 480 | #define T_NINFO		ns_t_ninfo | |
| 481 | #define T_RKEY		ns_t_rkey | |
| 482 | #define T_TALINK	ns_t_talink | |
| 483 | #define T_CDS		ns_t_cds | |
| 484 | #define T_CDNSKEY	ns_t_cdnskey | |
| 485 | #define T_OPENPGPKEY	ns_t_openpgpkey | |
| 486 | #define T_CSYNC		ns_t_csync | |
| 487 | #define T_SPF		ns_t_spf | |
| 488 | #define T_UINFO		ns_t_uinfo | |
| 489 | #define T_UID		ns_t_uid | |
| 490 | #define T_GID		ns_t_gid | |
| 491 | #define T_UNSPEC	ns_t_unspec | |
| 492 | #define T_NID		ns_t_nid | |
| 493 | #define T_L32		ns_t_l32 | |
| 494 | #define T_L64		ns_t_l64 | |
| 495 | #define T_LP		ns_t_lp | |
| 496 | #define T_EUI48		ns_t_eui48 | |
| 497 | #define T_EUI64		ns_t_eui64 | |
| 498 | #define T_TKEY		ns_t_tkey | |
| 433 | 499 | #define	T_TSIG		ns_t_tsig |
| 434 | 500 | #define	T_IXFR		ns_t_ixfr |
| 435 | 501 | #define T_AXFR		ns_t_axfr |
| 436 | 502 | #define T_MAILB		ns_t_mailb |
| 437 | 503 | #define T_MAILA		ns_t_maila |
| 438 | 504 | #define T_ANY		ns_t_any |
| 505 | #define T_URI		ns_t_uri | |
| 506 | #define T_CAA		ns_t_caa | |
| 507 | #define T_AVC		ns_t_avc | |
| 508 | #define T_TA		ns_t_ta | |
| 509 | #define T_DLV		ns_t_dlv | |
| 439 | 510 | |
| 440 | 511 | #define C_IN		ns_c_in |
| 441 | 512 | #define C_CHAOS		ns_c_chaos |
lib/libc/include/generic-musl/dirent.h+1-1| ... | ... | @@ -56,7 +56,7 @@ int getdents(int, struct dirent *, size_t); |
| 56 | 56 | int versionsort(const struct dirent **, const struct dirent **); |
| 57 | 57 | #endif |
| 58 | 58 | |
| 59 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 59 | #if defined(_LARGEFILE64_SOURCE) | |
| 60 | 60 | #define dirent64 dirent |
| 61 | 61 | #define readdir64 readdir |
| 62 | 62 | #define readdir64_r readdir_r |
lib/libc/include/generic-musl/elf.h+7-2| ... | ... | @@ -385,7 +385,8 @@ typedef struct { |
| 385 | 385 | #define SHT_PREINIT_ARRAY 16 |
| 386 | 386 | #define SHT_GROUP	 17 |
| 387 | 387 | #define SHT_SYMTAB_SHNDX 18 |
| 388 | #define	SHT_NUM		 19 | |
| 388 | #define SHT_RELR	 19 | |
| 389 | #define	SHT_NUM		 20 | |
| 389 | 390 | #define SHT_LOOS	 0x60000000 |
| 390 | 391 | #define SHT_GNU_ATTRIBUTES 0x6ffffff5 |
| 391 | 392 | #define SHT_GNU_HASH	 0x6ffffff6 |
| ... | ... | @@ -436,6 +437,7 @@ typedef struct { |
| 436 | 437 | } Elf64_Chdr; |
| 437 | 438 | |
| 438 | 439 | #define ELFCOMPRESS_ZLIB	1 |
| 440 | #define ELFCOMPRESS_ZSTD	2 | |
| 439 | 441 | #define ELFCOMPRESS_LOOS	0x60000000 |
| 440 | 442 | #define ELFCOMPRESS_HIOS	0x6fffffff |
| 441 | 443 | #define ELFCOMPRESS_LOPROC	0x70000000 |
| ... | ... | @@ -754,7 +756,10 @@ typedef struct { |
| 754 | 756 | #define DT_PREINIT_ARRAY 32 |
| 755 | 757 | #define DT_PREINIT_ARRAYSZ 33 |
| 756 | 758 | #define DT_SYMTAB_SHNDX	34 |
| 757 | #define	DT_NUM		35 | |
| 759 | #define DT_RELRSZ	35 | |
| 760 | #define DT_RELR		36 | |
| 761 | #define DT_RELRENT	37 | |
| 762 | #define	DT_NUM		38 | |
| 758 | 763 | #define DT_LOOS		0x6000000d |
| 759 | 764 | #define DT_HIOS		0x6ffff000 |
| 760 | 765 | #define DT_LOPROC	0x70000000 |
lib/libc/include/generic-musl/fcntl.h+1-1| ... | ... | @@ -195,7 +195,7 @@ ssize_t tee(int, int, size_t, unsigned); |
| 195 | 195 | #define loff_t off_t |
| 196 | 196 | #endif |
| 197 | 197 | |
| 198 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 198 | #if defined(_LARGEFILE64_SOURCE) | |
| 199 | 199 | #define F_GETLK64 F_GETLK |
| 200 | 200 | #define F_SETLK64 F_SETLK |
| 201 | 201 | #define F_SETLKW64 F_SETLKW |
lib/libc/include/generic-musl/ftw.h+1-1| ... | ... | @@ -29,7 +29,7 @@ struct FTW { |
| 29 | 29 | int ftw(const char *, int (*)(const char *, const struct stat *, int), int); |
| 30 | 30 | int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int); |
| 31 | 31 | |
| 32 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 32 | #if defined(_LARGEFILE64_SOURCE) | |
| 33 | 33 | #define ftw64 ftw |
| 34 | 34 | #define nftw64 nftw |
| 35 | 35 | #endif |
lib/libc/include/generic-musl/glob.h+1-1| ... | ... | @@ -39,7 +39,7 @@ void globfree(glob_t *); |
| 39 | 39 | #define GLOB_NOMATCH 3 |
| 40 | 40 | #define GLOB_NOSYS 4 |
| 41 | 41 | |
| 42 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 42 | #if defined(_LARGEFILE64_SOURCE) | |
| 43 | 43 | #define glob64 glob |
| 44 | 44 | #define globfree64 globfree |
| 45 | 45 | #define glob64_t glob_t |
lib/libc/include/generic-musl/netdb.h+1| ... | ... | @@ -44,6 +44,7 @@ struct addrinfo { |
| 44 | 44 | #define EAI_NONAME -2 |
| 45 | 45 | #define EAI_AGAIN -3 |
| 46 | 46 | #define EAI_FAIL -4 |
| 47 | #define EAI_NODATA -5 | |
| 47 | 48 | #define EAI_FAMILY -6 |
| 48 | 49 | #define EAI_SOCKTYPE -7 |
| 49 | 50 | #define EAI_SERVICE -8 |
lib/libc/include/generic-musl/sched.h+1-1| ... | ... | @@ -124,7 +124,7 @@ __CPU_op_func_S(XOR, ^) |
| 124 | 124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) |
| 125 | 125 | #define CPU_FREE(set) free(set) |
| 126 | 126 | |
| 127 | #define CPU_SETSIZE 128 | |
| 127 | #define CPU_SETSIZE 1024 | |
| 128 | 128 | |
| 129 | 129 | #define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set) |
| 130 | 130 | #define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set) |
lib/libc/include/generic-musl/stdio.h+1-1| ... | ... | @@ -205,7 +205,7 @@ typedef struct _IO_cookie_io_functions_t { |
| 205 | 205 | FILE *fopencookie(void *, const char *, cookie_io_functions_t); |
| 206 | 206 | #endif |
| 207 | 207 | |
| 208 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 208 | #if defined(_LARGEFILE64_SOURCE) | |
| 209 | 209 | #define tmpfile64 tmpfile |
| 210 | 210 | #define fopen64 fopen |
| 211 | 211 | #define freopen64 freopen |
lib/libc/include/generic-musl/stdlib.h+2-2| ... | ... | @@ -95,7 +95,7 @@ size_t __ctype_get_mb_cur_max(void); |
| 95 | 95 | #define WTERMSIG(s) ((s) & 0x7f) |
| 96 | 96 | #define WSTOPSIG(s) WEXITSTATUS(s) |
| 97 | 97 | #define WIFEXITED(s) (!WTERMSIG(s)) |
| 98 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) | |
| 98 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00) | |
| 99 | 99 | #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) |
| 100 | 100 | |
| 101 | 101 | int posix_memalign (void **, size_t, size_t); |
| ... | ... | @@ -163,7 +163,7 @@ double strtod_l(const char *__restrict, char **__restrict, struct __locale_struc |
| 163 | 163 | long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); |
| 164 | 164 | #endif |
| 165 | 165 | |
| 166 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 166 | #if defined(_LARGEFILE64_SOURCE) | |
| 167 | 167 | #define mkstemp64 mkstemp |
| 168 | 168 | #define mkostemp64 mkostemp |
| 169 | 169 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
lib/libc/include/generic-musl/string.h+1-1| ... | ... | @@ -73,6 +73,7 @@ char *strsignal(int); |
| 73 | 73 | char *strerror_l (int, locale_t); |
| 74 | 74 | int strcoll_l (const char *, const char *, locale_t); |
| 75 | 75 | size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); |
| 76 | void *memmem(const void *, size_t, const void *, size_t); | |
| 76 | 77 | #endif |
| 77 | 78 | |
| 78 | 79 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ |
| ... | ... | @@ -92,7 +93,6 @@ void explicit_bzero (void *, size_t); |
| 92 | 93 | int strverscmp (const char *, const char *); |
| 93 | 94 | char *strchrnul(const char *, int); |
| 94 | 95 | char *strcasestr(const char *, const char *); |
| 95 | void *memmem(const void *, size_t, const void *, size_t); | |
| 96 | 96 | void *memrchr(const void *, int, size_t); |
| 97 | 97 | void *mempcpy(void *, const void *, size_t); |
| 98 | 98 | #ifndef __cplusplus |
lib/libc/include/generic-musl/strings.h+1| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | extern "C" { |
| 6 | 6 | #endif |
| 7 | 7 | |
| 8 | #include <features.h> | |
| 8 | 9 | |
| 9 | 10 | #define __NEED_size_t |
| 10 | 11 | #define __NEED_locale_t |
lib/libc/include/generic-musl/sys/mman.h+1-1| ... | ... | @@ -141,7 +141,7 @@ int mincore (void *, size_t, unsigned char *); |
| 141 | 141 | int shm_open (const char *, int, mode_t); |
| 142 | 142 | int shm_unlink (const char *); |
| 143 | 143 | |
| 144 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 144 | #if defined(_LARGEFILE64_SOURCE) | |
| 145 | 145 | #define mmap64 mmap |
| 146 | 146 | #define off64_t off_t |
| 147 | 147 | #endif |
lib/libc/include/generic-musl/sys/resource.h+1-1| ... | ... | @@ -95,7 +95,7 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); |
| 95 | 95 | |
| 96 | 96 | #define RLIM_NLIMITS RLIMIT_NLIMITS |
| 97 | 97 | |
| 98 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 98 | #if defined(_LARGEFILE64_SOURCE) | |
| 99 | 99 | #define RLIM64_INFINITY RLIM_INFINITY |
| 100 | 100 | #define RLIM64_SAVED_CUR RLIM_SAVED_CUR |
| 101 | 101 | #define RLIM64_SAVED_MAX RLIM_SAVED_MAX |
lib/libc/include/generic-musl/sys/sendfile.h+1-1| ... | ... | @@ -10,7 +10,7 @@ extern "C" { |
| 10 | 10 | |
| 11 | 11 | ssize_t sendfile(int, int, off_t *, size_t); |
| 12 | 12 | |
| 13 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 13 | #if defined(_LARGEFILE64_SOURCE) | |
| 14 | 14 | #define sendfile64 sendfile |
| 15 | 15 | #define off64_t off_t |
| 16 | 16 | #endif |
lib/libc/include/generic-musl/sys/stat.h+1-1| ... | ... | @@ -98,7 +98,7 @@ int lchmod(const char *, mode_t); |
| 98 | 98 | #define S_IEXEC S_IXUSR |
| 99 | 99 | #endif |
| 100 | 100 | |
| 101 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 101 | #if defined(_LARGEFILE64_SOURCE) | |
| 102 | 102 | #define stat64 stat |
| 103 | 103 | #define fstat64 fstat |
| 104 | 104 | #define lstat64 lstat |
lib/libc/include/generic-musl/sys/statfs.h+1-1| ... | ... | @@ -18,7 +18,7 @@ typedef struct __fsid_t { |
| 18 | 18 | int statfs (const char *, struct statfs *); |
| 19 | 19 | int fstatfs (int, struct statfs *); |
| 20 | 20 | |
| 21 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 21 | #if defined(_LARGEFILE64_SOURCE) | |
| 22 | 22 | #define statfs64 statfs |
| 23 | 23 | #define fstatfs64 fstatfs |
| 24 | 24 | #define fsblkcnt64_t fsblkcnt_t |
lib/libc/include/generic-musl/sys/statvfs.h+1-1| ... | ... | @@ -42,7 +42,7 @@ int fstatvfs (int, struct statvfs *); |
| 42 | 42 | #define ST_NODIRATIME 2048 |
| 43 | 43 | #define ST_RELATIME 4096 |
| 44 | 44 | |
| 45 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 45 | #if defined(_LARGEFILE64_SOURCE) | |
| 46 | 46 | #define statvfs64 statvfs |
| 47 | 47 | #define fstatvfs64 fstatvfs |
| 48 | 48 | #define fsblkcnt64_t fsblkcnt_t |
lib/libc/include/generic-musl/sys/types.h+1-1| ... | ... | @@ -71,7 +71,7 @@ typedef unsigned long long u_quad_t; |
| 71 | 71 | #include <sys/select.h> |
| 72 | 72 | #endif |
| 73 | 73 | |
| 74 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 74 | #if defined(_LARGEFILE64_SOURCE) | |
| 75 | 75 | #define blkcnt64_t blkcnt_t |
| 76 | 76 | #define fsblkcnt64_t fsblkcnt_t |
| 77 | 77 | #define fsfilcnt64_t fsfilcnt_t |
lib/libc/include/generic-musl/sys/uio.h+1-1| ... | ... | @@ -29,7 +29,7 @@ ssize_t writev (int, const struct iovec *, int); |
| 29 | 29 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 30 | 30 | ssize_t preadv (int, const struct iovec *, int, off_t); |
| 31 | 31 | ssize_t pwritev (int, const struct iovec *, int, off_t); |
| 32 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 32 | #if defined(_LARGEFILE64_SOURCE) | |
| 33 | 33 | #define preadv64 preadv |
| 34 | 34 | #define pwritev64 pwritev |
| 35 | 35 | #define off64_t off_t |
lib/libc/include/generic-musl/sys/wait.h+1-1| ... | ... | @@ -50,7 +50,7 @@ pid_t wait4 (pid_t, int *, int, struct rusage *); |
| 50 | 50 | #define WSTOPSIG(s) WEXITSTATUS(s) |
| 51 | 51 | #define WCOREDUMP(s) ((s) & 0x80) |
| 52 | 52 | #define WIFEXITED(s) (!WTERMSIG(s)) |
| 53 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) | |
| 53 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00) | |
| 54 | 54 | #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) |
| 55 | 55 | #define WIFCONTINUED(s) ((s) == 0xffff) |
| 56 | 56 |
lib/libc/include/generic-musl/unistd.h+5-1| ... | ... | @@ -198,7 +198,7 @@ ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned); |
| 198 | 198 | pid_t gettid(void); |
| 199 | 199 | #endif |
| 200 | 200 | |
| 201 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 201 | #if defined(_LARGEFILE64_SOURCE) | |
| 202 | 202 | #define lseek64 lseek |
| 203 | 203 | #define pread64 pread |
| 204 | 204 | #define pwrite64 pwrite |
| ... | ... | @@ -425,6 +425,8 @@ pid_t gettid(void); |
| 425 | 425 | #define _SC_XOPEN_STREAMS	246 |
| 426 | 426 | #define _SC_THREAD_ROBUST_PRIO_INHERIT	247 |
| 427 | 427 | #define _SC_THREAD_ROBUST_PRIO_PROTECT	248 |
| 428 | #define _SC_MINSIGSTKSZ	249 | |
| 429 | #define _SC_SIGSTKSZ	250 | |
| 428 | 430 | |
| 429 | 431 | #define _CS_PATH	0 |
| 430 | 432 | #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	1 |
| ... | ... | @@ -467,6 +469,8 @@ pid_t gettid(void); |
| 467 | 469 | #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS	1147 |
| 468 | 470 | #define _CS_V6_ENV	1148 |
| 469 | 471 | #define _CS_V7_ENV	1149 |
| 472 | #define _CS_POSIX_V7_THREADS_CFLAGS	1150 | |
| 473 | #define _CS_POSIX_V7_THREADS_LDFLAGS	1151 | |
| 470 | 474 | |
| 471 | 475 | #ifdef __cplusplus |
| 472 | 476 | } |
lib/libc/include/i386-linux-musl/bits/alltypes.h deleted-438| ... | ... | @@ -1,438 +0,0 @@ |
| 1 | #define _REDIR_TIME64 1 | |
| 2 | #define _Addr int | |
| 3 | #define _Int64 long long | |
| 4 | #define _Reg int | |
| 5 | ||
| 6 | #define __BYTE_ORDER 1234 | |
| 7 | #define __LONG_MAX 0x7fffffffL | |
| 8 | ||
| 9 | #ifndef __cplusplus | |
| 10 | #ifdef __WCHAR_TYPE__ | |
| 11 | #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) | |
| 12 | typedef __WCHAR_TYPE__ wchar_t; | |
| 13 | #define __DEFINED_wchar_t | |
| 14 | #endif | |
| 15 | ||
| 16 | #else | |
| 17 | #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) | |
| 18 | typedef long wchar_t; | |
| 19 | #define __DEFINED_wchar_t | |
| 20 | #endif | |
| 21 | ||
| 22 | #endif | |
| 23 | #endif | |
| 24 | ||
| 25 | #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0 | |
| 26 | #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) | |
| 27 | typedef float float_t; | |
| 28 | #define __DEFINED_float_t | |
| 29 | #endif | |
| 30 | ||
| 31 | #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) | |
| 32 | typedef double double_t; | |
| 33 | #define __DEFINED_double_t | |
| 34 | #endif | |
| 35 | ||
| 36 | #else | |
| 37 | #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) | |
| 38 | typedef long double float_t; | |
| 39 | #define __DEFINED_float_t | |
| 40 | #endif | |
| 41 | ||
| 42 | #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) | |
| 43 | typedef long double double_t; | |
| 44 | #define __DEFINED_double_t | |
| 45 | #endif | |
| 46 | ||
| 47 | #endif | |
| 48 | ||
| 49 | #if !defined(__cplusplus) | |
| 50 | #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) | |
| 51 | typedef struct { _Alignas(8) long long __ll; long double __ld; } max_align_t; | |
| 52 | #define __DEFINED_max_align_t | |
| 53 | #endif | |
| 54 | ||
| 55 | #elif defined(__GNUC__) | |
| 56 | #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) | |
| 57 | typedef struct { __attribute__((__aligned__(8))) long long __ll; long double __ld; } max_align_t; | |
| 58 | #define __DEFINED_max_align_t | |
| 59 | #endif | |
| 60 | ||
| 61 | #else | |
| 62 | #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) | |
| 63 | typedef struct { alignas(8) long long __ll; long double __ld; } max_align_t; | |
| 64 | #define __DEFINED_max_align_t | |
| 65 | #endif | |
| 66 | ||
| 67 | #endif | |
| 68 | #define __LITTLE_ENDIAN 1234 | |
| 69 | #define __BIG_ENDIAN 4321 | |
| 70 | #define __USE_TIME_BITS64 1 | |
| 71 | ||
| 72 | #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) | |
| 73 | typedef unsigned _Addr size_t; | |
| 74 | #define __DEFINED_size_t | |
| 75 | #endif | |
| 76 | ||
| 77 | #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) | |
| 78 | typedef unsigned _Addr uintptr_t; | |
| 79 | #define __DEFINED_uintptr_t | |
| 80 | #endif | |
| 81 | ||
| 82 | #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) | |
| 83 | typedef _Addr ptrdiff_t; | |
| 84 | #define __DEFINED_ptrdiff_t | |
| 85 | #endif | |
| 86 | ||
| 87 | #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) | |
| 88 | typedef _Addr ssize_t; | |
| 89 | #define __DEFINED_ssize_t | |
| 90 | #endif | |
| 91 | ||
| 92 | #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) | |
| 93 | typedef _Addr intptr_t; | |
| 94 | #define __DEFINED_intptr_t | |
| 95 | #endif | |
| 96 | ||
| 97 | #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) | |
| 98 | typedef _Addr regoff_t; | |
| 99 | #define __DEFINED_regoff_t | |
| 100 | #endif | |
| 101 | ||
| 102 | #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) | |
| 103 | typedef _Reg register_t; | |
| 104 | #define __DEFINED_register_t | |
| 105 | #endif | |
| 106 | ||
| 107 | #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) | |
| 108 | typedef _Int64 time_t; | |
| 109 | #define __DEFINED_time_t | |
| 110 | #endif | |
| 111 | ||
| 112 | #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) | |
| 113 | typedef _Int64 suseconds_t; | |
| 114 | #define __DEFINED_suseconds_t | |
| 115 | #endif | |
| 116 | ||
| 117 | ||
| 118 | #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) | |
| 119 | typedef signed char int8_t; | |
| 120 | #define __DEFINED_int8_t | |
| 121 | #endif | |
| 122 | ||
| 123 | #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) | |
| 124 | typedef signed short int16_t; | |
| 125 | #define __DEFINED_int16_t | |
| 126 | #endif | |
| 127 | ||
| 128 | #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) | |
| 129 | typedef signed int int32_t; | |
| 130 | #define __DEFINED_int32_t | |
| 131 | #endif | |
| 132 | ||
| 133 | #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) | |
| 134 | typedef signed _Int64 int64_t; | |
| 135 | #define __DEFINED_int64_t | |
| 136 | #endif | |
| 137 | ||
| 138 | #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) | |
| 139 | typedef signed _Int64 intmax_t; | |
| 140 | #define __DEFINED_intmax_t | |
| 141 | #endif | |
| 142 | ||
| 143 | #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) | |
| 144 | typedef unsigned char uint8_t; | |
| 145 | #define __DEFINED_uint8_t | |
| 146 | #endif | |
| 147 | ||
| 148 | #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) | |
| 149 | typedef unsigned short uint16_t; | |
| 150 | #define __DEFINED_uint16_t | |
| 151 | #endif | |
| 152 | ||
| 153 | #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) | |
| 154 | typedef unsigned int uint32_t; | |
| 155 | #define __DEFINED_uint32_t | |
| 156 | #endif | |
| 157 | ||
| 158 | #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) | |
| 159 | typedef unsigned _Int64 uint64_t; | |
| 160 | #define __DEFINED_uint64_t | |
| 161 | #endif | |
| 162 | ||
| 163 | #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) | |
| 164 | typedef unsigned _Int64 u_int64_t; | |
| 165 | #define __DEFINED_u_int64_t | |
| 166 | #endif | |
| 167 | ||
| 168 | #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) | |
| 169 | typedef unsigned _Int64 uintmax_t; | |
| 170 | #define __DEFINED_uintmax_t | |
| 171 | #endif | |
| 172 | ||
| 173 | ||
| 174 | #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) | |
| 175 | typedef unsigned mode_t; | |
| 176 | #define __DEFINED_mode_t | |
| 177 | #endif | |
| 178 | ||
| 179 | #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) | |
| 180 | typedef unsigned _Reg nlink_t; | |
| 181 | #define __DEFINED_nlink_t | |
| 182 | #endif | |
| 183 | ||
| 184 | #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) | |
| 185 | typedef _Int64 off_t; | |
| 186 | #define __DEFINED_off_t | |
| 187 | #endif | |
| 188 | ||
| 189 | #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) | |
| 190 | typedef unsigned _Int64 ino_t; | |
| 191 | #define __DEFINED_ino_t | |
| 192 | #endif | |
| 193 | ||
| 194 | #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) | |
| 195 | typedef unsigned _Int64 dev_t; | |
| 196 | #define __DEFINED_dev_t | |
| 197 | #endif | |
| 198 | ||
| 199 | #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) | |
| 200 | typedef long blksize_t; | |
| 201 | #define __DEFINED_blksize_t | |
| 202 | #endif | |
| 203 | ||
| 204 | #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) | |
| 205 | typedef _Int64 blkcnt_t; | |
| 206 | #define __DEFINED_blkcnt_t | |
| 207 | #endif | |
| 208 | ||
| 209 | #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) | |
| 210 | typedef unsigned _Int64 fsblkcnt_t; | |
| 211 | #define __DEFINED_fsblkcnt_t | |
| 212 | #endif | |
| 213 | ||
| 214 | #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) | |
| 215 | typedef unsigned _Int64 fsfilcnt_t; | |
| 216 | #define __DEFINED_fsfilcnt_t | |
| 217 | #endif | |
| 218 | ||
| 219 | ||
| 220 | #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) | |
| 221 | typedef unsigned wint_t; | |
| 222 | #define __DEFINED_wint_t | |
| 223 | #endif | |
| 224 | ||
| 225 | #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) | |
| 226 | typedef unsigned long wctype_t; | |
| 227 | #define __DEFINED_wctype_t | |
| 228 | #endif | |
| 229 | ||
| 230 | ||
| 231 | #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) | |
| 232 | typedef void * timer_t; | |
| 233 | #define __DEFINED_timer_t | |
| 234 | #endif | |
| 235 | ||
| 236 | #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) | |
| 237 | typedef int clockid_t; | |
| 238 | #define __DEFINED_clockid_t | |
| 239 | #endif | |
| 240 | ||
| 241 | #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) | |
| 242 | typedef long clock_t; | |
| 243 | #define __DEFINED_clock_t | |
| 244 | #endif | |
| 245 | ||
| 246 | #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) | |
| 247 | struct timeval { time_t tv_sec; suseconds_t tv_usec; }; | |
| 248 | #define __DEFINED_struct_timeval | |
| 249 | #endif | |
| 250 | ||
| 251 | #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) | |
| 252 | struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; | |
| 253 | #define __DEFINED_struct_timespec | |
| 254 | #endif | |
| 255 | ||
| 256 | ||
| 257 | #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) | |
| 258 | typedef int pid_t; | |
| 259 | #define __DEFINED_pid_t | |
| 260 | #endif | |
| 261 | ||
| 262 | #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) | |
| 263 | typedef unsigned id_t; | |
| 264 | #define __DEFINED_id_t | |
| 265 | #endif | |
| 266 | ||
| 267 | #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) | |
| 268 | typedef unsigned uid_t; | |
| 269 | #define __DEFINED_uid_t | |
| 270 | #endif | |
| 271 | ||
| 272 | #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) | |
| 273 | typedef unsigned gid_t; | |
| 274 | #define __DEFINED_gid_t | |
| 275 | #endif | |
| 276 | ||
| 277 | #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) | |
| 278 | typedef int key_t; | |
| 279 | #define __DEFINED_key_t | |
| 280 | #endif | |
| 281 | ||
| 282 | #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) | |
| 283 | typedef unsigned useconds_t; | |
| 284 | #define __DEFINED_useconds_t | |
| 285 | #endif | |
| 286 | ||
| 287 | ||
| 288 | #ifdef __cplusplus | |
| 289 | #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) | |
| 290 | typedef unsigned long pthread_t; | |
| 291 | #define __DEFINED_pthread_t | |
| 292 | #endif | |
| 293 | ||
| 294 | #else | |
| 295 | #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) | |
| 296 | typedef struct __pthread * pthread_t; | |
| 297 | #define __DEFINED_pthread_t | |
| 298 | #endif | |
| 299 | ||
| 300 | #endif | |
| 301 | #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) | |
| 302 | typedef int pthread_once_t; | |
| 303 | #define __DEFINED_pthread_once_t | |
| 304 | #endif | |
| 305 | ||
| 306 | #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) | |
| 307 | typedef unsigned pthread_key_t; | |
| 308 | #define __DEFINED_pthread_key_t | |
| 309 | #endif | |
| 310 | ||
| 311 | #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) | |
| 312 | typedef int pthread_spinlock_t; | |
| 313 | #define __DEFINED_pthread_spinlock_t | |
| 314 | #endif | |
| 315 | ||
| 316 | #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) | |
| 317 | typedef struct { unsigned __attr; } pthread_mutexattr_t; | |
| 318 | #define __DEFINED_pthread_mutexattr_t | |
| 319 | #endif | |
| 320 | ||
| 321 | #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) | |
| 322 | typedef struct { unsigned __attr; } pthread_condattr_t; | |
| 323 | #define __DEFINED_pthread_condattr_t | |
| 324 | #endif | |
| 325 | ||
| 326 | #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) | |
| 327 | typedef struct { unsigned __attr; } pthread_barrierattr_t; | |
| 328 | #define __DEFINED_pthread_barrierattr_t | |
| 329 | #endif | |
| 330 | ||
| 331 | #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) | |
| 332 | typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; | |
| 333 | #define __DEFINED_pthread_rwlockattr_t | |
| 334 | #endif | |
| 335 | ||
| 336 | ||
| 337 | #if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE) | |
| 338 | struct _IO_FILE { char __x; }; | |
| 339 | #define __DEFINED_struct__IO_FILE | |
| 340 | #endif | |
| 341 | ||
| 342 | #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) | |
| 343 | typedef struct _IO_FILE FILE; | |
| 344 | #define __DEFINED_FILE | |
| 345 | #endif | |
| 346 | ||
| 347 | ||
| 348 | #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) | |
| 349 | typedef __builtin_va_list va_list; | |
| 350 | #define __DEFINED_va_list | |
| 351 | #endif | |
| 352 | ||
| 353 | #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) | |
| 354 | typedef __builtin_va_list __isoc_va_list; | |
| 355 | #define __DEFINED___isoc_va_list | |
| 356 | #endif | |
| 357 | ||
| 358 | ||
| 359 | #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) | |
| 360 | typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; | |
| 361 | #define __DEFINED_mbstate_t | |
| 362 | #endif | |
| 363 | ||
| 364 | ||
| 365 | #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) | |
| 366 | typedef struct __locale_struct * locale_t; | |
| 367 | #define __DEFINED_locale_t | |
| 368 | #endif | |
| 369 | ||
| 370 | ||
| 371 | #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) | |
| 372 | typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; | |
| 373 | #define __DEFINED_sigset_t | |
| 374 | #endif | |
| 375 | ||
| 376 | ||
| 377 | #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) | |
| 378 | struct iovec { void *iov_base; size_t iov_len; }; | |
| 379 | #define __DEFINED_struct_iovec | |
| 380 | #endif | |
| 381 | ||
| 382 | ||
| 383 | #if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize) | |
| 384 | struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; }; | |
| 385 | #define __DEFINED_struct_winsize | |
| 386 | #endif | |
| 387 | ||
| 388 | ||
| 389 | #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) | |
| 390 | typedef unsigned socklen_t; | |
| 391 | #define __DEFINED_socklen_t | |
| 392 | #endif | |
| 393 | ||
| 394 | #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) | |
| 395 | typedef unsigned short sa_family_t; | |
| 396 | #define __DEFINED_sa_family_t | |
| 397 | #endif | |
| 398 | ||
| 399 | ||
| 400 | #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) | |
| 401 | typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t; | |
| 402 | #define __DEFINED_pthread_attr_t | |
| 403 | #endif | |
| 404 | ||
| 405 | #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) | |
| 406 | typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t; | |
| 407 | #define __DEFINED_pthread_mutex_t | |
| 408 | #endif | |
| 409 | ||
| 410 | #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) | |
| 411 | typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t; | |
| 412 | #define __DEFINED_mtx_t | |
| 413 | #endif | |
| 414 | ||
| 415 | #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) | |
| 416 | typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t; | |
| 417 | #define __DEFINED_pthread_cond_t | |
| 418 | #endif | |
| 419 | ||
| 420 | #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) | |
| 421 | typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t; | |
| 422 | #define __DEFINED_cnd_t | |
| 423 | #endif | |
| 424 | ||
| 425 | #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) | |
| 426 | typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t; | |
| 427 | #define __DEFINED_pthread_rwlock_t | |
| 428 | #endif | |
| 429 | ||
| 430 | #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) | |
| 431 | typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t; | |
| 432 | #define __DEFINED_pthread_barrier_t | |
| 433 | #endif | |
| 434 | ||
| 435 | ||
| 436 | #undef _Addr | |
| 437 | #undef _Int64 | |
| 438 | #undef _Reg | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/fenv.h deleted-33| ... | ... | @@ -1,33 +0,0 @@ |
| 1 | #define FE_INVALID 1 | |
| 2 | #define __FE_DENORM 2 | |
| 3 | #define FE_DIVBYZERO 4 | |
| 4 | #define FE_OVERFLOW 8 | |
| 5 | #define FE_UNDERFLOW 16 | |
| 6 | #define FE_INEXACT 32 | |
| 7 | ||
| 8 | #define FE_ALL_EXCEPT 63 | |
| 9 | ||
| 10 | #define FE_TONEAREST 0 | |
| 11 | #define FE_DOWNWARD 0x400 | |
| 12 | #define FE_UPWARD 0x800 | |
| 13 | #define FE_TOWARDZERO 0xc00 | |
| 14 | ||
| 15 | typedef unsigned short fexcept_t; | |
| 16 | ||
| 17 | typedef struct { | |
| 18 | 	unsigned short __control_word; | |
| 19 | 	unsigned short __unused1; | |
| 20 | 	unsigned short __status_word; | |
| 21 | 	unsigned short __unused2; | |
| 22 | 	unsigned short __tags; | |
| 23 | 	unsigned short __unused3; | |
| 24 | 	unsigned int __eip; | |
| 25 | 	unsigned short __cs_selector; | |
| 26 | 	unsigned int __opcode:11; | |
| 27 | 	unsigned int __unused4:5; | |
| 28 | 	unsigned int __data_offset; | |
| 29 | 	unsigned short __data_selector; | |
| 30 | 	unsigned short __unused5; | |
| 31 | } fenv_t; | |
| 32 | ||
| 33 | #define FE_DFL_ENV ((const fenv_t *) -1) | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/float.h deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | #ifdef __FLT_EVAL_METHOD__ | |
| 2 | #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ | |
| 3 | #else | |
| 4 | #define FLT_EVAL_METHOD 2 | |
| 5 | #endif | |
| 6 | ||
| 7 | #define LDBL_TRUE_MIN 3.6451995318824746025e-4951L | |
| 8 | #define LDBL_MIN 3.3621031431120935063e-4932L | |
| 9 | #define LDBL_MAX 1.1897314953572317650e+4932L | |
| 10 | #define LDBL_EPSILON 1.0842021724855044340e-19L | |
| 11 | ||
| 12 | #define LDBL_MANT_DIG 64 | |
| 13 | #define LDBL_MIN_EXP (-16381) | |
| 14 | #define LDBL_MAX_EXP 16384 | |
| 15 | ||
| 16 | #define LDBL_DIG 18 | |
| 17 | #define LDBL_MIN_10_EXP (-4931) | |
| 18 | #define LDBL_MAX_10_EXP 4932 | |
| 19 | ||
| 20 | #define DECIMAL_DIG 21 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/io.h deleted-77| ... | ... | @@ -1,77 +0,0 @@ |
| 1 | static __inline void outb(unsigned char __val, unsigned short __port) | |
| 2 | { | |
| 3 | 	__asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port)); | |
| 4 | } | |
| 5 | ||
| 6 | static __inline void outw(unsigned short __val, unsigned short __port) | |
| 7 | { | |
| 8 | 	__asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port)); | |
| 9 | } | |
| 10 | ||
| 11 | static __inline void outl(unsigned int __val, unsigned short __port) | |
| 12 | { | |
| 13 | 	__asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port)); | |
| 14 | } | |
| 15 | ||
| 16 | static __inline unsigned char inb(unsigned short __port) | |
| 17 | { | |
| 18 | 	unsigned char __val; | |
| 19 | 	__asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port)); | |
| 20 | 	return __val; | |
| 21 | } | |
| 22 | ||
| 23 | static __inline unsigned short inw(unsigned short __port) | |
| 24 | { | |
| 25 | 	unsigned short __val; | |
| 26 | 	__asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port)); | |
| 27 | 	return __val; | |
| 28 | } | |
| 29 | ||
| 30 | static __inline unsigned int inl(unsigned short __port) | |
| 31 | { | |
| 32 | 	unsigned int __val; | |
| 33 | 	__asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port)); | |
| 34 | 	return __val; | |
| 35 | } | |
| 36 | ||
| 37 | static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n) | |
| 38 | { | |
| 39 | 	__asm__ volatile ("cld; rep; outsb" | |
| 40 | 		 : "+S" (__buf), "+c" (__n) | |
| 41 | 		 : "d" (__port)); | |
| 42 | } | |
| 43 | ||
| 44 | static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n) | |
| 45 | { | |
| 46 | 	__asm__ volatile ("cld; rep; outsw" | |
| 47 | 		 : "+S" (__buf), "+c" (__n) | |
| 48 | 		 : "d" (__port)); | |
| 49 | } | |
| 50 | ||
| 51 | static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n) | |
| 52 | { | |
| 53 | 	__asm__ volatile ("cld; rep; outsl" | |
| 54 | 		 : "+S" (__buf), "+c"(__n) | |
| 55 | 		 : "d" (__port)); | |
| 56 | } | |
| 57 | ||
| 58 | static __inline void insb(unsigned short __port, void *__buf, unsigned long __n) | |
| 59 | { | |
| 60 | 	__asm__ volatile ("cld; rep; insb" | |
| 61 | 		 : "+D" (__buf), "+c" (__n) | |
| 62 | 		 : "d" (__port)); | |
| 63 | } | |
| 64 | ||
| 65 | static __inline void insw(unsigned short __port, void *__buf, unsigned long __n) | |
| 66 | { | |
| 67 | 	__asm__ volatile ("cld; rep; insw" | |
| 68 | 		 : "+D" (__buf), "+c" (__n) | |
| 69 | 		 : "d" (__port)); | |
| 70 | } | |
| 71 | ||
| 72 | static __inline void insl(unsigned short __port, void *__buf, unsigned long __n) | |
| 73 | { | |
| 74 | 	__asm__ volatile ("cld; rep; insl" | |
| 75 | 		 : "+D" (__buf), "+c" (__n) | |
| 76 | 		 : "d" (__port)); | |
| 77 | } | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/ipcstat.h deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | #define IPC_STAT 0x102 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/limits.h deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | #define PAGESIZE 4096 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/mman.h deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | #define MAP_32BIT 0x40 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/msg.h deleted-18| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | struct msqid_ds { | |
| 2 | 	struct ipc_perm msg_perm; | |
| 3 | 	unsigned long __msg_stime_lo; | |
| 4 | 	unsigned long __msg_stime_hi; | |
| 5 | 	unsigned long __msg_rtime_lo; | |
| 6 | 	unsigned long __msg_rtime_hi; | |
| 7 | 	unsigned long __msg_ctime_lo; | |
| 8 | 	unsigned long __msg_ctime_hi; | |
| 9 | 	unsigned long msg_cbytes; | |
| 10 | 	msgqnum_t msg_qnum; | |
| 11 | 	msglen_t msg_qbytes; | |
| 12 | 	pid_t msg_lspid; | |
| 13 | 	pid_t msg_lrpid; | |
| 14 | 	unsigned long __unused[2]; | |
| 15 | 	time_t msg_stime; | |
| 16 | 	time_t msg_rtime; | |
| 17 | 	time_t msg_ctime; | |
| 18 | }; | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/ptrace.h deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | #define PTRACE_GET_THREAD_AREA		25 | |
| 2 | #define PTRACE_SET_THREAD_AREA		26 | |
| 3 | #define PTRACE_SYSEMU			31 | |
| 4 | #define PTRACE_SYSEMU_SINGLESTEP	32 | |
| 5 | #define PTRACE_SINGLEBLOCK		33 | |
| 6 | ||
| 7 | #define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA | |
| 8 | #define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA | |
| 9 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 10 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 11 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/reg.h deleted-19| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | #undef __WORDSIZE | |
| 2 | #define __WORDSIZE 32 | |
| 3 | #define EBX 0 | |
| 4 | #define ECX 1 | |
| 5 | #define EDX 2 | |
| 6 | #define ESI 3 | |
| 7 | #define EDI 4 | |
| 8 | #define EBP 5 | |
| 9 | #define EAX 6 | |
| 10 | #define DS 7 | |
| 11 | #define ES 8 | |
| 12 | #define FS 9 | |
| 13 | #define GS 10 | |
| 14 | #define ORIG_EAX 11 | |
| 15 | #define EIP 12 | |
| 16 | #define CS 13 | |
| 17 | #define EFL 14 | |
| 18 | #define UESP 15 | |
| 19 | #define SS 16 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/sem.h deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | struct semid_ds { | |
| 2 | 	struct ipc_perm sem_perm; | |
| 3 | 	unsigned long __sem_otime_lo; | |
| 4 | 	unsigned long __sem_otime_hi; | |
| 5 | 	unsigned long __sem_ctime_lo; | |
| 6 | 	unsigned long __sem_ctime_hi; | |
| 7 | 	unsigned short sem_nsems; | |
| 8 | 	char __sem_nsems_pad[sizeof(long)-sizeof(short)]; | |
| 9 | 	long __unused3; | |
| 10 | 	long __unused4; | |
| 11 | 	time_t sem_otime; | |
| 12 | 	time_t sem_ctime; | |
| 13 | }; | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/setjmp.h deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | typedef unsigned long __jmp_buf[6]; | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/shm.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | #define SHMLBA 4096 | |
| 2 | ||
| 3 | struct shmid_ds { | |
| 4 | 	struct ipc_perm shm_perm; | |
| 5 | 	size_t shm_segsz; | |
| 6 | 	unsigned long __shm_atime_lo; | |
| 7 | 	unsigned long __shm_atime_hi; | |
| 8 | 	unsigned long __shm_dtime_lo; | |
| 9 | 	unsigned long __shm_dtime_hi; | |
| 10 | 	unsigned long __shm_ctime_lo; | |
| 11 | 	unsigned long __shm_ctime_hi; | |
| 12 | 	pid_t shm_cpid; | |
| 13 | 	pid_t shm_lpid; | |
| 14 | 	unsigned long shm_nattch; | |
| 15 | 	unsigned long __pad1; | |
| 16 | 	unsigned long __pad2; | |
| 17 | 	unsigned long __pad3; | |
| 18 | 	time_t shm_atime; | |
| 19 | 	time_t shm_dtime; | |
| 20 | 	time_t shm_ctime; | |
| 21 | }; | |
| 22 | ||
| 23 | struct shminfo { | |
| 24 | 	unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; | |
| 25 | }; | |
| 26 | ||
| 27 | struct shm_info { | |
| 28 | 	int __used_ids; | |
| 29 | 	unsigned long shm_tot, shm_rss, shm_swp; | |
| 30 | 	unsigned long __swap_attempts, __swap_successes; | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/signal.h deleted-141| ... | ... | @@ -1,141 +0,0 @@ |
| 1 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ | |
| 2 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | |
| 3 | ||
| 4 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | |
| 5 | #define MINSIGSTKSZ 2048 | |
| 6 | #define SIGSTKSZ 8192 | |
| 7 | #endif | |
| 8 | ||
| 9 | #ifdef _GNU_SOURCE | |
| 10 | enum { REG_GS = 0 }; | |
| 11 | #define REG_GS REG_GS | |
| 12 | enum { REG_FS = 1 }; | |
| 13 | #define REG_FS REG_FS | |
| 14 | enum { REG_ES = 2 }; | |
| 15 | #define REG_ES REG_ES | |
| 16 | enum { REG_DS = 3 }; | |
| 17 | #define REG_DS REG_DS | |
| 18 | enum { REG_EDI = 4 }; | |
| 19 | #define REG_EDI REG_EDI | |
| 20 | enum { REG_ESI = 5 }; | |
| 21 | #define REG_ESI REG_ESI | |
| 22 | enum { REG_EBP = 6 }; | |
| 23 | #define REG_EBP REG_EBP | |
| 24 | enum { REG_ESP = 7 }; | |
| 25 | #define REG_ESP REG_ESP | |
| 26 | enum { REG_EBX = 8 }; | |
| 27 | #define REG_EBX REG_EBX | |
| 28 | enum { REG_EDX = 9 }; | |
| 29 | #define REG_EDX REG_EDX | |
| 30 | enum { REG_ECX = 10 }; | |
| 31 | #define REG_ECX REG_ECX | |
| 32 | enum { REG_EAX = 11 }; | |
| 33 | #define REG_EAX REG_EAX | |
| 34 | enum { REG_TRAPNO = 12 }; | |
| 35 | #define REG_TRAPNO REG_TRAPNO | |
| 36 | enum { REG_ERR = 13 }; | |
| 37 | #define REG_ERR REG_ERR | |
| 38 | enum { REG_EIP = 14 }; | |
| 39 | #define REG_EIP REG_EIP | |
| 40 | enum { REG_CS = 15 }; | |
| 41 | #define REG_CS REG_CS | |
| 42 | enum { REG_EFL = 16 }; | |
| 43 | #define REG_EFL REG_EFL | |
| 44 | enum { REG_UESP = 17 }; | |
| 45 | #define REG_UESP REG_UESP | |
| 46 | enum { REG_SS = 18 }; | |
| 47 | #define REG_SS REG_SS | |
| 48 | #endif | |
| 49 | ||
| 50 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | |
| 51 | typedef int greg_t, gregset_t[19]; | |
| 52 | typedef struct _fpstate { | |
| 53 | 	unsigned long cw, sw, tag, ipoff, cssel, dataoff, datasel; | |
| 54 | 	struct { | |
| 55 | 		unsigned short significand[4], exponent; | |
| 56 | 	} _st[8]; | |
| 57 | 	unsigned long status; | |
| 58 | } *fpregset_t; | |
| 59 | struct sigcontext { | |
| 60 | 	unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh; | |
| 61 | 	unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax; | |
| 62 | 	unsigned long trapno, err, eip; | |
| 63 | 	unsigned short cs, __csh; | |
| 64 | 	unsigned long eflags, esp_at_signal; | |
| 65 | 	unsigned short ss, __ssh; | |
| 66 | 	struct _fpstate *fpstate; | |
| 67 | 	unsigned long oldmask, cr2; | |
| 68 | }; | |
| 69 | typedef struct { | |
| 70 | 	gregset_t gregs; | |
| 71 | 	fpregset_t fpregs; | |
| 72 | 	unsigned long oldmask, cr2; | |
| 73 | } mcontext_t; | |
| 74 | #else | |
| 75 | typedef struct { | |
| 76 | 	unsigned __space[22]; | |
| 77 | } mcontext_t; | |
| 78 | #endif | |
| 79 | ||
| 80 | struct sigaltstack { | |
| 81 | 	void *ss_sp; | |
| 82 | 	int ss_flags; | |
| 83 | 	size_t ss_size; | |
| 84 | }; | |
| 85 | ||
| 86 | typedef struct __ucontext { | |
| 87 | 	unsigned long uc_flags; | |
| 88 | 	struct __ucontext *uc_link; | |
| 89 | 	stack_t uc_stack; | |
| 90 | 	mcontext_t uc_mcontext; | |
| 91 | 	sigset_t uc_sigmask; | |
| 92 | 	unsigned long __fpregs_mem[28]; | |
| 93 | } ucontext_t; | |
| 94 | ||
| 95 | #define SA_NOCLDSTOP 1 | |
| 96 | #define SA_NOCLDWAIT 2 | |
| 97 | #define SA_SIGINFO 4 | |
| 98 | #define SA_ONSTACK 0x08000000 | |
| 99 | #define SA_RESTART 0x10000000 | |
| 100 | #define SA_NODEFER 0x40000000 | |
| 101 | #define SA_RESETHAND 0x80000000 | |
| 102 | #define SA_RESTORER 0x04000000 | |
| 103 | ||
| 104 | #endif | |
| 105 | ||
| 106 | #define SIGHUP 1 | |
| 107 | #define SIGINT 2 | |
| 108 | #define SIGQUIT 3 | |
| 109 | #define SIGILL 4 | |
| 110 | #define SIGTRAP 5 | |
| 111 | #define SIGABRT 6 | |
| 112 | #define SIGIOT SIGABRT | |
| 113 | #define SIGBUS 7 | |
| 114 | #define SIGFPE 8 | |
| 115 | #define SIGKILL 9 | |
| 116 | #define SIGUSR1 10 | |
| 117 | #define SIGSEGV 11 | |
| 118 | #define SIGUSR2 12 | |
| 119 | #define SIGPIPE 13 | |
| 120 | #define SIGALRM 14 | |
| 121 | #define SIGTERM 15 | |
| 122 | #define SIGSTKFLT 16 | |
| 123 | #define SIGCHLD 17 | |
| 124 | #define SIGCONT 18 | |
| 125 | #define SIGSTOP 19 | |
| 126 | #define SIGTSTP 20 | |
| 127 | #define SIGTTIN 21 | |
| 128 | #define SIGTTOU 22 | |
| 129 | #define SIGURG 23 | |
| 130 | #define SIGXCPU 24 | |
| 131 | #define SIGXFSZ 25 | |
| 132 | #define SIGVTALRM 26 | |
| 133 | #define SIGPROF 27 | |
| 134 | #define SIGWINCH 28 | |
| 135 | #define SIGIO 29 | |
| 136 | #define SIGPOLL 29 | |
| 137 | #define SIGPWR 30 | |
| 138 | #define SIGSYS 31 | |
| 139 | #define SIGUNUSED SIGSYS | |
| 140 | ||
| 141 | #define _NSIG 65 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/stat.h deleted-25| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | /* copied from kernel definition, but with padding replaced | |
| 2 | * by the corresponding correctly-sized userspace types. */ | |
| 3 | ||
| 4 | struct stat { | |
| 5 | 	dev_t st_dev; | |
| 6 | 	int __st_dev_padding; | |
| 7 | 	long __st_ino_truncated; | |
| 8 | 	mode_t st_mode; | |
| 9 | 	nlink_t st_nlink; | |
| 10 | 	uid_t st_uid; | |
| 11 | 	gid_t st_gid; | |
| 12 | 	dev_t st_rdev; | |
| 13 | 	int __st_rdev_padding; | |
| 14 | 	off_t st_size; | |
| 15 | 	blksize_t st_blksize; | |
| 16 | 	blkcnt_t st_blocks; | |
| 17 | 	struct { | |
| 18 | 		long tv_sec; | |
| 19 | 		long tv_nsec; | |
| 20 | 	} __st_atim32, __st_mtim32, __st_ctim32; | |
| 21 | 	ino_t st_ino; | |
| 22 | 	struct timespec st_atim; | |
| 23 | 	struct timespec st_mtim; | |
| 24 | 	struct timespec st_ctim; | |
| 25 | }; | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/stdint.h deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | typedef int32_t int_fast16_t; | |
| 2 | typedef int32_t int_fast32_t; | |
| 3 | typedef uint32_t uint_fast16_t; | |
| 4 | typedef uint32_t uint_fast32_t; | |
| 5 | ||
| 6 | #define INT_FAST16_MIN INT32_MIN | |
| 7 | #define INT_FAST32_MIN INT32_MIN | |
| 8 | ||
| 9 | #define INT_FAST16_MAX INT32_MAX | |
| 10 | #define INT_FAST32_MAX INT32_MAX | |
| 11 | ||
| 12 | #define UINT_FAST16_MAX UINT32_MAX | |
| 13 | #define UINT_FAST32_MAX UINT32_MAX | |
| 14 | ||
| 15 | #define INTPTR_MIN INT32_MIN | |
| 16 | #define INTPTR_MAX INT32_MAX | |
| 17 | #define UINTPTR_MAX UINT32_MAX | |
| 18 | #define PTRDIFF_MIN INT32_MIN | |
| 19 | #define PTRDIFF_MAX INT32_MAX | |
| 20 | #define SIZE_MAX UINT32_MAX | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/syscall.h deleted-875| ... | ... | @@ -1,875 +0,0 @@ |
| 1 | #define __NR_restart_syscall 0 | |
| 2 | #define __NR_exit		 1 | |
| 3 | #define __NR_fork		 2 | |
| 4 | #define __NR_read		 3 | |
| 5 | #define __NR_write		 4 | |
| 6 | #define __NR_open		 5 | |
| 7 | #define __NR_close		 6 | |
| 8 | #define __NR_waitpid		 7 | |
| 9 | #define __NR_creat		 8 | |
| 10 | #define __NR_link		 9 | |
| 11 | #define __NR_unlink		 10 | |
| 12 | #define __NR_execve		 11 | |
| 13 | #define __NR_chdir		 12 | |
| 14 | #define __NR_time		 13 | |
| 15 | #define __NR_mknod		 14 | |
| 16 | #define __NR_chmod		 15 | |
| 17 | #define __NR_lchown		 16 | |
| 18 | #define __NR_break		 17 | |
| 19 | #define __NR_oldstat		 18 | |
| 20 | #define __NR_lseek		 19 | |
| 21 | #define __NR_getpid		 20 | |
| 22 | #define __NR_mount		 21 | |
| 23 | #define __NR_umount		 22 | |
| 24 | #define __NR_setuid		 23 | |
| 25 | #define __NR_getuid		 24 | |
| 26 | #define __NR_stime		 25 | |
| 27 | #define __NR_ptrace		 26 | |
| 28 | #define __NR_alarm		 27 | |
| 29 | #define __NR_oldfstat		 28 | |
| 30 | #define __NR_pause		 29 | |
| 31 | #define __NR_utime		 30 | |
| 32 | #define __NR_stty		 31 | |
| 33 | #define __NR_gtty		 32 | |
| 34 | #define __NR_access		 33 | |
| 35 | #define __NR_nice		 34 | |
| 36 | #define __NR_ftime		 35 | |
| 37 | #define __NR_sync		 36 | |
| 38 | #define __NR_kill		 37 | |
| 39 | #define __NR_rename		 38 | |
| 40 | #define __NR_mkdir		 39 | |
| 41 | #define __NR_rmdir		 40 | |
| 42 | #define __NR_dup		 41 | |
| 43 | #define __NR_pipe		 42 | |
| 44 | #define __NR_times		 43 | |
| 45 | #define __NR_prof		 44 | |
| 46 | #define __NR_brk		 45 | |
| 47 | #define __NR_setgid		 46 | |
| 48 | #define __NR_getgid		 47 | |
| 49 | #define __NR_signal		 48 | |
| 50 | #define __NR_geteuid		 49 | |
| 51 | #define __NR_getegid		 50 | |
| 52 | #define __NR_acct		 51 | |
| 53 | #define __NR_umount2		 52 | |
| 54 | #define __NR_lock		 53 | |
| 55 | #define __NR_ioctl		 54 | |
| 56 | #define __NR_fcntl		 55 | |
| 57 | #define __NR_mpx		 56 | |
| 58 | #define __NR_setpgid		 57 | |
| 59 | #define __NR_ulimit		 58 | |
| 60 | #define __NR_oldolduname	 59 | |
| 61 | #define __NR_umask		 60 | |
| 62 | #define __NR_chroot		 61 | |
| 63 | #define __NR_ustat		 62 | |
| 64 | #define __NR_dup2		 63 | |
| 65 | #define __NR_getppid		 64 | |
| 66 | #define __NR_getpgrp		 65 | |
| 67 | #define __NR_setsid		 66 | |
| 68 | #define __NR_sigaction		 67 | |
| 69 | #define __NR_sgetmask		 68 | |
| 70 | #define __NR_ssetmask		 69 | |
| 71 | #define __NR_setreuid		 70 | |
| 72 | #define __NR_setregid		 71 | |
| 73 | #define __NR_sigsuspend		 72 | |
| 74 | #define __NR_sigpending		 73 | |
| 75 | #define __NR_sethostname	 74 | |
| 76 | #define __NR_setrlimit		 75 | |
| 77 | #define __NR_getrlimit		 76 /* Back compatible 2Gig limited rlimit */ | |
| 78 | #define __NR_getrusage		 77 | |
| 79 | #define __NR_gettimeofday_time32	 78 | |
| 80 | #define __NR_settimeofday_time32	 79 | |
| 81 | #define __NR_getgroups		 80 | |
| 82 | #define __NR_setgroups		 81 | |
| 83 | #define __NR_select		 82 | |
| 84 | #define __NR_symlink		 83 | |
| 85 | #define __NR_oldlstat		 84 | |
| 86 | #define __NR_readlink		 85 | |
| 87 | #define __NR_uselib		 86 | |
| 88 | #define __NR_swapon		 87 | |
| 89 | #define __NR_reboot		 88 | |
| 90 | #define __NR_readdir		 89 | |
| 91 | #define __NR_mmap		 90 | |
| 92 | #define __NR_munmap		 91 | |
| 93 | #define __NR_truncate		 92 | |
| 94 | #define __NR_ftruncate		 93 | |
| 95 | #define __NR_fchmod		 94 | |
| 96 | #define __NR_fchown		 95 | |
| 97 | #define __NR_getpriority	 96 | |
| 98 | #define __NR_setpriority	 97 | |
| 99 | #define __NR_profil		 98 | |
| 100 | #define __NR_statfs		99 | |
| 101 | #define __NR_fstatfs		100 | |
| 102 | #define __NR_ioperm		101 | |
| 103 | #define __NR_socketcall		102 | |
| 104 | #define __NR_syslog		103 | |
| 105 | #define __NR_setitimer		104 | |
| 106 | #define __NR_getitimer		105 | |
| 107 | #define __NR_stat		106 | |
| 108 | #define __NR_lstat		107 | |
| 109 | #define __NR_fstat		108 | |
| 110 | #define __NR_olduname		109 | |
| 111 | #define __NR_iopl		110 | |
| 112 | #define __NR_vhangup		111 | |
| 113 | #define __NR_idle		112 | |
| 114 | #define __NR_vm86old		113 | |
| 115 | #define __NR_wait4		114 | |
| 116 | #define __NR_swapoff		115 | |
| 117 | #define __NR_sysinfo		116 | |
| 118 | #define __NR_ipc		117 | |
| 119 | #define __NR_fsync		118 | |
| 120 | #define __NR_sigreturn		119 | |
| 121 | #define __NR_clone		120 | |
| 122 | #define __NR_setdomainname	121 | |
| 123 | #define __NR_uname		122 | |
| 124 | #define __NR_modify_ldt		123 | |
| 125 | #define __NR_adjtimex		124 | |
| 126 | #define __NR_mprotect		125 | |
| 127 | #define __NR_sigprocmask	126 | |
| 128 | #define __NR_create_module	127 | |
| 129 | #define __NR_init_module	128 | |
| 130 | #define __NR_delete_module	129 | |
| 131 | #define __NR_get_kernel_syms	130 | |
| 132 | #define __NR_quotactl		131 | |
| 133 | #define __NR_getpgid		132 | |
| 134 | #define __NR_fchdir		133 | |
| 135 | #define __NR_bdflush		134 | |
| 136 | #define __NR_sysfs		135 | |
| 137 | #define __NR_personality	136 | |
| 138 | #define __NR_afs_syscall	137 | |
| 139 | #define __NR_setfsuid		138 | |
| 140 | #define __NR_setfsgid		139 | |
| 141 | #define __NR__llseek		140 | |
| 142 | #define __NR_getdents		141 | |
| 143 | #define __NR__newselect		142 | |
| 144 | #define __NR_flock		143 | |
| 145 | #define __NR_msync		144 | |
| 146 | #define __NR_readv		145 | |
| 147 | #define __NR_writev		146 | |
| 148 | #define __NR_getsid		147 | |
| 149 | #define __NR_fdatasync		148 | |
| 150 | #define __NR__sysctl		149 | |
| 151 | #define __NR_mlock		150 | |
| 152 | #define __NR_munlock		151 | |
| 153 | #define __NR_mlockall		152 | |
| 154 | #define __NR_munlockall		153 | |
| 155 | #define __NR_sched_setparam		154 | |
| 156 | #define __NR_sched_getparam		155 | |
| 157 | #define __NR_sched_setscheduler		156 | |
| 158 | #define __NR_sched_getscheduler		157 | |
| 159 | #define __NR_sched_yield		158 | |
| 160 | #define __NR_sched_get_priority_max	159 | |
| 161 | #define __NR_sched_get_priority_min	160 | |
| 162 | #define __NR_sched_rr_get_interval	161 | |
| 163 | #define __NR_nanosleep		162 | |
| 164 | #define __NR_mremap		163 | |
| 165 | #define __NR_setresuid		164 | |
| 166 | #define __NR_getresuid		165 | |
| 167 | #define __NR_vm86		166 | |
| 168 | #define __NR_query_module	167 | |
| 169 | #define __NR_poll		168 | |
| 170 | #define __NR_nfsservctl		169 | |
| 171 | #define __NR_setresgid		170 | |
| 172 | #define __NR_getresgid		171 | |
| 173 | #define __NR_prctl 172 | |
| 174 | #define __NR_rt_sigreturn	173 | |
| 175 | #define __NR_rt_sigaction	174 | |
| 176 | #define __NR_rt_sigprocmask	175 | |
| 177 | #define __NR_rt_sigpending	176 | |
| 178 | #define __NR_rt_sigtimedwait	177 | |
| 179 | #define __NR_rt_sigqueueinfo	178 | |
| 180 | #define __NR_rt_sigsuspend	179 | |
| 181 | #define __NR_pread64		180 | |
| 182 | #define __NR_pwrite64		181 | |
| 183 | #define __NR_chown		182 | |
| 184 | #define __NR_getcwd		183 | |
| 185 | #define __NR_capget		184 | |
| 186 | #define __NR_capset		185 | |
| 187 | #define __NR_sigaltstack	186 | |
| 188 | #define __NR_sendfile		187 | |
| 189 | #define __NR_getpmsg		188 | |
| 190 | #define __NR_putpmsg		189 | |
| 191 | #define __NR_vfork		190 | |
| 192 | #define __NR_ugetrlimit		191 | |
| 193 | #define __NR_mmap2		192 | |
| 194 | #define __NR_truncate64		193 | |
| 195 | #define __NR_ftruncate64	194 | |
| 196 | #define __NR_stat64		195 | |
| 197 | #define __NR_lstat64		196 | |
| 198 | #define __NR_fstat64		197 | |
| 199 | #define __NR_lchown32		198 | |
| 200 | #define __NR_getuid32		199 | |
| 201 | #define __NR_getgid32		200 | |
| 202 | #define __NR_geteuid32		201 | |
| 203 | #define __NR_getegid32		202 | |
| 204 | #define __NR_setreuid32		203 | |
| 205 | #define __NR_setregid32		204 | |
| 206 | #define __NR_getgroups32	205 | |
| 207 | #define __NR_setgroups32	206 | |
| 208 | #define __NR_fchown32		207 | |
| 209 | #define __NR_setresuid32	208 | |
| 210 | #define __NR_getresuid32	209 | |
| 211 | #define __NR_setresgid32	210 | |
| 212 | #define __NR_getresgid32	211 | |
| 213 | #define __NR_chown32		212 | |
| 214 | #define __NR_setuid32		213 | |
| 215 | #define __NR_setgid32		214 | |
| 216 | #define __NR_setfsuid32		215 | |
| 217 | #define __NR_setfsgid32		216 | |
| 218 | #define __NR_pivot_root		217 | |
| 219 | #define __NR_mincore		218 | |
| 220 | #define __NR_madvise		219 | |
| 221 | #define __NR_getdents64		220 | |
| 222 | #define __NR_fcntl64		221 | |
| 223 | /* 223 is unused */ | |
| 224 | #define __NR_gettid		224 | |
| 225 | #define __NR_readahead		225 | |
| 226 | #define __NR_setxattr		226 | |
| 227 | #define __NR_lsetxattr		227 | |
| 228 | #define __NR_fsetxattr		228 | |
| 229 | #define __NR_getxattr		229 | |
| 230 | #define __NR_lgetxattr		230 | |
| 231 | #define __NR_fgetxattr		231 | |
| 232 | #define __NR_listxattr		232 | |
| 233 | #define __NR_llistxattr		233 | |
| 234 | #define __NR_flistxattr		234 | |
| 235 | #define __NR_removexattr	235 | |
| 236 | #define __NR_lremovexattr	236 | |
| 237 | #define __NR_fremovexattr	237 | |
| 238 | #define __NR_tkill		238 | |
| 239 | #define __NR_sendfile64		239 | |
| 240 | #define __NR_futex		240 | |
| 241 | #define __NR_sched_setaffinity	241 | |
| 242 | #define __NR_sched_getaffinity	242 | |
| 243 | #define __NR_set_thread_area	243 | |
| 244 | #define __NR_get_thread_area	244 | |
| 245 | #define __NR_io_setup		245 | |
| 246 | #define __NR_io_destroy		246 | |
| 247 | #define __NR_io_getevents	247 | |
| 248 | #define __NR_io_submit		248 | |
| 249 | #define __NR_io_cancel		249 | |
| 250 | #define __NR_fadvise64		250 | |
| 251 | /* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ | |
| 252 | #define __NR_exit_group		252 | |
| 253 | #define __NR_lookup_dcookie	253 | |
| 254 | #define __NR_epoll_create	254 | |
| 255 | #define __NR_epoll_ctl		255 | |
| 256 | #define __NR_epoll_wait		256 | |
| 257 | #define __NR_remap_file_pages	257 | |
| 258 | #define __NR_set_tid_address	258 | |
| 259 | #define __NR_timer_create	259 | |
| 260 | #define __NR_timer_settime32	(__NR_timer_create+1) | |
| 261 | #define __NR_timer_gettime32	(__NR_timer_create+2) | |
| 262 | #define __NR_timer_getoverrun	(__NR_timer_create+3) | |
| 263 | #define __NR_timer_delete	(__NR_timer_create+4) | |
| 264 | #define __NR_clock_settime32	(__NR_timer_create+5) | |
| 265 | #define __NR_clock_gettime32	(__NR_timer_create+6) | |
| 266 | #define __NR_clock_getres_time32	(__NR_timer_create+7) | |
| 267 | #define __NR_clock_nanosleep_time32	(__NR_timer_create+8) | |
| 268 | #define __NR_statfs64		268 | |
| 269 | #define __NR_fstatfs64		269 | |
| 270 | #define __NR_tgkill		270 | |
| 271 | #define __NR_utimes		271 | |
| 272 | #define __NR_fadvise64_64	272 | |
| 273 | #define __NR_vserver		273 | |
| 274 | #define __NR_mbind		274 | |
| 275 | #define __NR_get_mempolicy	275 | |
| 276 | #define __NR_set_mempolicy	276 | |
| 277 | #define __NR_mq_open 		277 | |
| 278 | #define __NR_mq_unlink		(__NR_mq_open+1) | |
| 279 | #define __NR_mq_timedsend	(__NR_mq_open+2) | |
| 280 | #define __NR_mq_timedreceive	(__NR_mq_open+3) | |
| 281 | #define __NR_mq_notify		(__NR_mq_open+4) | |
| 282 | #define __NR_mq_getsetattr	(__NR_mq_open+5) | |
| 283 | #define __NR_kexec_load		283 | |
| 284 | #define __NR_waitid		284 | |
| 285 | /* #define __NR_sys_setaltroot	285 */ | |
| 286 | #define __NR_add_key		286 | |
| 287 | #define __NR_request_key	287 | |
| 288 | #define __NR_keyctl		288 | |
| 289 | #define __NR_ioprio_set		289 | |
| 290 | #define __NR_ioprio_get		290 | |
| 291 | #define __NR_inotify_init	291 | |
| 292 | #define __NR_inotify_add_watch	292 | |
| 293 | #define __NR_inotify_rm_watch	293 | |
| 294 | #define __NR_migrate_pages	294 | |
| 295 | #define __NR_openat		295 | |
| 296 | #define __NR_mkdirat		296 | |
| 297 | #define __NR_mknodat		297 | |
| 298 | #define __NR_fchownat		298 | |
| 299 | #define __NR_futimesat		299 | |
| 300 | #define __NR_fstatat64		300 | |
| 301 | #define __NR_unlinkat		301 | |
| 302 | #define __NR_renameat		302 | |
| 303 | #define __NR_linkat		303 | |
| 304 | #define __NR_symlinkat		304 | |
| 305 | #define __NR_readlinkat		305 | |
| 306 | #define __NR_fchmodat		306 | |
| 307 | #define __NR_faccessat		307 | |
| 308 | #define __NR_pselect6		308 | |
| 309 | #define __NR_ppoll		309 | |
| 310 | #define __NR_unshare		310 | |
| 311 | #define __NR_set_robust_list	311 | |
| 312 | #define __NR_get_robust_list	312 | |
| 313 | #define __NR_splice		313 | |
| 314 | #define __NR_sync_file_range	314 | |
| 315 | #define __NR_tee		315 | |
| 316 | #define __NR_vmsplice		316 | |
| 317 | #define __NR_move_pages		317 | |
| 318 | #define __NR_getcpu		318 | |
| 319 | #define __NR_epoll_pwait	319 | |
| 320 | #define __NR_utimensat		320 | |
| 321 | #define __NR_signalfd		321 | |
| 322 | #define __NR_timerfd_create	322 | |
| 323 | #define __NR_eventfd		323 | |
| 324 | #define __NR_fallocate		324 | |
| 325 | #define __NR_timerfd_settime32	325 | |
| 326 | #define __NR_timerfd_gettime32	326 | |
| 327 | #define __NR_signalfd4		327 | |
| 328 | #define __NR_eventfd2		328 | |
| 329 | #define __NR_epoll_create1	329 | |
| 330 | #define __NR_dup3		330 | |
| 331 | #define __NR_pipe2		331 | |
| 332 | #define __NR_inotify_init1	332 | |
| 333 | #define __NR_preadv		333 | |
| 334 | #define __NR_pwritev		334 | |
| 335 | #define __NR_rt_tgsigqueueinfo	335 | |
| 336 | #define __NR_perf_event_open	336 | |
| 337 | #define __NR_recvmmsg		337 | |
| 338 | #define __NR_fanotify_init	338 | |
| 339 | #define __NR_fanotify_mark	339 | |
| 340 | #define __NR_prlimit64		340 | |
| 341 | #define __NR_name_to_handle_at	341 | |
| 342 | #define __NR_open_by_handle_at	342 | |
| 343 | #define __NR_clock_adjtime	343 | |
| 344 | #define __NR_syncfs		344 | |
| 345 | #define __NR_sendmmsg		345 | |
| 346 | #define __NR_setns		346 | |
| 347 | #define __NR_process_vm_readv	347 | |
| 348 | #define __NR_process_vm_writev	348 | |
| 349 | #define __NR_kcmp		349 | |
| 350 | #define __NR_finit_module	350 | |
| 351 | #define __NR_sched_setattr	351 | |
| 352 | #define __NR_sched_getattr	352 | |
| 353 | #define __NR_renameat2		353 | |
| 354 | #define __NR_seccomp		354 | |
| 355 | #define __NR_getrandom		355 | |
| 356 | #define __NR_memfd_create	356 | |
| 357 | #define __NR_bpf		357 | |
| 358 | #define __NR_execveat		358 | |
| 359 | #define __NR_socket		359 | |
| 360 | #define __NR_socketpair		360 | |
| 361 | #define __NR_bind		361 | |
| 362 | #define __NR_connect		362 | |
| 363 | #define __NR_listen		363 | |
| 364 | #define __NR_accept4		364 | |
| 365 | #define __NR_getsockopt		365 | |
| 366 | #define __NR_setsockopt		366 | |
| 367 | #define __NR_getsockname	367 | |
| 368 | #define __NR_getpeername	368 | |
| 369 | #define __NR_sendto		369 | |
| 370 | #define __NR_sendmsg		370 | |
| 371 | #define __NR_recvfrom		371 | |
| 372 | #define __NR_recvmsg		372 | |
| 373 | #define __NR_shutdown		373 | |
| 374 | #define __NR_userfaultfd	374 | |
| 375 | #define __NR_membarrier		375 | |
| 376 | #define __NR_mlock2		376 | |
| 377 | #define __NR_copy_file_range	377 | |
| 378 | #define __NR_preadv2		378 | |
| 379 | #define __NR_pwritev2		379 | |
| 380 | #define __NR_pkey_mprotect	380 | |
| 381 | #define __NR_pkey_alloc		381 | |
| 382 | #define __NR_pkey_free		382 | |
| 383 | #define __NR_statx		383 | |
| 384 | #define __NR_arch_prctl		384 | |
| 385 | #define __NR_io_pgetevents	385 | |
| 386 | #define __NR_rseq		386 | |
| 387 | #define __NR_semget		393 | |
| 388 | #define __NR_semctl		394 | |
| 389 | #define __NR_shmget		395 | |
| 390 | #define __NR_shmctl		396 | |
| 391 | #define __NR_shmat		397 | |
| 392 | #define __NR_shmdt		398 | |
| 393 | #define __NR_msgget		399 | |
| 394 | #define __NR_msgsnd		400 | |
| 395 | #define __NR_msgrcv		401 | |
| 396 | #define __NR_msgctl		402 | |
| 397 | #define __NR_clock_gettime64	403 | |
| 398 | #define __NR_clock_settime64	404 | |
| 399 | #define __NR_clock_adjtime64	405 | |
| 400 | #define __NR_clock_getres_time64 406 | |
| 401 | #define __NR_clock_nanosleep_time64 407 | |
| 402 | #define __NR_timer_gettime64	408 | |
| 403 | #define __NR_timer_settime64	409 | |
| 404 | #define __NR_timerfd_gettime64	410 | |
| 405 | #define __NR_timerfd_settime64	411 | |
| 406 | #define __NR_utimensat_time64	412 | |
| 407 | #define __NR_pselect6_time64	413 | |
| 408 | #define __NR_ppoll_time64	414 | |
| 409 | #define __NR_io_pgetevents_time64 416 | |
| 410 | #define __NR_recvmmsg_time64	417 | |
| 411 | #define __NR_mq_timedsend_time64 418 | |
| 412 | #define __NR_mq_timedreceive_time64 419 | |
| 413 | #define __NR_semtimedop_time64	420 | |
| 414 | #define __NR_rt_sigtimedwait_time64 421 | |
| 415 | #define __NR_futex_time64	422 | |
| 416 | #define __NR_sched_rr_get_interval_time64 423 | |
| 417 | #define __NR_pidfd_send_signal	424 | |
| 418 | #define __NR_io_uring_setup	425 | |
| 419 | #define __NR_io_uring_enter	426 | |
| 420 | #define __NR_io_uring_register	427 | |
| 421 | #define __NR_open_tree		428 | |
| 422 | #define __NR_move_mount		429 | |
| 423 | #define __NR_fsopen		430 | |
| 424 | #define __NR_fsconfig		431 | |
| 425 | #define __NR_fsmount		432 | |
| 426 | #define __NR_fspick		433 | |
| 427 | #define __NR_pidfd_open		434 | |
| 428 | #define __NR_clone3		435 | |
| 429 | #define __NR_close_range	436 | |
| 430 | #define __NR_openat2		437 | |
| 431 | #define __NR_pidfd_getfd	438 | |
| 432 | #define __NR_faccessat2		439 | |
| 433 | #define __NR_process_madvise	440 | |
| 434 | #define __NR_epoll_pwait2	441 | |
| 435 | #define __NR_mount_setattr	442 | |
| 436 | #define __NR_landlock_create_ruleset	444 | |
| 437 | #define __NR_landlock_add_rule	445 | |
| 438 | #define __NR_landlock_restrict_self	446 | |
| 439 | ||
| 440 | #define SYS_restart_syscall 0 | |
| 441 | #define SYS_exit		 1 | |
| 442 | #define SYS_fork		 2 | |
| 443 | #define SYS_read		 3 | |
| 444 | #define SYS_write		 4 | |
| 445 | #define SYS_open		 5 | |
| 446 | #define SYS_close		 6 | |
| 447 | #define SYS_waitpid		 7 | |
| 448 | #define SYS_creat		 8 | |
| 449 | #define SYS_link		 9 | |
| 450 | #define SYS_unlink		 10 | |
| 451 | #define SYS_execve		 11 | |
| 452 | #define SYS_chdir		 12 | |
| 453 | #define SYS_time		 13 | |
| 454 | #define SYS_mknod		 14 | |
| 455 | #define SYS_chmod		 15 | |
| 456 | #define SYS_lchown		 16 | |
| 457 | #define SYS_break		 17 | |
| 458 | #define SYS_oldstat		 18 | |
| 459 | #define SYS_lseek		 19 | |
| 460 | #define SYS_getpid		 20 | |
| 461 | #define SYS_mount		 21 | |
| 462 | #define SYS_umount		 22 | |
| 463 | #define SYS_setuid		 23 | |
| 464 | #define SYS_getuid		 24 | |
| 465 | #define SYS_stime		 25 | |
| 466 | #define SYS_ptrace		 26 | |
| 467 | #define SYS_alarm		 27 | |
| 468 | #define SYS_oldfstat		 28 | |
| 469 | #define SYS_pause		 29 | |
| 470 | #define SYS_utime		 30 | |
| 471 | #define SYS_stty		 31 | |
| 472 | #define SYS_gtty		 32 | |
| 473 | #define SYS_access		 33 | |
| 474 | #define SYS_nice		 34 | |
| 475 | #define SYS_ftime		 35 | |
| 476 | #define SYS_sync		 36 | |
| 477 | #define SYS_kill		 37 | |
| 478 | #define SYS_rename		 38 | |
| 479 | #define SYS_mkdir		 39 | |
| 480 | #define SYS_rmdir		 40 | |
| 481 | #define SYS_dup		 41 | |
| 482 | #define SYS_pipe		 42 | |
| 483 | #define SYS_times		 43 | |
| 484 | #define SYS_prof		 44 | |
| 485 | #define SYS_brk		 45 | |
| 486 | #define SYS_setgid		 46 | |
| 487 | #define SYS_getgid		 47 | |
| 488 | #define SYS_signal		 48 | |
| 489 | #define SYS_geteuid		 49 | |
| 490 | #define SYS_getegid		 50 | |
| 491 | #define SYS_acct		 51 | |
| 492 | #define SYS_umount2		 52 | |
| 493 | #define SYS_lock		 53 | |
| 494 | #define SYS_ioctl		 54 | |
| 495 | #define SYS_fcntl		 55 | |
| 496 | #define SYS_mpx		 56 | |
| 497 | #define SYS_setpgid		 57 | |
| 498 | #define SYS_ulimit		 58 | |
| 499 | #define SYS_oldolduname	 59 | |
| 500 | #define SYS_umask		 60 | |
| 501 | #define SYS_chroot		 61 | |
| 502 | #define SYS_ustat		 62 | |
| 503 | #define SYS_dup2		 63 | |
| 504 | #define SYS_getppid		 64 | |
| 505 | #define SYS_getpgrp		 65 | |
| 506 | #define SYS_setsid		 66 | |
| 507 | #define SYS_sigaction		 67 | |
| 508 | #define SYS_sgetmask		 68 | |
| 509 | #define SYS_ssetmask		 69 | |
| 510 | #define SYS_setreuid		 70 | |
| 511 | #define SYS_setregid		 71 | |
| 512 | #define SYS_sigsuspend		 72 | |
| 513 | #define SYS_sigpending		 73 | |
| 514 | #define SYS_sethostname	 74 | |
| 515 | #define SYS_setrlimit		 75 | |
| 516 | #define SYS_getrlimit		 76 /* Back compatible 2Gig limited rlimit */ | |
| 517 | #define SYS_getrusage		 77 | |
| 518 | #define SYS_gettimeofday_time32	 78 | |
| 519 | #define SYS_settimeofday_time32	 79 | |
| 520 | #define SYS_getgroups		 80 | |
| 521 | #define SYS_setgroups		 81 | |
| 522 | #define SYS_select		 82 | |
| 523 | #define SYS_symlink		 83 | |
| 524 | #define SYS_oldlstat		 84 | |
| 525 | #define SYS_readlink		 85 | |
| 526 | #define SYS_uselib		 86 | |
| 527 | #define SYS_swapon		 87 | |
| 528 | #define SYS_reboot		 88 | |
| 529 | #define SYS_readdir		 89 | |
| 530 | #define SYS_mmap		 90 | |
| 531 | #define SYS_munmap		 91 | |
| 532 | #define SYS_truncate		 92 | |
| 533 | #define SYS_ftruncate		 93 | |
| 534 | #define SYS_fchmod		 94 | |
| 535 | #define SYS_fchown		 95 | |
| 536 | #define SYS_getpriority	 96 | |
| 537 | #define SYS_setpriority	 97 | |
| 538 | #define SYS_profil		 98 | |
| 539 | #define SYS_statfs		99 | |
| 540 | #define SYS_fstatfs		100 | |
| 541 | #define SYS_ioperm		101 | |
| 542 | #define SYS_socketcall		102 | |
| 543 | #define SYS_syslog		103 | |
| 544 | #define SYS_setitimer		104 | |
| 545 | #define SYS_getitimer		105 | |
| 546 | #define SYS_stat		106 | |
| 547 | #define SYS_lstat		107 | |
| 548 | #define SYS_fstat		108 | |
| 549 | #define SYS_olduname		109 | |
| 550 | #define SYS_iopl		110 | |
| 551 | #define SYS_vhangup		111 | |
| 552 | #define SYS_idle		112 | |
| 553 | #define SYS_vm86old		113 | |
| 554 | #define SYS_wait4		114 | |
| 555 | #define SYS_swapoff		115 | |
| 556 | #define SYS_sysinfo		116 | |
| 557 | #define SYS_ipc		117 | |
| 558 | #define SYS_fsync		118 | |
| 559 | #define SYS_sigreturn		119 | |
| 560 | #define SYS_clone		120 | |
| 561 | #define SYS_setdomainname	121 | |
| 562 | #define SYS_uname		122 | |
| 563 | #define SYS_modify_ldt		123 | |
| 564 | #define SYS_adjtimex		124 | |
| 565 | #define SYS_mprotect		125 | |
| 566 | #define SYS_sigprocmask	126 | |
| 567 | #define SYS_create_module	127 | |
| 568 | #define SYS_init_module	128 | |
| 569 | #define SYS_delete_module	129 | |
| 570 | #define SYS_get_kernel_syms	130 | |
| 571 | #define SYS_quotactl		131 | |
| 572 | #define SYS_getpgid		132 | |
| 573 | #define SYS_fchdir		133 | |
| 574 | #define SYS_bdflush		134 | |
| 575 | #define SYS_sysfs		135 | |
| 576 | #define SYS_personality	136 | |
| 577 | #define SYS_afs_syscall	137 | |
| 578 | #define SYS_setfsuid		138 | |
| 579 | #define SYS_setfsgid		139 | |
| 580 | #define SYS__llseek		140 | |
| 581 | #define SYS_getdents		141 | |
| 582 | #define SYS__newselect		142 | |
| 583 | #define SYS_flock		143 | |
| 584 | #define SYS_msync		144 | |
| 585 | #define SYS_readv		145 | |
| 586 | #define SYS_writev		146 | |
| 587 | #define SYS_getsid		147 | |
| 588 | #define SYS_fdatasync		148 | |
| 589 | #define SYS__sysctl		149 | |
| 590 | #define SYS_mlock		150 | |
| 591 | #define SYS_munlock		151 | |
| 592 | #define SYS_mlockall		152 | |
| 593 | #define SYS_munlockall		153 | |
| 594 | #define SYS_sched_setparam		154 | |
| 595 | #define SYS_sched_getparam		155 | |
| 596 | #define SYS_sched_setscheduler		156 | |
| 597 | #define SYS_sched_getscheduler		157 | |
| 598 | #define SYS_sched_yield		158 | |
| 599 | #define SYS_sched_get_priority_max	159 | |
| 600 | #define SYS_sched_get_priority_min	160 | |
| 601 | #define SYS_sched_rr_get_interval	161 | |
| 602 | #define SYS_nanosleep		162 | |
| 603 | #define SYS_mremap		163 | |
| 604 | #define SYS_setresuid		164 | |
| 605 | #define SYS_getresuid		165 | |
| 606 | #define SYS_vm86		166 | |
| 607 | #define SYS_query_module	167 | |
| 608 | #define SYS_poll		168 | |
| 609 | #define SYS_nfsservctl		169 | |
| 610 | #define SYS_setresgid		170 | |
| 611 | #define SYS_getresgid		171 | |
| 612 | #define SYS_prctl 172 | |
| 613 | #define SYS_rt_sigreturn	173 | |
| 614 | #define SYS_rt_sigaction	174 | |
| 615 | #define SYS_rt_sigprocmask	175 | |
| 616 | #define SYS_rt_sigpending	176 | |
| 617 | #define SYS_rt_sigtimedwait	177 | |
| 618 | #define SYS_rt_sigqueueinfo	178 | |
| 619 | #define SYS_rt_sigsuspend	179 | |
| 620 | #define SYS_pread64		180 | |
| 621 | #define SYS_pwrite64		181 | |
| 622 | #define SYS_chown		182 | |
| 623 | #define SYS_getcwd		183 | |
| 624 | #define SYS_capget		184 | |
| 625 | #define SYS_capset		185 | |
| 626 | #define SYS_sigaltstack	186 | |
| 627 | #define SYS_sendfile		187 | |
| 628 | #define SYS_getpmsg		188 | |
| 629 | #define SYS_putpmsg		189 | |
| 630 | #define SYS_vfork		190 | |
| 631 | #define SYS_ugetrlimit		191 | |
| 632 | #define SYS_mmap2		192 | |
| 633 | #define SYS_truncate64		193 | |
| 634 | #define SYS_ftruncate64	194 | |
| 635 | #define SYS_stat64		195 | |
| 636 | #define SYS_lstat64		196 | |
| 637 | #define SYS_fstat64		197 | |
| 638 | #define SYS_lchown32		198 | |
| 639 | #define SYS_getuid32		199 | |
| 640 | #define SYS_getgid32		200 | |
| 641 | #define SYS_geteuid32		201 | |
| 642 | #define SYS_getegid32		202 | |
| 643 | #define SYS_setreuid32		203 | |
| 644 | #define SYS_setregid32		204 | |
| 645 | #define SYS_getgroups32	205 | |
| 646 | #define SYS_setgroups32	206 | |
| 647 | #define SYS_fchown32		207 | |
| 648 | #define SYS_setresuid32	208 | |
| 649 | #define SYS_getresuid32	209 | |
| 650 | #define SYS_setresgid32	210 | |
| 651 | #define SYS_getresgid32	211 | |
| 652 | #define SYS_chown32		212 | |
| 653 | #define SYS_setuid32		213 | |
| 654 | #define SYS_setgid32		214 | |
| 655 | #define SYS_setfsuid32		215 | |
| 656 | #define SYS_setfsgid32		216 | |
| 657 | #define SYS_pivot_root		217 | |
| 658 | #define SYS_mincore		218 | |
| 659 | #define SYS_madvise		219 | |
| 660 | #define SYS_getdents64		220 | |
| 661 | #define SYS_fcntl64		221 | |
| 662 | #define SYS_gettid		224 | |
| 663 | #define SYS_readahead		225 | |
| 664 | #define SYS_setxattr		226 | |
| 665 | #define SYS_lsetxattr		227 | |
| 666 | #define SYS_fsetxattr		228 | |
| 667 | #define SYS_getxattr		229 | |
| 668 | #define SYS_lgetxattr		230 | |
| 669 | #define SYS_fgetxattr		231 | |
| 670 | #define SYS_listxattr		232 | |
| 671 | #define SYS_llistxattr		233 | |
| 672 | #define SYS_flistxattr		234 | |
| 673 | #define SYS_removexattr	235 | |
| 674 | #define SYS_lremovexattr	236 | |
| 675 | #define SYS_fremovexattr	237 | |
| 676 | #define SYS_tkill		238 | |
| 677 | #define SYS_sendfile64		239 | |
| 678 | #define SYS_futex		240 | |
| 679 | #define SYS_sched_setaffinity	241 | |
| 680 | #define SYS_sched_getaffinity	242 | |
| 681 | #define SYS_set_thread_area	243 | |
| 682 | #define SYS_get_thread_area	244 | |
| 683 | #define SYS_io_setup		245 | |
| 684 | #define SYS_io_destroy		246 | |
| 685 | #define SYS_io_getevents	247 | |
| 686 | #define SYS_io_submit		248 | |
| 687 | #define SYS_io_cancel		249 | |
| 688 | #define SYS_fadvise64		250 | |
| 689 | #define SYS_exit_group		252 | |
| 690 | #define SYS_lookup_dcookie	253 | |
| 691 | #define SYS_epoll_create	254 | |
| 692 | #define SYS_epoll_ctl		255 | |
| 693 | #define SYS_epoll_wait		256 | |
| 694 | #define SYS_remap_file_pages	257 | |
| 695 | #define SYS_set_tid_address	258 | |
| 696 | #define SYS_timer_create	259 | |
| 697 | #define SYS_timer_settime32	(__NR_timer_create+1) | |
| 698 | #define SYS_timer_gettime32	(__NR_timer_create+2) | |
| 699 | #define SYS_timer_getoverrun	(__NR_timer_create+3) | |
| 700 | #define SYS_timer_delete	(__NR_timer_create+4) | |
| 701 | #define SYS_clock_settime32	(__NR_timer_create+5) | |
| 702 | #define SYS_clock_gettime32	(__NR_timer_create+6) | |
| 703 | #define SYS_clock_getres_time32	(__NR_timer_create+7) | |
| 704 | #define SYS_clock_nanosleep_time32	(__NR_timer_create+8) | |
| 705 | #define SYS_statfs64		268 | |
| 706 | #define SYS_fstatfs64		269 | |
| 707 | #define SYS_tgkill		270 | |
| 708 | #define SYS_utimes		271 | |
| 709 | #define SYS_fadvise64_64	272 | |
| 710 | #define SYS_vserver		273 | |
| 711 | #define SYS_mbind		274 | |
| 712 | #define SYS_get_mempolicy	275 | |
| 713 | #define SYS_set_mempolicy	276 | |
| 714 | #define SYS_mq_open 		277 | |
| 715 | #define SYS_mq_unlink		(__NR_mq_open+1) | |
| 716 | #define SYS_mq_timedsend	(__NR_mq_open+2) | |
| 717 | #define SYS_mq_timedreceive	(__NR_mq_open+3) | |
| 718 | #define SYS_mq_notify		(__NR_mq_open+4) | |
| 719 | #define SYS_mq_getsetattr	(__NR_mq_open+5) | |
| 720 | #define SYS_kexec_load		283 | |
| 721 | #define SYS_waitid		284 | |
| 722 | /* #define SYS_sys_setaltroot	285 */ | |
| 723 | #define SYS_add_key		286 | |
| 724 | #define SYS_request_key	287 | |
| 725 | #define SYS_keyctl		288 | |
| 726 | #define SYS_ioprio_set		289 | |
| 727 | #define SYS_ioprio_get		290 | |
| 728 | #define SYS_inotify_init	291 | |
| 729 | #define SYS_inotify_add_watch	292 | |
| 730 | #define SYS_inotify_rm_watch	293 | |
| 731 | #define SYS_migrate_pages	294 | |
| 732 | #define SYS_openat		295 | |
| 733 | #define SYS_mkdirat		296 | |
| 734 | #define SYS_mknodat		297 | |
| 735 | #define SYS_fchownat		298 | |
| 736 | #define SYS_futimesat		299 | |
| 737 | #define SYS_fstatat64		300 | |
| 738 | #define SYS_unlinkat		301 | |
| 739 | #define SYS_renameat		302 | |
| 740 | #define SYS_linkat		303 | |
| 741 | #define SYS_symlinkat		304 | |
| 742 | #define SYS_readlinkat		305 | |
| 743 | #define SYS_fchmodat		306 | |
| 744 | #define SYS_faccessat		307 | |
| 745 | #define SYS_pselect6		308 | |
| 746 | #define SYS_ppoll		309 | |
| 747 | #define SYS_unshare		310 | |
| 748 | #define SYS_set_robust_list	311 | |
| 749 | #define SYS_get_robust_list	312 | |
| 750 | #define SYS_splice		313 | |
| 751 | #define SYS_sync_file_range	314 | |
| 752 | #define SYS_tee		315 | |
| 753 | #define SYS_vmsplice		316 | |
| 754 | #define SYS_move_pages		317 | |
| 755 | #define SYS_getcpu		318 | |
| 756 | #define SYS_epoll_pwait	319 | |
| 757 | #define SYS_utimensat		320 | |
| 758 | #define SYS_signalfd		321 | |
| 759 | #define SYS_timerfd_create	322 | |
| 760 | #define SYS_eventfd		323 | |
| 761 | #define SYS_fallocate		324 | |
| 762 | #define SYS_timerfd_settime32	325 | |
| 763 | #define SYS_timerfd_gettime32	326 | |
| 764 | #define SYS_signalfd4		327 | |
| 765 | #define SYS_eventfd2		328 | |
| 766 | #define SYS_epoll_create1	329 | |
| 767 | #define SYS_dup3		330 | |
| 768 | #define SYS_pipe2		331 | |
| 769 | #define SYS_inotify_init1	332 | |
| 770 | #define SYS_preadv		333 | |
| 771 | #define SYS_pwritev		334 | |
| 772 | #define SYS_rt_tgsigqueueinfo	335 | |
| 773 | #define SYS_perf_event_open	336 | |
| 774 | #define SYS_recvmmsg		337 | |
| 775 | #define SYS_fanotify_init	338 | |
| 776 | #define SYS_fanotify_mark	339 | |
| 777 | #define SYS_prlimit64		340 | |
| 778 | #define SYS_name_to_handle_at	341 | |
| 779 | #define SYS_open_by_handle_at	342 | |
| 780 | #define SYS_clock_adjtime	343 | |
| 781 | #define SYS_syncfs		344 | |
| 782 | #define SYS_sendmmsg		345 | |
| 783 | #define SYS_setns		346 | |
| 784 | #define SYS_process_vm_readv	347 | |
| 785 | #define SYS_process_vm_writev	348 | |
| 786 | #define SYS_kcmp		349 | |
| 787 | #define SYS_finit_module	350 | |
| 788 | #define SYS_sched_setattr	351 | |
| 789 | #define SYS_sched_getattr	352 | |
| 790 | #define SYS_renameat2		353 | |
| 791 | #define SYS_seccomp		354 | |
| 792 | #define SYS_getrandom		355 | |
| 793 | #define SYS_memfd_create	356 | |
| 794 | #define SYS_bpf		357 | |
| 795 | #define SYS_execveat		358 | |
| 796 | #define SYS_socket		359 | |
| 797 | #define SYS_socketpair		360 | |
| 798 | #define SYS_bind		361 | |
| 799 | #define SYS_connect		362 | |
| 800 | #define SYS_listen		363 | |
| 801 | #define SYS_accept4		364 | |
| 802 | #define SYS_getsockopt		365 | |
| 803 | #define SYS_setsockopt		366 | |
| 804 | #define SYS_getsockname	367 | |
| 805 | #define SYS_getpeername	368 | |
| 806 | #define SYS_sendto		369 | |
| 807 | #define SYS_sendmsg		370 | |
| 808 | #define SYS_recvfrom		371 | |
| 809 | #define SYS_recvmsg		372 | |
| 810 | #define SYS_shutdown		373 | |
| 811 | #define SYS_userfaultfd	374 | |
| 812 | #define SYS_membarrier		375 | |
| 813 | #define SYS_mlock2		376 | |
| 814 | #define SYS_copy_file_range	377 | |
| 815 | #define SYS_preadv2		378 | |
| 816 | #define SYS_pwritev2		379 | |
| 817 | #define SYS_pkey_mprotect	380 | |
| 818 | #define SYS_pkey_alloc		381 | |
| 819 | #define SYS_pkey_free		382 | |
| 820 | #define SYS_statx		383 | |
| 821 | #define SYS_arch_prctl		384 | |
| 822 | #define SYS_io_pgetevents	385 | |
| 823 | #define SYS_rseq		386 | |
| 824 | #define SYS_semget		393 | |
| 825 | #define SYS_semctl		394 | |
| 826 | #define SYS_shmget		395 | |
| 827 | #define SYS_shmctl		396 | |
| 828 | #define SYS_shmat		397 | |
| 829 | #define SYS_shmdt		398 | |
| 830 | #define SYS_msgget		399 | |
| 831 | #define SYS_msgsnd		400 | |
| 832 | #define SYS_msgrcv		401 | |
| 833 | #define SYS_msgctl		402 | |
| 834 | #define SYS_clock_gettime64	403 | |
| 835 | #define SYS_clock_settime64	404 | |
| 836 | #define SYS_clock_adjtime64	405 | |
| 837 | #define SYS_clock_getres_time64 406 | |
| 838 | #define SYS_clock_nanosleep_time64 407 | |
| 839 | #define SYS_timer_gettime64	408 | |
| 840 | #define SYS_timer_settime64	409 | |
| 841 | #define SYS_timerfd_gettime64	410 | |
| 842 | #define SYS_timerfd_settime64	411 | |
| 843 | #define SYS_utimensat_time64	412 | |
| 844 | #define SYS_pselect6_time64	413 | |
| 845 | #define SYS_ppoll_time64	414 | |
| 846 | #define SYS_io_pgetevents_time64 416 | |
| 847 | #define SYS_recvmmsg_time64	417 | |
| 848 | #define SYS_mq_timedsend_time64 418 | |
| 849 | #define SYS_mq_timedreceive_time64 419 | |
| 850 | #define SYS_semtimedop_time64	420 | |
| 851 | #define SYS_rt_sigtimedwait_time64 421 | |
| 852 | #define SYS_futex_time64	422 | |
| 853 | #define SYS_sched_rr_get_interval_time64 423 | |
| 854 | #define SYS_pidfd_send_signal	424 | |
| 855 | #define SYS_io_uring_setup	425 | |
| 856 | #define SYS_io_uring_enter	426 | |
| 857 | #define SYS_io_uring_register	427 | |
| 858 | #define SYS_open_tree		428 | |
| 859 | #define SYS_move_mount		429 | |
| 860 | #define SYS_fsopen		430 | |
| 861 | #define SYS_fsconfig		431 | |
| 862 | #define SYS_fsmount		432 | |
| 863 | #define SYS_fspick		433 | |
| 864 | #define SYS_pidfd_open		434 | |
| 865 | #define SYS_clone3		435 | |
| 866 | #define SYS_close_range	436 | |
| 867 | #define SYS_openat2		437 | |
| 868 | #define SYS_pidfd_getfd	438 | |
| 869 | #define SYS_faccessat2		439 | |
| 870 | #define SYS_process_madvise	440 | |
| 871 | #define SYS_epoll_pwait2	441 | |
| 872 | #define SYS_mount_setattr	442 | |
| 873 | #define SYS_landlock_create_ruleset	444 | |
| 874 | #define SYS_landlock_add_rule	445 | |
| 875 | #define SYS_landlock_restrict_self	446 | |
| \ No newline at end of file |
lib/libc/include/i386-linux-musl/bits/user.h deleted-44| ... | ... | @@ -1,44 +0,0 @@ |
| 1 | #undef __WORDSIZE | |
| 2 | #define __WORDSIZE 32 | |
| 3 | ||
| 4 | typedef struct user_fpregs_struct { | |
| 5 | 	long cwd, swd, twd, fip, fcs, foo, fos, st_space[20]; | |
| 6 | } elf_fpregset_t; | |
| 7 | ||
| 8 | typedef struct user_fpxregs_struct { | |
| 9 | 	unsigned short cwd, swd, twd, fop; | |
| 10 | 	long fip, fcs, foo, fos, mxcsr, reserved; | |
| 11 | 	long st_space[32], xmm_space[32], padding[56]; | |
| 12 | } elf_fpxregset_t; | |
| 13 | ||
| 14 | struct user_regs_struct { | |
| 15 | 	long ebx, ecx, edx, esi, edi, ebp, eax, xds, xes, xfs, xgs; | |
| 16 | 	long orig_eax, eip, xcs, eflags, esp, xss; | |
| 17 | }; | |
| 18 | ||
| 19 | #define ELF_NGREG 17 | |
| 20 | typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; | |
| 21 | ||
| 22 | struct user { | |
| 23 | 	struct user_regs_struct		regs; | |
| 24 | 	int				u_fpvalid; | |
| 25 | 	struct user_fpregs_struct	i387; | |
| 26 | 	unsigned long			u_tsize; | |
| 27 | 	unsigned long			u_dsize; | |
| 28 | 	unsigned long			u_ssize; | |
| 29 | 	unsigned long			start_code; | |
| 30 | 	unsigned long			start_stack; | |
| 31 | 	long				signal; | |
| 32 | 	int				reserved; | |
| 33 | 	struct user_regs_struct		*u_ar0; | |
| 34 | 	struct user_fpregs_struct	*u_fpstate; | |
| 35 | 	unsigned long			magic; | |
| 36 | 	char				u_comm[32]; | |
| 37 | 	int				u_debugreg[8]; | |
| 38 | }; | |
| 39 | ||
| 40 | #define PAGE_MASK		(~(PAGESIZE-1)) | |
| 41 | #define NBPG			PAGESIZE | |
| 42 | #define UPAGES			1 | |
| 43 | #define HOST_TEXT_START_ADDR	(u.start_code) | |
| 44 | #define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG) | |
| \ No newline at end of file |
lib/libc/include/mips-linux-musl/bits/signal.h-1| ... | ... | @@ -66,7 +66,6 @@ typedef struct __ucontext { |
| 66 | 66 | #define SA_RESTART 0x10000000 |
| 67 | 67 | #define SA_NODEFER 0x40000000 |
| 68 | 68 | #define SA_RESETHAND 0x80000000 |
| 69 | #define SA_RESTORER 0x04000000 | |
| 70 | 69 | |
| 71 | 70 | #undef SIG_BLOCK |
| 72 | 71 | #undef SIG_UNBLOCK |
lib/libc/include/mips64-linux-musl/bits/signal.h-1| ... | ... | @@ -85,7 +85,6 @@ typedef struct __ucontext { |
| 85 | 85 | #define SA_RESTART 0x10000000 |
| 86 | 86 | #define SA_NODEFER 0x40000000 |
| 87 | 87 | #define SA_RESETHAND 0x80000000 |
| 88 | #define SA_RESTORER 0x04000000 | |
| 89 | 88 | |
| 90 | 89 | #undef SIG_BLOCK |
| 91 | 90 | #undef SIG_UNBLOCK |
lib/libc/include/riscv64-linux-musl/bits/signal.h-1| ... | ... | @@ -76,7 +76,6 @@ typedef struct __ucontext |
| 76 | 76 | #define SA_RESTART 0x10000000 |
| 77 | 77 | #define SA_NODEFER 0x40000000 |
| 78 | 78 | #define SA_RESETHAND 0x80000000 |
| 79 | #define SA_RESTORER 0x04000000 | |
| 80 | 79 | |
| 81 | 80 | #endif |
| 82 | 81 |
lib/libc/include/x86-linux-musl/bits/alltypes.h created+438| ... | ... | @@ -0,0 +1,438 @@ |
| 1 | #define _REDIR_TIME64 1 | |
| 2 | #define _Addr int | |
| 3 | #define _Int64 long long | |
| 4 | #define _Reg int | |
| 5 | ||
| 6 | #define __BYTE_ORDER 1234 | |
| 7 | #define __LONG_MAX 0x7fffffffL | |
| 8 | ||
| 9 | #ifndef __cplusplus | |
| 10 | #ifdef __WCHAR_TYPE__ | |
| 11 | #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) | |
| 12 | typedef __WCHAR_TYPE__ wchar_t; | |
| 13 | #define __DEFINED_wchar_t | |
| 14 | #endif | |
| 15 | ||
| 16 | #else | |
| 17 | #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) | |
| 18 | typedef long wchar_t; | |
| 19 | #define __DEFINED_wchar_t | |
| 20 | #endif | |
| 21 | ||
| 22 | #endif | |
| 23 | #endif | |
| 24 | ||
| 25 | #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0 | |
| 26 | #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) | |
| 27 | typedef float float_t; | |
| 28 | #define __DEFINED_float_t | |
| 29 | #endif | |
| 30 | ||
| 31 | #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) | |
| 32 | typedef double double_t; | |
| 33 | #define __DEFINED_double_t | |
| 34 | #endif | |
| 35 | ||
| 36 | #else | |
| 37 | #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) | |
| 38 | typedef long double float_t; | |
| 39 | #define __DEFINED_float_t | |
| 40 | #endif | |
| 41 | ||
| 42 | #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) | |
| 43 | typedef long double double_t; | |
| 44 | #define __DEFINED_double_t | |
| 45 | #endif | |
| 46 | ||
| 47 | #endif | |
| 48 | ||
| 49 | #if !defined(__cplusplus) | |
| 50 | #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) | |
| 51 | typedef struct { _Alignas(8) long long __ll; long double __ld; } max_align_t; | |
| 52 | #define __DEFINED_max_align_t | |
| 53 | #endif | |
| 54 | ||
| 55 | #elif defined(__GNUC__) | |
| 56 | #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) | |
| 57 | typedef struct { __attribute__((__aligned__(8))) long long __ll; long double __ld; } max_align_t; | |
| 58 | #define __DEFINED_max_align_t | |
| 59 | #endif | |
| 60 | ||
| 61 | #else | |
| 62 | #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) | |
| 63 | typedef struct { alignas(8) long long __ll; long double __ld; } max_align_t; | |
| 64 | #define __DEFINED_max_align_t | |
| 65 | #endif | |
| 66 | ||
| 67 | #endif | |
| 68 | #define __LITTLE_ENDIAN 1234 | |
| 69 | #define __BIG_ENDIAN 4321 | |
| 70 | #define __USE_TIME_BITS64 1 | |
| 71 | ||
| 72 | #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) | |
| 73 | typedef unsigned _Addr size_t; | |
| 74 | #define __DEFINED_size_t | |
| 75 | #endif | |
| 76 | ||
| 77 | #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) | |
| 78 | typedef unsigned _Addr uintptr_t; | |
| 79 | #define __DEFINED_uintptr_t | |
| 80 | #endif | |
| 81 | ||
| 82 | #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) | |
| 83 | typedef _Addr ptrdiff_t; | |
| 84 | #define __DEFINED_ptrdiff_t | |
| 85 | #endif | |
| 86 | ||
| 87 | #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) | |
| 88 | typedef _Addr ssize_t; | |
| 89 | #define __DEFINED_ssize_t | |
| 90 | #endif | |
| 91 | ||
| 92 | #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) | |
| 93 | typedef _Addr intptr_t; | |
| 94 | #define __DEFINED_intptr_t | |
| 95 | #endif | |
| 96 | ||
| 97 | #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) | |
| 98 | typedef _Addr regoff_t; | |
| 99 | #define __DEFINED_regoff_t | |
| 100 | #endif | |
| 101 | ||
| 102 | #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) | |
| 103 | typedef _Reg register_t; | |
| 104 | #define __DEFINED_register_t | |
| 105 | #endif | |
| 106 | ||
| 107 | #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) | |
| 108 | typedef _Int64 time_t; | |
| 109 | #define __DEFINED_time_t | |
| 110 | #endif | |
| 111 | ||
| 112 | #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) | |
| 113 | typedef _Int64 suseconds_t; | |
| 114 | #define __DEFINED_suseconds_t | |
| 115 | #endif | |
| 116 | ||
| 117 | ||
| 118 | #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) | |
| 119 | typedef signed char int8_t; | |
| 120 | #define __DEFINED_int8_t | |
| 121 | #endif | |
| 122 | ||
| 123 | #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) | |
| 124 | typedef signed short int16_t; | |
| 125 | #define __DEFINED_int16_t | |
| 126 | #endif | |
| 127 | ||
| 128 | #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) | |
| 129 | typedef signed int int32_t; | |
| 130 | #define __DEFINED_int32_t | |
| 131 | #endif | |
| 132 | ||
| 133 | #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) | |
| 134 | typedef signed _Int64 int64_t; | |
| 135 | #define __DEFINED_int64_t | |
| 136 | #endif | |
| 137 | ||
| 138 | #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) | |
| 139 | typedef signed _Int64 intmax_t; | |
| 140 | #define __DEFINED_intmax_t | |
| 141 | #endif | |
| 142 | ||
| 143 | #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) | |
| 144 | typedef unsigned char uint8_t; | |
| 145 | #define __DEFINED_uint8_t | |
| 146 | #endif | |
| 147 | ||
| 148 | #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) | |
| 149 | typedef unsigned short uint16_t; | |
| 150 | #define __DEFINED_uint16_t | |
| 151 | #endif | |
| 152 | ||
| 153 | #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) | |
| 154 | typedef unsigned int uint32_t; | |
| 155 | #define __DEFINED_uint32_t | |
| 156 | #endif | |
| 157 | ||
| 158 | #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) | |
| 159 | typedef unsigned _Int64 uint64_t; | |
| 160 | #define __DEFINED_uint64_t | |
| 161 | #endif | |
| 162 | ||
| 163 | #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) | |
| 164 | typedef unsigned _Int64 u_int64_t; | |
| 165 | #define __DEFINED_u_int64_t | |
| 166 | #endif | |
| 167 | ||
| 168 | #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) | |
| 169 | typedef unsigned _Int64 uintmax_t; | |
| 170 | #define __DEFINED_uintmax_t | |
| 171 | #endif | |
| 172 | ||
| 173 | ||
| 174 | #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) | |
| 175 | typedef unsigned mode_t; | |
| 176 | #define __DEFINED_mode_t | |
| 177 | #endif | |
| 178 | ||
| 179 | #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) | |
| 180 | typedef unsigned _Reg nlink_t; | |
| 181 | #define __DEFINED_nlink_t | |
| 182 | #endif | |
| 183 | ||
| 184 | #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) | |
| 185 | typedef _Int64 off_t; | |
| 186 | #define __DEFINED_off_t | |
| 187 | #endif | |
| 188 | ||
| 189 | #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) | |
| 190 | typedef unsigned _Int64 ino_t; | |
| 191 | #define __DEFINED_ino_t | |
| 192 | #endif | |
| 193 | ||
| 194 | #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) | |
| 195 | typedef unsigned _Int64 dev_t; | |
| 196 | #define __DEFINED_dev_t | |
| 197 | #endif | |
| 198 | ||
| 199 | #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) | |
| 200 | typedef long blksize_t; | |
| 201 | #define __DEFINED_blksize_t | |
| 202 | #endif | |
| 203 | ||
| 204 | #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) | |
| 205 | typedef _Int64 blkcnt_t; | |
| 206 | #define __DEFINED_blkcnt_t | |
| 207 | #endif | |
| 208 | ||
| 209 | #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) | |
| 210 | typedef unsigned _Int64 fsblkcnt_t; | |
| 211 | #define __DEFINED_fsblkcnt_t | |
| 212 | #endif | |
| 213 | ||
| 214 | #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) | |
| 215 | typedef unsigned _Int64 fsfilcnt_t; | |
| 216 | #define __DEFINED_fsfilcnt_t | |
| 217 | #endif | |
| 218 | ||
| 219 | ||
| 220 | #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) | |
| 221 | typedef unsigned wint_t; | |
| 222 | #define __DEFINED_wint_t | |
| 223 | #endif | |
| 224 | ||
| 225 | #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) | |
| 226 | typedef unsigned long wctype_t; | |
| 227 | #define __DEFINED_wctype_t | |
| 228 | #endif | |
| 229 | ||
| 230 | ||
| 231 | #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) | |
| 232 | typedef void * timer_t; | |
| 233 | #define __DEFINED_timer_t | |
| 234 | #endif | |
| 235 | ||
| 236 | #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) | |
| 237 | typedef int clockid_t; | |
| 238 | #define __DEFINED_clockid_t | |
| 239 | #endif | |
| 240 | ||
| 241 | #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) | |
| 242 | typedef long clock_t; | |
| 243 | #define __DEFINED_clock_t | |
| 244 | #endif | |
| 245 | ||
| 246 | #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) | |
| 247 | struct timeval { time_t tv_sec; suseconds_t tv_usec; }; | |
| 248 | #define __DEFINED_struct_timeval | |
| 249 | #endif | |
| 250 | ||
| 251 | #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) | |
| 252 | struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; | |
| 253 | #define __DEFINED_struct_timespec | |
| 254 | #endif | |
| 255 | ||
| 256 | ||
| 257 | #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) | |
| 258 | typedef int pid_t; | |
| 259 | #define __DEFINED_pid_t | |
| 260 | #endif | |
| 261 | ||
| 262 | #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) | |
| 263 | typedef unsigned id_t; | |
| 264 | #define __DEFINED_id_t | |
| 265 | #endif | |
| 266 | ||
| 267 | #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) | |
| 268 | typedef unsigned uid_t; | |
| 269 | #define __DEFINED_uid_t | |
| 270 | #endif | |
| 271 | ||
| 272 | #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) | |
| 273 | typedef unsigned gid_t; | |
| 274 | #define __DEFINED_gid_t | |
| 275 | #endif | |
| 276 | ||
| 277 | #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) | |
| 278 | typedef int key_t; | |
| 279 | #define __DEFINED_key_t | |
| 280 | #endif | |
| 281 | ||
| 282 | #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) | |
| 283 | typedef unsigned useconds_t; | |
| 284 | #define __DEFINED_useconds_t | |
| 285 | #endif | |
| 286 | ||
| 287 | ||
| 288 | #ifdef __cplusplus | |
| 289 | #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) | |
| 290 | typedef unsigned long pthread_t; | |
| 291 | #define __DEFINED_pthread_t | |
| 292 | #endif | |
| 293 | ||
| 294 | #else | |
| 295 | #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) | |
| 296 | typedef struct __pthread * pthread_t; | |
| 297 | #define __DEFINED_pthread_t | |
| 298 | #endif | |
| 299 | ||
| 300 | #endif | |
| 301 | #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) | |
| 302 | typedef int pthread_once_t; | |
| 303 | #define __DEFINED_pthread_once_t | |
| 304 | #endif | |
| 305 | ||
| 306 | #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) | |
| 307 | typedef unsigned pthread_key_t; | |
| 308 | #define __DEFINED_pthread_key_t | |
| 309 | #endif | |
| 310 | ||
| 311 | #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) | |
| 312 | typedef int pthread_spinlock_t; | |
| 313 | #define __DEFINED_pthread_spinlock_t | |
| 314 | #endif | |
| 315 | ||
| 316 | #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) | |
| 317 | typedef struct { unsigned __attr; } pthread_mutexattr_t; | |
| 318 | #define __DEFINED_pthread_mutexattr_t | |
| 319 | #endif | |
| 320 | ||
| 321 | #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) | |
| 322 | typedef struct { unsigned __attr; } pthread_condattr_t; | |
| 323 | #define __DEFINED_pthread_condattr_t | |
| 324 | #endif | |
| 325 | ||
| 326 | #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) | |
| 327 | typedef struct { unsigned __attr; } pthread_barrierattr_t; | |
| 328 | #define __DEFINED_pthread_barrierattr_t | |
| 329 | #endif | |
| 330 | ||
| 331 | #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) | |
| 332 | typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; | |
| 333 | #define __DEFINED_pthread_rwlockattr_t | |
| 334 | #endif | |
| 335 | ||
| 336 | ||
| 337 | #if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE) | |
| 338 | struct _IO_FILE { char __x; }; | |
| 339 | #define __DEFINED_struct__IO_FILE | |
| 340 | #endif | |
| 341 | ||
| 342 | #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) | |
| 343 | typedef struct _IO_FILE FILE; | |
| 344 | #define __DEFINED_FILE | |
| 345 | #endif | |
| 346 | ||
| 347 | ||
| 348 | #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) | |
| 349 | typedef __builtin_va_list va_list; | |
| 350 | #define __DEFINED_va_list | |
| 351 | #endif | |
| 352 | ||
| 353 | #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) | |
| 354 | typedef __builtin_va_list __isoc_va_list; | |
| 355 | #define __DEFINED___isoc_va_list | |
| 356 | #endif | |
| 357 | ||
| 358 | ||
| 359 | #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) | |
| 360 | typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; | |
| 361 | #define __DEFINED_mbstate_t | |
| 362 | #endif | |
| 363 | ||
| 364 | ||
| 365 | #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) | |
| 366 | typedef struct __locale_struct * locale_t; | |
| 367 | #define __DEFINED_locale_t | |
| 368 | #endif | |
| 369 | ||
| 370 | ||
| 371 | #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) | |
| 372 | typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; | |
| 373 | #define __DEFINED_sigset_t | |
| 374 | #endif | |
| 375 | ||
| 376 | ||
| 377 | #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) | |
| 378 | struct iovec { void *iov_base; size_t iov_len; }; | |
| 379 | #define __DEFINED_struct_iovec | |
| 380 | #endif | |
| 381 | ||
| 382 | ||
| 383 | #if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize) | |
| 384 | struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; }; | |
| 385 | #define __DEFINED_struct_winsize | |
| 386 | #endif | |
| 387 | ||
| 388 | ||
| 389 | #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) | |
| 390 | typedef unsigned socklen_t; | |
| 391 | #define __DEFINED_socklen_t | |
| 392 | #endif | |
| 393 | ||
| 394 | #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) | |
| 395 | typedef unsigned short sa_family_t; | |
| 396 | #define __DEFINED_sa_family_t | |
| 397 | #endif | |
| 398 | ||
| 399 | ||
| 400 | #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) | |
| 401 | typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t; | |
| 402 | #define __DEFINED_pthread_attr_t | |
| 403 | #endif | |
| 404 | ||
| 405 | #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) | |
| 406 | typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t; | |
| 407 | #define __DEFINED_pthread_mutex_t | |
| 408 | #endif | |
| 409 | ||
| 410 | #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) | |
| 411 | typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t; | |
| 412 | #define __DEFINED_mtx_t | |
| 413 | #endif | |
| 414 | ||
| 415 | #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) | |
| 416 | typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t; | |
| 417 | #define __DEFINED_pthread_cond_t | |
| 418 | #endif | |
| 419 | ||
| 420 | #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) | |
| 421 | typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t; | |
| 422 | #define __DEFINED_cnd_t | |
| 423 | #endif | |
| 424 | ||
| 425 | #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) | |
| 426 | typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t; | |
| 427 | #define __DEFINED_pthread_rwlock_t | |
| 428 | #endif | |
| 429 | ||
| 430 | #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) | |
| 431 | typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t; | |
| 432 | #define __DEFINED_pthread_barrier_t | |
| 433 | #endif | |
| 434 | ||
| 435 | ||
| 436 | #undef _Addr | |
| 437 | #undef _Int64 | |
| 438 | #undef _Reg | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/fenv.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | #define FE_INVALID 1 | |
| 2 | #define __FE_DENORM 2 | |
| 3 | #define FE_DIVBYZERO 4 | |
| 4 | #define FE_OVERFLOW 8 | |
| 5 | #define FE_UNDERFLOW 16 | |
| 6 | #define FE_INEXACT 32 | |
| 7 | ||
| 8 | #define FE_ALL_EXCEPT 63 | |
| 9 | ||
| 10 | #define FE_TONEAREST 0 | |
| 11 | #define FE_DOWNWARD 0x400 | |
| 12 | #define FE_UPWARD 0x800 | |
| 13 | #define FE_TOWARDZERO 0xc00 | |
| 14 | ||
| 15 | typedef unsigned short fexcept_t; | |
| 16 | ||
| 17 | typedef struct { | |
| 18 | 	unsigned short __control_word; | |
| 19 | 	unsigned short __unused1; | |
| 20 | 	unsigned short __status_word; | |
| 21 | 	unsigned short __unused2; | |
| 22 | 	unsigned short __tags; | |
| 23 | 	unsigned short __unused3; | |
| 24 | 	unsigned int __eip; | |
| 25 | 	unsigned short __cs_selector; | |
| 26 | 	unsigned int __opcode:11; | |
| 27 | 	unsigned int __unused4:5; | |
| 28 | 	unsigned int __data_offset; | |
| 29 | 	unsigned short __data_selector; | |
| 30 | 	unsigned short __unused5; | |
| 31 | } fenv_t; | |
| 32 | ||
| 33 | #define FE_DFL_ENV ((const fenv_t *) -1) | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/float.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | #ifdef __FLT_EVAL_METHOD__ | |
| 2 | #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ | |
| 3 | #else | |
| 4 | #define FLT_EVAL_METHOD 2 | |
| 5 | #endif | |
| 6 | ||
| 7 | #define LDBL_TRUE_MIN 3.6451995318824746025e-4951L | |
| 8 | #define LDBL_MIN 3.3621031431120935063e-4932L | |
| 9 | #define LDBL_MAX 1.1897314953572317650e+4932L | |
| 10 | #define LDBL_EPSILON 1.0842021724855044340e-19L | |
| 11 | ||
| 12 | #define LDBL_MANT_DIG 64 | |
| 13 | #define LDBL_MIN_EXP (-16381) | |
| 14 | #define LDBL_MAX_EXP 16384 | |
| 15 | ||
| 16 | #define LDBL_DIG 18 | |
| 17 | #define LDBL_MIN_10_EXP (-4931) | |
| 18 | #define LDBL_MAX_10_EXP 4932 | |
| 19 | ||
| 20 | #define DECIMAL_DIG 21 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/io.h created+77| ... | ... | @@ -0,0 +1,77 @@ |
| 1 | static __inline void outb(unsigned char __val, unsigned short __port) | |
| 2 | { | |
| 3 | 	__asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port)); | |
| 4 | } | |
| 5 | ||
| 6 | static __inline void outw(unsigned short __val, unsigned short __port) | |
| 7 | { | |
| 8 | 	__asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port)); | |
| 9 | } | |
| 10 | ||
| 11 | static __inline void outl(unsigned int __val, unsigned short __port) | |
| 12 | { | |
| 13 | 	__asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port)); | |
| 14 | } | |
| 15 | ||
| 16 | static __inline unsigned char inb(unsigned short __port) | |
| 17 | { | |
| 18 | 	unsigned char __val; | |
| 19 | 	__asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port)); | |
| 20 | 	return __val; | |
| 21 | } | |
| 22 | ||
| 23 | static __inline unsigned short inw(unsigned short __port) | |
| 24 | { | |
| 25 | 	unsigned short __val; | |
| 26 | 	__asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port)); | |
| 27 | 	return __val; | |
| 28 | } | |
| 29 | ||
| 30 | static __inline unsigned int inl(unsigned short __port) | |
| 31 | { | |
| 32 | 	unsigned int __val; | |
| 33 | 	__asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port)); | |
| 34 | 	return __val; | |
| 35 | } | |
| 36 | ||
| 37 | static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n) | |
| 38 | { | |
| 39 | 	__asm__ volatile ("cld; rep; outsb" | |
| 40 | 		 : "+S" (__buf), "+c" (__n) | |
| 41 | 		 : "d" (__port)); | |
| 42 | } | |
| 43 | ||
| 44 | static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n) | |
| 45 | { | |
| 46 | 	__asm__ volatile ("cld; rep; outsw" | |
| 47 | 		 : "+S" (__buf), "+c" (__n) | |
| 48 | 		 : "d" (__port)); | |
| 49 | } | |
| 50 | ||
| 51 | static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n) | |
| 52 | { | |
| 53 | 	__asm__ volatile ("cld; rep; outsl" | |
| 54 | 		 : "+S" (__buf), "+c"(__n) | |
| 55 | 		 : "d" (__port)); | |
| 56 | } | |
| 57 | ||
| 58 | static __inline void insb(unsigned short __port, void *__buf, unsigned long __n) | |
| 59 | { | |
| 60 | 	__asm__ volatile ("cld; rep; insb" | |
| 61 | 		 : "+D" (__buf), "+c" (__n) | |
| 62 | 		 : "d" (__port)); | |
| 63 | } | |
| 64 | ||
| 65 | static __inline void insw(unsigned short __port, void *__buf, unsigned long __n) | |
| 66 | { | |
| 67 | 	__asm__ volatile ("cld; rep; insw" | |
| 68 | 		 : "+D" (__buf), "+c" (__n) | |
| 69 | 		 : "d" (__port)); | |
| 70 | } | |
| 71 | ||
| 72 | static __inline void insl(unsigned short __port, void *__buf, unsigned long __n) | |
| 73 | { | |
| 74 | 	__asm__ volatile ("cld; rep; insl" | |
| 75 | 		 : "+D" (__buf), "+c" (__n) | |
| 76 | 		 : "d" (__port)); | |
| 77 | } | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/ipcstat.h created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | #define IPC_STAT 0x102 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/limits.h created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | #define PAGESIZE 4096 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/mman.h created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | #define MAP_32BIT 0x40 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/msg.h created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | struct msqid_ds { | |
| 2 | 	struct ipc_perm msg_perm; | |
| 3 | 	unsigned long __msg_stime_lo; | |
| 4 | 	unsigned long __msg_stime_hi; | |
| 5 | 	unsigned long __msg_rtime_lo; | |
| 6 | 	unsigned long __msg_rtime_hi; | |
| 7 | 	unsigned long __msg_ctime_lo; | |
| 8 | 	unsigned long __msg_ctime_hi; | |
| 9 | 	unsigned long msg_cbytes; | |
| 10 | 	msgqnum_t msg_qnum; | |
| 11 | 	msglen_t msg_qbytes; | |
| 12 | 	pid_t msg_lspid; | |
| 13 | 	pid_t msg_lrpid; | |
| 14 | 	unsigned long __unused[2]; | |
| 15 | 	time_t msg_stime; | |
| 16 | 	time_t msg_rtime; | |
| 17 | 	time_t msg_ctime; | |
| 18 | }; | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/ptrace.h created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | #define PTRACE_GET_THREAD_AREA		25 | |
| 2 | #define PTRACE_SET_THREAD_AREA		26 | |
| 3 | #define PTRACE_SYSEMU			31 | |
| 4 | #define PTRACE_SYSEMU_SINGLESTEP	32 | |
| 5 | #define PTRACE_SINGLEBLOCK		33 | |
| 6 | ||
| 7 | #define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA | |
| 8 | #define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA | |
| 9 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 10 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 11 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/reg.h created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | #undef __WORDSIZE | |
| 2 | #define __WORDSIZE 32 | |
| 3 | #define EBX 0 | |
| 4 | #define ECX 1 | |
| 5 | #define EDX 2 | |
| 6 | #define ESI 3 | |
| 7 | #define EDI 4 | |
| 8 | #define EBP 5 | |
| 9 | #define EAX 6 | |
| 10 | #define DS 7 | |
| 11 | #define ES 8 | |
| 12 | #define FS 9 | |
| 13 | #define GS 10 | |
| 14 | #define ORIG_EAX 11 | |
| 15 | #define EIP 12 | |
| 16 | #define CS 13 | |
| 17 | #define EFL 14 | |
| 18 | #define UESP 15 | |
| 19 | #define SS 16 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/sem.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | struct semid_ds { | |
| 2 | 	struct ipc_perm sem_perm; | |
| 3 | 	unsigned long __sem_otime_lo; | |
| 4 | 	unsigned long __sem_otime_hi; | |
| 5 | 	unsigned long __sem_ctime_lo; | |
| 6 | 	unsigned long __sem_ctime_hi; | |
| 7 | 	unsigned short sem_nsems; | |
| 8 | 	char __sem_nsems_pad[sizeof(long)-sizeof(short)]; | |
| 9 | 	long __unused3; | |
| 10 | 	long __unused4; | |
| 11 | 	time_t sem_otime; | |
| 12 | 	time_t sem_ctime; | |
| 13 | }; | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/setjmp.h created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | typedef unsigned long __jmp_buf[6]; | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/shm.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | #define SHMLBA 4096 | |
| 2 | ||
| 3 | struct shmid_ds { | |
| 4 | 	struct ipc_perm shm_perm; | |
| 5 | 	size_t shm_segsz; | |
| 6 | 	unsigned long __shm_atime_lo; | |
| 7 | 	unsigned long __shm_atime_hi; | |
| 8 | 	unsigned long __shm_dtime_lo; | |
| 9 | 	unsigned long __shm_dtime_hi; | |
| 10 | 	unsigned long __shm_ctime_lo; | |
| 11 | 	unsigned long __shm_ctime_hi; | |
| 12 | 	pid_t shm_cpid; | |
| 13 | 	pid_t shm_lpid; | |
| 14 | 	unsigned long shm_nattch; | |
| 15 | 	unsigned long __pad1; | |
| 16 | 	unsigned long __pad2; | |
| 17 | 	unsigned long __pad3; | |
| 18 | 	time_t shm_atime; | |
| 19 | 	time_t shm_dtime; | |
| 20 | 	time_t shm_ctime; | |
| 21 | }; | |
| 22 | ||
| 23 | struct shminfo { | |
| 24 | 	unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; | |
| 25 | }; | |
| 26 | ||
| 27 | struct shm_info { | |
| 28 | 	int __used_ids; | |
| 29 | 	unsigned long shm_tot, shm_rss, shm_swp; | |
| 30 | 	unsigned long __swap_attempts, __swap_successes; | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/signal.h created+141| ... | ... | @@ -0,0 +1,141 @@ |
| 1 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ | |
| 2 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | |
| 3 | ||
| 4 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | |
| 5 | #define MINSIGSTKSZ 2048 | |
| 6 | #define SIGSTKSZ 8192 | |
| 7 | #endif | |
| 8 | ||
| 9 | #ifdef _GNU_SOURCE | |
| 10 | enum { REG_GS = 0 }; | |
| 11 | #define REG_GS REG_GS | |
| 12 | enum { REG_FS = 1 }; | |
| 13 | #define REG_FS REG_FS | |
| 14 | enum { REG_ES = 2 }; | |
| 15 | #define REG_ES REG_ES | |
| 16 | enum { REG_DS = 3 }; | |
| 17 | #define REG_DS REG_DS | |
| 18 | enum { REG_EDI = 4 }; | |
| 19 | #define REG_EDI REG_EDI | |
| 20 | enum { REG_ESI = 5 }; | |
| 21 | #define REG_ESI REG_ESI | |
| 22 | enum { REG_EBP = 6 }; | |
| 23 | #define REG_EBP REG_EBP | |
| 24 | enum { REG_ESP = 7 }; | |
| 25 | #define REG_ESP REG_ESP | |
| 26 | enum { REG_EBX = 8 }; | |
| 27 | #define REG_EBX REG_EBX | |
| 28 | enum { REG_EDX = 9 }; | |
| 29 | #define REG_EDX REG_EDX | |
| 30 | enum { REG_ECX = 10 }; | |
| 31 | #define REG_ECX REG_ECX | |
| 32 | enum { REG_EAX = 11 }; | |
| 33 | #define REG_EAX REG_EAX | |
| 34 | enum { REG_TRAPNO = 12 }; | |
| 35 | #define REG_TRAPNO REG_TRAPNO | |
| 36 | enum { REG_ERR = 13 }; | |
| 37 | #define REG_ERR REG_ERR | |
| 38 | enum { REG_EIP = 14 }; | |
| 39 | #define REG_EIP REG_EIP | |
| 40 | enum { REG_CS = 15 }; | |
| 41 | #define REG_CS REG_CS | |
| 42 | enum { REG_EFL = 16 }; | |
| 43 | #define REG_EFL REG_EFL | |
| 44 | enum { REG_UESP = 17 }; | |
| 45 | #define REG_UESP REG_UESP | |
| 46 | enum { REG_SS = 18 }; | |
| 47 | #define REG_SS REG_SS | |
| 48 | #endif | |
| 49 | ||
| 50 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | |
| 51 | typedef int greg_t, gregset_t[19]; | |
| 52 | typedef struct _fpstate { | |
| 53 | 	unsigned long cw, sw, tag, ipoff, cssel, dataoff, datasel; | |
| 54 | 	struct { | |
| 55 | 		unsigned short significand[4], exponent; | |
| 56 | 	} _st[8]; | |
| 57 | 	unsigned long status; | |
| 58 | } *fpregset_t; | |
| 59 | struct sigcontext { | |
| 60 | 	unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh; | |
| 61 | 	unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax; | |
| 62 | 	unsigned long trapno, err, eip; | |
| 63 | 	unsigned short cs, __csh; | |
| 64 | 	unsigned long eflags, esp_at_signal; | |
| 65 | 	unsigned short ss, __ssh; | |
| 66 | 	struct _fpstate *fpstate; | |
| 67 | 	unsigned long oldmask, cr2; | |
| 68 | }; | |
| 69 | typedef struct { | |
| 70 | 	gregset_t gregs; | |
| 71 | 	fpregset_t fpregs; | |
| 72 | 	unsigned long oldmask, cr2; | |
| 73 | } mcontext_t; | |
| 74 | #else | |
| 75 | typedef struct { | |
| 76 | 	unsigned __space[22]; | |
| 77 | } mcontext_t; | |
| 78 | #endif | |
| 79 | ||
| 80 | struct sigaltstack { | |
| 81 | 	void *ss_sp; | |
| 82 | 	int ss_flags; | |
| 83 | 	size_t ss_size; | |
| 84 | }; | |
| 85 | ||
| 86 | typedef struct __ucontext { | |
| 87 | 	unsigned long uc_flags; | |
| 88 | 	struct __ucontext *uc_link; | |
| 89 | 	stack_t uc_stack; | |
| 90 | 	mcontext_t uc_mcontext; | |
| 91 | 	sigset_t uc_sigmask; | |
| 92 | 	unsigned long __fpregs_mem[28]; | |
| 93 | } ucontext_t; | |
| 94 | ||
| 95 | #define SA_NOCLDSTOP 1 | |
| 96 | #define SA_NOCLDWAIT 2 | |
| 97 | #define SA_SIGINFO 4 | |
| 98 | #define SA_ONSTACK 0x08000000 | |
| 99 | #define SA_RESTART 0x10000000 | |
| 100 | #define SA_NODEFER 0x40000000 | |
| 101 | #define SA_RESETHAND 0x80000000 | |
| 102 | #define SA_RESTORER 0x04000000 | |
| 103 | ||
| 104 | #endif | |
| 105 | ||
| 106 | #define SIGHUP 1 | |
| 107 | #define SIGINT 2 | |
| 108 | #define SIGQUIT 3 | |
| 109 | #define SIGILL 4 | |
| 110 | #define SIGTRAP 5 | |
| 111 | #define SIGABRT 6 | |
| 112 | #define SIGIOT SIGABRT | |
| 113 | #define SIGBUS 7 | |
| 114 | #define SIGFPE 8 | |
| 115 | #define SIGKILL 9 | |
| 116 | #define SIGUSR1 10 | |
| 117 | #define SIGSEGV 11 | |
| 118 | #define SIGUSR2 12 | |
| 119 | #define SIGPIPE 13 | |
| 120 | #define SIGALRM 14 | |
| 121 | #define SIGTERM 15 | |
| 122 | #define SIGSTKFLT 16 | |
| 123 | #define SIGCHLD 17 | |
| 124 | #define SIGCONT 18 | |
| 125 | #define SIGSTOP 19 | |
| 126 | #define SIGTSTP 20 | |
| 127 | #define SIGTTIN 21 | |
| 128 | #define SIGTTOU 22 | |
| 129 | #define SIGURG 23 | |
| 130 | #define SIGXCPU 24 | |
| 131 | #define SIGXFSZ 25 | |
| 132 | #define SIGVTALRM 26 | |
| 133 | #define SIGPROF 27 | |
| 134 | #define SIGWINCH 28 | |
| 135 | #define SIGIO 29 | |
| 136 | #define SIGPOLL 29 | |
| 137 | #define SIGPWR 30 | |
| 138 | #define SIGSYS 31 | |
| 139 | #define SIGUNUSED SIGSYS | |
| 140 | ||
| 141 | #define _NSIG 65 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/stat.h created+25| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | /* copied from kernel definition, but with padding replaced | |
| 2 | * by the corresponding correctly-sized userspace types. */ | |
| 3 | ||
| 4 | struct stat { | |
| 5 | 	dev_t st_dev; | |
| 6 | 	int __st_dev_padding; | |
| 7 | 	long __st_ino_truncated; | |
| 8 | 	mode_t st_mode; | |
| 9 | 	nlink_t st_nlink; | |
| 10 | 	uid_t st_uid; | |
| 11 | 	gid_t st_gid; | |
| 12 | 	dev_t st_rdev; | |
| 13 | 	int __st_rdev_padding; | |
| 14 | 	off_t st_size; | |
| 15 | 	blksize_t st_blksize; | |
| 16 | 	blkcnt_t st_blocks; | |
| 17 | 	struct { | |
| 18 | 		long tv_sec; | |
| 19 | 		long tv_nsec; | |
| 20 | 	} __st_atim32, __st_mtim32, __st_ctim32; | |
| 21 | 	ino_t st_ino; | |
| 22 | 	struct timespec st_atim; | |
| 23 | 	struct timespec st_mtim; | |
| 24 | 	struct timespec st_ctim; | |
| 25 | }; | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/stdint.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | typedef int32_t int_fast16_t; | |
| 2 | typedef int32_t int_fast32_t; | |
| 3 | typedef uint32_t uint_fast16_t; | |
| 4 | typedef uint32_t uint_fast32_t; | |
| 5 | ||
| 6 | #define INT_FAST16_MIN INT32_MIN | |
| 7 | #define INT_FAST32_MIN INT32_MIN | |
| 8 | ||
| 9 | #define INT_FAST16_MAX INT32_MAX | |
| 10 | #define INT_FAST32_MAX INT32_MAX | |
| 11 | ||
| 12 | #define UINT_FAST16_MAX UINT32_MAX | |
| 13 | #define UINT_FAST32_MAX UINT32_MAX | |
| 14 | ||
| 15 | #define INTPTR_MIN INT32_MIN | |
| 16 | #define INTPTR_MAX INT32_MAX | |
| 17 | #define UINTPTR_MAX UINT32_MAX | |
| 18 | #define PTRDIFF_MIN INT32_MIN | |
| 19 | #define PTRDIFF_MAX INT32_MAX | |
| 20 | #define SIZE_MAX UINT32_MAX | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/syscall.h created+875| ... | ... | @@ -0,0 +1,875 @@ |
| 1 | #define __NR_restart_syscall 0 | |
| 2 | #define __NR_exit		 1 | |
| 3 | #define __NR_fork		 2 | |
| 4 | #define __NR_read		 3 | |
| 5 | #define __NR_write		 4 | |
| 6 | #define __NR_open		 5 | |
| 7 | #define __NR_close		 6 | |
| 8 | #define __NR_waitpid		 7 | |
| 9 | #define __NR_creat		 8 | |
| 10 | #define __NR_link		 9 | |
| 11 | #define __NR_unlink		 10 | |
| 12 | #define __NR_execve		 11 | |
| 13 | #define __NR_chdir		 12 | |
| 14 | #define __NR_time		 13 | |
| 15 | #define __NR_mknod		 14 | |
| 16 | #define __NR_chmod		 15 | |
| 17 | #define __NR_lchown		 16 | |
| 18 | #define __NR_break		 17 | |
| 19 | #define __NR_oldstat		 18 | |
| 20 | #define __NR_lseek		 19 | |
| 21 | #define __NR_getpid		 20 | |
| 22 | #define __NR_mount		 21 | |
| 23 | #define __NR_umount		 22 | |
| 24 | #define __NR_setuid		 23 | |
| 25 | #define __NR_getuid		 24 | |
| 26 | #define __NR_stime		 25 | |
| 27 | #define __NR_ptrace		 26 | |
| 28 | #define __NR_alarm		 27 | |
| 29 | #define __NR_oldfstat		 28 | |
| 30 | #define __NR_pause		 29 | |
| 31 | #define __NR_utime		 30 | |
| 32 | #define __NR_stty		 31 | |
| 33 | #define __NR_gtty		 32 | |
| 34 | #define __NR_access		 33 | |
| 35 | #define __NR_nice		 34 | |
| 36 | #define __NR_ftime		 35 | |
| 37 | #define __NR_sync		 36 | |
| 38 | #define __NR_kill		 37 | |
| 39 | #define __NR_rename		 38 | |
| 40 | #define __NR_mkdir		 39 | |
| 41 | #define __NR_rmdir		 40 | |
| 42 | #define __NR_dup		 41 | |
| 43 | #define __NR_pipe		 42 | |
| 44 | #define __NR_times		 43 | |
| 45 | #define __NR_prof		 44 | |
| 46 | #define __NR_brk		 45 | |
| 47 | #define __NR_setgid		 46 | |
| 48 | #define __NR_getgid		 47 | |
| 49 | #define __NR_signal		 48 | |
| 50 | #define __NR_geteuid		 49 | |
| 51 | #define __NR_getegid		 50 | |
| 52 | #define __NR_acct		 51 | |
| 53 | #define __NR_umount2		 52 | |
| 54 | #define __NR_lock		 53 | |
| 55 | #define __NR_ioctl		 54 | |
| 56 | #define __NR_fcntl		 55 | |
| 57 | #define __NR_mpx		 56 | |
| 58 | #define __NR_setpgid		 57 | |
| 59 | #define __NR_ulimit		 58 | |
| 60 | #define __NR_oldolduname	 59 | |
| 61 | #define __NR_umask		 60 | |
| 62 | #define __NR_chroot		 61 | |
| 63 | #define __NR_ustat		 62 | |
| 64 | #define __NR_dup2		 63 | |
| 65 | #define __NR_getppid		 64 | |
| 66 | #define __NR_getpgrp		 65 | |
| 67 | #define __NR_setsid		 66 | |
| 68 | #define __NR_sigaction		 67 | |
| 69 | #define __NR_sgetmask		 68 | |
| 70 | #define __NR_ssetmask		 69 | |
| 71 | #define __NR_setreuid		 70 | |
| 72 | #define __NR_setregid		 71 | |
| 73 | #define __NR_sigsuspend		 72 | |
| 74 | #define __NR_sigpending		 73 | |
| 75 | #define __NR_sethostname	 74 | |
| 76 | #define __NR_setrlimit		 75 | |
| 77 | #define __NR_getrlimit		 76 /* Back compatible 2Gig limited rlimit */ | |
| 78 | #define __NR_getrusage		 77 | |
| 79 | #define __NR_gettimeofday_time32	 78 | |
| 80 | #define __NR_settimeofday_time32	 79 | |
| 81 | #define __NR_getgroups		 80 | |
| 82 | #define __NR_setgroups		 81 | |
| 83 | #define __NR_select		 82 | |
| 84 | #define __NR_symlink		 83 | |
| 85 | #define __NR_oldlstat		 84 | |
| 86 | #define __NR_readlink		 85 | |
| 87 | #define __NR_uselib		 86 | |
| 88 | #define __NR_swapon		 87 | |
| 89 | #define __NR_reboot		 88 | |
| 90 | #define __NR_readdir		 89 | |
| 91 | #define __NR_mmap		 90 | |
| 92 | #define __NR_munmap		 91 | |
| 93 | #define __NR_truncate		 92 | |
| 94 | #define __NR_ftruncate		 93 | |
| 95 | #define __NR_fchmod		 94 | |
| 96 | #define __NR_fchown		 95 | |
| 97 | #define __NR_getpriority	 96 | |
| 98 | #define __NR_setpriority	 97 | |
| 99 | #define __NR_profil		 98 | |
| 100 | #define __NR_statfs		99 | |
| 101 | #define __NR_fstatfs		100 | |
| 102 | #define __NR_ioperm		101 | |
| 103 | #define __NR_socketcall		102 | |
| 104 | #define __NR_syslog		103 | |
| 105 | #define __NR_setitimer		104 | |
| 106 | #define __NR_getitimer		105 | |
| 107 | #define __NR_stat		106 | |
| 108 | #define __NR_lstat		107 | |
| 109 | #define __NR_fstat		108 | |
| 110 | #define __NR_olduname		109 | |
| 111 | #define __NR_iopl		110 | |
| 112 | #define __NR_vhangup		111 | |
| 113 | #define __NR_idle		112 | |
| 114 | #define __NR_vm86old		113 | |
| 115 | #define __NR_wait4		114 | |
| 116 | #define __NR_swapoff		115 | |
| 117 | #define __NR_sysinfo		116 | |
| 118 | #define __NR_ipc		117 | |
| 119 | #define __NR_fsync		118 | |
| 120 | #define __NR_sigreturn		119 | |
| 121 | #define __NR_clone		120 | |
| 122 | #define __NR_setdomainname	121 | |
| 123 | #define __NR_uname		122 | |
| 124 | #define __NR_modify_ldt		123 | |
| 125 | #define __NR_adjtimex		124 | |
| 126 | #define __NR_mprotect		125 | |
| 127 | #define __NR_sigprocmask	126 | |
| 128 | #define __NR_create_module	127 | |
| 129 | #define __NR_init_module	128 | |
| 130 | #define __NR_delete_module	129 | |
| 131 | #define __NR_get_kernel_syms	130 | |
| 132 | #define __NR_quotactl		131 | |
| 133 | #define __NR_getpgid		132 | |
| 134 | #define __NR_fchdir		133 | |
| 135 | #define __NR_bdflush		134 | |
| 136 | #define __NR_sysfs		135 | |
| 137 | #define __NR_personality	136 | |
| 138 | #define __NR_afs_syscall	137 | |
| 139 | #define __NR_setfsuid		138 | |
| 140 | #define __NR_setfsgid		139 | |
| 141 | #define __NR__llseek		140 | |
| 142 | #define __NR_getdents		141 | |
| 143 | #define __NR__newselect		142 | |
| 144 | #define __NR_flock		143 | |
| 145 | #define __NR_msync		144 | |
| 146 | #define __NR_readv		145 | |
| 147 | #define __NR_writev		146 | |
| 148 | #define __NR_getsid		147 | |
| 149 | #define __NR_fdatasync		148 | |
| 150 | #define __NR__sysctl		149 | |
| 151 | #define __NR_mlock		150 | |
| 152 | #define __NR_munlock		151 | |
| 153 | #define __NR_mlockall		152 | |
| 154 | #define __NR_munlockall		153 | |
| 155 | #define __NR_sched_setparam		154 | |
| 156 | #define __NR_sched_getparam		155 | |
| 157 | #define __NR_sched_setscheduler		156 | |
| 158 | #define __NR_sched_getscheduler		157 | |
| 159 | #define __NR_sched_yield		158 | |
| 160 | #define __NR_sched_get_priority_max	159 | |
| 161 | #define __NR_sched_get_priority_min	160 | |
| 162 | #define __NR_sched_rr_get_interval	161 | |
| 163 | #define __NR_nanosleep		162 | |
| 164 | #define __NR_mremap		163 | |
| 165 | #define __NR_setresuid		164 | |
| 166 | #define __NR_getresuid		165 | |
| 167 | #define __NR_vm86		166 | |
| 168 | #define __NR_query_module	167 | |
| 169 | #define __NR_poll		168 | |
| 170 | #define __NR_nfsservctl		169 | |
| 171 | #define __NR_setresgid		170 | |
| 172 | #define __NR_getresgid		171 | |
| 173 | #define __NR_prctl 172 | |
| 174 | #define __NR_rt_sigreturn	173 | |
| 175 | #define __NR_rt_sigaction	174 | |
| 176 | #define __NR_rt_sigprocmask	175 | |
| 177 | #define __NR_rt_sigpending	176 | |
| 178 | #define __NR_rt_sigtimedwait	177 | |
| 179 | #define __NR_rt_sigqueueinfo	178 | |
| 180 | #define __NR_rt_sigsuspend	179 | |
| 181 | #define __NR_pread64		180 | |
| 182 | #define __NR_pwrite64		181 | |
| 183 | #define __NR_chown		182 | |
| 184 | #define __NR_getcwd		183 | |
| 185 | #define __NR_capget		184 | |
| 186 | #define __NR_capset		185 | |
| 187 | #define __NR_sigaltstack	186 | |
| 188 | #define __NR_sendfile		187 | |
| 189 | #define __NR_getpmsg		188 | |
| 190 | #define __NR_putpmsg		189 | |
| 191 | #define __NR_vfork		190 | |
| 192 | #define __NR_ugetrlimit		191 | |
| 193 | #define __NR_mmap2		192 | |
| 194 | #define __NR_truncate64		193 | |
| 195 | #define __NR_ftruncate64	194 | |
| 196 | #define __NR_stat64		195 | |
| 197 | #define __NR_lstat64		196 | |
| 198 | #define __NR_fstat64		197 | |
| 199 | #define __NR_lchown32		198 | |
| 200 | #define __NR_getuid32		199 | |
| 201 | #define __NR_getgid32		200 | |
| 202 | #define __NR_geteuid32		201 | |
| 203 | #define __NR_getegid32		202 | |
| 204 | #define __NR_setreuid32		203 | |
| 205 | #define __NR_setregid32		204 | |
| 206 | #define __NR_getgroups32	205 | |
| 207 | #define __NR_setgroups32	206 | |
| 208 | #define __NR_fchown32		207 | |
| 209 | #define __NR_setresuid32	208 | |
| 210 | #define __NR_getresuid32	209 | |
| 211 | #define __NR_setresgid32	210 | |
| 212 | #define __NR_getresgid32	211 | |
| 213 | #define __NR_chown32		212 | |
| 214 | #define __NR_setuid32		213 | |
| 215 | #define __NR_setgid32		214 | |
| 216 | #define __NR_setfsuid32		215 | |
| 217 | #define __NR_setfsgid32		216 | |
| 218 | #define __NR_pivot_root		217 | |
| 219 | #define __NR_mincore		218 | |
| 220 | #define __NR_madvise		219 | |
| 221 | #define __NR_getdents64		220 | |
| 222 | #define __NR_fcntl64		221 | |
| 223 | /* 223 is unused */ | |
| 224 | #define __NR_gettid		224 | |
| 225 | #define __NR_readahead		225 | |
| 226 | #define __NR_setxattr		226 | |
| 227 | #define __NR_lsetxattr		227 | |
| 228 | #define __NR_fsetxattr		228 | |
| 229 | #define __NR_getxattr		229 | |
| 230 | #define __NR_lgetxattr		230 | |
| 231 | #define __NR_fgetxattr		231 | |
| 232 | #define __NR_listxattr		232 | |
| 233 | #define __NR_llistxattr		233 | |
| 234 | #define __NR_flistxattr		234 | |
| 235 | #define __NR_removexattr	235 | |
| 236 | #define __NR_lremovexattr	236 | |
| 237 | #define __NR_fremovexattr	237 | |
| 238 | #define __NR_tkill		238 | |
| 239 | #define __NR_sendfile64		239 | |
| 240 | #define __NR_futex		240 | |
| 241 | #define __NR_sched_setaffinity	241 | |
| 242 | #define __NR_sched_getaffinity	242 | |
| 243 | #define __NR_set_thread_area	243 | |
| 244 | #define __NR_get_thread_area	244 | |
| 245 | #define __NR_io_setup		245 | |
| 246 | #define __NR_io_destroy		246 | |
| 247 | #define __NR_io_getevents	247 | |
| 248 | #define __NR_io_submit		248 | |
| 249 | #define __NR_io_cancel		249 | |
| 250 | #define __NR_fadvise64		250 | |
| 251 | /* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ | |
| 252 | #define __NR_exit_group		252 | |
| 253 | #define __NR_lookup_dcookie	253 | |
| 254 | #define __NR_epoll_create	254 | |
| 255 | #define __NR_epoll_ctl		255 | |
| 256 | #define __NR_epoll_wait		256 | |
| 257 | #define __NR_remap_file_pages	257 | |
| 258 | #define __NR_set_tid_address	258 | |
| 259 | #define __NR_timer_create	259 | |
| 260 | #define __NR_timer_settime32	(__NR_timer_create+1) | |
| 261 | #define __NR_timer_gettime32	(__NR_timer_create+2) | |
| 262 | #define __NR_timer_getoverrun	(__NR_timer_create+3) | |
| 263 | #define __NR_timer_delete	(__NR_timer_create+4) | |
| 264 | #define __NR_clock_settime32	(__NR_timer_create+5) | |
| 265 | #define __NR_clock_gettime32	(__NR_timer_create+6) | |
| 266 | #define __NR_clock_getres_time32	(__NR_timer_create+7) | |
| 267 | #define __NR_clock_nanosleep_time32	(__NR_timer_create+8) | |
| 268 | #define __NR_statfs64		268 | |
| 269 | #define __NR_fstatfs64		269 | |
| 270 | #define __NR_tgkill		270 | |
| 271 | #define __NR_utimes		271 | |
| 272 | #define __NR_fadvise64_64	272 | |
| 273 | #define __NR_vserver		273 | |
| 274 | #define __NR_mbind		274 | |
| 275 | #define __NR_get_mempolicy	275 | |
| 276 | #define __NR_set_mempolicy	276 | |
| 277 | #define __NR_mq_open 		277 | |
| 278 | #define __NR_mq_unlink		(__NR_mq_open+1) | |
| 279 | #define __NR_mq_timedsend	(__NR_mq_open+2) | |
| 280 | #define __NR_mq_timedreceive	(__NR_mq_open+3) | |
| 281 | #define __NR_mq_notify		(__NR_mq_open+4) | |
| 282 | #define __NR_mq_getsetattr	(__NR_mq_open+5) | |
| 283 | #define __NR_kexec_load		283 | |
| 284 | #define __NR_waitid		284 | |
| 285 | /* #define __NR_sys_setaltroot	285 */ | |
| 286 | #define __NR_add_key		286 | |
| 287 | #define __NR_request_key	287 | |
| 288 | #define __NR_keyctl		288 | |
| 289 | #define __NR_ioprio_set		289 | |
| 290 | #define __NR_ioprio_get		290 | |
| 291 | #define __NR_inotify_init	291 | |
| 292 | #define __NR_inotify_add_watch	292 | |
| 293 | #define __NR_inotify_rm_watch	293 | |
| 294 | #define __NR_migrate_pages	294 | |
| 295 | #define __NR_openat		295 | |
| 296 | #define __NR_mkdirat		296 | |
| 297 | #define __NR_mknodat		297 | |
| 298 | #define __NR_fchownat		298 | |
| 299 | #define __NR_futimesat		299 | |
| 300 | #define __NR_fstatat64		300 | |
| 301 | #define __NR_unlinkat		301 | |
| 302 | #define __NR_renameat		302 | |
| 303 | #define __NR_linkat		303 | |
| 304 | #define __NR_symlinkat		304 | |
| 305 | #define __NR_readlinkat		305 | |
| 306 | #define __NR_fchmodat		306 | |
| 307 | #define __NR_faccessat		307 | |
| 308 | #define __NR_pselect6		308 | |
| 309 | #define __NR_ppoll		309 | |
| 310 | #define __NR_unshare		310 | |
| 311 | #define __NR_set_robust_list	311 | |
| 312 | #define __NR_get_robust_list	312 | |
| 313 | #define __NR_splice		313 | |
| 314 | #define __NR_sync_file_range	314 | |
| 315 | #define __NR_tee		315 | |
| 316 | #define __NR_vmsplice		316 | |
| 317 | #define __NR_move_pages		317 | |
| 318 | #define __NR_getcpu		318 | |
| 319 | #define __NR_epoll_pwait	319 | |
| 320 | #define __NR_utimensat		320 | |
| 321 | #define __NR_signalfd		321 | |
| 322 | #define __NR_timerfd_create	322 | |
| 323 | #define __NR_eventfd		323 | |
| 324 | #define __NR_fallocate		324 | |
| 325 | #define __NR_timerfd_settime32	325 | |
| 326 | #define __NR_timerfd_gettime32	326 | |
| 327 | #define __NR_signalfd4		327 | |
| 328 | #define __NR_eventfd2		328 | |
| 329 | #define __NR_epoll_create1	329 | |
| 330 | #define __NR_dup3		330 | |
| 331 | #define __NR_pipe2		331 | |
| 332 | #define __NR_inotify_init1	332 | |
| 333 | #define __NR_preadv		333 | |
| 334 | #define __NR_pwritev		334 | |
| 335 | #define __NR_rt_tgsigqueueinfo	335 | |
| 336 | #define __NR_perf_event_open	336 | |
| 337 | #define __NR_recvmmsg		337 | |
| 338 | #define __NR_fanotify_init	338 | |
| 339 | #define __NR_fanotify_mark	339 | |
| 340 | #define __NR_prlimit64		340 | |
| 341 | #define __NR_name_to_handle_at	341 | |
| 342 | #define __NR_open_by_handle_at	342 | |
| 343 | #define __NR_clock_adjtime	343 | |
| 344 | #define __NR_syncfs		344 | |
| 345 | #define __NR_sendmmsg		345 | |
| 346 | #define __NR_setns		346 | |
| 347 | #define __NR_process_vm_readv	347 | |
| 348 | #define __NR_process_vm_writev	348 | |
| 349 | #define __NR_kcmp		349 | |
| 350 | #define __NR_finit_module	350 | |
| 351 | #define __NR_sched_setattr	351 | |
| 352 | #define __NR_sched_getattr	352 | |
| 353 | #define __NR_renameat2		353 | |
| 354 | #define __NR_seccomp		354 | |
| 355 | #define __NR_getrandom		355 | |
| 356 | #define __NR_memfd_create	356 | |
| 357 | #define __NR_bpf		357 | |
| 358 | #define __NR_execveat		358 | |
| 359 | #define __NR_socket		359 | |
| 360 | #define __NR_socketpair		360 | |
| 361 | #define __NR_bind		361 | |
| 362 | #define __NR_connect		362 | |
| 363 | #define __NR_listen		363 | |
| 364 | #define __NR_accept4		364 | |
| 365 | #define __NR_getsockopt		365 | |
| 366 | #define __NR_setsockopt		366 | |
| 367 | #define __NR_getsockname	367 | |
| 368 | #define __NR_getpeername	368 | |
| 369 | #define __NR_sendto		369 | |
| 370 | #define __NR_sendmsg		370 | |
| 371 | #define __NR_recvfrom		371 | |
| 372 | #define __NR_recvmsg		372 | |
| 373 | #define __NR_shutdown		373 | |
| 374 | #define __NR_userfaultfd	374 | |
| 375 | #define __NR_membarrier		375 | |
| 376 | #define __NR_mlock2		376 | |
| 377 | #define __NR_copy_file_range	377 | |
| 378 | #define __NR_preadv2		378 | |
| 379 | #define __NR_pwritev2		379 | |
| 380 | #define __NR_pkey_mprotect	380 | |
| 381 | #define __NR_pkey_alloc		381 | |
| 382 | #define __NR_pkey_free		382 | |
| 383 | #define __NR_statx		383 | |
| 384 | #define __NR_arch_prctl		384 | |
| 385 | #define __NR_io_pgetevents	385 | |
| 386 | #define __NR_rseq		386 | |
| 387 | #define __NR_semget		393 | |
| 388 | #define __NR_semctl		394 | |
| 389 | #define __NR_shmget		395 | |
| 390 | #define __NR_shmctl		396 | |
| 391 | #define __NR_shmat		397 | |
| 392 | #define __NR_shmdt		398 | |
| 393 | #define __NR_msgget		399 | |
| 394 | #define __NR_msgsnd		400 | |
| 395 | #define __NR_msgrcv		401 | |
| 396 | #define __NR_msgctl		402 | |
| 397 | #define __NR_clock_gettime64	403 | |
| 398 | #define __NR_clock_settime64	404 | |
| 399 | #define __NR_clock_adjtime64	405 | |
| 400 | #define __NR_clock_getres_time64 406 | |
| 401 | #define __NR_clock_nanosleep_time64 407 | |
| 402 | #define __NR_timer_gettime64	408 | |
| 403 | #define __NR_timer_settime64	409 | |
| 404 | #define __NR_timerfd_gettime64	410 | |
| 405 | #define __NR_timerfd_settime64	411 | |
| 406 | #define __NR_utimensat_time64	412 | |
| 407 | #define __NR_pselect6_time64	413 | |
| 408 | #define __NR_ppoll_time64	414 | |
| 409 | #define __NR_io_pgetevents_time64 416 | |
| 410 | #define __NR_recvmmsg_time64	417 | |
| 411 | #define __NR_mq_timedsend_time64 418 | |
| 412 | #define __NR_mq_timedreceive_time64 419 | |
| 413 | #define __NR_semtimedop_time64	420 | |
| 414 | #define __NR_rt_sigtimedwait_time64 421 | |
| 415 | #define __NR_futex_time64	422 | |
| 416 | #define __NR_sched_rr_get_interval_time64 423 | |
| 417 | #define __NR_pidfd_send_signal	424 | |
| 418 | #define __NR_io_uring_setup	425 | |
| 419 | #define __NR_io_uring_enter	426 | |
| 420 | #define __NR_io_uring_register	427 | |
| 421 | #define __NR_open_tree		428 | |
| 422 | #define __NR_move_mount		429 | |
| 423 | #define __NR_fsopen		430 | |
| 424 | #define __NR_fsconfig		431 | |
| 425 | #define __NR_fsmount		432 | |
| 426 | #define __NR_fspick		433 | |
| 427 | #define __NR_pidfd_open		434 | |
| 428 | #define __NR_clone3		435 | |
| 429 | #define __NR_close_range	436 | |
| 430 | #define __NR_openat2		437 | |
| 431 | #define __NR_pidfd_getfd	438 | |
| 432 | #define __NR_faccessat2		439 | |
| 433 | #define __NR_process_madvise	440 | |
| 434 | #define __NR_epoll_pwait2	441 | |
| 435 | #define __NR_mount_setattr	442 | |
| 436 | #define __NR_landlock_create_ruleset	444 | |
| 437 | #define __NR_landlock_add_rule	445 | |
| 438 | #define __NR_landlock_restrict_self	446 | |
| 439 | ||
| 440 | #define SYS_restart_syscall 0 | |
| 441 | #define SYS_exit		 1 | |
| 442 | #define SYS_fork		 2 | |
| 443 | #define SYS_read		 3 | |
| 444 | #define SYS_write		 4 | |
| 445 | #define SYS_open		 5 | |
| 446 | #define SYS_close		 6 | |
| 447 | #define SYS_waitpid		 7 | |
| 448 | #define SYS_creat		 8 | |
| 449 | #define SYS_link		 9 | |
| 450 | #define SYS_unlink		 10 | |
| 451 | #define SYS_execve		 11 | |
| 452 | #define SYS_chdir		 12 | |
| 453 | #define SYS_time		 13 | |
| 454 | #define SYS_mknod		 14 | |
| 455 | #define SYS_chmod		 15 | |
| 456 | #define SYS_lchown		 16 | |
| 457 | #define SYS_break		 17 | |
| 458 | #define SYS_oldstat		 18 | |
| 459 | #define SYS_lseek		 19 | |
| 460 | #define SYS_getpid		 20 | |
| 461 | #define SYS_mount		 21 | |
| 462 | #define SYS_umount		 22 | |
| 463 | #define SYS_setuid		 23 | |
| 464 | #define SYS_getuid		 24 | |
| 465 | #define SYS_stime		 25 | |
| 466 | #define SYS_ptrace		 26 | |
| 467 | #define SYS_alarm		 27 | |
| 468 | #define SYS_oldfstat		 28 | |
| 469 | #define SYS_pause		 29 | |
| 470 | #define SYS_utime		 30 | |
| 471 | #define SYS_stty		 31 | |
| 472 | #define SYS_gtty		 32 | |
| 473 | #define SYS_access		 33 | |
| 474 | #define SYS_nice		 34 | |
| 475 | #define SYS_ftime		 35 | |
| 476 | #define SYS_sync		 36 | |
| 477 | #define SYS_kill		 37 | |
| 478 | #define SYS_rename		 38 | |
| 479 | #define SYS_mkdir		 39 | |
| 480 | #define SYS_rmdir		 40 | |
| 481 | #define SYS_dup		 41 | |
| 482 | #define SYS_pipe		 42 | |
| 483 | #define SYS_times		 43 | |
| 484 | #define SYS_prof		 44 | |
| 485 | #define SYS_brk		 45 | |
| 486 | #define SYS_setgid		 46 | |
| 487 | #define SYS_getgid		 47 | |
| 488 | #define SYS_signal		 48 | |
| 489 | #define SYS_geteuid		 49 | |
| 490 | #define SYS_getegid		 50 | |
| 491 | #define SYS_acct		 51 | |
| 492 | #define SYS_umount2		 52 | |
| 493 | #define SYS_lock		 53 | |
| 494 | #define SYS_ioctl		 54 | |
| 495 | #define SYS_fcntl		 55 | |
| 496 | #define SYS_mpx		 56 | |
| 497 | #define SYS_setpgid		 57 | |
| 498 | #define SYS_ulimit		 58 | |
| 499 | #define SYS_oldolduname	 59 | |
| 500 | #define SYS_umask		 60 | |
| 501 | #define SYS_chroot		 61 | |
| 502 | #define SYS_ustat		 62 | |
| 503 | #define SYS_dup2		 63 | |
| 504 | #define SYS_getppid		 64 | |
| 505 | #define SYS_getpgrp		 65 | |
| 506 | #define SYS_setsid		 66 | |
| 507 | #define SYS_sigaction		 67 | |
| 508 | #define SYS_sgetmask		 68 | |
| 509 | #define SYS_ssetmask		 69 | |
| 510 | #define SYS_setreuid		 70 | |
| 511 | #define SYS_setregid		 71 | |
| 512 | #define SYS_sigsuspend		 72 | |
| 513 | #define SYS_sigpending		 73 | |
| 514 | #define SYS_sethostname	 74 | |
| 515 | #define SYS_setrlimit		 75 | |
| 516 | #define SYS_getrlimit		 76 /* Back compatible 2Gig limited rlimit */ | |
| 517 | #define SYS_getrusage		 77 | |
| 518 | #define SYS_gettimeofday_time32	 78 | |
| 519 | #define SYS_settimeofday_time32	 79 | |
| 520 | #define SYS_getgroups		 80 | |
| 521 | #define SYS_setgroups		 81 | |
| 522 | #define SYS_select		 82 | |
| 523 | #define SYS_symlink		 83 | |
| 524 | #define SYS_oldlstat		 84 | |
| 525 | #define SYS_readlink		 85 | |
| 526 | #define SYS_uselib		 86 | |
| 527 | #define SYS_swapon		 87 | |
| 528 | #define SYS_reboot		 88 | |
| 529 | #define SYS_readdir		 89 | |
| 530 | #define SYS_mmap		 90 | |
| 531 | #define SYS_munmap		 91 | |
| 532 | #define SYS_truncate		 92 | |
| 533 | #define SYS_ftruncate		 93 | |
| 534 | #define SYS_fchmod		 94 | |
| 535 | #define SYS_fchown		 95 | |
| 536 | #define SYS_getpriority	 96 | |
| 537 | #define SYS_setpriority	 97 | |
| 538 | #define SYS_profil		 98 | |
| 539 | #define SYS_statfs		99 | |
| 540 | #define SYS_fstatfs		100 | |
| 541 | #define SYS_ioperm		101 | |
| 542 | #define SYS_socketcall		102 | |
| 543 | #define SYS_syslog		103 | |
| 544 | #define SYS_setitimer		104 | |
| 545 | #define SYS_getitimer		105 | |
| 546 | #define SYS_stat		106 | |
| 547 | #define SYS_lstat		107 | |
| 548 | #define SYS_fstat		108 | |
| 549 | #define SYS_olduname		109 | |
| 550 | #define SYS_iopl		110 | |
| 551 | #define SYS_vhangup		111 | |
| 552 | #define SYS_idle		112 | |
| 553 | #define SYS_vm86old		113 | |
| 554 | #define SYS_wait4		114 | |
| 555 | #define SYS_swapoff		115 | |
| 556 | #define SYS_sysinfo		116 | |
| 557 | #define SYS_ipc		117 | |
| 558 | #define SYS_fsync		118 | |
| 559 | #define SYS_sigreturn		119 | |
| 560 | #define SYS_clone		120 | |
| 561 | #define SYS_setdomainname	121 | |
| 562 | #define SYS_uname		122 | |
| 563 | #define SYS_modify_ldt		123 | |
| 564 | #define SYS_adjtimex		124 | |
| 565 | #define SYS_mprotect		125 | |
| 566 | #define SYS_sigprocmask	126 | |
| 567 | #define SYS_create_module	127 | |
| 568 | #define SYS_init_module	128 | |
| 569 | #define SYS_delete_module	129 | |
| 570 | #define SYS_get_kernel_syms	130 | |
| 571 | #define SYS_quotactl		131 | |
| 572 | #define SYS_getpgid		132 | |
| 573 | #define SYS_fchdir		133 | |
| 574 | #define SYS_bdflush		134 | |
| 575 | #define SYS_sysfs		135 | |
| 576 | #define SYS_personality	136 | |
| 577 | #define SYS_afs_syscall	137 | |
| 578 | #define SYS_setfsuid		138 | |
| 579 | #define SYS_setfsgid		139 | |
| 580 | #define SYS__llseek		140 | |
| 581 | #define SYS_getdents		141 | |
| 582 | #define SYS__newselect		142 | |
| 583 | #define SYS_flock		143 | |
| 584 | #define SYS_msync		144 | |
| 585 | #define SYS_readv		145 | |
| 586 | #define SYS_writev		146 | |
| 587 | #define SYS_getsid		147 | |
| 588 | #define SYS_fdatasync		148 | |
| 589 | #define SYS__sysctl		149 | |
| 590 | #define SYS_mlock		150 | |
| 591 | #define SYS_munlock		151 | |
| 592 | #define SYS_mlockall		152 | |
| 593 | #define SYS_munlockall		153 | |
| 594 | #define SYS_sched_setparam		154 | |
| 595 | #define SYS_sched_getparam		155 | |
| 596 | #define SYS_sched_setscheduler		156 | |
| 597 | #define SYS_sched_getscheduler		157 | |
| 598 | #define SYS_sched_yield		158 | |
| 599 | #define SYS_sched_get_priority_max	159 | |
| 600 | #define SYS_sched_get_priority_min	160 | |
| 601 | #define SYS_sched_rr_get_interval	161 | |
| 602 | #define SYS_nanosleep		162 | |
| 603 | #define SYS_mremap		163 | |
| 604 | #define SYS_setresuid		164 | |
| 605 | #define SYS_getresuid		165 | |
| 606 | #define SYS_vm86		166 | |
| 607 | #define SYS_query_module	167 | |
| 608 | #define SYS_poll		168 | |
| 609 | #define SYS_nfsservctl		169 | |
| 610 | #define SYS_setresgid		170 | |
| 611 | #define SYS_getresgid		171 | |
| 612 | #define SYS_prctl 172 | |
| 613 | #define SYS_rt_sigreturn	173 | |
| 614 | #define SYS_rt_sigaction	174 | |
| 615 | #define SYS_rt_sigprocmask	175 | |
| 616 | #define SYS_rt_sigpending	176 | |
| 617 | #define SYS_rt_sigtimedwait	177 | |
| 618 | #define SYS_rt_sigqueueinfo	178 | |
| 619 | #define SYS_rt_sigsuspend	179 | |
| 620 | #define SYS_pread64		180 | |
| 621 | #define SYS_pwrite64		181 | |
| 622 | #define SYS_chown		182 | |
| 623 | #define SYS_getcwd		183 | |
| 624 | #define SYS_capget		184 | |
| 625 | #define SYS_capset		185 | |
| 626 | #define SYS_sigaltstack	186 | |
| 627 | #define SYS_sendfile		187 | |
| 628 | #define SYS_getpmsg		188 | |
| 629 | #define SYS_putpmsg		189 | |
| 630 | #define SYS_vfork		190 | |
| 631 | #define SYS_ugetrlimit		191 | |
| 632 | #define SYS_mmap2		192 | |
| 633 | #define SYS_truncate64		193 | |
| 634 | #define SYS_ftruncate64	194 | |
| 635 | #define SYS_stat64		195 | |
| 636 | #define SYS_lstat64		196 | |
| 637 | #define SYS_fstat64		197 | |
| 638 | #define SYS_lchown32		198 | |
| 639 | #define SYS_getuid32		199 | |
| 640 | #define SYS_getgid32		200 | |
| 641 | #define SYS_geteuid32		201 | |
| 642 | #define SYS_getegid32		202 | |
| 643 | #define SYS_setreuid32		203 | |
| 644 | #define SYS_setregid32		204 | |
| 645 | #define SYS_getgroups32	205 | |
| 646 | #define SYS_setgroups32	206 | |
| 647 | #define SYS_fchown32		207 | |
| 648 | #define SYS_setresuid32	208 | |
| 649 | #define SYS_getresuid32	209 | |
| 650 | #define SYS_setresgid32	210 | |
| 651 | #define SYS_getresgid32	211 | |
| 652 | #define SYS_chown32		212 | |
| 653 | #define SYS_setuid32		213 | |
| 654 | #define SYS_setgid32		214 | |
| 655 | #define SYS_setfsuid32		215 | |
| 656 | #define SYS_setfsgid32		216 | |
| 657 | #define SYS_pivot_root		217 | |
| 658 | #define SYS_mincore		218 | |
| 659 | #define SYS_madvise		219 | |
| 660 | #define SYS_getdents64		220 | |
| 661 | #define SYS_fcntl64		221 | |
| 662 | #define SYS_gettid		224 | |
| 663 | #define SYS_readahead		225 | |
| 664 | #define SYS_setxattr		226 | |
| 665 | #define SYS_lsetxattr		227 | |
| 666 | #define SYS_fsetxattr		228 | |
| 667 | #define SYS_getxattr		229 | |
| 668 | #define SYS_lgetxattr		230 | |
| 669 | #define SYS_fgetxattr		231 | |
| 670 | #define SYS_listxattr		232 | |
| 671 | #define SYS_llistxattr		233 | |
| 672 | #define SYS_flistxattr		234 | |
| 673 | #define SYS_removexattr	235 | |
| 674 | #define SYS_lremovexattr	236 | |
| 675 | #define SYS_fremovexattr	237 | |
| 676 | #define SYS_tkill		238 | |
| 677 | #define SYS_sendfile64		239 | |
| 678 | #define SYS_futex		240 | |
| 679 | #define SYS_sched_setaffinity	241 | |
| 680 | #define SYS_sched_getaffinity	242 | |
| 681 | #define SYS_set_thread_area	243 | |
| 682 | #define SYS_get_thread_area	244 | |
| 683 | #define SYS_io_setup		245 | |
| 684 | #define SYS_io_destroy		246 | |
| 685 | #define SYS_io_getevents	247 | |
| 686 | #define SYS_io_submit		248 | |
| 687 | #define SYS_io_cancel		249 | |
| 688 | #define SYS_fadvise64		250 | |
| 689 | #define SYS_exit_group		252 | |
| 690 | #define SYS_lookup_dcookie	253 | |
| 691 | #define SYS_epoll_create	254 | |
| 692 | #define SYS_epoll_ctl		255 | |
| 693 | #define SYS_epoll_wait		256 | |
| 694 | #define SYS_remap_file_pages	257 | |
| 695 | #define SYS_set_tid_address	258 | |
| 696 | #define SYS_timer_create	259 | |
| 697 | #define SYS_timer_settime32	(__NR_timer_create+1) | |
| 698 | #define SYS_timer_gettime32	(__NR_timer_create+2) | |
| 699 | #define SYS_timer_getoverrun	(__NR_timer_create+3) | |
| 700 | #define SYS_timer_delete	(__NR_timer_create+4) | |
| 701 | #define SYS_clock_settime32	(__NR_timer_create+5) | |
| 702 | #define SYS_clock_gettime32	(__NR_timer_create+6) | |
| 703 | #define SYS_clock_getres_time32	(__NR_timer_create+7) | |
| 704 | #define SYS_clock_nanosleep_time32	(__NR_timer_create+8) | |
| 705 | #define SYS_statfs64		268 | |
| 706 | #define SYS_fstatfs64		269 | |
| 707 | #define SYS_tgkill		270 | |
| 708 | #define SYS_utimes		271 | |
| 709 | #define SYS_fadvise64_64	272 | |
| 710 | #define SYS_vserver		273 | |
| 711 | #define SYS_mbind		274 | |
| 712 | #define SYS_get_mempolicy	275 | |
| 713 | #define SYS_set_mempolicy	276 | |
| 714 | #define SYS_mq_open 		277 | |
| 715 | #define SYS_mq_unlink		(__NR_mq_open+1) | |
| 716 | #define SYS_mq_timedsend	(__NR_mq_open+2) | |
| 717 | #define SYS_mq_timedreceive	(__NR_mq_open+3) | |
| 718 | #define SYS_mq_notify		(__NR_mq_open+4) | |
| 719 | #define SYS_mq_getsetattr	(__NR_mq_open+5) | |
| 720 | #define SYS_kexec_load		283 | |
| 721 | #define SYS_waitid		284 | |
| 722 | /* #define SYS_sys_setaltroot	285 */ | |
| 723 | #define SYS_add_key		286 | |
| 724 | #define SYS_request_key	287 | |
| 725 | #define SYS_keyctl		288 | |
| 726 | #define SYS_ioprio_set		289 | |
| 727 | #define SYS_ioprio_get		290 | |
| 728 | #define SYS_inotify_init	291 | |
| 729 | #define SYS_inotify_add_watch	292 | |
| 730 | #define SYS_inotify_rm_watch	293 | |
| 731 | #define SYS_migrate_pages	294 | |
| 732 | #define SYS_openat		295 | |
| 733 | #define SYS_mkdirat		296 | |
| 734 | #define SYS_mknodat		297 | |
| 735 | #define SYS_fchownat		298 | |
| 736 | #define SYS_futimesat		299 | |
| 737 | #define SYS_fstatat64		300 | |
| 738 | #define SYS_unlinkat		301 | |
| 739 | #define SYS_renameat		302 | |
| 740 | #define SYS_linkat		303 | |
| 741 | #define SYS_symlinkat		304 | |
| 742 | #define SYS_readlinkat		305 | |
| 743 | #define SYS_fchmodat		306 | |
| 744 | #define SYS_faccessat		307 | |
| 745 | #define SYS_pselect6		308 | |
| 746 | #define SYS_ppoll		309 | |
| 747 | #define SYS_unshare		310 | |
| 748 | #define SYS_set_robust_list	311 | |
| 749 | #define SYS_get_robust_list	312 | |
| 750 | #define SYS_splice		313 | |
| 751 | #define SYS_sync_file_range	314 | |
| 752 | #define SYS_tee		315 | |
| 753 | #define SYS_vmsplice		316 | |
| 754 | #define SYS_move_pages		317 | |
| 755 | #define SYS_getcpu		318 | |
| 756 | #define SYS_epoll_pwait	319 | |
| 757 | #define SYS_utimensat		320 | |
| 758 | #define SYS_signalfd		321 | |
| 759 | #define SYS_timerfd_create	322 | |
| 760 | #define SYS_eventfd		323 | |
| 761 | #define SYS_fallocate		324 | |
| 762 | #define SYS_timerfd_settime32	325 | |
| 763 | #define SYS_timerfd_gettime32	326 | |
| 764 | #define SYS_signalfd4		327 | |
| 765 | #define SYS_eventfd2		328 | |
| 766 | #define SYS_epoll_create1	329 | |
| 767 | #define SYS_dup3		330 | |
| 768 | #define SYS_pipe2		331 | |
| 769 | #define SYS_inotify_init1	332 | |
| 770 | #define SYS_preadv		333 | |
| 771 | #define SYS_pwritev		334 | |
| 772 | #define SYS_rt_tgsigqueueinfo	335 | |
| 773 | #define SYS_perf_event_open	336 | |
| 774 | #define SYS_recvmmsg		337 | |
| 775 | #define SYS_fanotify_init	338 | |
| 776 | #define SYS_fanotify_mark	339 | |
| 777 | #define SYS_prlimit64		340 | |
| 778 | #define SYS_name_to_handle_at	341 | |
| 779 | #define SYS_open_by_handle_at	342 | |
| 780 | #define SYS_clock_adjtime	343 | |
| 781 | #define SYS_syncfs		344 | |
| 782 | #define SYS_sendmmsg		345 | |
| 783 | #define SYS_setns		346 | |
| 784 | #define SYS_process_vm_readv	347 | |
| 785 | #define SYS_process_vm_writev	348 | |
| 786 | #define SYS_kcmp		349 | |
| 787 | #define SYS_finit_module	350 | |
| 788 | #define SYS_sched_setattr	351 | |
| 789 | #define SYS_sched_getattr	352 | |
| 790 | #define SYS_renameat2		353 | |
| 791 | #define SYS_seccomp		354 | |
| 792 | #define SYS_getrandom		355 | |
| 793 | #define SYS_memfd_create	356 | |
| 794 | #define SYS_bpf		357 | |
| 795 | #define SYS_execveat		358 | |
| 796 | #define SYS_socket		359 | |
| 797 | #define SYS_socketpair		360 | |
| 798 | #define SYS_bind		361 | |
| 799 | #define SYS_connect		362 | |
| 800 | #define SYS_listen		363 | |
| 801 | #define SYS_accept4		364 | |
| 802 | #define SYS_getsockopt		365 | |
| 803 | #define SYS_setsockopt		366 | |
| 804 | #define SYS_getsockname	367 | |
| 805 | #define SYS_getpeername	368 | |
| 806 | #define SYS_sendto		369 | |
| 807 | #define SYS_sendmsg		370 | |
| 808 | #define SYS_recvfrom		371 | |
| 809 | #define SYS_recvmsg		372 | |
| 810 | #define SYS_shutdown		373 | |
| 811 | #define SYS_userfaultfd	374 | |
| 812 | #define SYS_membarrier		375 | |
| 813 | #define SYS_mlock2		376 | |
| 814 | #define SYS_copy_file_range	377 | |
| 815 | #define SYS_preadv2		378 | |
| 816 | #define SYS_pwritev2		379 | |
| 817 | #define SYS_pkey_mprotect	380 | |
| 818 | #define SYS_pkey_alloc		381 | |
| 819 | #define SYS_pkey_free		382 | |
| 820 | #define SYS_statx		383 | |
| 821 | #define SYS_arch_prctl		384 | |
| 822 | #define SYS_io_pgetevents	385 | |
| 823 | #define SYS_rseq		386 | |
| 824 | #define SYS_semget		393 | |
| 825 | #define SYS_semctl		394 | |
| 826 | #define SYS_shmget		395 | |
| 827 | #define SYS_shmctl		396 | |
| 828 | #define SYS_shmat		397 | |
| 829 | #define SYS_shmdt		398 | |
| 830 | #define SYS_msgget		399 | |
| 831 | #define SYS_msgsnd		400 | |
| 832 | #define SYS_msgrcv		401 | |
| 833 | #define SYS_msgctl		402 | |
| 834 | #define SYS_clock_gettime64	403 | |
| 835 | #define SYS_clock_settime64	404 | |
| 836 | #define SYS_clock_adjtime64	405 | |
| 837 | #define SYS_clock_getres_time64 406 | |
| 838 | #define SYS_clock_nanosleep_time64 407 | |
| 839 | #define SYS_timer_gettime64	408 | |
| 840 | #define SYS_timer_settime64	409 | |
| 841 | #define SYS_timerfd_gettime64	410 | |
| 842 | #define SYS_timerfd_settime64	411 | |
| 843 | #define SYS_utimensat_time64	412 | |
| 844 | #define SYS_pselect6_time64	413 | |
| 845 | #define SYS_ppoll_time64	414 | |
| 846 | #define SYS_io_pgetevents_time64 416 | |
| 847 | #define SYS_recvmmsg_time64	417 | |
| 848 | #define SYS_mq_timedsend_time64 418 | |
| 849 | #define SYS_mq_timedreceive_time64 419 | |
| 850 | #define SYS_semtimedop_time64	420 | |
| 851 | #define SYS_rt_sigtimedwait_time64 421 | |
| 852 | #define SYS_futex_time64	422 | |
| 853 | #define SYS_sched_rr_get_interval_time64 423 | |
| 854 | #define SYS_pidfd_send_signal	424 | |
| 855 | #define SYS_io_uring_setup	425 | |
| 856 | #define SYS_io_uring_enter	426 | |
| 857 | #define SYS_io_uring_register	427 | |
| 858 | #define SYS_open_tree		428 | |
| 859 | #define SYS_move_mount		429 | |
| 860 | #define SYS_fsopen		430 | |
| 861 | #define SYS_fsconfig		431 | |
| 862 | #define SYS_fsmount		432 | |
| 863 | #define SYS_fspick		433 | |
| 864 | #define SYS_pidfd_open		434 | |
| 865 | #define SYS_clone3		435 | |
| 866 | #define SYS_close_range	436 | |
| 867 | #define SYS_openat2		437 | |
| 868 | #define SYS_pidfd_getfd	438 | |
| 869 | #define SYS_faccessat2		439 | |
| 870 | #define SYS_process_madvise	440 | |
| 871 | #define SYS_epoll_pwait2	441 | |
| 872 | #define SYS_mount_setattr	442 | |
| 873 | #define SYS_landlock_create_ruleset	444 | |
| 874 | #define SYS_landlock_add_rule	445 | |
| 875 | #define SYS_landlock_restrict_self	446 | |
| \ No newline at end of file |
lib/libc/include/x86-linux-musl/bits/user.h created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | #undef __WORDSIZE | |
| 2 | #define __WORDSIZE 32 | |
| 3 | ||
| 4 | typedef struct user_fpregs_struct { | |
| 5 | 	long cwd, swd, twd, fip, fcs, foo, fos, st_space[20]; | |
| 6 | } elf_fpregset_t; | |
| 7 | ||
| 8 | typedef struct user_fpxregs_struct { | |
| 9 | 	unsigned short cwd, swd, twd, fop; | |
| 10 | 	long fip, fcs, foo, fos, mxcsr, reserved; | |
| 11 | 	long st_space[32], xmm_space[32], padding[56]; | |
| 12 | } elf_fpxregset_t; | |
| 13 | ||
| 14 | struct user_regs_struct { | |
| 15 | 	long ebx, ecx, edx, esi, edi, ebp, eax, xds, xes, xfs, xgs; | |
| 16 | 	long orig_eax, eip, xcs, eflags, esp, xss; | |
| 17 | }; | |
| 18 | ||
| 19 | #define ELF_NGREG 17 | |
| 20 | typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; | |
| 21 | ||
| 22 | struct user { | |
| 23 | 	struct user_regs_struct		regs; | |
| 24 | 	int				u_fpvalid; | |
| 25 | 	struct user_fpregs_struct	i387; | |
| 26 | 	unsigned long			u_tsize; | |
| 27 | 	unsigned long			u_dsize; | |
| 28 | 	unsigned long			u_ssize; | |
| 29 | 	unsigned long			start_code; | |
| 30 | 	unsigned long			start_stack; | |
| 31 | 	long				signal; | |
| 32 | 	int				reserved; | |
| 33 | 	struct user_regs_struct		*u_ar0; | |
| 34 | 	struct user_fpregs_struct	*u_fpstate; | |
| 35 | 	unsigned long			magic; | |
| 36 | 	char				u_comm[32]; | |
| 37 | 	int				u_debugreg[8]; | |
| 38 | }; | |
| 39 | ||
| 40 | #define PAGE_MASK		(~(PAGESIZE-1)) | |
| 41 | #define NBPG			PAGESIZE | |
| 42 | #define UPAGES			1 | |
| 43 | #define HOST_TEXT_START_ADDR	(u.start_code) | |
| 44 | #define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG) | |
| \ No newline at end of file |
lib/libc/musl/arch/arm/syscall_arch.h+7| ... | ... | @@ -101,3 +101,10 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo |
| 101 | 101 | #define SYSCALL_FADVISE_6_ARG |
| 102 | 102 | |
| 103 | 103 | #define SYSCALL_IPC_BROKEN_MODE |
| 104 | ||
| 105 | #define VDSO_USEFUL | |
| 106 | #define VDSO_CGT32_SYM "__vdso_clock_gettime" | |
| 107 | #define VDSO_CGT32_VER "LINUX_2.6" | |
| 108 | #define VDSO_CGT_SYM "__vdso_clock_gettime64" | |
| 109 | #define VDSO_CGT_VER "LINUX_2.6" | |
| 110 | #define VDSO_CGT_WORKAROUND 1 |
lib/libc/musl/arch/i386/arch.mak deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | COMPAT_SRC_DIRS = compat/time32 |
lib/libc/musl/arch/m68k/arch.mak deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | COMPAT_SRC_DIRS = compat/time32 |
lib/libc/musl/arch/mips/arch.mak deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | COMPAT_SRC_DIRS = compat/time32 |
lib/libc/musl/arch/mips/bits/signal.h-1| ... | ... | @@ -66,7 +66,6 @@ typedef struct __ucontext { |
| 66 | 66 | #define SA_RESTART 0x10000000 |
| 67 | 67 | #define SA_NODEFER 0x40000000 |
| 68 | 68 | #define SA_RESETHAND 0x80000000 |
| 69 | #define SA_RESTORER 0x04000000 | |
| 70 | 69 | |
| 71 | 70 | #undef SIG_BLOCK |
| 72 | 71 | #undef SIG_UNBLOCK |
lib/libc/musl/arch/mips/ksigaction.h+1-4| ... | ... | @@ -4,10 +4,7 @@ struct k_sigaction { |
| 4 | 4 | 	unsigned flags; |
| 5 | 5 | 	void (*handler)(int); |
| 6 | 6 | 	unsigned long mask[4]; |
| 7 | 	/* The following field is past the end of the structure the | |
| 8 | 	 * kernel will read or write, and exists only to avoid having | |
| 9 | 	 * mips-specific preprocessor conditionals in sigaction.c. */ | |
| 10 | 	void (*restorer)(); | |
| 7 | 	void *unused; | |
| 11 | 8 | }; |
| 12 | 9 | |
| 13 | 10 | hidden void __restore(), __restore_rt(); |
lib/libc/musl/arch/mips/reloc.h+1| ... | ... | @@ -29,6 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | #define NEED_MIPS_GOT_RELOCS 1 |
| 31 | 31 | #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP |
| 32 | #define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL | |
| 32 | 33 | #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) |
| 33 | 34 | |
| 34 | 35 | #define CRTJMP(pc,sp) __asm__ __volatile__( \ |
lib/libc/musl/arch/mips64/bits/signal.h-1| ... | ... | @@ -85,7 +85,6 @@ typedef struct __ucontext { |
| 85 | 85 | #define SA_RESTART 0x10000000 |
| 86 | 86 | #define SA_NODEFER 0x40000000 |
| 87 | 87 | #define SA_RESETHAND 0x80000000 |
| 88 | #define SA_RESTORER 0x04000000 | |
| 89 | 88 | |
| 90 | 89 | #undef SIG_BLOCK |
| 91 | 90 | #undef SIG_UNBLOCK |
lib/libc/musl/arch/mips64/ksigaction.h+1-1| ... | ... | @@ -4,7 +4,7 @@ struct k_sigaction { |
| 4 | 4 | 	unsigned flags; |
| 5 | 5 | 	void (*handler)(int); |
| 6 | 6 | 	unsigned long mask[2]; |
| 7 | 	void (*restorer)(); | |
| 7 | 	void *unused; | |
| 8 | 8 | }; |
| 9 | 9 | |
| 10 | 10 | hidden void __restore(), __restore_rt(); |
lib/libc/musl/arch/mips64/reloc.h+1| ... | ... | @@ -38,6 +38,7 @@ |
| 38 | 38 | |
| 39 | 39 | #define NEED_MIPS_GOT_RELOCS 1 |
| 40 | 40 | #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP |
| 41 | #define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL | |
| 41 | 42 | #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) |
| 42 | 43 | |
| 43 | 44 | #define CRTJMP(pc,sp) __asm__ __volatile__( \ |
lib/libc/musl/arch/powerpc/arch.mak deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | COMPAT_SRC_DIRS = compat/time32 |
lib/libc/musl/arch/riscv64/bits/signal.h-1| ... | ... | @@ -76,7 +76,6 @@ typedef struct __ucontext |
| 76 | 76 | #define SA_RESTART 0x10000000 |
| 77 | 77 | #define SA_NODEFER 0x40000000 |
| 78 | 78 | #define SA_RESETHAND 0x80000000 |
| 79 | #define SA_RESTORER 0x04000000 | |
| 80 | 79 | |
| 81 | 80 | #endif |
| 82 | 81 |
lib/libc/musl/compat/time32/__xstat.c+4-4| ... | ... | @@ -3,22 +3,22 @@ |
| 3 | 3 | |
| 4 | 4 | struct stat32; |
| 5 | 5 | |
| 6 | int __fxstat64(int ver, int fd, struct stat32 *buf) | |
| 6 | int __fxstat(int ver, int fd, struct stat32 *buf) | |
| 7 | 7 | { |
| 8 | 8 | 	return __fstat_time32(fd, buf); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf, int flag) | |
| 11 | int __fxstatat(int ver, int fd, const char *path, struct stat32 *buf, int flag) | |
| 12 | 12 | { |
| 13 | 13 | 	return __fstatat_time32(fd, path, buf, flag); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | int __lxstat64(int ver, const char *path, struct stat32 *buf) | |
| 16 | int __lxstat(int ver, const char *path, struct stat32 *buf) | |
| 17 | 17 | { |
| 18 | 18 | 	return __lstat_time32(path, buf); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | int __xstat64(int ver, const char *path, struct stat32 *buf) | |
| 21 | int __xstat(int ver, const char *path, struct stat32 *buf) | |
| 22 | 22 | { |
| 23 | 23 | 	return __stat_time32(path, buf); |
| 24 | 24 | } |
lib/libc/musl/compat/time32/aio_suspend_time32.c-2| ... | ... | @@ -7,5 +7,3 @@ int __aio_suspend_time32(const struct aiocb *const cbs[], int cnt, const struct |
| 7 | 7 | 	return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){ |
| 8 | 8 | 		.tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); |
| 9 | 9 | } |
| 10 | ||
| 11 | weak_alias(aio_suspend, aio_suspend64); |
lib/libc/musl/compat/time32/fstat_time32.c-2| ... | ... | @@ -13,5 +13,3 @@ int __fstat_time32(int fd, struct stat32 *restrict st32) |
| 13 | 13 | 	if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); |
| 14 | 14 | 	return r; |
| 15 | 15 | } |
| 16 | ||
| 17 | weak_alias(fstat, fstat64); |
lib/libc/musl/compat/time32/fstatat_time32.c-2| ... | ... | @@ -13,5 +13,3 @@ int __fstatat_time32(int fd, const char *restrict path, struct stat32 *restrict |
| 13 | 13 | 	if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); |
| 14 | 14 | 	return r; |
| 15 | 15 | } |
| 16 | ||
| 17 | weak_alias(fstatat, fstatat64); |
lib/libc/musl/compat/time32/lstat_time32.c-2| ... | ... | @@ -13,5 +13,3 @@ int __lstat_time32(const char *restrict path, struct stat32 *restrict st32) |
| 13 | 13 | 	if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); |
| 14 | 14 | 	return r; |
| 15 | 15 | } |
| 16 | ||
| 17 | weak_alias(lstat, lstat64); |
lib/libc/musl/compat/time32/stat_time32.c-2| ... | ... | @@ -13,5 +13,3 @@ int __stat_time32(const char *restrict path, struct stat32 *restrict st32) |
| 13 | 13 | 	if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); |
| 14 | 14 | 	return r; |
| 15 | 15 | } |
| 16 | ||
| 17 | weak_alias(stat, stat64); |
lib/libc/musl/include/aio.h+1-1| ... | ... | @@ -49,7 +49,7 @@ int aio_fsync(int, struct aiocb *); |
| 49 | 49 | |
| 50 | 50 | int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict); |
| 51 | 51 | |
| 52 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 52 | #if defined(_LARGEFILE64_SOURCE) | |
| 53 | 53 | #define aiocb64 aiocb |
| 54 | 54 | #define aio_read64 aio_read |
| 55 | 55 | #define aio_write64 aio_write |
lib/libc/musl/include/arpa/nameser.h+71| ... | ... | @@ -188,6 +188,36 @@ typedef enum __ns_type { |
| 188 | 188 | 	ns_t_sink = 40, |
| 189 | 189 | 	ns_t_opt = 41, |
| 190 | 190 | 	ns_t_apl = 42, |
| 191 | 	ns_t_ds = 43, | |
| 192 | 	ns_t_sshfp = 44, | |
| 193 | 	ns_t_ipseckey = 45, | |
| 194 | 	ns_t_rrsig = 46, | |
| 195 | 	ns_t_nsec = 47, | |
| 196 | 	ns_t_dnskey = 48, | |
| 197 | 	ns_t_dhcid = 49, | |
| 198 | 	ns_t_nsec3 = 50, | |
| 199 | 	ns_t_nsec3param = 51, | |
| 200 | 	ns_t_tlsa = 52, | |
| 201 | 	ns_t_smimea = 53, | |
| 202 | 	ns_t_hip = 55, | |
| 203 | 	ns_t_ninfo = 56, | |
| 204 | 	ns_t_rkey = 57, | |
| 205 | 	ns_t_talink = 58, | |
| 206 | 	ns_t_cds = 59, | |
| 207 | 	ns_t_cdnskey = 60, | |
| 208 | 	ns_t_openpgpkey = 61, | |
| 209 | 	ns_t_csync = 62, | |
| 210 | 	ns_t_spf = 99, | |
| 211 | 	ns_t_uinfo = 100, | |
| 212 | 	ns_t_uid = 101, | |
| 213 | 	ns_t_gid = 102, | |
| 214 | 	ns_t_unspec = 103, | |
| 215 | 	ns_t_nid = 104, | |
| 216 | 	ns_t_l32 = 105, | |
| 217 | 	ns_t_l64 = 106, | |
| 218 | 	ns_t_lp = 107, | |
| 219 | 	ns_t_eui48 = 108, | |
| 220 | 	ns_t_eui64 = 109, | |
| 191 | 221 | 	ns_t_tkey = 249, |
| 192 | 222 | 	ns_t_tsig = 250, |
| 193 | 223 | 	ns_t_ixfr = 251, |
| ... | ... | @@ -196,6 +226,11 @@ typedef enum __ns_type { |
| 196 | 226 | 	ns_t_maila = 254, |
| 197 | 227 | 	ns_t_any = 255, |
| 198 | 228 | 	ns_t_zxfr = 256, |
| 229 | 	ns_t_uri = 256, | |
| 230 | 	ns_t_caa = 257, | |
| 231 | 	ns_t_avc = 258, | |
| 232 | 	ns_t_ta = 32768, | |
| 233 | 	ns_t_dlv = 32769, | |
| 199 | 234 | 	ns_t_max = 65536 |
| 200 | 235 | } ns_type; |
| 201 | 236 | |
| ... | ... | @@ -430,12 +465,48 @@ typedef struct { |
| 430 | 465 | #define T_NAPTR		ns_t_naptr |
| 431 | 466 | #define T_A6		ns_t_a6 |
| 432 | 467 | #define T_DNAME		ns_t_dname |
| 468 | #define T_DS		ns_t_ds | |
| 469 | #define T_SSHFP		ns_t_sshfp | |
| 470 | #define T_IPSECKEY	ns_t_ipseckey | |
| 471 | #define T_RRSIG		ns_t_rrsig | |
| 472 | #define T_NSEC		ns_t_nsec | |
| 473 | #define T_DNSKEY	ns_t_dnskey | |
| 474 | #define T_DHCID		ns_t_dhcid | |
| 475 | #define T_NSEC3		ns_t_nsec3 | |
| 476 | #define T_NSEC3PARAM	ns_t_nsec3param | |
| 477 | #define T_TLSA		ns_t_tlsa | |
| 478 | #define T_SMIMEA	ns_t_smimea | |
| 479 | #define T_HIP		ns_t_hip | |
| 480 | #define T_NINFO		ns_t_ninfo | |
| 481 | #define T_RKEY		ns_t_rkey | |
| 482 | #define T_TALINK	ns_t_talink | |
| 483 | #define T_CDS		ns_t_cds | |
| 484 | #define T_CDNSKEY	ns_t_cdnskey | |
| 485 | #define T_OPENPGPKEY	ns_t_openpgpkey | |
| 486 | #define T_CSYNC		ns_t_csync | |
| 487 | #define T_SPF		ns_t_spf | |
| 488 | #define T_UINFO		ns_t_uinfo | |
| 489 | #define T_UID		ns_t_uid | |
| 490 | #define T_GID		ns_t_gid | |
| 491 | #define T_UNSPEC	ns_t_unspec | |
| 492 | #define T_NID		ns_t_nid | |
| 493 | #define T_L32		ns_t_l32 | |
| 494 | #define T_L64		ns_t_l64 | |
| 495 | #define T_LP		ns_t_lp | |
| 496 | #define T_EUI48		ns_t_eui48 | |
| 497 | #define T_EUI64		ns_t_eui64 | |
| 498 | #define T_TKEY		ns_t_tkey | |
| 433 | 499 | #define	T_TSIG		ns_t_tsig |
| 434 | 500 | #define	T_IXFR		ns_t_ixfr |
| 435 | 501 | #define T_AXFR		ns_t_axfr |
| 436 | 502 | #define T_MAILB		ns_t_mailb |
| 437 | 503 | #define T_MAILA		ns_t_maila |
| 438 | 504 | #define T_ANY		ns_t_any |
| 505 | #define T_URI		ns_t_uri | |
| 506 | #define T_CAA		ns_t_caa | |
| 507 | #define T_AVC		ns_t_avc | |
| 508 | #define T_TA		ns_t_ta | |
| 509 | #define T_DLV		ns_t_dlv | |
| 439 | 510 | |
| 440 | 511 | #define C_IN		ns_c_in |
| 441 | 512 | #define C_CHAOS		ns_c_chaos |
lib/libc/musl/include/dirent.h+1-1| ... | ... | @@ -56,7 +56,7 @@ int getdents(int, struct dirent *, size_t); |
| 56 | 56 | int versionsort(const struct dirent **, const struct dirent **); |
| 57 | 57 | #endif |
| 58 | 58 | |
| 59 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 59 | #if defined(_LARGEFILE64_SOURCE) | |
| 60 | 60 | #define dirent64 dirent |
| 61 | 61 | #define readdir64 readdir |
| 62 | 62 | #define readdir64_r readdir_r |
lib/libc/musl/include/elf.h+7-2| ... | ... | @@ -385,7 +385,8 @@ typedef struct { |
| 385 | 385 | #define SHT_PREINIT_ARRAY 16 |
| 386 | 386 | #define SHT_GROUP	 17 |
| 387 | 387 | #define SHT_SYMTAB_SHNDX 18 |
| 388 | #define	SHT_NUM		 19 | |
| 388 | #define SHT_RELR	 19 | |
| 389 | #define	SHT_NUM		 20 | |
| 389 | 390 | #define SHT_LOOS	 0x60000000 |
| 390 | 391 | #define SHT_GNU_ATTRIBUTES 0x6ffffff5 |
| 391 | 392 | #define SHT_GNU_HASH	 0x6ffffff6 |
| ... | ... | @@ -436,6 +437,7 @@ typedef struct { |
| 436 | 437 | } Elf64_Chdr; |
| 437 | 438 | |
| 438 | 439 | #define ELFCOMPRESS_ZLIB	1 |
| 440 | #define ELFCOMPRESS_ZSTD	2 | |
| 439 | 441 | #define ELFCOMPRESS_LOOS	0x60000000 |
| 440 | 442 | #define ELFCOMPRESS_HIOS	0x6fffffff |
| 441 | 443 | #define ELFCOMPRESS_LOPROC	0x70000000 |
| ... | ... | @@ -754,7 +756,10 @@ typedef struct { |
| 754 | 756 | #define DT_PREINIT_ARRAY 32 |
| 755 | 757 | #define DT_PREINIT_ARRAYSZ 33 |
| 756 | 758 | #define DT_SYMTAB_SHNDX	34 |
| 757 | #define	DT_NUM		35 | |
| 759 | #define DT_RELRSZ	35 | |
| 760 | #define DT_RELR		36 | |
| 761 | #define DT_RELRENT	37 | |
| 762 | #define	DT_NUM		38 | |
| 758 | 763 | #define DT_LOOS		0x6000000d |
| 759 | 764 | #define DT_HIOS		0x6ffff000 |
| 760 | 765 | #define DT_LOPROC	0x70000000 |
lib/libc/musl/include/fcntl.h+1-1| ... | ... | @@ -195,7 +195,7 @@ ssize_t tee(int, int, size_t, unsigned); |
| 195 | 195 | #define loff_t off_t |
| 196 | 196 | #endif |
| 197 | 197 | |
| 198 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 198 | #if defined(_LARGEFILE64_SOURCE) | |
| 199 | 199 | #define F_GETLK64 F_GETLK |
| 200 | 200 | #define F_SETLK64 F_SETLK |
| 201 | 201 | #define F_SETLKW64 F_SETLKW |
lib/libc/musl/include/ftw.h+1-1| ... | ... | @@ -29,7 +29,7 @@ struct FTW { |
| 29 | 29 | int ftw(const char *, int (*)(const char *, const struct stat *, int), int); |
| 30 | 30 | int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int); |
| 31 | 31 | |
| 32 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 32 | #if defined(_LARGEFILE64_SOURCE) | |
| 33 | 33 | #define ftw64 ftw |
| 34 | 34 | #define nftw64 nftw |
| 35 | 35 | #endif |
lib/libc/musl/include/glob.h+1-1| ... | ... | @@ -39,7 +39,7 @@ void globfree(glob_t *); |
| 39 | 39 | #define GLOB_NOMATCH 3 |
| 40 | 40 | #define GLOB_NOSYS 4 |
| 41 | 41 | |
| 42 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 42 | #if defined(_LARGEFILE64_SOURCE) | |
| 43 | 43 | #define glob64 glob |
| 44 | 44 | #define globfree64 globfree |
| 45 | 45 | #define glob64_t glob_t |
lib/libc/musl/include/netdb.h+1| ... | ... | @@ -44,6 +44,7 @@ struct addrinfo { |
| 44 | 44 | #define EAI_NONAME -2 |
| 45 | 45 | #define EAI_AGAIN -3 |
| 46 | 46 | #define EAI_FAIL -4 |
| 47 | #define EAI_NODATA -5 | |
| 47 | 48 | #define EAI_FAMILY -6 |
| 48 | 49 | #define EAI_SOCKTYPE -7 |
| 49 | 50 | #define EAI_SERVICE -8 |
lib/libc/musl/include/sched.h+1-1| ... | ... | @@ -124,7 +124,7 @@ __CPU_op_func_S(XOR, ^) |
| 124 | 124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) |
| 125 | 125 | #define CPU_FREE(set) free(set) |
| 126 | 126 | |
| 127 | #define CPU_SETSIZE 128 | |
| 127 | #define CPU_SETSIZE 1024 | |
| 128 | 128 | |
| 129 | 129 | #define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set) |
| 130 | 130 | #define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set) |
lib/libc/musl/include/stdio.h+1-1| ... | ... | @@ -205,7 +205,7 @@ typedef struct _IO_cookie_io_functions_t { |
| 205 | 205 | FILE *fopencookie(void *, const char *, cookie_io_functions_t); |
| 206 | 206 | #endif |
| 207 | 207 | |
| 208 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 208 | #if defined(_LARGEFILE64_SOURCE) | |
| 209 | 209 | #define tmpfile64 tmpfile |
| 210 | 210 | #define fopen64 fopen |
| 211 | 211 | #define freopen64 freopen |
lib/libc/musl/include/stdlib.h+2-2| ... | ... | @@ -95,7 +95,7 @@ size_t __ctype_get_mb_cur_max(void); |
| 95 | 95 | #define WTERMSIG(s) ((s) & 0x7f) |
| 96 | 96 | #define WSTOPSIG(s) WEXITSTATUS(s) |
| 97 | 97 | #define WIFEXITED(s) (!WTERMSIG(s)) |
| 98 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) | |
| 98 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00) | |
| 99 | 99 | #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) |
| 100 | 100 | |
| 101 | 101 | int posix_memalign (void **, size_t, size_t); |
| ... | ... | @@ -163,7 +163,7 @@ double strtod_l(const char *__restrict, char **__restrict, struct __locale_struc |
| 163 | 163 | long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); |
| 164 | 164 | #endif |
| 165 | 165 | |
| 166 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 166 | #if defined(_LARGEFILE64_SOURCE) | |
| 167 | 167 | #define mkstemp64 mkstemp |
| 168 | 168 | #define mkostemp64 mkostemp |
| 169 | 169 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
lib/libc/musl/include/string.h+1-1| ... | ... | @@ -73,6 +73,7 @@ char *strsignal(int); |
| 73 | 73 | char *strerror_l (int, locale_t); |
| 74 | 74 | int strcoll_l (const char *, const char *, locale_t); |
| 75 | 75 | size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); |
| 76 | void *memmem(const void *, size_t, const void *, size_t); | |
| 76 | 77 | #endif |
| 77 | 78 | |
| 78 | 79 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ |
| ... | ... | @@ -92,7 +93,6 @@ void explicit_bzero (void *, size_t); |
| 92 | 93 | int strverscmp (const char *, const char *); |
| 93 | 94 | char *strchrnul(const char *, int); |
| 94 | 95 | char *strcasestr(const char *, const char *); |
| 95 | void *memmem(const void *, size_t, const void *, size_t); | |
| 96 | 96 | void *memrchr(const void *, int, size_t); |
| 97 | 97 | void *mempcpy(void *, const void *, size_t); |
| 98 | 98 | #ifndef __cplusplus |
lib/libc/musl/include/strings.h+1| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | extern "C" { |
| 6 | 6 | #endif |
| 7 | 7 | |
| 8 | #include <features.h> | |
| 8 | 9 | |
| 9 | 10 | #define __NEED_size_t |
| 10 | 11 | #define __NEED_locale_t |
lib/libc/musl/include/sys/mman.h+1-1| ... | ... | @@ -141,7 +141,7 @@ int mincore (void *, size_t, unsigned char *); |
| 141 | 141 | int shm_open (const char *, int, mode_t); |
| 142 | 142 | int shm_unlink (const char *); |
| 143 | 143 | |
| 144 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 144 | #if defined(_LARGEFILE64_SOURCE) | |
| 145 | 145 | #define mmap64 mmap |
| 146 | 146 | #define off64_t off_t |
| 147 | 147 | #endif |
lib/libc/musl/include/sys/resource.h+1-1| ... | ... | @@ -95,7 +95,7 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); |
| 95 | 95 | |
| 96 | 96 | #define RLIM_NLIMITS RLIMIT_NLIMITS |
| 97 | 97 | |
| 98 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 98 | #if defined(_LARGEFILE64_SOURCE) | |
| 99 | 99 | #define RLIM64_INFINITY RLIM_INFINITY |
| 100 | 100 | #define RLIM64_SAVED_CUR RLIM_SAVED_CUR |
| 101 | 101 | #define RLIM64_SAVED_MAX RLIM_SAVED_MAX |
lib/libc/musl/include/sys/sendfile.h+1-1| ... | ... | @@ -10,7 +10,7 @@ extern "C" { |
| 10 | 10 | |
| 11 | 11 | ssize_t sendfile(int, int, off_t *, size_t); |
| 12 | 12 | |
| 13 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 13 | #if defined(_LARGEFILE64_SOURCE) | |
| 14 | 14 | #define sendfile64 sendfile |
| 15 | 15 | #define off64_t off_t |
| 16 | 16 | #endif |
lib/libc/musl/include/sys/stat.h+1-1| ... | ... | @@ -98,7 +98,7 @@ int lchmod(const char *, mode_t); |
| 98 | 98 | #define S_IEXEC S_IXUSR |
| 99 | 99 | #endif |
| 100 | 100 | |
| 101 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 101 | #if defined(_LARGEFILE64_SOURCE) | |
| 102 | 102 | #define stat64 stat |
| 103 | 103 | #define fstat64 fstat |
| 104 | 104 | #define lstat64 lstat |
lib/libc/musl/include/sys/statfs.h+1-1| ... | ... | @@ -18,7 +18,7 @@ typedef struct __fsid_t { |
| 18 | 18 | int statfs (const char *, struct statfs *); |
| 19 | 19 | int fstatfs (int, struct statfs *); |
| 20 | 20 | |
| 21 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 21 | #if defined(_LARGEFILE64_SOURCE) | |
| 22 | 22 | #define statfs64 statfs |
| 23 | 23 | #define fstatfs64 fstatfs |
| 24 | 24 | #define fsblkcnt64_t fsblkcnt_t |
lib/libc/musl/include/sys/statvfs.h+1-1| ... | ... | @@ -42,7 +42,7 @@ int fstatvfs (int, struct statvfs *); |
| 42 | 42 | #define ST_NODIRATIME 2048 |
| 43 | 43 | #define ST_RELATIME 4096 |
| 44 | 44 | |
| 45 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 45 | #if defined(_LARGEFILE64_SOURCE) | |
| 46 | 46 | #define statvfs64 statvfs |
| 47 | 47 | #define fstatvfs64 fstatvfs |
| 48 | 48 | #define fsblkcnt64_t fsblkcnt_t |
lib/libc/musl/include/sys/types.h+1-1| ... | ... | @@ -71,7 +71,7 @@ typedef unsigned long long u_quad_t; |
| 71 | 71 | #include <sys/select.h> |
| 72 | 72 | #endif |
| 73 | 73 | |
| 74 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 74 | #if defined(_LARGEFILE64_SOURCE) | |
| 75 | 75 | #define blkcnt64_t blkcnt_t |
| 76 | 76 | #define fsblkcnt64_t fsblkcnt_t |
| 77 | 77 | #define fsfilcnt64_t fsfilcnt_t |
lib/libc/musl/include/sys/uio.h+1-1| ... | ... | @@ -29,7 +29,7 @@ ssize_t writev (int, const struct iovec *, int); |
| 29 | 29 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 30 | 30 | ssize_t preadv (int, const struct iovec *, int, off_t); |
| 31 | 31 | ssize_t pwritev (int, const struct iovec *, int, off_t); |
| 32 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 32 | #if defined(_LARGEFILE64_SOURCE) | |
| 33 | 33 | #define preadv64 preadv |
| 34 | 34 | #define pwritev64 pwritev |
| 35 | 35 | #define off64_t off_t |
lib/libc/musl/include/sys/wait.h+1-1| ... | ... | @@ -50,7 +50,7 @@ pid_t wait4 (pid_t, int *, int, struct rusage *); |
| 50 | 50 | #define WSTOPSIG(s) WEXITSTATUS(s) |
| 51 | 51 | #define WCOREDUMP(s) ((s) & 0x80) |
| 52 | 52 | #define WIFEXITED(s) (!WTERMSIG(s)) |
| 53 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) | |
| 53 | #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00) | |
| 54 | 54 | #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) |
| 55 | 55 | #define WIFCONTINUED(s) ((s) == 0xffff) |
| 56 | 56 |
lib/libc/musl/include/unistd.h+5-1| ... | ... | @@ -198,7 +198,7 @@ ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned); |
| 198 | 198 | pid_t gettid(void); |
| 199 | 199 | #endif |
| 200 | 200 | |
| 201 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | |
| 201 | #if defined(_LARGEFILE64_SOURCE) | |
| 202 | 202 | #define lseek64 lseek |
| 203 | 203 | #define pread64 pread |
| 204 | 204 | #define pwrite64 pwrite |
| ... | ... | @@ -425,6 +425,8 @@ pid_t gettid(void); |
| 425 | 425 | #define _SC_XOPEN_STREAMS	246 |
| 426 | 426 | #define _SC_THREAD_ROBUST_PRIO_INHERIT	247 |
| 427 | 427 | #define _SC_THREAD_ROBUST_PRIO_PROTECT	248 |
| 428 | #define _SC_MINSIGSTKSZ	249 | |
| 429 | #define _SC_SIGSTKSZ	250 | |
| 428 | 430 | |
| 429 | 431 | #define _CS_PATH	0 |
| 430 | 432 | #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	1 |
| ... | ... | @@ -467,6 +469,8 @@ pid_t gettid(void); |
| 467 | 469 | #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS	1147 |
| 468 | 470 | #define _CS_V6_ENV	1148 |
| 469 | 471 | #define _CS_V7_ENV	1149 |
| 472 | #define _CS_POSIX_V7_THREADS_CFLAGS	1150 | |
| 473 | #define _CS_POSIX_V7_THREADS_LDFLAGS	1151 | |
| 470 | 474 | |
| 471 | 475 | #ifdef __cplusplus |
| 472 | 476 | } |
lib/libc/musl/libc.S+30-203| ... | ... | @@ -168,7 +168,7 @@ _IO_putc: |
| 168 | 168 | .weak _IO_putc_unlocked |
| 169 | 169 | .type _IO_putc_unlocked, %function; |
| 170 | 170 | _IO_putc_unlocked: |
| 171 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 171 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 172 | 172 | .globl ___tls_get_addr |
| 173 | 173 | .type ___tls_get_addr, %function; |
| 174 | 174 | ___tls_get_addr: |
| ... | ... | @@ -187,7 +187,7 @@ __aio_suspend_time64: |
| 187 | 187 | .globl __assert_fail |
| 188 | 188 | .type __assert_fail, %function; |
| 189 | 189 | __assert_fail: |
| 190 | #if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 190 | #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 191 | 191 | .globl __cachectl |
| 192 | 192 | .type __cachectl, %function; |
| 193 | 193 | __cachectl: |
| ... | ... | @@ -313,10 +313,10 @@ __fseterr: |
| 313 | 313 | .type __fsetlocking, %function; |
| 314 | 314 | __fsetlocking: |
| 315 | 315 | #ifdef PTR32 |
| 316 | .globl __fstat_time64 | |
| 316 | .weak __fstat_time64 | |
| 317 | 317 | .type __fstat_time64, %function; |
| 318 | 318 | __fstat_time64: |
| 319 | .globl __fstatat_time64 | |
| 319 | .weak __fstatat_time64 | |
| 320 | 320 | .type __fstatat_time64, %function; |
| 321 | 321 | __fstatat_time64: |
| 322 | 322 | .globl __ftime64 |
| ... | ... | @@ -338,22 +338,12 @@ __fwritable: |
| 338 | 338 | .globl __fwriting |
| 339 | 339 | .type __fwriting, %function; |
| 340 | 340 | __fwriting: |
| 341 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc) | |
| 342 | 341 | .globl __fxstat |
| 343 | 342 | .type __fxstat, %function; |
| 344 | 343 | __fxstat: |
| 345 | #endif | |
| 346 | WEAK64 __fxstat64 | |
| 347 | .type __fxstat64, %function; | |
| 348 | __fxstat64: | |
| 349 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc) | |
| 350 | 344 | .globl __fxstatat |
| 351 | 345 | .type __fxstatat, %function; |
| 352 | 346 | __fxstatat: |
| 353 | #endif | |
| 354 | WEAK64 __fxstatat64 | |
| 355 | .type __fxstatat64, %function; | |
| 356 | __fxstatat64: | |
| 357 | 347 | .weak __getdelim |
| 358 | 348 | .type __getdelim, %function; |
| 359 | 349 | __getdelim: |
| ... | ... | @@ -508,7 +498,7 @@ __localtime64: |
| 508 | 498 | .type __localtime64_r, %function; |
| 509 | 499 | __localtime64_r: |
| 510 | 500 | #endif |
| 511 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 501 | #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 512 | 502 | .globl __longjmp |
| 513 | 503 | .type __longjmp, %function; |
| 514 | 504 | __longjmp: |
| ... | ... | @@ -521,14 +511,9 @@ __lstat_time64: |
| 521 | 511 | .type __lutimes_time64, %function; |
| 522 | 512 | __lutimes_time64: |
| 523 | 513 | #endif |
| 524 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc) | |
| 525 | 514 | .globl __lxstat |
| 526 | 515 | .type __lxstat, %function; |
| 527 | 516 | __lxstat: |
| 528 | #endif | |
| 529 | WEAK64 __lxstat64 | |
| 530 | .type __lxstat64, %function; | |
| 531 | __lxstat64: | |
| 532 | 517 | #ifdef PTR32 |
| 533 | 518 | .globl __mktime64 |
| 534 | 519 | .type __mktime64, %function; |
| ... | ... | @@ -591,7 +576,17 @@ __recvmmsg_time64: |
| 591 | 576 | .globl __res_state |
| 592 | 577 | .type __res_state, %function; |
| 593 | 578 | __res_state: |
| 594 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 579 | #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 580 | .globl __restore | |
| 581 | .type __restore, %function; | |
| 582 | __restore: | |
| 583 | #endif | |
| 584 | #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 585 | .globl __restore_rt | |
| 586 | .type __restore_rt, %function; | |
| 587 | __restore_rt: | |
| 588 | #endif | |
| 589 | #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 595 | 590 | .globl __riscv_flush_icache |
| 596 | 591 | .type __riscv_flush_icache, %function; |
| 597 | 592 | __riscv_flush_icache: |
| ... | ... | @@ -792,27 +787,27 @@ __xpg_basename: |
| 792 | 787 | .weak __xpg_strerror_r |
| 793 | 788 | .type __xpg_strerror_r, %function; |
| 794 | 789 | __xpg_strerror_r: |
| 795 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc) | |
| 796 | 790 | .globl __xstat |
| 797 | 791 | .type __xstat, %function; |
| 798 | 792 | __xstat: |
| 799 | #endif | |
| 800 | WEAK64 __xstat64 | |
| 801 | .type __xstat64, %function; | |
| 802 | __xstat64: | |
| 803 | 793 | .weak _dl_debug_state |
| 804 | 794 | .type _dl_debug_state, %function; |
| 805 | 795 | _dl_debug_state: |
| 806 | 796 | .globl _dlstart |
| 807 | 797 | .type _dlstart, %function; |
| 808 | 798 | _dlstart: |
| 799 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 800 | .globl _dlstart_data | |
| 801 | .type _dlstart_data, %function; | |
| 802 | _dlstart_data: | |
| 803 | #endif | |
| 809 | 804 | .globl _exit |
| 810 | 805 | .type _exit, %function; |
| 811 | 806 | _exit: |
| 812 | 807 | .weak _fini |
| 813 | 808 | .type _fini, %function; |
| 814 | 809 | _fini: |
| 815 | #if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 810 | #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 816 | 811 | .globl _flush_cache |
| 817 | 812 | .type _flush_cache, %function; |
| 818 | 813 | _flush_cache: |
| ... | ... | @@ -886,45 +881,24 @@ adjtimex: |
| 886 | 881 | .globl aio_cancel |
| 887 | 882 | .type aio_cancel, %function; |
| 888 | 883 | aio_cancel: |
| 889 | .weak aio_cancel64 | |
| 890 | .type aio_cancel64, %function; | |
| 891 | aio_cancel64: | |
| 892 | 884 | .globl aio_error |
| 893 | 885 | .type aio_error, %function; |
| 894 | 886 | aio_error: |
| 895 | .weak aio_error64 | |
| 896 | .type aio_error64, %function; | |
| 897 | aio_error64: | |
| 898 | 887 | .globl aio_fsync |
| 899 | 888 | .type aio_fsync, %function; |
| 900 | 889 | aio_fsync: |
| 901 | .weak aio_fsync64 | |
| 902 | .type aio_fsync64, %function; | |
| 903 | aio_fsync64: | |
| 904 | 890 | .globl aio_read |
| 905 | 891 | .type aio_read, %function; |
| 906 | 892 | aio_read: |
| 907 | .weak aio_read64 | |
| 908 | .type aio_read64, %function; | |
| 909 | aio_read64: | |
| 910 | 893 | .globl aio_return |
| 911 | 894 | .type aio_return, %function; |
| 912 | 895 | aio_return: |
| 913 | .weak aio_return64 | |
| 914 | .type aio_return64, %function; | |
| 915 | aio_return64: | |
| 916 | 896 | .globl aio_suspend |
| 917 | 897 | .type aio_suspend, %function; |
| 918 | 898 | aio_suspend: |
| 919 | .weak aio_suspend64 | |
| 920 | .type aio_suspend64, %function; | |
| 921 | aio_suspend64: | |
| 922 | 899 | .globl aio_write |
| 923 | 900 | .type aio_write, %function; |
| 924 | 901 | aio_write: |
| 925 | .weak aio_write64 | |
| 926 | .type aio_write64, %function; | |
| 927 | aio_write64: | |
| 928 | 902 | .globl alarm |
| 929 | 903 | .type alarm, %function; |
| 930 | 904 | alarm: |
| ... | ... | @@ -934,10 +908,7 @@ aligned_alloc: |
| 934 | 908 | .globl alphasort |
| 935 | 909 | .type alphasort, %function; |
| 936 | 910 | alphasort: |
| 937 | .weak alphasort64 | |
| 938 | .type alphasort64, %function; | |
| 939 | alphasort64: | |
| 940 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 911 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 941 | 912 | .globl arch_prctl |
| 942 | 913 | .type arch_prctl, %function; |
| 943 | 914 | arch_prctl: |
| ... | ... | @@ -1062,12 +1033,12 @@ cabsf: |
| 1062 | 1033 | .globl cabsl |
| 1063 | 1034 | .type cabsl, %function; |
| 1064 | 1035 | cabsl: |
| 1065 | #if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 1036 | #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 1066 | 1037 | .weak cachectl |
| 1067 | 1038 | .type cachectl, %function; |
| 1068 | 1039 | cachectl: |
| 1069 | 1040 | #endif |
| 1070 | #if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 1041 | #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 1071 | 1042 | .weak cacheflush |
| 1072 | 1043 | .type cacheflush, %function; |
| 1073 | 1044 | cacheflush: |
| ... | ... | @@ -1384,9 +1355,6 @@ creall: |
| 1384 | 1355 | .globl creat |
| 1385 | 1356 | .type creat, %function; |
| 1386 | 1357 | creat: |
| 1387 | .weak creat64 | |
| 1388 | .type creat64, %function; | |
| 1389 | creat64: | |
| 1390 | 1358 | .globl crypt |
| 1391 | 1359 | .type crypt, %function; |
| 1392 | 1360 | crypt: |
| ... | ... | @@ -1729,9 +1697,6 @@ faccessat: |
| 1729 | 1697 | .globl fallocate |
| 1730 | 1698 | .type fallocate, %function; |
| 1731 | 1699 | fallocate: |
| 1732 | .weak fallocate64 | |
| 1733 | .type fallocate64, %function; | |
| 1734 | fallocate64: | |
| 1735 | 1700 | .globl fanotify_init |
| 1736 | 1701 | .type fanotify_init, %function; |
| 1737 | 1702 | fanotify_init: |
| ... | ... | @@ -1858,9 +1823,6 @@ fgetln: |
| 1858 | 1823 | .globl fgetpos |
| 1859 | 1824 | .type fgetpos, %function; |
| 1860 | 1825 | fgetpos: |
| 1861 | .weak fgetpos64 | |
| 1862 | .type fgetpos64, %function; | |
| 1863 | fgetpos64: | |
| 1864 | 1826 | .globl fgetpwent |
| 1865 | 1827 | .type fgetpwent, %function; |
| 1866 | 1828 | fgetpwent: |
| ... | ... | @@ -1966,9 +1928,6 @@ fnmatch: |
| 1966 | 1928 | .globl fopen |
| 1967 | 1929 | .type fopen, %function; |
| 1968 | 1930 | fopen: |
| 1969 | .weak fopen64 | |
| 1970 | .type fopen64, %function; | |
| 1971 | fopen64: | |
| 1972 | 1931 | .globl fopencookie |
| 1973 | 1932 | .type fopencookie, %function; |
| 1974 | 1933 | fopencookie: |
| ... | ... | @@ -2035,9 +1994,6 @@ fremovexattr: |
| 2035 | 1994 | .globl freopen |
| 2036 | 1995 | .type freopen, %function; |
| 2037 | 1996 | freopen: |
| 2038 | .weak freopen64 | |
| 2039 | .type freopen64, %function; | |
| 2040 | freopen64: | |
| 2041 | 1997 | .globl frexp |
| 2042 | 1998 | .type frexp, %function; |
| 2043 | 1999 | frexp: |
| ... | ... | @@ -2056,42 +2012,24 @@ fseek: |
| 2056 | 2012 | .weak fseeko |
| 2057 | 2013 | .type fseeko, %function; |
| 2058 | 2014 | fseeko: |
| 2059 | .weak fseeko64 | |
| 2060 | .type fseeko64, %function; | |
| 2061 | fseeko64: | |
| 2062 | 2015 | .globl fsetpos |
| 2063 | 2016 | .type fsetpos, %function; |
| 2064 | 2017 | fsetpos: |
| 2065 | .weak fsetpos64 | |
| 2066 | .type fsetpos64, %function; | |
| 2067 | fsetpos64: | |
| 2068 | 2018 | .globl fsetxattr |
| 2069 | 2019 | .type fsetxattr, %function; |
| 2070 | 2020 | fsetxattr: |
| 2071 | .globl fstat | |
| 2021 | WEAK64 fstat | |
| 2072 | 2022 | .type fstat, %function; |
| 2073 | 2023 | fstat: |
| 2074 | .weak fstat64 | |
| 2075 | .type fstat64, %function; | |
| 2076 | fstat64: | |
| 2077 | .globl fstatat | |
| 2024 | WEAK64 fstatat | |
| 2078 | 2025 | .type fstatat, %function; |
| 2079 | 2026 | fstatat: |
| 2080 | .weak fstatat64 | |
| 2081 | .type fstatat64, %function; | |
| 2082 | fstatat64: | |
| 2083 | 2027 | .weak fstatfs |
| 2084 | 2028 | .type fstatfs, %function; |
| 2085 | 2029 | fstatfs: |
| 2086 | .weak fstatfs64 | |
| 2087 | .type fstatfs64, %function; | |
| 2088 | fstatfs64: | |
| 2089 | 2030 | .globl fstatvfs |
| 2090 | 2031 | .type fstatvfs, %function; |
| 2091 | 2032 | fstatvfs: |
| 2092 | .weak fstatvfs64 | |
| 2093 | .type fstatvfs64, %function; | |
| 2094 | fstatvfs64: | |
| 2095 | 2033 | .globl fsync |
| 2096 | 2034 | .type fsync, %function; |
| 2097 | 2035 | fsync: |
| ... | ... | @@ -2101,9 +2039,6 @@ ftell: |
| 2101 | 2039 | .weak ftello |
| 2102 | 2040 | .type ftello, %function; |
| 2103 | 2041 | ftello: |
| 2104 | .weak ftello64 | |
| 2105 | .type ftello64, %function; | |
| 2106 | ftello64: | |
| 2107 | 2042 | .globl ftime |
| 2108 | 2043 | .type ftime, %function; |
| 2109 | 2044 | ftime: |
| ... | ... | @@ -2113,18 +2048,12 @@ ftok: |
| 2113 | 2048 | .globl ftruncate |
| 2114 | 2049 | .type ftruncate, %function; |
| 2115 | 2050 | ftruncate: |
| 2116 | .weak ftruncate64 | |
| 2117 | .type ftruncate64, %function; | |
| 2118 | ftruncate64: | |
| 2119 | 2051 | .globl ftrylockfile |
| 2120 | 2052 | .type ftrylockfile, %function; |
| 2121 | 2053 | ftrylockfile: |
| 2122 | 2054 | .globl ftw |
| 2123 | 2055 | .type ftw, %function; |
| 2124 | 2056 | ftw: |
| 2125 | .weak ftw64 | |
| 2126 | .type ftw64, %function; | |
| 2127 | ftw64: | |
| 2128 | 2057 | .globl funlockfile |
| 2129 | 2058 | .type funlockfile, %function; |
| 2130 | 2059 | funlockfile: |
| ... | ... | @@ -2203,9 +2132,6 @@ getdelim: |
| 2203 | 2132 | .globl getdents |
| 2204 | 2133 | .type getdents, %function; |
| 2205 | 2134 | getdents: |
| 2206 | .weak getdents64 | |
| 2207 | .type getdents64, %function; | |
| 2208 | getdents64: | |
| 2209 | 2135 | .globl getdomainname |
| 2210 | 2136 | .type getdomainname, %function; |
| 2211 | 2137 | getdomainname: |
| ... | ... | @@ -2380,9 +2306,6 @@ getresuid: |
| 2380 | 2306 | .globl getrlimit |
| 2381 | 2307 | .type getrlimit, %function; |
| 2382 | 2308 | getrlimit: |
| 2383 | .weak getrlimit64 | |
| 2384 | .type getrlimit64, %function; | |
| 2385 | getrlimit64: | |
| 2386 | 2309 | .globl getrusage |
| 2387 | 2310 | .type getrusage, %function; |
| 2388 | 2311 | getrusage: |
| ... | ... | @@ -2479,15 +2402,9 @@ getxattr: |
| 2479 | 2402 | .globl glob |
| 2480 | 2403 | .type glob, %function; |
| 2481 | 2404 | glob: |
| 2482 | .weak glob64 | |
| 2483 | .type glob64, %function; | |
| 2484 | glob64: | |
| 2485 | 2405 | .globl globfree |
| 2486 | 2406 | .type globfree, %function; |
| 2487 | 2407 | globfree: |
| 2488 | .weak globfree64 | |
| 2489 | .type globfree64, %function; | |
| 2490 | globfree64: | |
| 2491 | 2408 | .globl gmtime |
| 2492 | 2409 | .type gmtime, %function; |
| 2493 | 2410 | gmtime: |
| ... | ... | @@ -2632,12 +2549,12 @@ insque: |
| 2632 | 2549 | .globl ioctl |
| 2633 | 2550 | .type ioctl, %function; |
| 2634 | 2551 | ioctl: |
| 2635 | #if !defined(ARCH_riscv64) && !defined(ARCH_aarch64) | |
| 2552 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips64) && !defined(ARCH_aarch64) | |
| 2636 | 2553 | .globl ioperm |
| 2637 | 2554 | .type ioperm, %function; |
| 2638 | 2555 | ioperm: |
| 2639 | 2556 | #endif |
| 2640 | #if !defined(ARCH_riscv64) && !defined(ARCH_aarch64) | |
| 2557 | #if !defined(ARCH_riscv64) && !defined(ARCH_mips64) && !defined(ARCH_aarch64) | |
| 2641 | 2558 | .globl iopl |
| 2642 | 2559 | .type iopl, %function; |
| 2643 | 2560 | iopl: |
| ... | ... | @@ -2897,9 +2814,6 @@ linkat: |
| 2897 | 2814 | .globl lio_listio |
| 2898 | 2815 | .type lio_listio, %function; |
| 2899 | 2816 | lio_listio: |
| 2900 | .weak lio_listio64 | |
| 2901 | .type lio_listio64, %function; | |
| 2902 | lio_listio64: | |
| 2903 | 2817 | .globl listen |
| 2904 | 2818 | .type listen, %function; |
| 2905 | 2819 | listen: |
| ... | ... | @@ -2945,9 +2859,6 @@ localtime_r: |
| 2945 | 2859 | .globl lockf |
| 2946 | 2860 | .type lockf, %function; |
| 2947 | 2861 | lockf: |
| 2948 | .weak lockf64 | |
| 2949 | .type lockf64, %function; | |
| 2950 | lockf64: | |
| 2951 | 2862 | .globl log |
| 2952 | 2863 | .type log, %function; |
| 2953 | 2864 | log: |
| ... | ... | @@ -3029,18 +2940,12 @@ lsearch: |
| 3029 | 2940 | .weak lseek |
| 3030 | 2941 | .type lseek, %function; |
| 3031 | 2942 | lseek: |
| 3032 | .weak lseek64 | |
| 3033 | .type lseek64, %function; | |
| 3034 | lseek64: | |
| 3035 | 2943 | .globl lsetxattr |
| 3036 | 2944 | .type lsetxattr, %function; |
| 3037 | 2945 | lsetxattr: |
| 3038 | 2946 | .globl lstat |
| 3039 | 2947 | .type lstat, %function; |
| 3040 | 2948 | lstat: |
| 3041 | .weak lstat64 | |
| 3042 | .type lstat64, %function; | |
| 3043 | lstat64: | |
| 3044 | 2949 | .globl lutimes |
| 3045 | 2950 | .type lutimes, %function; |
| 3046 | 2951 | lutimes: |
| ... | ... | @@ -3146,27 +3051,15 @@ mknodat: |
| 3146 | 3051 | .globl mkostemp |
| 3147 | 3052 | .type mkostemp, %function; |
| 3148 | 3053 | mkostemp: |
| 3149 | .weak mkostemp64 | |
| 3150 | .type mkostemp64, %function; | |
| 3151 | mkostemp64: | |
| 3152 | 3054 | .weak mkostemps |
| 3153 | 3055 | .type mkostemps, %function; |
| 3154 | 3056 | mkostemps: |
| 3155 | .weak mkostemps64 | |
| 3156 | .type mkostemps64, %function; | |
| 3157 | mkostemps64: | |
| 3158 | 3057 | .globl mkstemp |
| 3159 | 3058 | .type mkstemp, %function; |
| 3160 | 3059 | mkstemp: |
| 3161 | .weak mkstemp64 | |
| 3162 | .type mkstemp64, %function; | |
| 3163 | mkstemp64: | |
| 3164 | 3060 | .globl mkstemps |
| 3165 | 3061 | .type mkstemps, %function; |
| 3166 | 3062 | mkstemps: |
| 3167 | .weak mkstemps64 | |
| 3168 | .type mkstemps64, %function; | |
| 3169 | mkstemps64: | |
| 3170 | 3063 | .globl mktemp |
| 3171 | 3064 | .type mktemp, %function; |
| 3172 | 3065 | mktemp: |
| ... | ... | @@ -3185,9 +3078,6 @@ mlockall: |
| 3185 | 3078 | .weak mmap |
| 3186 | 3079 | .type mmap, %function; |
| 3187 | 3080 | mmap: |
| 3188 | .weak mmap64 | |
| 3189 | .type mmap64, %function; | |
| 3190 | mmap64: | |
| 3191 | 3081 | .globl modf |
| 3192 | 3082 | .type modf, %function; |
| 3193 | 3083 | modf: |
| ... | ... | @@ -3329,9 +3219,6 @@ nexttowardl: |
| 3329 | 3219 | .globl nftw |
| 3330 | 3220 | .type nftw, %function; |
| 3331 | 3221 | nftw: |
| 3332 | .weak nftw64 | |
| 3333 | .type nftw64, %function; | |
| 3334 | nftw64: | |
| 3335 | 3222 | .globl ngettext |
| 3336 | 3223 | .type ngettext, %function; |
| 3337 | 3224 | ngettext: |
| ... | ... | @@ -3380,9 +3267,6 @@ ntohs: |
| 3380 | 3267 | .globl open |
| 3381 | 3268 | .type open, %function; |
| 3382 | 3269 | open: |
| 3383 | .weak open64 | |
| 3384 | .type open64, %function; | |
| 3385 | open64: | |
| 3386 | 3270 | .globl open_by_handle_at |
| 3387 | 3271 | .type open_by_handle_at, %function; |
| 3388 | 3272 | open_by_handle_at: |
| ... | ... | @@ -3395,9 +3279,6 @@ open_wmemstream: |
| 3395 | 3279 | .globl openat |
| 3396 | 3280 | .type openat, %function; |
| 3397 | 3281 | openat: |
| 3398 | .weak openat64 | |
| 3399 | .type openat64, %function; | |
| 3400 | openat64: | |
| 3401 | 3282 | .globl opendir |
| 3402 | 3283 | .type opendir, %function; |
| 3403 | 3284 | opendir: |
| ... | ... | @@ -3443,15 +3324,9 @@ posix_close: |
| 3443 | 3324 | .globl posix_fadvise |
| 3444 | 3325 | .type posix_fadvise, %function; |
| 3445 | 3326 | posix_fadvise: |
| 3446 | .weak posix_fadvise64 | |
| 3447 | .type posix_fadvise64, %function; | |
| 3448 | posix_fadvise64: | |
| 3449 | 3327 | .globl posix_fallocate |
| 3450 | 3328 | .type posix_fallocate, %function; |
| 3451 | 3329 | posix_fallocate: |
| 3452 | .weak posix_fallocate64 | |
| 3453 | .type posix_fallocate64, %function; | |
| 3454 | posix_fallocate64: | |
| 3455 | 3330 | .globl posix_madvise |
| 3456 | 3331 | .type posix_madvise, %function; |
| 3457 | 3332 | posix_madvise: |
| ... | ... | @@ -3557,24 +3432,15 @@ prctl: |
| 3557 | 3432 | .globl pread |
| 3558 | 3433 | .type pread, %function; |
| 3559 | 3434 | pread: |
| 3560 | .weak pread64 | |
| 3561 | .type pread64, %function; | |
| 3562 | pread64: | |
| 3563 | 3435 | .globl preadv |
| 3564 | 3436 | .type preadv, %function; |
| 3565 | 3437 | preadv: |
| 3566 | .weak preadv64 | |
| 3567 | .type preadv64, %function; | |
| 3568 | preadv64: | |
| 3569 | 3438 | .globl printf |
| 3570 | 3439 | .type printf, %function; |
| 3571 | 3440 | printf: |
| 3572 | 3441 | .globl prlimit |
| 3573 | 3442 | .type prlimit, %function; |
| 3574 | 3443 | prlimit: |
| 3575 | .weak prlimit64 | |
| 3576 | .type prlimit64, %function; | |
| 3577 | prlimit64: | |
| 3578 | 3444 | .globl process_vm_readv |
| 3579 | 3445 | .type process_vm_readv, %function; |
| 3580 | 3446 | process_vm_readv: |
| ... | ... | @@ -3971,15 +3837,9 @@ putwchar_unlocked: |
| 3971 | 3837 | .globl pwrite |
| 3972 | 3838 | .type pwrite, %function; |
| 3973 | 3839 | pwrite: |
| 3974 | .weak pwrite64 | |
| 3975 | .type pwrite64, %function; | |
| 3976 | pwrite64: | |
| 3977 | 3840 | .globl pwritev |
| 3978 | 3841 | .type pwritev, %function; |
| 3979 | 3842 | pwritev: |
| 3980 | .weak pwritev64 | |
| 3981 | .type pwritev64, %function; | |
| 3982 | pwritev64: | |
| 3983 | 3843 | .globl qsort |
| 3984 | 3844 | .type qsort, %function; |
| 3985 | 3845 | qsort: |
| ... | ... | @@ -4013,12 +3873,6 @@ readahead: |
| 4013 | 3873 | .globl readdir |
| 4014 | 3874 | .type readdir, %function; |
| 4015 | 3875 | readdir: |
| 4016 | .weak readdir64 | |
| 4017 | .type readdir64, %function; | |
| 4018 | readdir64: | |
| 4019 | .weak readdir64_r | |
| 4020 | .type readdir64_r, %function; | |
| 4021 | readdir64_r: | |
| 4022 | 3876 | .globl readdir_r |
| 4023 | 3877 | .type readdir_r, %function; |
| 4024 | 3878 | readdir_r: |
| ... | ... | @@ -4139,7 +3993,7 @@ rintf: |
| 4139 | 3993 | .globl rintl |
| 4140 | 3994 | .type rintl, %function; |
| 4141 | 3995 | rintl: |
| 4142 | #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 3996 | #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) | |
| 4143 | 3997 | .weak riscv_flush_icache |
| 4144 | 3998 | .type riscv_flush_icache, %function; |
| 4145 | 3999 | riscv_flush_icache: |
| ... | ... | @@ -4186,9 +4040,6 @@ scalbnl: |
| 4186 | 4040 | .globl scandir |
| 4187 | 4041 | .type scandir, %function; |
| 4188 | 4042 | scandir: |
| 4189 | .weak scandir64 | |
| 4190 | .type scandir64, %function; | |
| 4191 | scandir64: | |
| 4192 | 4043 | .globl scanf |
| 4193 | 4044 | .type scanf, %function; |
| 4194 | 4045 | scanf: |
| ... | ... | @@ -4285,9 +4136,6 @@ send: |
| 4285 | 4136 | .globl sendfile |
| 4286 | 4137 | .type sendfile, %function; |
| 4287 | 4138 | sendfile: |
| 4288 | .weak sendfile64 | |
| 4289 | .type sendfile64, %function; | |
| 4290 | sendfile64: | |
| 4291 | 4139 | .globl sendmmsg |
| 4292 | 4140 | .type sendmmsg, %function; |
| 4293 | 4141 | sendmmsg: |
| ... | ... | @@ -4393,9 +4241,6 @@ setreuid: |
| 4393 | 4241 | .globl setrlimit |
| 4394 | 4242 | .type setrlimit, %function; |
| 4395 | 4243 | setrlimit: |
| 4396 | .weak setrlimit64 | |
| 4397 | .type setrlimit64, %function; | |
| 4398 | setrlimit64: | |
| 4399 | 4244 | .globl setservent |
| 4400 | 4245 | .type setservent, %function; |
| 4401 | 4246 | setservent: |
| ... | ... | @@ -4612,21 +4457,12 @@ sscanf: |
| 4612 | 4457 | .globl stat |
| 4613 | 4458 | .type stat, %function; |
| 4614 | 4459 | stat: |
| 4615 | .weak stat64 | |
| 4616 | .type stat64, %function; | |
| 4617 | stat64: | |
| 4618 | 4460 | .weak statfs |
| 4619 | 4461 | .type statfs, %function; |
| 4620 | 4462 | statfs: |
| 4621 | .weak statfs64 | |
| 4622 | .type statfs64, %function; | |
| 4623 | statfs64: | |
| 4624 | 4463 | .globl statvfs |
| 4625 | 4464 | .type statvfs, %function; |
| 4626 | 4465 | statvfs: |
| 4627 | .weak statvfs64 | |
| 4628 | .type statvfs64, %function; | |
| 4629 | statvfs64: | |
| 4630 | 4466 | .globl stime |
| 4631 | 4467 | .type stime, %function; |
| 4632 | 4468 | stime: |
| ... | ... | @@ -4984,9 +4820,6 @@ timespec_get: |
| 4984 | 4820 | .globl tmpfile |
| 4985 | 4821 | .type tmpfile, %function; |
| 4986 | 4822 | tmpfile: |
| 4987 | .weak tmpfile64 | |
| 4988 | .type tmpfile64, %function; | |
| 4989 | tmpfile64: | |
| 4990 | 4823 | .globl tmpnam |
| 4991 | 4824 | .type tmpnam, %function; |
| 4992 | 4825 | tmpnam: |
| ... | ... | @@ -5029,9 +4862,6 @@ trunc: |
| 5029 | 4862 | .globl truncate |
| 5030 | 4863 | .type truncate, %function; |
| 5031 | 4864 | truncate: |
| 5032 | .weak truncate64 | |
| 5033 | .type truncate64, %function; | |
| 5034 | truncate64: | |
| 5035 | 4865 | .globl truncf |
| 5036 | 4866 | .type truncf, %function; |
| 5037 | 4867 | truncf: |
| ... | ... | @@ -5152,9 +4982,6 @@ verrx: |
| 5152 | 4982 | .globl versionsort |
| 5153 | 4983 | .type versionsort, %function; |
| 5154 | 4984 | versionsort: |
| 5155 | .weak versionsort64 | |
| 5156 | .type versionsort64, %function; | |
| 5157 | versionsort64: | |
| 5158 | 4985 | .globl vfork |
| 5159 | 4986 | .type vfork, %function; |
| 5160 | 4987 | vfork: |
lib/libc/musl/src/aio/aio.c+23-9| ... | ... | @@ -82,6 +82,8 @@ static size_t io_thread_stack_size; |
| 82 | 82 | |
| 83 | 83 | static struct aio_queue *__aio_get_queue(int fd, int need) |
| 84 | 84 | { |
| 85 | 	sigset_t allmask, origmask; | |
| 86 | 	int masked = 0; | |
| 85 | 87 | 	if (fd < 0) { |
| 86 | 88 | 		errno = EBADF; |
| 87 | 89 | 		return 0; |
| ... | ... | @@ -93,6 +95,9 @@ static struct aio_queue *__aio_get_queue(int fd, int need) |
| 93 | 95 | 	if ((!map || !map[a] || !map[a][b] || !map[a][b][c] || !(q=map[a][b][c][d])) && need) { |
| 94 | 96 | 		pthread_rwlock_unlock(&maplock); |
| 95 | 97 | 		if (fcntl(fd, F_GETFD) < 0) return 0; |
| 98 | 		sigfillset(&allmask); | |
| 99 | 		masked = 1; | |
| 100 | 		pthread_sigmask(SIG_BLOCK, &allmask, &origmask); | |
| 96 | 101 | 		pthread_rwlock_wrlock(&maplock); |
| 97 | 102 | 		if (!io_thread_stack_size) { |
| 98 | 103 | 			unsigned long val = __getauxval(AT_MINSIGSTKSZ); |
| ... | ... | @@ -119,6 +124,7 @@ static struct aio_queue *__aio_get_queue(int fd, int need) |
| 119 | 124 | 	if (q) pthread_mutex_lock(&q->lock); |
| 120 | 125 | out: |
| 121 | 126 | 	pthread_rwlock_unlock(&maplock); |
| 127 | 	if (masked) pthread_sigmask(SIG_SETMASK, &origmask, 0); | |
| 122 | 128 | 	return q; |
| 123 | 129 | } |
| 124 | 130 | |
| ... | ... | @@ -401,18 +407,26 @@ void __aio_atfork(int who) |
| 401 | 407 | 	if (who<0) { |
| 402 | 408 | 		pthread_rwlock_rdlock(&maplock); |
| 403 | 409 | 		return; |
| 410 | 	} else if (!who) { | |
| 411 | 		pthread_rwlock_unlock(&maplock); | |
| 412 | 		return; | |
| 404 | 413 | 	} |
| 405 | 	if (who>0 && map) for (int a=0; a<(-1U/2+1)>>24; a++) | |
| 414 | 	aio_fd_cnt = 0; | |
| 415 | 	if (pthread_rwlock_tryrdlock(&maplock)) { | |
| 416 | 		/* Obtaining lock may fail if _Fork was called nor via | |
| 417 | 		 * fork. In this case, no further aio is possible from | |
| 418 | 		 * child and we can just null out map so __aio_close | |
| 419 | 		 * does not attempt to do anything. */ | |
| 420 | 		map = 0; | |
| 421 | 		return; | |
| 422 | 	} | |
| 423 | 	if (map) for (int a=0; a<(-1U/2+1)>>24; a++) | |
| 406 | 424 | 		if (map[a]) for (int b=0; b<256; b++) |
| 407 | 425 | 			if (map[a][b]) for (int c=0; c<256; c++) |
| 408 | 426 | 				if (map[a][b][c]) for (int d=0; d<256; d++) |
| 409 | 427 | 					map[a][b][c][d] = 0; |
| 410 | 	pthread_rwlock_unlock(&maplock); | |
| 428 | 	/* Re-initialize the rwlock rather than unlocking since there | |
| 429 | 	 * may have been more than one reference on it in the parent. | |
| 430 | 	 * We are not a lock holder anyway; the thread in the parent was. */ | |
| 431 | 	pthread_rwlock_init(&maplock, 0); | |
| 411 | 432 | } |
| 412 | ||
| 413 | weak_alias(aio_cancel, aio_cancel64); | |
| 414 | weak_alias(aio_error, aio_error64); | |
| 415 | weak_alias(aio_fsync, aio_fsync64); | |
| 416 | weak_alias(aio_read, aio_read64); | |
| 417 | weak_alias(aio_write, aio_write64); | |
| 418 | weak_alias(aio_return, aio_return64); |
lib/libc/musl/src/aio/aio_suspend.c+1-5| ... | ... | @@ -9,7 +9,7 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec |
| 9 | 9 | { |
| 10 | 10 | 	int i, tid = 0, ret, expect = 0; |
| 11 | 11 | 	struct timespec at; |
| 12 | 	volatile int dummy_fut, *pfut; | |
| 12 | 	volatile int dummy_fut = 0, *pfut; | |
| 13 | 13 | 	int nzcnt = 0; |
| 14 | 14 | 	const struct aiocb *cb = 0; |
| 15 | 15 | |
| ... | ... | @@ -73,7 +73,3 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec |
| 73 | 73 | 		} |
| 74 | 74 | 	} |
| 75 | 75 | } |
| 76 | ||
| 77 | #if !_REDIR_TIME64 | |
| 78 | weak_alias(aio_suspend, aio_suspend64); | |
| 79 | #endif |
lib/libc/musl/src/aio/lio_listio.c-2| ... | ... | @@ -139,5 +139,3 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st |
| 139 | 139 | |
| 140 | 140 | 	return 0; |
| 141 | 141 | } |
| 142 | ||
| 143 | weak_alias(lio_listio, lio_listio64); |
lib/libc/musl/src/conf/confstr.c+1-1| ... | ... | @@ -7,7 +7,7 @@ size_t confstr(int name, char *buf, size_t len) |
| 7 | 7 | 	const char *s = ""; |
| 8 | 8 | 	if (!name) { |
| 9 | 9 | 		s = "/bin:/usr/bin"; |
| 10 | 	} else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) { | |
| 10 | 	} else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>35U) { | |
| 11 | 11 | 		errno = EINVAL; |
| 12 | 12 | 		return 0; |
| 13 | 13 | 	} |
lib/libc/musl/src/conf/sysconf.c+13| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | #include <sys/resource.h> |
| 5 | 5 | #include <signal.h> |
| 6 | 6 | #include <sys/sysinfo.h> |
| 7 | #include <sys/auxv.h> | |
| 7 | 8 | #include "syscall.h" |
| 8 | 9 | #include "libc.h" |
| 9 | 10 | |
| ... | ... | @@ -19,6 +20,8 @@ |
| 19 | 20 | #define JT_AVPHYS_PAGES JT(9) |
| 20 | 21 | #define JT_ZERO JT(10) |
| 21 | 22 | #define JT_DELAYTIMER_MAX JT(11) |
| 23 | #define JT_MINSIGSTKSZ JT(12) | |
| 24 | #define JT_SIGSTKSZ JT(13) | |
| 22 | 25 | |
| 23 | 26 | #define RLIM(x) (-32768|(RLIMIT_ ## x)) |
| 24 | 27 | |
| ... | ... | @@ -165,6 +168,9 @@ long sysconf(int name) |
| 165 | 168 | 		[_SC_XOPEN_STREAMS] = JT_ZERO, |
| 166 | 169 | 		[_SC_THREAD_ROBUST_PRIO_INHERIT] = -1, |
| 167 | 170 | 		[_SC_THREAD_ROBUST_PRIO_PROTECT] = -1, |
| 171 | ||
| 172 | 		[_SC_MINSIGSTKSZ] = JT_MINSIGSTKSZ, | |
| 173 | 		[_SC_SIGSTKSZ] = JT_SIGSTKSZ, | |
| 168 | 174 | 	}; |
| 169 | 175 | |
| 170 | 176 | 	if (name >= sizeof(values)/sizeof(values[0]) || !values[name]) { |
| ... | ... | @@ -212,6 +218,13 @@ long sysconf(int name) |
| 212 | 218 | 		mem *= si.mem_unit; |
| 213 | 219 | 		mem /= PAGE_SIZE; |
| 214 | 220 | 		return (mem > LONG_MAX) ? LONG_MAX : mem; |
| 221 | 	case JT_MINSIGSTKSZ & 255: | |
| 222 | 	case JT_SIGSTKSZ & 255: ; | |
| 223 | 		long val = __getauxval(AT_MINSIGSTKSZ); | |
| 224 | 		if (val < MINSIGSTKSZ) val = MINSIGSTKSZ; | |
| 225 | 		if (values[name] == JT_SIGSTKSZ) | |
| 226 | 			val += SIGSTKSZ - MINSIGSTKSZ; | |
| 227 | 		return val; | |
| 215 | 228 | 	case JT_ZERO & 255: |
| 216 | 229 | 		return 0; |
| 217 | 230 | 	} |
lib/libc/musl/src/dirent/alphasort.c-2| ... | ... | @@ -5,5 +5,3 @@ int alphasort(const struct dirent **a, const struct dirent **b) |
| 5 | 5 | { |
| 6 | 6 | 	return strcoll((*a)->d_name, (*b)->d_name); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(alphasort, alphasort64); |
lib/libc/musl/src/dirent/readdir.c-2| ... | ... | @@ -25,5 +25,3 @@ struct dirent *readdir(DIR *dir) |
| 25 | 25 | 	dir->tell = de->d_off; |
| 26 | 26 | 	return de; |
| 27 | 27 | } |
| 28 | ||
| 29 | weak_alias(readdir, readdir64); |
lib/libc/musl/src/dirent/readdir_r.c-2| ... | ... | @@ -25,5 +25,3 @@ int readdir_r(DIR *restrict dir, struct dirent *restrict buf, struct dirent **re |
| 25 | 25 | 	*result = buf; |
| 26 | 26 | 	return 0; |
| 27 | 27 | } |
| 28 | ||
| 29 | weak_alias(readdir_r, readdir64_r); |
lib/libc/musl/src/dirent/scandir.c-2| ... | ... | @@ -43,5 +43,3 @@ int scandir(const char *path, struct dirent ***res, |
| 43 | 43 | 	*res = names; |
| 44 | 44 | 	return cnt; |
| 45 | 45 | } |
| 46 | ||
| 47 | weak_alias(scandir, scandir64); |
lib/libc/musl/src/dirent/versionsort.c-3| ... | ... | @@ -6,6 +6,3 @@ int versionsort(const struct dirent **a, const struct dirent **b) |
| 6 | 6 | { |
| 7 | 7 | 	return strverscmp((*a)->d_name, (*b)->d_name); |
| 8 | 8 | } |
| 9 | ||
| 10 | #undef versionsort64 | |
| 11 | weak_alias(versionsort, versionsort64); |
lib/libc/musl/src/fcntl/creat.c-2| ... | ... | @@ -4,5 +4,3 @@ int creat(const char *filename, mode_t mode) |
| 4 | 4 | { |
| 5 | 5 | 	return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode); |
| 6 | 6 | } |
| 7 | ||
| 8 | weak_alias(creat, creat64); |
lib/libc/musl/src/fcntl/open.c-2| ... | ... | @@ -19,5 +19,3 @@ int open(const char *filename, int flags, ...) |
| 19 | 19 | |
| 20 | 20 | 	return __syscall_ret(fd); |
| 21 | 21 | } |
| 22 | ||
| 23 | weak_alias(open, open64); |
lib/libc/musl/src/fcntl/openat.c-2| ... | ... | @@ -15,5 +15,3 @@ int openat(int fd, const char *filename, int flags, ...) |
| 15 | 15 | |
| 16 | 16 | 	return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode); |
| 17 | 17 | } |
| 18 | ||
| 19 | weak_alias(openat, openat64); |
lib/libc/musl/src/fcntl/posix_fadvise.c-2| ... | ... | @@ -14,5 +14,3 @@ int posix_fadvise(int fd, off_t base, off_t len, int advice) |
| 14 | 14 | 		__SYSCALL_LL_E(len), advice); |
| 15 | 15 | #endif |
| 16 | 16 | } |
| 17 | ||
| 18 | weak_alias(posix_fadvise, posix_fadvise64); |
lib/libc/musl/src/fcntl/posix_fallocate.c-2| ... | ... | @@ -6,5 +6,3 @@ int posix_fallocate(int fd, off_t base, off_t len) |
| 6 | 6 | 	return -__syscall(SYS_fallocate, fd, 0, __SYSCALL_LL_E(base), |
| 7 | 7 | 		__SYSCALL_LL_E(len)); |
| 8 | 8 | } |
| 9 | ||
| 10 | weak_alias(posix_fallocate, posix_fallocate64); |
lib/libc/musl/src/include/sys/stat.h created+9| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | #ifndef SYS_STAT_H | |
| 2 | #define SYS_STAT_H | |
| 3 | ||
| 4 | #include "../../../include/sys/stat.h" | |
| 5 | ||
| 6 | hidden int __fstat(int, struct stat *); | |
| 7 | hidden int __fstatat(int, const char *restrict, struct stat *restrict, int); | |
| 8 | ||
| 9 | #endif |
lib/libc/musl/src/internal/dynlink.h+5-1| ... | ... | @@ -92,8 +92,12 @@ struct fdpic_dummy_loadmap { |
| 92 | 92 | #define DT_DEBUG_INDIRECT 0 |
| 93 | 93 | #endif |
| 94 | 94 | |
| 95 | #ifndef DT_DEBUG_INDIRECT_REL | |
| 96 | #define DT_DEBUG_INDIRECT_REL 0 | |
| 97 | #endif | |
| 98 | ||
| 95 | 99 | #define AUX_CNT 32 |
| 96 | #define DYN_CNT 32 | |
| 100 | #define DYN_CNT 37 | |
| 97 | 101 | |
| 98 | 102 | typedef void (*stage2_func)(unsigned char *, size_t *); |
| 99 | 103 |
lib/libc/musl/src/internal/fork_impl.h+1-1| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | extern hidden volatile int *const __at_quick_exit_lockptr; |
| 4 | 4 | extern hidden volatile int *const __atexit_lockptr; |
| 5 | extern hidden volatile int *const __dlerror_lockptr; | |
| 6 | 5 | extern hidden volatile int *const __gettext_lockptr; |
| 7 | 6 | extern hidden volatile int *const __locale_lockptr; |
| 8 | 7 | extern hidden volatile int *const __random_lockptr; |
| ... | ... | @@ -17,3 +16,4 @@ extern hidden volatile int *const __vmlock_lockptr; |
| 17 | 16 | |
| 18 | 17 | hidden void __malloc_atfork(int); |
| 19 | 18 | hidden void __ldso_atfork(int); |
| 19 | hidden void __pthread_key_atfork(int); |
lib/libc/musl/src/internal/ksigaction.h+5| ... | ... | @@ -6,8 +6,13 @@ |
| 6 | 6 | struct k_sigaction { |
| 7 | 7 | 	void (*handler)(int); |
| 8 | 8 | 	unsigned long flags; |
| 9 | #ifdef SA_RESTORER | |
| 9 | 10 | 	void (*restorer)(void); |
| 11 | #endif | |
| 10 | 12 | 	unsigned mask[2]; |
| 13 | #ifndef SA_RESTORER | |
| 14 | 	void *unused; | |
| 15 | #endif | |
| 11 | 16 | }; |
| 12 | 17 | |
| 13 | 18 | hidden void __restore(), __restore_rt(); |
lib/libc/musl/src/internal/syscall.h+13-13| ... | ... | @@ -58,7 +58,7 @@ hidden long __syscall_ret(unsigned long), |
| 58 | 58 | #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__) |
| 59 | 59 | #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__)) |
| 60 | 60 | |
| 61 | static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, long c, long d, long e, long f) | |
| 61 | static inline long __alt_socketcall(int sys, int sock, int cp, syscall_arg_t a, syscall_arg_t b, syscall_arg_t c, syscall_arg_t d, syscall_arg_t e, syscall_arg_t f) | |
| 62 | 62 | { |
| 63 | 63 | 	long r; |
| 64 | 64 | 	if (cp) r = __syscall_cp(sys, a, b, c, d, e, f); |
| ... | ... | @@ -71,9 +71,9 @@ static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, l |
| 71 | 71 | 	return r; |
| 72 | 72 | } |
| 73 | 73 | #define __socketcall(nm, a, b, c, d, e, f) __alt_socketcall(SYS_##nm, __SC_##nm, 0, \ |
| 74 | 	(long)(a), (long)(b), (long)(c), (long)(d), (long)(e), (long)(f)) | |
| 74 | 	__scc(a), __scc(b), __scc(c), __scc(d), __scc(e), __scc(f)) | |
| 75 | 75 | #define __socketcall_cp(nm, a, b, c, d, e, f) __alt_socketcall(SYS_##nm, __SC_##nm, 1, \ |
| 76 | 	(long)(a), (long)(b), (long)(c), (long)(d), (long)(e), (long)(f)) | |
| 76 | 	__scc(a), __scc(b), __scc(c), __scc(d), __scc(e), __scc(f)) | |
| 77 | 77 | |
| 78 | 78 | /* fixup legacy 16-bit junk */ |
| 79 | 79 | |
| ... | ... | @@ -201,43 +201,43 @@ static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, l |
| 201 | 201 | #define SYS_sendfile SYS_sendfile64 |
| 202 | 202 | #endif |
| 203 | 203 | |
| 204 | #ifndef SYS_timer_settime | |
| 204 | #ifdef SYS_timer_settime32 | |
| 205 | 205 | #define SYS_timer_settime SYS_timer_settime32 |
| 206 | 206 | #endif |
| 207 | 207 | |
| 208 | #ifndef SYS_timer_gettime | |
| 208 | #ifdef SYS_timer_gettime32 | |
| 209 | 209 | #define SYS_timer_gettime SYS_timer_gettime32 |
| 210 | 210 | #endif |
| 211 | 211 | |
| 212 | #ifndef SYS_timerfd_settime | |
| 212 | #ifdef SYS_timerfd_settime32 | |
| 213 | 213 | #define SYS_timerfd_settime SYS_timerfd_settime32 |
| 214 | 214 | #endif |
| 215 | 215 | |
| 216 | #ifndef SYS_timerfd_gettime | |
| 216 | #ifdef SYS_timerfd_gettime32 | |
| 217 | 217 | #define SYS_timerfd_gettime SYS_timerfd_gettime32 |
| 218 | 218 | #endif |
| 219 | 219 | |
| 220 | #ifndef SYS_clock_settime | |
| 220 | #ifdef SYS_clock_settime32 | |
| 221 | 221 | #define SYS_clock_settime SYS_clock_settime32 |
| 222 | 222 | #endif |
| 223 | 223 | |
| 224 | #ifndef SYS_clock_gettime | |
| 224 | #ifdef SYS_clock_gettime32 | |
| 225 | 225 | #define SYS_clock_gettime SYS_clock_gettime32 |
| 226 | 226 | #endif |
| 227 | 227 | |
| 228 | #ifndef SYS_clock_getres | |
| 228 | #ifdef SYS_clock_getres_time32 | |
| 229 | 229 | #define SYS_clock_getres SYS_clock_getres_time32 |
| 230 | 230 | #endif |
| 231 | 231 | |
| 232 | #ifndef SYS_clock_nanosleep | |
| 232 | #ifdef SYS_clock_nanosleep_time32 | |
| 233 | 233 | #define SYS_clock_nanosleep SYS_clock_nanosleep_time32 |
| 234 | 234 | #endif |
| 235 | 235 | |
| 236 | #ifndef SYS_gettimeofday | |
| 236 | #ifdef SYS_gettimeofday_time32 | |
| 237 | 237 | #define SYS_gettimeofday SYS_gettimeofday_time32 |
| 238 | 238 | #endif |
| 239 | 239 | |
| 240 | #ifndef SYS_settimeofday | |
| 240 | #ifdef SYS_settimeofday_time32 | |
| 241 | 241 | #define SYS_settimeofday SYS_settimeofday_time32 |
| 242 | 242 | #endif |
| 243 | 243 |
lib/libc/musl/src/internal/version.h+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | #define VERSION "1.2.3" | |
| 1 | #define VERSION "1.2.4" |
lib/libc/musl/src/ipc/semtimedop.c+2-1| ... | ... | @@ -7,7 +7,8 @@ |
| 7 | 7 | #define IS32BIT(x) !((x)+0x80000000ULL>>32) |
| 8 | 8 | #define CLAMP(x) (int)(IS32BIT(x) ? (x) : 0x7fffffffU+((0ULL+(x))>>63)) |
| 9 | 9 | |
| 10 | #if !defined(SYS_semtimedop) && !defined(SYS_ipc) | |
| 10 | #if !defined(SYS_semtimedop) && !defined(SYS_ipc) || \ | |
| 11 | 	SYS_semtimedop == SYS_semtimedop_time64 | |
| 11 | 12 | #define NO_TIME32 1 |
| 12 | 13 | #else |
| 13 | 14 | #define NO_TIME32 0 |
lib/libc/musl/src/ldso/dlerror.c+18-16| ... | ... | @@ -3,8 +3,7 @@ |
| 3 | 3 | #include <stdarg.h> |
| 4 | 4 | #include "pthread_impl.h" |
| 5 | 5 | #include "dynlink.h" |
| 6 | #include "lock.h" | |
| 7 | #include "fork_impl.h" | |
| 6 | #include "atomic.h" | |
| 8 | 7 | |
| 9 | 8 | #define malloc __libc_malloc |
| 10 | 9 | #define calloc __libc_calloc |
| ... | ... | @@ -23,28 +22,31 @@ char *dlerror() |
| 23 | 22 | 		return s; |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | static volatile int freebuf_queue_lock[1]; | |
| 27 | static void **freebuf_queue; | |
| 28 | volatile int *const __dlerror_lockptr = freebuf_queue_lock; | |
| 25 | /* Atomic singly-linked list, used to store list of thread-local dlerror | |
| 26 | * buffers for deferred free. They cannot be freed at thread exit time | |
| 27 | * because, by the time it's known they can be freed, the exiting thread | |
| 28 | * is in a highly restrictive context where it cannot call (even the | |
| 29 | * libc-internal) free. It also can't take locks; thus the atomic list. */ | |
| 30 | ||
| 31 | static void *volatile freebuf_queue; | |
| 29 | 32 | |
| 30 | 33 | void __dl_thread_cleanup(void) |
| 31 | 34 | { |
| 32 | 35 | 	pthread_t self = __pthread_self(); |
| 33 | 	if (self->dlerror_buf && self->dlerror_buf != (void *)-1) { | |
| 34 | 		LOCK(freebuf_queue_lock); | |
| 35 | 		void **p = (void **)self->dlerror_buf; | |
| 36 | 		*p = freebuf_queue; | |
| 37 | 		freebuf_queue = p; | |
| 38 | 		UNLOCK(freebuf_queue_lock); | |
| 39 | 	} | |
| 36 | 	if (!self->dlerror_buf || self->dlerror_buf == (void *)-1) | |
| 37 | 		return; | |
| 38 | 	void *h; | |
| 39 | 	do { | |
| 40 | 		h = freebuf_queue; | |
| 41 | 		*(void **)self->dlerror_buf = h; | |
| 42 | 	} while (a_cas_p(&freebuf_queue, h, self->dlerror_buf) != h); | |
| 40 | 43 | } |
| 41 | 44 | |
| 42 | 45 | hidden void __dl_vseterr(const char *fmt, va_list ap) |
| 43 | 46 | { |
| 44 | 	LOCK(freebuf_queue_lock); | |
| 45 | 	void **q = freebuf_queue; | |
| 46 | 	freebuf_queue = 0; | |
| 47 | 	UNLOCK(freebuf_queue_lock); | |
| 47 | 	void **q; | |
| 48 | 	do q = freebuf_queue; | |
| 49 | 	while (q && a_cas_p(&freebuf_queue, q, 0) != q); | |
| 48 | 50 | |
| 49 | 51 | 	while (q) { |
| 50 | 52 | 		void **p = *q; |
lib/libc/musl/src/legacy/ftw.c-2| ... | ... | @@ -7,5 +7,3 @@ int ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int |
| 7 | 7 | 	 * actually undefined, but works on all real-world machines. */ |
| 8 | 8 | 	return nftw(path, (int (*)())fn, fd_limit, FTW_PHYS); |
| 9 | 9 | } |
| 10 | ||
| 11 | weak_alias(ftw, ftw64); |
lib/libc/musl/src/linux/epoll.c+1| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | int epoll_create(int size) |
| 7 | 7 | { |
| 8 | 	if (size<=0) return __syscall_ret(-EINVAL); | |
| 8 | 9 | 	return epoll_create1(0); |
| 9 | 10 | } |
| 10 | 11 |
lib/libc/musl/src/linux/fallocate.c-3| ... | ... | @@ -7,6 +7,3 @@ int fallocate(int fd, int mode, off_t base, off_t len) |
| 7 | 7 | 	return syscall(SYS_fallocate, fd, mode, __SYSCALL_LL_E(base), |
| 8 | 8 | 		__SYSCALL_LL_E(len)); |
| 9 | 9 | } |
| 10 | ||
| 11 | #undef fallocate64 | |
| 12 | weak_alias(fallocate, fallocate64); |
lib/libc/musl/src/linux/getdents.c-2| ... | ... | @@ -8,5 +8,3 @@ int getdents(int fd, struct dirent *buf, size_t len) |
| 8 | 8 | 	if (len>INT_MAX) len = INT_MAX; |
| 9 | 9 | 	return syscall(SYS_getdents, fd, buf, len); |
| 10 | 10 | } |
| 11 | ||
| 12 | weak_alias(getdents, getdents64); |
lib/libc/musl/src/linux/membarrier.c+1-1| ... | ... | @@ -35,7 +35,7 @@ int __membarrier(int cmd, int flags) |
| 35 | 35 | 		__tl_lock(); |
| 36 | 36 | 		sem_init(&barrier_sem, 0, 0); |
| 37 | 37 | 		struct sigaction sa = { |
| 38 | 			.sa_flags = SA_RESTART, | |
| 38 | 			.sa_flags = SA_RESTART | SA_ONSTACK, | |
| 39 | 39 | 			.sa_handler = bcast_barrier |
| 40 | 40 | 		}; |
| 41 | 41 | 		memset(&sa.sa_mask, -1, sizeof sa.sa_mask); |
lib/libc/musl/src/linux/prlimit.c-3| ... | ... | @@ -21,6 +21,3 @@ int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlim |
| 21 | 21 | 	} |
| 22 | 22 | 	return r; |
| 23 | 23 | } |
| 24 | ||
| 25 | #undef prlimit64 | |
| 26 | weak_alias(prlimit, prlimit64); |
lib/libc/musl/src/linux/sendfile.c-2| ... | ... | @@ -5,5 +5,3 @@ ssize_t sendfile(int out_fd, int in_fd, off_t *ofs, size_t count) |
| 5 | 5 | { |
| 6 | 6 | 	return syscall(SYS_sendfile, out_fd, in_fd, ofs, count); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(sendfile, sendfile64); |
lib/libc/musl/src/linux/wait4.c+1-1| ... | ... | @@ -12,7 +12,7 @@ pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru) |
| 12 | 12 | 	if (ru) { |
| 13 | 13 | 		long long kru64[18]; |
| 14 | 14 | 		r = __syscall(SYS_wait4_time64, pid, status, options, kru64); |
| 15 | 		if (!r) { | |
| 15 | 		if (r > 0) { | |
| 16 | 16 | 			ru->ru_utime = (struct timeval) |
| 17 | 17 | 				{ .tv_sec = kru64[0], .tv_usec = kru64[1] }; |
| 18 | 18 | 			ru->ru_stime = (struct timeval) |
lib/libc/musl/src/malloc/mallocng/free.c+1-1| ... | ... | @@ -119,7 +119,7 @@ void free(void *p) |
| 119 | 119 | 	if (((uintptr_t)(start-1) ^ (uintptr_t)end) >= 2*PGSZ && g->last_idx) { |
| 120 | 120 | 		unsigned char *base = start + (-(uintptr_t)start & (PGSZ-1)); |
| 121 | 121 | 		size_t len = (end-base) & -PGSZ; |
| 122 | 		if (len) { | |
| 122 | 		if (len && USE_MADV_FREE) { | |
| 123 | 123 | 			int e = errno; |
| 124 | 124 | 			madvise(base, len, MADV_FREE); |
| 125 | 125 | 			errno = e; |
lib/libc/musl/src/malloc/mallocng/glue.h+2| ... | ... | @@ -24,6 +24,8 @@ |
| 24 | 24 | #define realloc __libc_realloc |
| 25 | 25 | #define free __libc_free |
| 26 | 26 | |
| 27 | #define USE_MADV_FREE 0 | |
| 28 | ||
| 27 | 29 | #if USE_REAL_ASSERT |
| 28 | 30 | #include <assert.h> |
| 29 | 31 | #else |
lib/libc/musl/src/math/logf.c+1-1| ... | ... | @@ -53,7 +53,7 @@ float logf(float x) |
| 53 | 53 | 	tmp = ix - OFF; |
| 54 | 54 | 	i = (tmp >> (23 - LOGF_TABLE_BITS)) % N; |
| 55 | 55 | 	k = (int32_t)tmp >> 23; /* arithmetic shift */ |
| 56 | 	iz = ix - (tmp & 0x1ff << 23); | |
| 56 | 	iz = ix - (tmp & 0xff800000); | |
| 57 | 57 | 	invc = T[i].invc; |
| 58 | 58 | 	logc = T[i].logc; |
| 59 | 59 | 	z = (double_t)asfloat(iz); |
lib/libc/musl/src/misc/getopt.c+2-1| ... | ... | @@ -87,7 +87,8 @@ int getopt(int argc, char * const argv[], const char *optstring) |
| 87 | 87 | 	if (optstring[i] == ':') { |
| 88 | 88 | 		optarg = 0; |
| 89 | 89 | 		if (optstring[i+1] != ':' || optpos) { |
| 90 | 			optarg = argv[optind++] + optpos; | |
| 90 | 			optarg = argv[optind++]; | |
| 91 | 			if (optpos) optarg += optpos; | |
| 91 | 92 | 			optpos = 0; |
| 92 | 93 | 		} |
| 93 | 94 | 		if (optind > argc) { |
lib/libc/musl/src/misc/getrlimit.c+5-3| ... | ... | @@ -6,12 +6,13 @@ |
| 6 | 6 | |
| 7 | 7 | int getrlimit(int resource, struct rlimit *rlim) |
| 8 | 8 | { |
| 9 | 	unsigned long k_rlim[2]; | |
| 10 | 9 | 	int ret = syscall(SYS_prlimit64, 0, resource, 0, rlim); |
| 11 | 10 | 	if (!ret) { |
| 12 | 11 | 		FIX(rlim->rlim_cur); |
| 13 | 12 | 		FIX(rlim->rlim_max); |
| 14 | 13 | 	} |
| 14 | #ifdef SYS_getrlimit | |
| 15 | 	unsigned long k_rlim[2]; | |
| 15 | 16 | 	if (!ret || errno != ENOSYS) |
| 16 | 17 | 		return ret; |
| 17 | 18 | 	if (syscall(SYS_getrlimit, resource, k_rlim) < 0) |
| ... | ... | @@ -21,6 +22,7 @@ int getrlimit(int resource, struct rlimit *rlim) |
| 21 | 22 | 	FIX(rlim->rlim_cur); |
| 22 | 23 | 	FIX(rlim->rlim_max); |
| 23 | 24 | 	return 0; |
| 25 | #else | |
| 26 | 	return ret; | |
| 27 | #endif | |
| 24 | 28 | } |
| 25 | ||
| 26 | weak_alias(getrlimit, getrlimit64); |
lib/libc/musl/src/misc/lockf.c-2| ... | ... | @@ -28,5 +28,3 @@ int lockf(int fd, int op, off_t size) |
| 28 | 28 | 	errno = EINVAL; |
| 29 | 29 | 	return -1; |
| 30 | 30 | } |
| 31 | ||
| 32 | weak_alias(lockf, lockf64); |
lib/libc/musl/src/misc/mntent.c+9-3| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | #include <string.h> |
| 3 | 3 | #include <mntent.h> |
| 4 | 4 | #include <errno.h> |
| 5 | #include <limits.h> | |
| 5 | 6 | |
| 6 | 7 | static char *internal_buf; |
| 7 | 8 | static size_t internal_bufsize; |
| ... | ... | @@ -21,7 +22,8 @@ int endmntent(FILE *f) |
| 21 | 22 | |
| 22 | 23 | struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int buflen) |
| 23 | 24 | { |
| 24 | 	int cnt, n[8], use_internal = (linebuf == SENTINEL); | |
| 25 | 	int n[8], use_internal = (linebuf == SENTINEL); | |
| 26 | 	size_t len, i; | |
| 25 | 27 | |
| 26 | 28 | 	mnt->mnt_freq = 0; |
| 27 | 29 | 	mnt->mnt_passno = 0; |
| ... | ... | @@ -39,10 +41,14 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle |
| 39 | 41 | 			errno = ERANGE; |
| 40 | 42 | 			return 0; |
| 41 | 43 | 		} |
| 42 | 		cnt = sscanf(linebuf, " %n%*s%n %n%*s%n %n%*s%n %n%*s%n %d %d", | |
| 44 | ||
| 45 | 		len = strlen(linebuf); | |
| 46 | 		if (len > INT_MAX) continue; | |
| 47 | 		for (i = 0; i < sizeof n / sizeof *n; i++) n[i] = len; | |
| 48 | 		sscanf(linebuf, " %n%*s%n %n%*s%n %n%*s%n %n%*s%n %d %d", | |
| 43 | 49 | 			n, n+1, n+2, n+3, n+4, n+5, n+6, n+7, |
| 44 | 50 | 			&mnt->mnt_freq, &mnt->mnt_passno); |
| 45 | 	} while (cnt < 2 || linebuf[n[0]] == '#'); | |
| 51 | 	} while (linebuf[n[0]] == '#' || n[1]==len); | |
| 46 | 52 | |
| 47 | 53 | 	linebuf[n[1]] = 0; |
| 48 | 54 | 	linebuf[n[3]] = 0; |
lib/libc/musl/src/misc/nftw.c+3-3| ... | ... | @@ -31,6 +31,8 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, |
| 31 | 31 | 	int err; |
| 32 | 32 | 	struct FTW lev; |
| 33 | 33 | |
| 34 | 	st.st_dev = st.st_ino = 0; | |
| 35 | ||
| 34 | 36 | 	if ((flags & FTW_PHYS) ? lstat(path, &st) : stat(path, &st) < 0) { |
| 35 | 37 | 		if (!(flags & FTW_PHYS) && errno==ENOENT && !lstat(path, &st)) |
| 36 | 38 | 			type = FTW_SLN; |
| ... | ... | @@ -46,7 +48,7 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, |
| 46 | 48 | 		type = FTW_F; |
| 47 | 49 | 	} |
| 48 | 50 | |
| 49 | 	if ((flags & FTW_MOUNT) && h && st.st_dev != h->dev) | |
| 51 | 	if ((flags & FTW_MOUNT) && h && type != FTW_NS && st.st_dev != h->dev) | |
| 50 | 52 | 		return 0; |
| 51 | 53 | 	 |
| 52 | 54 | 	new.chain = h; |
| ... | ... | @@ -138,5 +140,3 @@ int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, str |
| 138 | 140 | 	pthread_setcancelstate(cs, 0); |
| 139 | 141 | 	return r; |
| 140 | 142 | } |
| 141 | ||
| 142 | weak_alias(nftw, nftw64); |
lib/libc/musl/src/misc/setrlimit.c+6-2| ... | ... | @@ -12,12 +12,14 @@ struct ctx { |
| 12 | 12 | 	int err; |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | #ifdef SYS_setrlimit | |
| 15 | 16 | static void do_setrlimit(void *p) |
| 16 | 17 | { |
| 17 | 18 | 	struct ctx *c = p; |
| 18 | 19 | 	if (c->err>0) return; |
| 19 | 20 | 	c->err = -__syscall(SYS_setrlimit, c->res, c->lim); |
| 20 | 21 | } |
| 22 | #endif | |
| 21 | 23 | |
| 22 | 24 | int setrlimit(int resource, const struct rlimit *rlim) |
| 23 | 25 | { |
| ... | ... | @@ -29,6 +31,7 @@ int setrlimit(int resource, const struct rlimit *rlim) |
| 29 | 31 | 		rlim = &tmp; |
| 30 | 32 | 	} |
| 31 | 33 | 	int ret = __syscall(SYS_prlimit64, 0, resource, rlim, 0); |
| 34 | #ifdef SYS_setrlimit | |
| 32 | 35 | 	if (ret != -ENOSYS) return __syscall_ret(ret); |
| 33 | 36 | |
| 34 | 37 | 	struct ctx c = { |
| ... | ... | @@ -42,6 +45,7 @@ int setrlimit(int resource, const struct rlimit *rlim) |
| 42 | 45 | 		return -1; |
| 43 | 46 | 	} |
| 44 | 47 | 	return 0; |
| 48 | #else | |
| 49 | 	return __syscall_ret(ret); | |
| 50 | #endif | |
| 45 | 51 | } |
| 46 | ||
| 47 | weak_alias(setrlimit, setrlimit64); |
lib/libc/musl/src/mman/mmap.c-2| ... | ... | @@ -37,5 +37,3 @@ void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | weak_alias(__mmap, mmap); |
| 40 | ||
| 41 | weak_alias(mmap, mmap64); |
lib/libc/musl/src/mq/mq_notify.c+33-14| ... | ... | @@ -4,11 +4,14 @@ |
| 4 | 4 | #include <sys/socket.h> |
| 5 | 5 | #include <signal.h> |
| 6 | 6 | #include <unistd.h> |
| 7 | #include <semaphore.h> | |
| 7 | 8 | #include "syscall.h" |
| 8 | 9 | |
| 9 | 10 | struct args { |
| 10 | 	pthread_barrier_t barrier; | |
| 11 | 	sem_t sem; | |
| 11 | 12 | 	int sock; |
| 13 | 	mqd_t mqd; | |
| 14 | 	int err; | |
| 12 | 15 | 	const struct sigevent *sev; |
| 13 | 16 | }; |
| 14 | 17 | |
| ... | ... | @@ -20,8 +23,19 @@ static void *start(void *p) |
| 20 | 23 | 	int s = args->sock; |
| 21 | 24 | 	void (*func)(union sigval) = args->sev->sigev_notify_function; |
| 22 | 25 | 	union sigval val = args->sev->sigev_value; |
| 26 | 	struct sigevent sev2; | |
| 27 | 	static const char zeros[32]; | |
| 28 | 	int err; | |
| 29 | ||
| 30 | 	sev2.sigev_notify = SIGEV_THREAD; | |
| 31 | 	sev2.sigev_signo = s; | |
| 32 | 	sev2.sigev_value.sival_ptr = (void *)&zeros; | |
| 33 | ||
| 34 | 	args->err = err = -__syscall(SYS_mq_notify, args->mqd, &sev2); | |
| 35 | 	sem_post(&args->sem); | |
| 36 | 	if (err) return 0; | |
| 23 | 37 | |
| 24 | 	pthread_barrier_wait(&args->barrier); | |
| 38 | 	pthread_detach(pthread_self()); | |
| 25 | 39 | 	n = recv(s, buf, sizeof(buf), MSG_NOSIGNAL|MSG_WAITALL); |
| 26 | 40 | 	close(s); |
| 27 | 41 | 	if (n==sizeof buf && buf[sizeof buf - 1] == 1) |
| ... | ... | @@ -35,8 +49,8 @@ int mq_notify(mqd_t mqd, const struct sigevent *sev) |
| 35 | 49 | 	pthread_attr_t attr; |
| 36 | 50 | 	pthread_t td; |
| 37 | 51 | 	int s; |
| 38 | 	struct sigevent sev2; | |
| 39 | 	static const char zeros[32]; | |
| 52 | 	int cs; | |
| 53 | 	sigset_t allmask, origmask; | |
| 40 | 54 | |
| 41 | 55 | 	if (!sev || sev->sigev_notify != SIGEV_THREAD) |
| 42 | 56 | 		return syscall(SYS_mq_notify, mqd, sev); |
| ... | ... | @@ -44,30 +58,35 @@ int mq_notify(mqd_t mqd, const struct sigevent *sev) |
| 44 | 58 | 	s = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, 0); |
| 45 | 59 | 	if (s < 0) return -1; |
| 46 | 60 | 	args.sock = s; |
| 61 | 	args.mqd = mqd; | |
| 47 | 62 | |
| 48 | 63 | 	if (sev->sigev_notify_attributes) attr = *sev->sigev_notify_attributes; |
| 49 | 64 | 	else pthread_attr_init(&attr); |
| 50 | 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); | |
| 51 | 	pthread_barrier_init(&args.barrier, 0, 2); | |
| 65 | 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); | |
| 66 | 	sem_init(&args.sem, 0, 0); | |
| 52 | 67 | |
| 68 | 	sigfillset(&allmask); | |
| 69 | 	pthread_sigmask(SIG_BLOCK, &allmask, &origmask); | |
| 53 | 70 | 	if (pthread_create(&td, &attr, start, &args)) { |
| 54 | 71 | 		__syscall(SYS_close, s); |
| 72 | 		pthread_sigmask(SIG_SETMASK, &origmask, 0); | |
| 55 | 73 | 		errno = EAGAIN; |
| 56 | 74 | 		return -1; |
| 57 | 75 | 	} |
| 76 | 	pthread_sigmask(SIG_SETMASK, &origmask, 0); | |
| 58 | 77 | |
| 59 | 	pthread_barrier_wait(&args.barrier); | |
| 60 | 	pthread_barrier_destroy(&args.barrier); | |
| 61 | ||
| 62 | 	sev2.sigev_notify = SIGEV_THREAD; | |
| 63 | 	sev2.sigev_signo = s; | |
| 64 | 	sev2.sigev_value.sival_ptr = (void *)&zeros; | |
| 78 | 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); | |
| 79 | 	sem_wait(&args.sem); | |
| 80 | 	sem_destroy(&args.sem); | |
| 65 | 81 | |
| 66 | 	if (syscall(SYS_mq_notify, mqd, &sev2) < 0) { | |
| 67 | 		pthread_cancel(td); | |
| 82 | 	if (args.err) { | |
| 68 | 83 | 		__syscall(SYS_close, s); |
| 84 | 		pthread_join(td, 0); | |
| 85 | 		pthread_setcancelstate(cs, 0); | |
| 86 | 		errno = args.err; | |
| 69 | 87 | 		return -1; |
| 70 | 88 | 	} |
| 71 | 89 | |
| 90 | 	pthread_setcancelstate(cs, 0); | |
| 72 | 91 | 	return 0; |
| 73 | 92 | } |
lib/libc/musl/src/network/accept4.c+4| ... | ... | @@ -9,6 +9,10 @@ int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int |
| 9 | 9 | 	if (!flg) return accept(fd, addr, len); |
| 10 | 10 | 	int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0); |
| 11 | 11 | 	if (ret>=0 || (errno != ENOSYS && errno != EINVAL)) return ret; |
| 12 | 	if (flg & ~(SOCK_CLOEXEC|SOCK_NONBLOCK)) { | |
| 13 | 		errno = EINVAL; | |
| 14 | 		return -1; | |
| 15 | 	} | |
| 12 | 16 | 	ret = accept(fd, addr, len); |
| 13 | 17 | 	if (ret<0) return ret; |
| 14 | 18 | 	if (flg & SOCK_CLOEXEC) |
lib/libc/musl/src/network/dns_parse.c+5-5| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | #include <string.h> |
| 2 | 2 | #include "lookup.h" |
| 3 | 3 | |
| 4 | int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, const void *, int, const void *), void *ctx) | |
| 4 | int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, const void *, int, const void *, int), void *ctx) | |
| 5 | 5 | { |
| 6 | 6 | 	int qdcount, ancount; |
| 7 | 7 | 	const unsigned char *p; |
| ... | ... | @@ -15,18 +15,18 @@ int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, c |
| 15 | 15 | 	if (qdcount+ancount > 64) return -1; |
| 16 | 16 | 	while (qdcount--) { |
| 17 | 17 | 		while (p-r < rlen && *p-1U < 127) p++; |
| 18 | 		if (*p>193 || (*p==193 && p[1]>254) || p>r+rlen-6) | |
| 18 | 		if (p>r+rlen-6 || *p>193 || (*p==193 && p[1]>254)) | |
| 19 | 19 | 			return -1; |
| 20 | 20 | 		p += 5 + !!*p; |
| 21 | 21 | 	} |
| 22 | 22 | 	while (ancount--) { |
| 23 | 23 | 		while (p-r < rlen && *p-1U < 127) p++; |
| 24 | 		if (*p>193 || (*p==193 && p[1]>254) || p>r+rlen-6) | |
| 24 | 		if (p>r+rlen-12 || *p>193 || (*p==193 && p[1]>254)) | |
| 25 | 25 | 			return -1; |
| 26 | 26 | 		p += 1 + !!*p; |
| 27 | 27 | 		len = p[8]*256 + p[9]; |
| 28 | 		if (p+len > r+rlen) return -1; | |
| 29 | 		if (callback(ctx, p[1], p+10, len, r) < 0) return -1; | |
| 28 | 		if (len+10 > r+rlen-p) return -1; | |
| 29 | 		if (callback(ctx, p[1], p+10, len, r, rlen) < 0) return -1; | |
| 30 | 30 | 		p += 10 + len; |
| 31 | 31 | 	} |
| 32 | 32 | 	return 0; |
lib/libc/musl/src/network/gai_strerror.c+1-1| ... | ... | @@ -6,7 +6,7 @@ static const char msgs[] = |
| 6 | 6 | 	"Name does not resolve\0" |
| 7 | 7 | 	"Try again\0" |
| 8 | 8 | 	"Non-recoverable error\0" |
| 9 | 	"Unknown error\0" | |
| 9 | 	"Name has no usable address\0" | |
| 10 | 10 | 	"Unrecognized address family or invalid length\0" |
| 11 | 11 | 	"Unrecognized socket type\0" |
| 12 | 12 | 	"Unrecognized service\0" |
lib/libc/musl/src/network/getaddrinfo.c+6-1| ... | ... | @@ -16,6 +16,7 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru |
| 16 | 16 | 	char canon[256], *outcanon; |
| 17 | 17 | 	int nservs, naddrs, nais, canon_len, i, j, k; |
| 18 | 18 | 	int family = AF_UNSPEC, flags = 0, proto = 0, socktype = 0; |
| 19 | 	int no_family = 0; | |
| 19 | 20 | 	struct aibuf *out; |
| 20 | 21 | |
| 21 | 22 | 	if (!host && !serv) return EAI_NONAME; |
| ... | ... | @@ -66,9 +67,11 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru |
| 66 | 67 | 				pthread_setcancelstate( |
| 67 | 68 | 					PTHREAD_CANCEL_DISABLE, &cs); |
| 68 | 69 | 				int r = connect(s, ta[i], tl[i]); |
| 70 | 				int saved_errno = errno; | |
| 69 | 71 | 				pthread_setcancelstate(cs, 0); |
| 70 | 72 | 				close(s); |
| 71 | 73 | 				if (!r) continue; |
| 74 | 				errno = saved_errno; | |
| 72 | 75 | 			} |
| 73 | 76 | 			switch (errno) { |
| 74 | 77 | 			case EADDRNOTAVAIL: |
| ... | ... | @@ -80,7 +83,7 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru |
| 80 | 83 | 			default: |
| 81 | 84 | 				return EAI_SYSTEM; |
| 82 | 85 | 			} |
| 83 | 			if (family == tf[i]) return EAI_NONAME; | |
| 86 | 			if (family == tf[i]) no_family = 1; | |
| 84 | 87 | 			family = tf[1-i]; |
| 85 | 88 | 		} |
| 86 | 89 | 	} |
| ... | ... | @@ -91,6 +94,8 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru |
| 91 | 94 | 	naddrs = __lookup_name(addrs, canon, host, family, flags); |
| 92 | 95 | 	if (naddrs < 0) return naddrs; |
| 93 | 96 | |
| 97 | 	if (no_family) return EAI_NODATA; | |
| 98 | ||
| 94 | 99 | 	nais = nservs * naddrs; |
| 95 | 100 | 	canon_len = strlen(canon); |
| 96 | 101 | 	out = calloc(1, nais * sizeof(*out) + canon_len + 1); |
lib/libc/musl/src/network/gethostbyaddr.c+1-1| ... | ... | @@ -20,5 +20,5 @@ struct hostent *gethostbyaddr(const void *a, socklen_t l, int af) |
| 20 | 20 | 		err = gethostbyaddr_r(a, l, af, h, |
| 21 | 21 | 			(void *)(h+1), size-sizeof *h, &res, &h_errno); |
| 22 | 22 | 	} while (err == ERANGE); |
| 23 | 	return err ? 0 : h; | |
| 23 | 	return res; | |
| 24 | 24 | } |
lib/libc/musl/src/network/gethostbyaddr_r.c+3-2| ... | ... | @@ -54,9 +54,10 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af, |
| 54 | 54 | 	case EAI_OVERFLOW: |
| 55 | 55 | 		return ERANGE; |
| 56 | 56 | 	default: |
| 57 | 	case EAI_MEMORY: | |
| 58 | 	case EAI_SYSTEM: | |
| 59 | 57 | 	case EAI_FAIL: |
| 58 | 		*err = NO_RECOVERY; | |
| 59 | 		return EBADMSG; | |
| 60 | 	case EAI_SYSTEM: | |
| 60 | 61 | 		*err = NO_RECOVERY; |
| 61 | 62 | 		return errno; |
| 62 | 63 | 	case 0: |
lib/libc/musl/src/network/gethostbyname2.c+1-1| ... | ... | @@ -21,5 +21,5 @@ struct hostent *gethostbyname2(const char *name, int af) |
| 21 | 21 | 		err = gethostbyname2_r(name, af, h, |
| 22 | 22 | 			(void *)(h+1), size-sizeof *h, &res, &h_errno); |
| 23 | 23 | 	} while (err == ERANGE); |
| 24 | 	return err ? 0 : h; | |
| 24 | 	return res; | |
| 25 | 25 | } |
lib/libc/musl/src/network/gethostbyname2_r.c+4-2| ... | ... | @@ -22,7 +22,10 @@ int gethostbyname2_r(const char *name, int af, |
| 22 | 22 | 	if (cnt<0) switch (cnt) { |
| 23 | 23 | 	case EAI_NONAME: |
| 24 | 24 | 		*err = HOST_NOT_FOUND; |
| 25 | 		return ENOENT; | |
| 25 | 		return 0; | |
| 26 | 	case EAI_NODATA: | |
| 27 | 		*err = NO_DATA; | |
| 28 | 		return 0; | |
| 26 | 29 | 	case EAI_AGAIN: |
| 27 | 30 | 		*err = TRY_AGAIN; |
| 28 | 31 | 		return EAGAIN; |
| ... | ... | @@ -30,7 +33,6 @@ int gethostbyname2_r(const char *name, int af, |
| 30 | 33 | 	case EAI_FAIL: |
| 31 | 34 | 		*err = NO_RECOVERY; |
| 32 | 35 | 		return EBADMSG; |
| 33 | 	case EAI_MEMORY: | |
| 34 | 36 | 	case EAI_SYSTEM: |
| 35 | 37 | 		*err = NO_RECOVERY; |
| 36 | 38 | 		return errno; |
lib/libc/musl/src/network/getifaddrs.c+7-7| ... | ... | @@ -39,8 +39,8 @@ struct ifaddrs_storage { |
| 39 | 39 | }; |
| 40 | 40 | |
| 41 | 41 | struct ifaddrs_ctx { |
| 42 | 	struct ifaddrs_storage *first; | |
| 43 | 	struct ifaddrs_storage *last; | |
| 42 | 	struct ifaddrs *first; | |
| 43 | 	struct ifaddrs *last; | |
| 44 | 44 | 	struct ifaddrs_storage *hash[IFADDRS_HASH_SIZE]; |
| 45 | 45 | }; |
| 46 | 46 | |
| ... | ... | @@ -195,9 +195,9 @@ static int netlink_msg_to_ifaddr(void *pctx, struct nlmsghdr *h) |
| 195 | 195 | 	} |
| 196 | 196 | |
| 197 | 197 | 	if (ifs->ifa.ifa_name) { |
| 198 | 		if (!ctx->first) ctx->first = ifs; | |
| 199 | 		if (ctx->last) ctx->last->ifa.ifa_next = &ifs->ifa; | |
| 200 | 		ctx->last = ifs; | |
| 198 | 		if (!ctx->first) ctx->first = &ifs->ifa; | |
| 199 | 		if (ctx->last) ctx->last->ifa_next = &ifs->ifa; | |
| 200 | 		ctx->last = &ifs->ifa; | |
| 201 | 201 | 	} else { |
| 202 | 202 | 		free(ifs); |
| 203 | 203 | 	} |
| ... | ... | @@ -210,7 +210,7 @@ int getifaddrs(struct ifaddrs **ifap) |
| 210 | 210 | 	int r; |
| 211 | 211 | 	memset(ctx, 0, sizeof *ctx); |
| 212 | 212 | 	r = __rtnetlink_enumerate(AF_UNSPEC, AF_UNSPEC, netlink_msg_to_ifaddr, ctx); |
| 213 | 	if (r == 0) *ifap = &ctx->first->ifa; | |
| 214 | 	else freeifaddrs(&ctx->first->ifa); | |
| 213 | 	if (r == 0) *ifap = ctx->first; | |
| 214 | 	else freeifaddrs(ctx->first); | |
| 215 | 215 | 	return r; |
| 216 | 216 | } |
lib/libc/musl/src/network/getnameinfo.c+3-2| ... | ... | @@ -58,6 +58,7 @@ static void reverse_hosts(char *buf, const unsigned char *a, unsigned scopeid, i |
| 58 | 58 | 		if ((p=strchr(line, '#'))) *p++='\n', *p=0; |
| 59 | 59 | |
| 60 | 60 | 		for (p=line; *p && !isspace(*p); p++); |
| 61 | 		if (!*p) continue; | |
| 61 | 62 | 		*p++ = 0; |
| 62 | 63 | 		if (__lookup_ipliteral(&iplit, line, AF_UNSPEC)<=0) |
| 63 | 64 | 			continue; |
| ... | ... | @@ -108,10 +109,10 @@ static void reverse_services(char *buf, int port, int dgram) |
| 108 | 109 | 	__fclose_ca(f); |
| 109 | 110 | } |
| 110 | 111 | |
| 111 | static int dns_parse_callback(void *c, int rr, const void *data, int len, const void *packet) | |
| 112 | static int dns_parse_callback(void *c, int rr, const void *data, int len, const void *packet, int plen) | |
| 112 | 113 | { |
| 113 | 114 | 	if (rr != RR_PTR) return 0; |
| 114 | 	if (__dn_expand(packet, (const unsigned char *)packet + 512, | |
| 115 | 	if (__dn_expand(packet, (const unsigned char *)packet + plen, | |
| 115 | 116 | 	 data, c, 256) <= 0) |
| 116 | 117 | 		*(char *)c = 0; |
| 117 | 118 | 	return 0; |
lib/libc/musl/src/network/getservbyport_r.c+3-1| ... | ... | @@ -26,7 +26,7 @@ int getservbyport_r(int port, const char *prots, |
| 26 | 26 | 	/* Align buffer */ |
| 27 | 27 | 	i = (uintptr_t)buf & sizeof(char *)-1; |
| 28 | 28 | 	if (!i) i = sizeof(char *); |
| 29 | 	if (buflen < 3*sizeof(char *)-i) | |
| 29 | 	if (buflen <= 3*sizeof(char *)-i) | |
| 30 | 30 | 		return ERANGE; |
| 31 | 31 | 	buf += sizeof(char *)-i; |
| 32 | 32 | 	buflen -= sizeof(char *)-i; |
| ... | ... | @@ -46,6 +46,8 @@ int getservbyport_r(int port, const char *prots, |
| 46 | 46 | 	case EAI_MEMORY: |
| 47 | 47 | 	case EAI_SYSTEM: |
| 48 | 48 | 		return ENOMEM; |
| 49 | 	case EAI_OVERFLOW: | |
| 50 | 		return ERANGE; | |
| 49 | 51 | 	default: |
| 50 | 52 | 		return ENOENT; |
| 51 | 53 | 	case 0: |
lib/libc/musl/src/network/inet_pton.c+1| ... | ... | @@ -54,6 +54,7 @@ int inet_pton(int af, const char *restrict s, void *restrict a0) |
| 54 | 54 | 			if (s[j]!='.' || (i<6 && brk<0)) return 0; |
| 55 | 55 | 			need_v4=1; |
| 56 | 56 | 			i++; |
| 57 | 			ip[i&7]=0; | |
| 57 | 58 | 			break; |
| 58 | 59 | 		} |
| 59 | 60 | 		s += j+1; |
lib/libc/musl/src/network/lookup.h+1-1| ... | ... | @@ -50,6 +50,6 @@ hidden int __lookup_ipliteral(struct address buf[static 1], const char *name, in |
| 50 | 50 | hidden int __get_resolv_conf(struct resolvconf *, char *, size_t); |
| 51 | 51 | hidden int __res_msend_rc(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int, const struct resolvconf *); |
| 52 | 52 | |
| 53 | hidden int __dns_parse(const unsigned char *, int, int (*)(void *, int, const void *, int, const void *), void *); | |
| 53 | hidden int __dns_parse(const unsigned char *, int, int (*)(void *, int, const void *, int, const void *, int), void *); | |
| 54 | 54 | |
| 55 | 55 | #endif |
lib/libc/musl/src/network/lookup_ipliteral.c+2-2| ... | ... | @@ -15,7 +15,7 @@ int __lookup_ipliteral(struct address buf[static 1], const char *name, int famil |
| 15 | 15 | 	struct in6_addr a6; |
| 16 | 16 | 	if (__inet_aton(name, &a4) > 0) { |
| 17 | 17 | 		if (family == AF_INET6) /* wrong family */ |
| 18 | 			return EAI_NONAME; | |
| 18 | 			return EAI_NODATA; | |
| 19 | 19 | 		memcpy(&buf[0].addr, &a4, sizeof a4); |
| 20 | 20 | 		buf[0].family = AF_INET; |
| 21 | 21 | 		buf[0].scopeid = 0; |
| ... | ... | @@ -34,7 +34,7 @@ int __lookup_ipliteral(struct address buf[static 1], const char *name, int famil |
| 34 | 34 | 	if (inet_pton(AF_INET6, name, &a6) <= 0) |
| 35 | 35 | 		return 0; |
| 36 | 36 | 	if (family == AF_INET) /* wrong family */ |
| 37 | 		return EAI_NONAME; | |
| 37 | 		return EAI_NODATA; | |
| 38 | 38 | |
| 39 | 39 | 	memcpy(&buf[0].addr, &a6, sizeof a6); |
| 40 | 40 | 	buf[0].family = AF_INET6; |
lib/libc/musl/src/network/lookup_name.c+31-19| ... | ... | @@ -79,7 +79,7 @@ static int name_from_hosts(struct address buf[static MAXADDRS], char canon[stati |
| 79 | 79 | 		case 0: |
| 80 | 80 | 			continue; |
| 81 | 81 | 		default: |
| 82 | 			badfam = EAI_NONAME; | |
| 82 | 			badfam = EAI_NODATA; | |
| 83 | 83 | 			break; |
| 84 | 84 | 		} |
| 85 | 85 | |
| ... | ... | @@ -102,45 +102,50 @@ struct dpc_ctx { |
| 102 | 102 | 	struct address *addrs; |
| 103 | 103 | 	char *canon; |
| 104 | 104 | 	int cnt; |
| 105 | 	int rrtype; | |
| 105 | 106 | }; |
| 106 | 107 | |
| 107 | 108 | #define RR_A 1 |
| 108 | 109 | #define RR_CNAME 5 |
| 109 | 110 | #define RR_AAAA 28 |
| 110 | 111 | |
| 111 | static int dns_parse_callback(void *c, int rr, const void *data, int len, const void *packet) | |
| 112 | #define ABUF_SIZE 768 | |
| 113 | ||
| 114 | static int dns_parse_callback(void *c, int rr, const void *data, int len, const void *packet, int plen) | |
| 112 | 115 | { |
| 113 | 116 | 	char tmp[256]; |
| 117 | 	int family; | |
| 114 | 118 | 	struct dpc_ctx *ctx = c; |
| 115 | 	if (ctx->cnt >= MAXADDRS) return -1; | |
| 119 | 	if (rr == RR_CNAME) { | |
| 120 | 		if (__dn_expand(packet, (const unsigned char *)packet + plen, | |
| 121 | 		 data, tmp, sizeof tmp) > 0 && is_valid_hostname(tmp)) | |
| 122 | 			strcpy(ctx->canon, tmp); | |
| 123 | 		return 0; | |
| 124 | 	} | |
| 125 | 	if (ctx->cnt >= MAXADDRS) return 0; | |
| 126 | 	if (rr != ctx->rrtype) return 0; | |
| 116 | 127 | 	switch (rr) { |
| 117 | 128 | 	case RR_A: |
| 118 | 129 | 		if (len != 4) return -1; |
| 119 | 		ctx->addrs[ctx->cnt].family = AF_INET; | |
| 120 | 		ctx->addrs[ctx->cnt].scopeid = 0; | |
| 121 | 		memcpy(ctx->addrs[ctx->cnt++].addr, data, 4); | |
| 130 | 		family = AF_INET; | |
| 122 | 131 | 		break; |
| 123 | 132 | 	case RR_AAAA: |
| 124 | 133 | 		if (len != 16) return -1; |
| 125 | 		ctx->addrs[ctx->cnt].family = AF_INET6; | |
| 126 | 		ctx->addrs[ctx->cnt].scopeid = 0; | |
| 127 | 		memcpy(ctx->addrs[ctx->cnt++].addr, data, 16); | |
| 128 | 		break; | |
| 129 | 	case RR_CNAME: | |
| 130 | 		if (__dn_expand(packet, (const unsigned char *)packet + 512, | |
| 131 | 		 data, tmp, sizeof tmp) > 0 && is_valid_hostname(tmp)) | |
| 132 | 			strcpy(ctx->canon, tmp); | |
| 134 | 		family = AF_INET6; | |
| 133 | 135 | 		break; |
| 134 | 136 | 	} |
| 137 | 	ctx->addrs[ctx->cnt].family = family; | |
| 138 | 	ctx->addrs[ctx->cnt].scopeid = 0; | |
| 139 | 	memcpy(ctx->addrs[ctx->cnt++].addr, data, len); | |
| 135 | 140 | 	return 0; |
| 136 | 141 | } |
| 137 | 142 | |
| 138 | 143 | static int name_from_dns(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, const struct resolvconf *conf) |
| 139 | 144 | { |
| 140 | 	unsigned char qbuf[2][280], abuf[2][512]; | |
| 145 | 	unsigned char qbuf[2][280], abuf[2][ABUF_SIZE]; | |
| 141 | 146 | 	const unsigned char *qp[2] = { qbuf[0], qbuf[1] }; |
| 142 | 147 | 	unsigned char *ap[2] = { abuf[0], abuf[1] }; |
| 143 | 	int qlens[2], alens[2]; | |
| 148 | 	int qlens[2], alens[2], qtypes[2]; | |
| 144 | 149 | 	int i, nq = 0; |
| 145 | 150 | 	struct dpc_ctx ctx = { .addrs = buf, .canon = canon }; |
| 146 | 151 | 	static const struct { int af; int rr; } afrr[2] = { |
| ... | ... | @@ -153,8 +158,12 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static |
| 153 | 158 | 			qlens[nq] = __res_mkquery(0, name, 1, afrr[i].rr, |
| 154 | 159 | 				0, 0, 0, qbuf[nq], sizeof *qbuf); |
| 155 | 160 | 			if (qlens[nq] == -1) |
| 156 | 				return EAI_NONAME; | |
| 161 | 				return 0; | |
| 162 | 			qtypes[nq] = afrr[i].rr; | |
| 157 | 163 | 			qbuf[nq][3] = 0; /* don't need AD flag */ |
| 164 | 			/* Ensure query IDs are distinct. */ | |
| 165 | 			if (nq && qbuf[nq][0] == qbuf[0][0]) | |
| 166 | 				qbuf[nq][0]++; | |
| 158 | 167 | 			nq++; |
| 159 | 168 | 		} |
| 160 | 169 | 	} |
| ... | ... | @@ -168,11 +177,14 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static |
| 168 | 177 | 		if ((abuf[i][3] & 15) != 0) return EAI_FAIL; |
| 169 | 178 | 	} |
| 170 | 179 | |
| 171 | 	for (i=0; i<nq; i++) | |
| 180 | 	for (i=nq-1; i>=0; i--) { | |
| 181 | 		ctx.rrtype = qtypes[i]; | |
| 182 | 		if (alens[i] > sizeof(abuf[i])) alens[i] = sizeof abuf[i]; | |
| 172 | 183 | 		__dns_parse(abuf[i], alens[i], dns_parse_callback, &ctx); |
| 184 | 	} | |
| 173 | 185 | |
| 174 | 186 | 	if (ctx.cnt) return ctx.cnt; |
| 175 | 	return EAI_NONAME; | |
| 187 | 	return EAI_NODATA; | |
| 176 | 188 | } |
| 177 | 189 | |
| 178 | 190 | static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family) |
lib/libc/musl/src/network/netlink.h+1-1| ... | ... | @@ -86,7 +86,7 @@ struct ifaddrmsg { |
| 86 | 86 | #define RTA_DATALEN(rta)	((rta)->rta_len-sizeof(struct rtattr)) |
| 87 | 87 | #define RTA_DATAEND(rta)	((char*)(rta)+(rta)->rta_len) |
| 88 | 88 | #define RTA_NEXT(rta)		(struct rtattr*)((char*)(rta)+NETLINK_ALIGN((rta)->rta_len)) |
| 89 | #define RTA_OK(nlh,end)		((char*)(end)-(char*)(rta) >= sizeof(struct rtattr)) | |
| 89 | #define RTA_OK(rta,end)		((char*)(end)-(char*)(rta) >= sizeof(struct rtattr)) | |
| 90 | 90 | |
| 91 | 91 | #define NLMSG_RTA(nlh,len)	((void*)((char*)(nlh)+sizeof(struct nlmsghdr)+NETLINK_ALIGN(len))) |
| 92 | 92 | #define NLMSG_RTAOK(rta,nlh)	RTA_OK(rta,NLMSG_DATAEND(nlh)) |
lib/libc/musl/src/network/res_mkquery.c+1| ... | ... | @@ -13,6 +13,7 @@ int __res_mkquery(int op, const char *dname, int class, int type, |
| 13 | 13 | 	int n; |
| 14 | 14 | |
| 15 | 15 | 	if (l && dname[l-1]=='.') l--; |
| 16 | 	if (l && dname[l-1]=='.') return -1; | |
| 16 | 17 | 	n = 17+l+!!l; |
| 17 | 18 | 	if (l>253 || buflen<n || op>15u || class>255u || type>255u) |
| 18 | 19 | 		return -1; |
lib/libc/musl/src/network/res_msend.c+160-23| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | #include <sys/socket.h> |
| 2 | 2 | #include <netinet/in.h> |
| 3 | #include <netinet/tcp.h> | |
| 3 | 4 | #include <netdb.h> |
| 4 | 5 | #include <arpa/inet.h> |
| 5 | 6 | #include <stdint.h> |
| ... | ... | @@ -16,17 +17,65 @@ |
| 16 | 17 | |
| 17 | 18 | static void cleanup(void *p) |
| 18 | 19 | { |
| 19 | 	__syscall(SYS_close, (intptr_t)p); | |
| 20 | 	struct pollfd *pfd = p; | |
| 21 | 	for (int i=0; pfd[i].fd >= -1; i++) | |
| 22 | 		if (pfd[i].fd >= 0) __syscall(SYS_close, pfd[i].fd); | |
| 20 | 23 | } |
| 21 | 24 | |
| 22 | 25 | static unsigned long mtime() |
| 23 | 26 | { |
| 24 | 27 | 	struct timespec ts; |
| 25 | 	clock_gettime(CLOCK_REALTIME, &ts); | |
| 28 | 	if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0 && errno == ENOSYS) | |
| 29 | 		clock_gettime(CLOCK_REALTIME, &ts); | |
| 26 | 30 | 	return (unsigned long)ts.tv_sec * 1000 |
| 27 | 31 | 		+ ts.tv_nsec / 1000000; |
| 28 | 32 | } |
| 29 | 33 | |
| 34 | static int start_tcp(struct pollfd *pfd, int family, const void *sa, socklen_t sl, const unsigned char *q, int ql) | |
| 35 | { | |
| 36 | 	struct msghdr mh = { | |
| 37 | 		.msg_name = (void *)sa, | |
| 38 | 		.msg_namelen = sl, | |
| 39 | 		.msg_iovlen = 2, | |
| 40 | 		.msg_iov = (struct iovec [2]){ | |
| 41 | 			{ .iov_base = (uint8_t[]){ ql>>8, ql }, .iov_len = 2 }, | |
| 42 | 			{ .iov_base = (void *)q, .iov_len = ql } } | |
| 43 | 	}; | |
| 44 | 	int r; | |
| 45 | 	int fd = socket(family, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); | |
| 46 | 	pfd->fd = fd; | |
| 47 | 	pfd->events = POLLOUT; | |
| 48 | 	if (!setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, | |
| 49 | 	 &(int){1}, sizeof(int))) { | |
| 50 | 		r = sendmsg(fd, &mh, MSG_FASTOPEN|MSG_NOSIGNAL); | |
| 51 | 		if (r == ql+2) pfd->events = POLLIN; | |
| 52 | 		if (r >= 0) return r; | |
| 53 | 		if (errno == EINPROGRESS) return 0; | |
| 54 | 	} | |
| 55 | 	r = connect(fd, sa, sl); | |
| 56 | 	if (!r || errno == EINPROGRESS) return 0; | |
| 57 | 	close(fd); | |
| 58 | 	pfd->fd = -1; | |
| 59 | 	return -1; | |
| 60 | } | |
| 61 | ||
| 62 | static void step_mh(struct msghdr *mh, size_t n) | |
| 63 | { | |
| 64 | 	/* Adjust iovec in msghdr to skip first n bytes. */ | |
| 65 | 	while (mh->msg_iovlen && n >= mh->msg_iov->iov_len) { | |
| 66 | 		n -= mh->msg_iov->iov_len; | |
| 67 | 		mh->msg_iov++; | |
| 68 | 		mh->msg_iovlen--; | |
| 69 | 	} | |
| 70 | 	if (!mh->msg_iovlen) return; | |
| 71 | 	mh->msg_iov->iov_base = (char *)mh->msg_iov->iov_base + n; | |
| 72 | 	mh->msg_iov->iov_len -= n; | |
| 73 | } | |
| 74 | ||
| 75 | /* Internal contract for __res_msend[_rc]: asize must be >=512, nqueries | |
| 76 | * must be sufficiently small to be safe as VLA size. In practice it's | |
| 77 | * either 1 or 2, anyway. */ | |
| 78 | ||
| 30 | 79 | int __res_msend_rc(int nqueries, const unsigned char *const *queries, |
| 31 | 80 | 	const int *qlens, unsigned char *const *answers, int *alens, int asize, |
| 32 | 81 | 	const struct resolvconf *conf) |
| ... | ... | @@ -44,7 +93,10 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, |
| 44 | 93 | 	int next; |
| 45 | 94 | 	int i, j; |
| 46 | 95 | 	int cs; |
| 47 | 	struct pollfd pfd; | |
| 96 | 	struct pollfd pfd[nqueries+2]; | |
| 97 | 	int qpos[nqueries], apos[nqueries]; | |
| 98 | 	unsigned char alen_buf[nqueries][2]; | |
| 99 | 	int r; | |
| 48 | 100 | 	unsigned long t0, t1, t2; |
| 49 | 101 | |
| 50 | 102 | 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); |
| ... | ... | @@ -68,29 +120,22 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, |
| 68 | 120 | 	} |
| 69 | 121 | |
| 70 | 122 | 	/* Get local address and open/bind a socket */ |
| 71 | 	sa.sin.sin_family = family; | |
| 72 | 123 | 	fd = socket(family, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); |
| 73 | 124 | |
| 74 | 125 | 	/* Handle case where system lacks IPv6 support */ |
| 75 | 126 | 	if (fd < 0 && family == AF_INET6 && errno == EAFNOSUPPORT) { |
| 127 | 		for (i=0; i<nns && conf->ns[nns].family == AF_INET6; i++); | |
| 128 | 		if (i==nns) { | |
| 129 | 			pthread_setcancelstate(cs, 0); | |
| 130 | 			return -1; | |
| 131 | 		} | |
| 76 | 132 | 		fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); |
| 77 | 133 | 		family = AF_INET; |
| 134 | 		sl = sizeof sa.sin; | |
| 78 | 135 | 	} |
| 79 | 	if (fd < 0 || bind(fd, (void *)&sa, sl) < 0) { | |
| 80 | 		if (fd >= 0) close(fd); | |
| 81 | 		pthread_setcancelstate(cs, 0); | |
| 82 | 		return -1; | |
| 83 | 	} | |
| 84 | ||
| 85 | 	/* Past this point, there are no errors. Each individual query will | |
| 86 | 	 * yield either no reply (indicated by zero length) or an answer | |
| 87 | 	 * packet which is up to the caller to interpret. */ | |
| 88 | ||
| 89 | 	pthread_cleanup_push(cleanup, (void *)(intptr_t)fd); | |
| 90 | 	pthread_setcancelstate(cs, 0); | |
| 91 | 136 | |
| 92 | 137 | 	/* Convert any IPv4 addresses in a mixed environment to v4-mapped */ |
| 93 | 	if (family == AF_INET6) { | |
| 138 | 	if (fd >= 0 && family == AF_INET6) { | |
| 94 | 139 | 		setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){0}, sizeof 0); |
| 95 | 140 | 		for (i=0; i<nns; i++) { |
| 96 | 141 | 			if (ns[i].sin.sin_family != AF_INET) continue; |
| ... | ... | @@ -104,16 +149,38 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, |
| 104 | 149 | 		} |
| 105 | 150 | 	} |
| 106 | 151 | |
| 152 | 	sa.sin.sin_family = family; | |
| 153 | 	if (fd < 0 || bind(fd, (void *)&sa, sl) < 0) { | |
| 154 | 		if (fd >= 0) close(fd); | |
| 155 | 		pthread_setcancelstate(cs, 0); | |
| 156 | 		return -1; | |
| 157 | 	} | |
| 158 | ||
| 159 | 	/* Past this point, there are no errors. Each individual query will | |
| 160 | 	 * yield either no reply (indicated by zero length) or an answer | |
| 161 | 	 * packet which is up to the caller to interpret. */ | |
| 162 | ||
| 163 | 	for (i=0; i<nqueries; i++) pfd[i].fd = -1; | |
| 164 | 	pfd[nqueries].fd = fd; | |
| 165 | 	pfd[nqueries].events = POLLIN; | |
| 166 | 	pfd[nqueries+1].fd = -2; | |
| 167 | ||
| 168 | 	pthread_cleanup_push(cleanup, pfd); | |
| 169 | 	pthread_setcancelstate(cs, 0); | |
| 170 | ||
| 107 | 171 | 	memset(alens, 0, sizeof *alens * nqueries); |
| 108 | 172 | |
| 109 | 	pfd.fd = fd; | |
| 110 | 	pfd.events = POLLIN; | |
| 111 | 173 | 	retry_interval = timeout / attempts; |
| 112 | 174 | 	next = 0; |
| 113 | 175 | 	t0 = t2 = mtime(); |
| 114 | 176 | 	t1 = t2 - retry_interval; |
| 115 | 177 | |
| 116 | 178 | 	for (; t2-t0 < timeout; t2=mtime()) { |
| 179 | 		/* This is the loop exit condition: that all queries | |
| 180 | 		 * have an accepted answer. */ | |
| 181 | 		for (i=0; i<nqueries && alens[i]>0; i++); | |
| 182 | 		if (i==nqueries) break; | |
| 183 | ||
| 117 | 184 | 		if (t2-t1 >= retry_interval) { |
| 118 | 185 | 			/* Query all configured namservers in parallel */ |
| 119 | 186 | 			for (i=0; i<nqueries; i++) |
| ... | ... | @@ -127,10 +194,20 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, |
| 127 | 194 | 		} |
| 128 | 195 | |
| 129 | 196 | 		/* Wait for a response, or until time to retry */ |
| 130 | 		if (poll(&pfd, 1, t1+retry_interval-t2) <= 0) continue; | |
| 197 | 		if (poll(pfd, nqueries+1, t1+retry_interval-t2) <= 0) continue; | |
| 131 | 198 | |
| 132 | 		while ((rlen = recvfrom(fd, answers[next], asize, 0, | |
| 133 | 		 (void *)&sa, (socklen_t[1]){sl})) >= 0) { | |
| 199 | 		while (next < nqueries) { | |
| 200 | 			struct msghdr mh = { | |
| 201 | 				.msg_name = (void *)&sa, | |
| 202 | 				.msg_namelen = sl, | |
| 203 | 				.msg_iovlen = 1, | |
| 204 | 				.msg_iov = (struct iovec []){ | |
| 205 | 					{ .iov_base = (void *)answers[next], | |
| 206 | 					 .iov_len = asize } | |
| 207 | 				} | |
| 208 | 			}; | |
| 209 | 			rlen = recvmsg(fd, &mh, 0); | |
| 210 | 			if (rlen < 0) break; | |
| 134 | 211 | |
| 135 | 212 | 			/* Ignore non-identifiable packets */ |
| 136 | 213 | 			if (rlen < 4) continue; |
| ... | ... | @@ -170,12 +247,72 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, |
| 170 | 247 | 			else |
| 171 | 248 | 				memcpy(answers[i], answers[next], rlen); |
| 172 | 249 | |
| 173 | 			if (next == nqueries) goto out; | |
| 250 | 			/* Ignore further UDP if all slots full or TCP-mode */ | |
| 251 | 			if (next == nqueries) pfd[nqueries].events = 0; | |
| 252 | ||
| 253 | 			/* If answer is truncated (TC bit), fallback to TCP */ | |
| 254 | 			if ((answers[i][2] & 2) || (mh.msg_flags & MSG_TRUNC)) { | |
| 255 | 				alens[i] = -1; | |
| 256 | 				pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0); | |
| 257 | 				r = start_tcp(pfd+i, family, ns+j, sl, queries[i], qlens[i]); | |
| 258 | 				pthread_setcancelstate(cs, 0); | |
| 259 | 				if (r >= 0) { | |
| 260 | 					qpos[i] = r; | |
| 261 | 					apos[i] = 0; | |
| 262 | 				} | |
| 263 | 				continue; | |
| 264 | 			} | |
| 265 | 		} | |
| 266 | ||
| 267 | 		for (i=0; i<nqueries; i++) if (pfd[i].revents & POLLOUT) { | |
| 268 | 			struct msghdr mh = { | |
| 269 | 				.msg_iovlen = 2, | |
| 270 | 				.msg_iov = (struct iovec [2]){ | |
| 271 | 					{ .iov_base = (uint8_t[]){ qlens[i]>>8, qlens[i] }, .iov_len = 2 }, | |
| 272 | 					{ .iov_base = (void *)queries[i], .iov_len = qlens[i] } } | |
| 273 | 			}; | |
| 274 | 			step_mh(&mh, qpos[i]); | |
| 275 | 			r = sendmsg(pfd[i].fd, &mh, MSG_NOSIGNAL); | |
| 276 | 			if (r < 0) goto out; | |
| 277 | 			qpos[i] += r; | |
| 278 | 			if (qpos[i] == qlens[i]+2) | |
| 279 | 				pfd[i].events = POLLIN; | |
| 280 | 		} | |
| 281 | ||
| 282 | 		for (i=0; i<nqueries; i++) if (pfd[i].revents & POLLIN) { | |
| 283 | 			struct msghdr mh = { | |
| 284 | 				.msg_iovlen = 2, | |
| 285 | 				.msg_iov = (struct iovec [2]){ | |
| 286 | 					{ .iov_base = alen_buf[i], .iov_len = 2 }, | |
| 287 | 					{ .iov_base = answers[i], .iov_len = asize } } | |
| 288 | 			}; | |
| 289 | 			step_mh(&mh, apos[i]); | |
| 290 | 			r = recvmsg(pfd[i].fd, &mh, 0); | |
| 291 | 			if (r <= 0) goto out; | |
| 292 | 			apos[i] += r; | |
| 293 | 			if (apos[i] < 2) continue; | |
| 294 | 			int alen = alen_buf[i][0]*256 + alen_buf[i][1]; | |
| 295 | 			if (alen < 13) goto out; | |
| 296 | 			if (apos[i] < alen+2 && apos[i] < asize+2) | |
| 297 | 				continue; | |
| 298 | 			int rcode = answers[i][3] & 15; | |
| 299 | 			if (rcode != 0 && rcode != 3) | |
| 300 | 				goto out; | |
| 301 | ||
| 302 | 			/* Storing the length here commits the accepted answer. | |
| 303 | 			 * Immediately close TCP socket so as not to consume | |
| 304 | 			 * resources we no longer need. */ | |
| 305 | 			alens[i] = alen; | |
| 306 | 			__syscall(SYS_close, pfd[i].fd); | |
| 307 | 			pfd[i].fd = -1; | |
| 174 | 308 | 		} |
| 175 | 309 | 	} |
| 176 | 310 | out: |
| 177 | 311 | 	pthread_cleanup_pop(1); |
| 178 | 312 | |
| 313 | 	/* Disregard any incomplete TCP results */ | |
| 314 | 	for (i=0; i<nqueries; i++) if (alens[i]<0) alens[i] = 0; | |
| 315 | ||
| 179 | 316 | 	return 0; |
| 180 | 317 | } |
| 181 | 318 |
lib/libc/musl/src/network/res_send.c+9-1| ... | ... | @@ -1,8 +1,16 @@ |
| 1 | 1 | #include <resolv.h> |
| 2 | #include <string.h> | |
| 2 | 3 | |
| 3 | 4 | int __res_send(const unsigned char *msg, int msglen, unsigned char *answer, int anslen) |
| 4 | 5 | { |
| 5 | 	int r = __res_msend(1, &msg, &msglen, &answer, &anslen, anslen); | |
| 6 | 	int r; | |
| 7 | 	if (anslen < 512) { | |
| 8 | 		unsigned char buf[512]; | |
| 9 | 		r = __res_send(msg, msglen, buf, sizeof buf); | |
| 10 | 		if (r >= 0) memcpy(answer, buf, r < anslen ? r : anslen); | |
| 11 | 		return r; | |
| 12 | 	} | |
| 13 | 	r = __res_msend(1, &msg, &msglen, &answer, &anslen, anslen); | |
| 6 | 14 | 	return r<0 || !anslen ? -1 : anslen; |
| 7 | 15 | } |
| 8 | 16 |
lib/libc/musl/src/network/sendmsg.c+5-2| ... | ... | @@ -8,13 +8,16 @@ ssize_t sendmsg(int fd, const struct msghdr *msg, int flags) |
| 8 | 8 | { |
| 9 | 9 | #if LONG_MAX > INT_MAX |
| 10 | 10 | 	struct msghdr h; |
| 11 | 	struct cmsghdr chbuf[1024/sizeof(struct cmsghdr)+1], *c; | |
| 11 | 	/* Kernels before 2.6.38 set SCM_MAX_FD to 255, allocate enough | |
| 12 | 	 * space to support an SCM_RIGHTS ancillary message with 255 fds. | |
| 13 | 	 * Kernels since 2.6.38 set SCM_MAX_FD to 253. */ | |
| 14 | 	struct cmsghdr chbuf[CMSG_SPACE(255*sizeof(int))/sizeof(struct cmsghdr)+1], *c; | |
| 12 | 15 | 	if (msg) { |
| 13 | 16 | 		h = *msg; |
| 14 | 17 | 		h.__pad1 = h.__pad2 = 0; |
| 15 | 18 | 		msg = &h; |
| 16 | 19 | 		if (h.msg_controllen) { |
| 17 | 			if (h.msg_controllen > 1024) { | |
| 20 | 			if (h.msg_controllen > sizeof chbuf) { | |
| 18 | 21 | 				errno = ENOMEM; |
| 19 | 22 | 				return -1; |
| 20 | 23 | 			} |
lib/libc/musl/src/process/_Fork.c+1-2| ... | ... | @@ -14,7 +14,6 @@ pid_t _Fork(void) |
| 14 | 14 | 	pid_t ret; |
| 15 | 15 | 	sigset_t set; |
| 16 | 16 | 	__block_all_sigs(&set); |
| 17 | 	__aio_atfork(-1); | |
| 18 | 17 | 	LOCK(__abort_lock); |
| 19 | 18 | #ifdef SYS_fork |
| 20 | 19 | 	ret = __syscall(SYS_fork); |
| ... | ... | @@ -32,7 +31,7 @@ pid_t _Fork(void) |
| 32 | 31 | 		if (libc.need_locks) libc.need_locks = -1; |
| 33 | 32 | 	} |
| 34 | 33 | 	UNLOCK(__abort_lock); |
| 35 | 	__aio_atfork(!ret); | |
| 34 | 	if (!ret) __aio_atfork(1); | |
| 36 | 35 | 	__restore_sigs(&set); |
| 37 | 36 | 	return __syscall_ret(ret); |
| 38 | 37 | } |
lib/libc/musl/src/process/aarch64/vfork.s created+9| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | .global vfork | |
| 2 | .type vfork,%function | |
| 3 | vfork: | |
| 4 | 	mov x8, 220 // SYS_clone | |
| 5 | 	mov x0, 0x4111 // SIGCHLD | CLONE_VM | CLONE_VFORK | |
| 6 | 	mov x1, 0 | |
| 7 | 	svc 0 | |
| 8 | 	.hidden __syscall_ret | |
| 9 | 	b __syscall_ret |
lib/libc/musl/src/process/fork.c+6-2| ... | ... | @@ -9,7 +9,6 @@ static volatile int *const dummy_lockptr = 0; |
| 9 | 9 | |
| 10 | 10 | weak_alias(dummy_lockptr, __at_quick_exit_lockptr); |
| 11 | 11 | weak_alias(dummy_lockptr, __atexit_lockptr); |
| 12 | weak_alias(dummy_lockptr, __dlerror_lockptr); | |
| 13 | 12 | weak_alias(dummy_lockptr, __gettext_lockptr); |
| 14 | 13 | weak_alias(dummy_lockptr, __locale_lockptr); |
| 15 | 14 | weak_alias(dummy_lockptr, __random_lockptr); |
| ... | ... | @@ -24,7 +23,6 @@ weak_alias(dummy_lockptr, __vmlock_lockptr); |
| 24 | 23 | static volatile int *const *const atfork_locks[] = { |
| 25 | 24 | 	&__at_quick_exit_lockptr, |
| 26 | 25 | 	&__atexit_lockptr, |
| 27 | 	&__dlerror_lockptr, | |
| 28 | 26 | 	&__gettext_lockptr, |
| 29 | 27 | 	&__locale_lockptr, |
| 30 | 28 | 	&__random_lockptr, |
| ... | ... | @@ -38,6 +36,8 @@ static volatile int *const *const atfork_locks[] = { |
| 38 | 36 | static void dummy(int x) { } |
| 39 | 37 | weak_alias(dummy, __fork_handler); |
| 40 | 38 | weak_alias(dummy, __malloc_atfork); |
| 39 | weak_alias(dummy, __aio_atfork); | |
| 40 | weak_alias(dummy, __pthread_key_atfork); | |
| 41 | 41 | weak_alias(dummy, __ldso_atfork); |
| 42 | 42 | |
| 43 | 43 | static void dummy_0(void) { } |
| ... | ... | @@ -52,6 +52,8 @@ pid_t fork(void) |
| 52 | 52 | 	int need_locks = libc.need_locks > 0; |
| 53 | 53 | 	if (need_locks) { |
| 54 | 54 | 		__ldso_atfork(-1); |
| 55 | 		__pthread_key_atfork(-1); | |
| 56 | 		__aio_atfork(-1); | |
| 55 | 57 | 		__inhibit_ptc(); |
| 56 | 58 | 		for (int i=0; i<sizeof atfork_locks/sizeof *atfork_locks; i++) |
| 57 | 59 | 			if (*atfork_locks[i]) LOCK(*atfork_locks[i]); |
| ... | ... | @@ -77,6 +79,8 @@ pid_t fork(void) |
| 77 | 79 | 				if (ret) UNLOCK(*atfork_locks[i]); |
| 78 | 80 | 				else **atfork_locks[i] = 0; |
| 79 | 81 | 		__release_ptc(); |
| 82 | 		if (ret) __aio_atfork(0); | |
| 83 | 		__pthread_key_atfork(!ret); | |
| 80 | 84 | 		__ldso_atfork(!ret); |
| 81 | 85 | 	} |
| 82 | 86 | 	__restore_sigs(&set); |
lib/libc/musl/src/process/riscv64/vfork.s created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | .global vfork | |
| 2 | .type vfork,@function | |
| 3 | vfork: | |
| 4 | 	/* riscv does not have SYS_vfork, so we must use clone instead */ | |
| 5 | 	/* note: riscv's clone = clone(flags, sp, ptidptr, tls, ctidptr) */ | |
| 6 | 	li a7, 220 | |
| 7 | 	li a0, 0x100 | 0x4000 | 17 /* flags = CLONE_VM | CLONE_VFORK | SIGCHLD */ | |
| 8 | 	mv a1, sp | |
| 9 | 	/* the other arguments are ignoreable */ | |
| 10 | 	ecall | |
| 11 | 	.hidden __syscall_ret | |
| 12 | 	j __syscall_ret |
lib/libc/musl/src/regex/glob.c-3| ... | ... | @@ -306,6 +306,3 @@ void globfree(glob_t *g) |
| 306 | 306 | 	g->gl_pathc = 0; |
| 307 | 307 | 	g->gl_pathv = NULL; |
| 308 | 308 | } |
| 309 | ||
| 310 | weak_alias(glob, glob64); | |
| 311 | weak_alias(globfree, globfree64); |
lib/libc/musl/src/search/hsearch.c+2-2| ... | ... | @@ -41,9 +41,9 @@ static int resize(size_t nel, struct hsearch_data *htab) |
| 41 | 41 | { |
| 42 | 42 | 	size_t newsize; |
| 43 | 43 | 	size_t i, j; |
| 44 | 	size_t oldsize = htab->__tab->mask + 1; | |
| 44 | 45 | 	ENTRY *e, *newe; |
| 45 | 46 | 	ENTRY *oldtab = htab->__tab->entries; |
| 46 | 	ENTRY *oldend = htab->__tab->entries + htab->__tab->mask + 1; | |
| 47 | 47 | |
| 48 | 48 | 	if (nel > MAXSIZE) |
| 49 | 49 | 		nel = MAXSIZE; |
| ... | ... | @@ -56,7 +56,7 @@ static int resize(size_t nel, struct hsearch_data *htab) |
| 56 | 56 | 	htab->__tab->mask = newsize - 1; |
| 57 | 57 | 	if (!oldtab) |
| 58 | 58 | 		return 1; |
| 59 | 	for (e = oldtab; e < oldend; e++) | |
| 59 | 	for (e = oldtab; e < oldtab + oldsize; e++) | |
| 60 | 60 | 		if (e->key) { |
| 61 | 61 | 			for (i=keyhash(e->key),j=1; ; i+=j++) { |
| 62 | 62 | 				newe = htab->__tab->entries + (i & htab->__tab->mask); |
lib/libc/musl/src/select/poll.c+7-2| ... | ... | @@ -8,8 +8,13 @@ int poll(struct pollfd *fds, nfds_t n, int timeout) |
| 8 | 8 | #ifdef SYS_poll |
| 9 | 9 | 	return syscall_cp(SYS_poll, fds, n, timeout); |
| 10 | 10 | #else |
| 11 | #if SYS_ppoll_time64 == SYS_ppoll | |
| 12 | 	typedef long long ppoll_ts_t[2]; | |
| 13 | #else | |
| 14 | 	typedef long ppoll_ts_t[2]; | |
| 15 | #endif | |
| 11 | 16 | 	return syscall_cp(SYS_ppoll, fds, n, timeout>=0 ? |
| 12 | 		&((struct timespec){ .tv_sec = timeout/1000, | |
| 13 | 		.tv_nsec = timeout%1000*1000000 }) : 0, 0, _NSIG/8); | |
| 17 | 		((ppoll_ts_t){ timeout/1000, timeout%1000*1000000 }) : 0, | |
| 18 | 		0, _NSIG/8); | |
| 14 | 19 | #endif |
| 15 | 20 | } |
lib/libc/musl/src/select/select.c+1| ... | ... | @@ -33,6 +33,7 @@ int select(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict |
| 33 | 33 | 			((syscall_arg_t[]){ 0, _NSIG/8 })); |
| 34 | 34 | 	if (SYS_pselect6 == SYS_pselect6_time64 || r!=-ENOSYS) |
| 35 | 35 | 		return __syscall_ret(r); |
| 36 | 	s = CLAMP(s); | |
| 36 | 37 | #endif |
| 37 | 38 | #ifdef SYS_select |
| 38 | 39 | 	return syscall_cp(SYS_select, n, rfds, wfds, efds, |
lib/libc/musl/src/setjmp/powerpc/longjmp.S+4-4| ... | ... | @@ -42,10 +42,10 @@ longjmp: |
| 42 | 42 | 	bl 1f |
| 43 | 43 | 	.hidden __hwcap |
| 44 | 44 | 	.long __hwcap-. |
| 45 | 1:	mflr 4 | |
| 46 | 	lwz 5, 0(4) | |
| 47 | 	lwzx 4, 4, 5 | |
| 48 | 	andis. 4, 4, 0x80 | |
| 45 | 1:	mflr 6 | |
| 46 | 	lwz 5, 0(6) | |
| 47 | 	lwzx 6, 6, 5 | |
| 48 | 	andis. 6, 6, 0x80 | |
| 49 | 49 | 	beq 1f |
| 50 | 50 | 	.long 0x11c35b01 /* evldd 14,88(3) */ |
| 51 | 51 | 	.long 0x11e36301 /* ... */ |
lib/libc/musl/src/signal/mips/restore.s deleted-15| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | .set noreorder | |
| 2 | ||
| 3 | .global __restore_rt | |
| 4 | .hidden __restore_rt | |
| 5 | .type __restore_rt,@function | |
| 6 | __restore_rt: | |
| 7 | 	li $2, 4193 | |
| 8 | 	syscall | |
| 9 | ||
| 10 | .global __restore | |
| 11 | .hidden __restore | |
| 12 | .type __restore,@function | |
| 13 | __restore: | |
| 14 | 	li $2, 4119 | |
| 15 | 	syscall |
lib/libc/musl/src/signal/mips64/restore.s deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | .set	noreorder | |
| 2 | .global	__restore_rt | |
| 3 | .global	__restore | |
| 4 | .hidden __restore_rt | |
| 5 | .hidden __restore | |
| 6 | .type	__restore_rt,@function | |
| 7 | .type	__restore,@function | |
| 8 | __restore_rt: | |
| 9 | __restore: | |
| 10 | 	li	$2,5211 | |
| 11 | 	syscall |
lib/libc/musl/src/signal/mipsn32/restore.s deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | .set	noreorder | |
| 2 | .global	__restore_rt | |
| 3 | .global	__restore | |
| 4 | .hidden __restore_rt | |
| 5 | .hidden __restore | |
| 6 | .type	__restore_rt,@function | |
| 7 | .type	__restore,@function | |
| 8 | __restore_rt: | |
| 9 | __restore: | |
| 10 | 	li	$2,6211 | |
| 11 | 	syscall |
lib/libc/musl/src/signal/sigaction.c+4-1| ... | ... | @@ -44,8 +44,11 @@ int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigact |
| 44 | 44 | 			} |
| 45 | 45 | 		} |
| 46 | 46 | 		ksa.handler = sa->sa_handler; |
| 47 | 		ksa.flags = sa->sa_flags | SA_RESTORER; | |
| 47 | 		ksa.flags = sa->sa_flags; | |
| 48 | #ifdef SA_RESTORER | |
| 49 | 		ksa.flags |= SA_RESTORER; | |
| 48 | 50 | 		ksa.restorer = (sa->sa_flags & SA_SIGINFO) ? __restore_rt : __restore; |
| 51 | #endif | |
| 49 | 52 | 		memcpy(&ksa.mask, &sa->sa_mask, _NSIG/8); |
| 50 | 53 | 	} |
| 51 | 54 | 	int r = __syscall(SYS_rt_sigaction, sig, sa?&ksa:0, old?&ksa_old:0, _NSIG/8); |
lib/libc/musl/src/stat/__xstat.c-5| ... | ... | @@ -22,11 +22,6 @@ int __xstat(int ver, const char *path, struct stat *buf) |
| 22 | 22 | 	return stat(path, buf); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | weak_alias(__fxstat, __fxstat64); | |
| 26 | weak_alias(__fxstatat, __fxstatat64); | |
| 27 | weak_alias(__lxstat, __lxstat64); | |
| 28 | weak_alias(__xstat, __xstat64); | |
| 29 | ||
| 30 | 25 | #endif |
| 31 | 26 | |
| 32 | 27 | int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev) |
lib/libc/musl/src/stat/fchmodat.c+7-8| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | #include <fcntl.h> |
| 3 | 3 | #include <errno.h> |
| 4 | 4 | #include "syscall.h" |
| 5 | #include "kstat.h" | |
| 6 | 5 | |
| 7 | 6 | int fchmodat(int fd, const char *path, mode_t mode, int flag) |
| 8 | 7 | { |
| ... | ... | @@ -11,12 +10,12 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag) |
| 11 | 10 | 	if (flag != AT_SYMLINK_NOFOLLOW) |
| 12 | 11 | 		return __syscall_ret(-EINVAL); |
| 13 | 12 | |
| 14 | 	struct kstat st; | |
| 13 | 	struct stat st; | |
| 15 | 14 | 	int ret, fd2; |
| 16 | 15 | 	char proc[15+3*sizeof(int)]; |
| 17 | 16 | |
| 18 | 	if ((ret = __syscall(SYS_fstatat, fd, path, &st, flag))) | |
| 19 | 		return __syscall_ret(ret); | |
| 17 | 	if (fstatat(fd, path, &st, flag)) | |
| 18 | 		return -1; | |
| 20 | 19 | 	if (S_ISLNK(st.st_mode)) |
| 21 | 20 | 		return __syscall_ret(-EOPNOTSUPP); |
| 22 | 21 | |
| ... | ... | @@ -27,12 +26,12 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag) |
| 27 | 26 | 	} |
| 28 | 27 | |
| 29 | 28 | 	__procfdname(proc, fd2); |
| 30 | 	ret = __syscall(SYS_fstatat, AT_FDCWD, proc, &st, 0); | |
| 29 | 	ret = stat(proc, &st); | |
| 31 | 30 | 	if (!ret) { |
| 32 | 		if (S_ISLNK(st.st_mode)) ret = -EOPNOTSUPP; | |
| 33 | 		else ret = __syscall(SYS_fchmodat, AT_FDCWD, proc, mode); | |
| 31 | 		if (S_ISLNK(st.st_mode)) ret = __syscall_ret(-EOPNOTSUPP); | |
| 32 | 		else ret = syscall(SYS_fchmodat, AT_FDCWD, proc, mode); | |
| 34 | 33 | 	} |
| 35 | 34 | |
| 36 | 35 | 	__syscall(SYS_close, fd2); |
| 37 | 	return __syscall_ret(ret); | |
| 36 | 	return ret; | |
| 38 | 37 | } |
lib/libc/musl/src/stat/fstat.c+3-5| ... | ... | @@ -4,12 +4,10 @@ |
| 4 | 4 | #include <fcntl.h> |
| 5 | 5 | #include "syscall.h" |
| 6 | 6 | |
| 7 | int fstat(int fd, struct stat *st) | |
| 7 | int __fstat(int fd, struct stat *st) | |
| 8 | 8 | { |
| 9 | 9 | 	if (fd<0) return __syscall_ret(-EBADF); |
| 10 | 	return fstatat(fd, "", st, AT_EMPTY_PATH); | |
| 10 | 	return __fstatat(fd, "", st, AT_EMPTY_PATH); | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | #if !_REDIR_TIME64 | |
| 14 | weak_alias(fstat, fstat64); | |
| 15 | #endif | |
| 13 | weak_alias(__fstat, fstat); |
lib/libc/musl/src/stat/fstatat.c+11-5| ... | ... | @@ -6,7 +6,6 @@ |
| 6 | 6 | #include <stdint.h> |
| 7 | 7 | #include <sys/sysmacros.h> |
| 8 | 8 | #include "syscall.h" |
| 9 | #include "kstat.h" | |
| 10 | 9 | |
| 11 | 10 | struct statx { |
| 12 | 11 | 	uint32_t stx_mask; |
| ... | ... | @@ -69,6 +68,10 @@ static int fstatat_statx(int fd, const char *restrict path, struct stat *restric |
| 69 | 68 | 	return 0; |
| 70 | 69 | } |
| 71 | 70 | |
| 71 | #ifdef SYS_fstatat | |
| 72 | ||
| 73 | #include "kstat.h" | |
| 74 | ||
| 72 | 75 | static int fstatat_kstat(int fd, const char *restrict path, struct stat *restrict st, int flag) |
| 73 | 76 | { |
| 74 | 77 | 	int ret; |
| ... | ... | @@ -130,18 +133,21 @@ static int fstatat_kstat(int fd, const char *restrict path, struct stat *restric |
| 130 | 133 | |
| 131 | 134 | 	return 0; |
| 132 | 135 | } |
| 136 | #endif | |
| 133 | 137 | |
| 134 | int fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag) | |
| 138 | int __fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag) | |
| 135 | 139 | { |
| 136 | 140 | 	int ret; |
| 141 | #ifdef SYS_fstatat | |
| 137 | 142 | 	if (sizeof((struct kstat){0}.st_atime_sec) < sizeof(time_t)) { |
| 138 | 143 | 		ret = fstatat_statx(fd, path, st, flag); |
| 139 | 144 | 		if (ret!=-ENOSYS) return __syscall_ret(ret); |
| 140 | 145 | 	} |
| 141 | 146 | 	ret = fstatat_kstat(fd, path, st, flag); |
| 147 | #else | |
| 148 | 	ret = fstatat_statx(fd, path, st, flag); | |
| 149 | #endif | |
| 142 | 150 | 	return __syscall_ret(ret); |
| 143 | 151 | } |
| 144 | 152 | |
| 145 | #if !_REDIR_TIME64 | |
| 146 | weak_alias(fstatat, fstatat64); | |
| 147 | #endif | |
| 153 | weak_alias(__fstatat, fstatat); |
lib/libc/musl/src/stat/lstat.c-4| ... | ... | @@ -5,7 +5,3 @@ int lstat(const char *restrict path, struct stat *restrict buf) |
| 5 | 5 | { |
| 6 | 6 | 	return fstatat(AT_FDCWD, path, buf, AT_SYMLINK_NOFOLLOW); |
| 7 | 7 | } |
| 8 | ||
| 9 | #if !_REDIR_TIME64 | |
| 10 | weak_alias(lstat, lstat64); | |
| 11 | #endif |
lib/libc/musl/src/stat/stat.c-4| ... | ... | @@ -5,7 +5,3 @@ int stat(const char *restrict path, struct stat *restrict buf) |
| 5 | 5 | { |
| 6 | 6 | 	return fstatat(AT_FDCWD, path, buf, 0); |
| 7 | 7 | } |
| 8 | ||
| 9 | #if !_REDIR_TIME64 | |
| 10 | weak_alias(stat, stat64); | |
| 11 | #endif |
lib/libc/musl/src/stat/statvfs.c-5| ... | ... | @@ -56,8 +56,3 @@ int fstatvfs(int fd, struct statvfs *buf) |
| 56 | 56 | 	fixup(buf, &kbuf); |
| 57 | 57 | 	return 0; |
| 58 | 58 | } |
| 59 | ||
| 60 | weak_alias(statvfs, statvfs64); | |
| 61 | weak_alias(statfs, statfs64); | |
| 62 | weak_alias(fstatvfs, fstatvfs64); | |
| 63 | weak_alias(fstatfs, fstatfs64); |
lib/libc/musl/src/stdio/fgetpos.c-2| ... | ... | @@ -7,5 +7,3 @@ int fgetpos(FILE *restrict f, fpos_t *restrict pos) |
| 7 | 7 | 	*(long long *)pos = off; |
| 8 | 8 | 	return 0; |
| 9 | 9 | } |
| 10 | ||
| 11 | weak_alias(fgetpos, fgetpos64); |
lib/libc/musl/src/stdio/fgets.c+3-2| ... | ... | @@ -12,13 +12,14 @@ char *fgets(char *restrict s, int n, FILE *restrict f) |
| 12 | 12 | |
| 13 | 13 | 	FLOCK(f); |
| 14 | 14 | |
| 15 | 	if (n--<=1) { | |
| 15 | 	if (n<=1) { | |
| 16 | 16 | 		f->mode |= f->mode-1; |
| 17 | 17 | 		FUNLOCK(f); |
| 18 | 		if (n) return 0; | |
| 18 | 		if (n<1) return 0; | |
| 19 | 19 | 		*s = 0; |
| 20 | 20 | 		return s; |
| 21 | 21 | 	} |
| 22 | 	n--; | |
| 22 | 23 | |
| 23 | 24 | 	while (n) { |
| 24 | 25 | 		if (f->rpos != f->rend) { |
lib/libc/musl/src/stdio/fopen.c-2| ... | ... | @@ -29,5 +29,3 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) |
| 29 | 29 | 	__syscall(SYS_close, fd); |
| 30 | 30 | 	return 0; |
| 31 | 31 | } |
| 32 | ||
| 33 | weak_alias(fopen, fopen64); |
lib/libc/musl/src/stdio/freopen.c+2-2| ... | ... | @@ -40,6 +40,8 @@ FILE *freopen(const char *restrict filename, const char *restrict mode, FILE *re |
| 40 | 40 | 		fclose(f2); |
| 41 | 41 | 	} |
| 42 | 42 | |
| 43 | 	f->mode = 0; | |
| 44 | 	f->locale = 0; | |
| 43 | 45 | 	FUNLOCK(f); |
| 44 | 46 | 	return f; |
| 45 | 47 | |
| ... | ... | @@ -49,5 +51,3 @@ fail: |
| 49 | 51 | 	fclose(f); |
| 50 | 52 | 	return NULL; |
| 51 | 53 | } |
| 52 | ||
| 53 | weak_alias(freopen, freopen64); |
lib/libc/musl/src/stdio/fseek.c-2| ... | ... | @@ -46,5 +46,3 @@ int fseek(FILE *f, long off, int whence) |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | weak_alias(__fseeko, fseeko); |
| 49 | ||
| 50 | weak_alias(fseeko, fseeko64); |
lib/libc/musl/src/stdio/fsetpos.c-2| ... | ... | @@ -4,5 +4,3 @@ int fsetpos(FILE *f, const fpos_t *pos) |
| 4 | 4 | { |
| 5 | 5 | 	return __fseeko(f, *(const long long *)pos, SEEK_SET); |
| 6 | 6 | } |
| 7 | ||
| 8 | weak_alias(fsetpos, fsetpos64); |
lib/libc/musl/src/stdio/ftell.c-2| ... | ... | @@ -37,5 +37,3 @@ long ftell(FILE *f) |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | weak_alias(__ftello, ftello); |
| 40 | ||
| 41 | weak_alias(ftello, ftello64); |
lib/libc/musl/src/stdio/open_wmemstream.c+5-1| ... | ... | @@ -40,8 +40,12 @@ fail: |
| 40 | 40 | static size_t wms_write(FILE *f, const unsigned char *buf, size_t len) |
| 41 | 41 | { |
| 42 | 42 | 	struct cookie *c = f->cookie; |
| 43 | 	size_t len2; | |
| 43 | 	size_t len2 = f->wpos - f->wbase; | |
| 44 | 44 | 	wchar_t *newbuf; |
| 45 | 	if (len2) { | |
| 46 | 		f->wpos = f->wbase; | |
| 47 | 		if (wms_write(f, f->wbase, len2) < len2) return 0; | |
| 48 | 	} | |
| 45 | 49 | 	if (len + c->pos >= c->space) { |
| 46 | 50 | 		len2 = 2*c->space+1 | c->pos+len+1; |
| 47 | 51 | 		if (len2 > SSIZE_MAX/4) return 0; |
lib/libc/musl/src/stdio/tempnam.c+3-5| ... | ... | @@ -6,7 +6,6 @@ |
| 6 | 6 | #include <string.h> |
| 7 | 7 | #include <stdlib.h> |
| 8 | 8 | #include "syscall.h" |
| 9 | #include "kstat.h" | |
| 10 | 9 | |
| 11 | 10 | #define MAXTRIES 100 |
| 12 | 11 | |
| ... | ... | @@ -37,11 +36,10 @@ char *tempnam(const char *dir, const char *pfx) |
| 37 | 36 | |
| 38 | 37 | 	for (try=0; try<MAXTRIES; try++) { |
| 39 | 38 | 		__randname(s+l-6); |
| 40 | #ifdef SYS_lstat | |
| 41 | 		r = __syscall(SYS_lstat, s, &(struct kstat){0}); | |
| 39 | #ifdef SYS_readlink | |
| 40 | 		r = __syscall(SYS_readlink, s, (char[1]){0}, 1); | |
| 42 | 41 | #else |
| 43 | 		r = __syscall(SYS_fstatat, AT_FDCWD, s, | |
| 44 | 			&(struct kstat){0}, AT_SYMLINK_NOFOLLOW); | |
| 42 | 		r = __syscall(SYS_readlinkat, AT_FDCWD, s, (char[1]){0}, 1); | |
| 45 | 43 | #endif |
| 46 | 44 | 		if (r == -ENOENT) return strdup(s); |
| 47 | 45 | 	} |
lib/libc/musl/src/stdio/tmpfile.c-2| ... | ... | @@ -27,5 +27,3 @@ FILE *tmpfile(void) |
| 27 | 27 | 	} |
| 28 | 28 | 	return 0; |
| 29 | 29 | } |
| 30 | ||
| 31 | weak_alias(tmpfile, tmpfile64); |
lib/libc/musl/src/stdio/tmpnam.c+3-5| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | #include <string.h> |
| 6 | 6 | #include <stdlib.h> |
| 7 | 7 | #include "syscall.h" |
| 8 | #include "kstat.h" | |
| 9 | 8 | |
| 10 | 9 | #define MAXTRIES 100 |
| 11 | 10 | |
| ... | ... | @@ -17,11 +16,10 @@ char *tmpnam(char *buf) |
| 17 | 16 | 	int r; |
| 18 | 17 | 	for (try=0; try<MAXTRIES; try++) { |
| 19 | 18 | 		__randname(s+12); |
| 20 | #ifdef SYS_lstat | |
| 21 | 		r = __syscall(SYS_lstat, s, &(struct kstat){0}); | |
| 19 | #ifdef SYS_readlink | |
| 20 | 		r = __syscall(SYS_readlink, s, (char[1]){0}, 1); | |
| 22 | 21 | #else |
| 23 | 		r = __syscall(SYS_fstatat, AT_FDCWD, s, | |
| 24 | 			&(struct kstat){0}, AT_SYMLINK_NOFOLLOW); | |
| 22 | 		r = __syscall(SYS_readlinkat, AT_FDCWD, s, (char[1]){0}, 1); | |
| 25 | 23 | #endif |
| 26 | 24 | 		if (r == -ENOENT) return strcpy(buf ? buf : internal, s); |
| 27 | 25 | 	} |
lib/libc/musl/src/stdio/vfprintf.c+14-9| ... | ... | @@ -132,7 +132,7 @@ static void pop_arg(union arg *arg, int type, va_list *ap) |
| 132 | 132 | |
| 133 | 133 | static void out(FILE *f, const char *s, size_t l) |
| 134 | 134 | { |
| 135 | 	if (!(f->flags & F_ERR)) __fwritex((void *)s, l, f); | |
| 135 | 	if (!ferror(f)) __fwritex((void *)s, l, f); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static void pad(FILE *f, char c, int w, int l, int fl) |
| ... | ... | @@ -478,8 +478,8 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, |
| 478 | 478 | 		if (*s=='*') { |
| 479 | 479 | 			if (isdigit(s[1]) && s[2]=='$') { |
| 480 | 480 | 				l10n=1; |
| 481 | 				nl_type[s[1]-'0'] = INT; | |
| 482 | 				w = nl_arg[s[1]-'0'].i; | |
| 481 | 				if (!f) nl_type[s[1]-'0'] = INT, w = 0; | |
| 482 | 				else w = nl_arg[s[1]-'0'].i; | |
| 483 | 483 | 				s+=3; |
| 484 | 484 | 			} else if (!l10n) { |
| 485 | 485 | 				w = f ? va_arg(*ap, int) : 0; |
| ... | ... | @@ -491,8 +491,8 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, |
| 491 | 491 | 		/* Read precision */ |
| 492 | 492 | 		if (*s=='.' && s[1]=='*') { |
| 493 | 493 | 			if (isdigit(s[2]) && s[3]=='$') { |
| 494 | 				nl_type[s[2]-'0'] = INT; | |
| 495 | 				p = nl_arg[s[2]-'0'].i; | |
| 494 | 				if (!f) nl_type[s[2]-'0'] = INT, p = 0; | |
| 495 | 				else p = nl_arg[s[2]-'0'].i; | |
| 496 | 496 | 				s+=4; |
| 497 | 497 | 			} else if (!l10n) { |
| 498 | 498 | 				p = f ? va_arg(*ap, int) : 0; |
| ... | ... | @@ -521,13 +521,18 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, |
| 521 | 521 | 		if (st==NOARG) { |
| 522 | 522 | 			if (argpos>=0) goto inval; |
| 523 | 523 | 		} else { |
| 524 | 			if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos]; | |
| 525 | 			else if (f) pop_arg(&arg, st, ap); | |
| 524 | 			if (argpos>=0) { | |
| 525 | 				if (!f) nl_type[argpos]=st; | |
| 526 | 				else arg=nl_arg[argpos]; | |
| 527 | 			} else if (f) pop_arg(&arg, st, ap); | |
| 526 | 528 | 			else return 0; |
| 527 | 529 | 		} |
| 528 | 530 | |
| 529 | 531 | 		if (!f) continue; |
| 530 | 532 | |
| 533 | 		/* Do not process any new directives once in error state. */ | |
| 534 | 		if (ferror(f)) return -1; | |
| 535 | ||
| 531 | 536 | 		z = buf + sizeof(buf); |
| 532 | 537 | 		prefix = "-+ 0X0x"; |
| 533 | 538 | 		pl = 0; |
| ... | ... | @@ -672,7 +677,7 @@ int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap) |
| 672 | 677 | |
| 673 | 678 | 	FLOCK(f); |
| 674 | 679 | 	olderr = f->flags & F_ERR; |
| 675 | 	if (f->mode < 1) f->flags &= ~F_ERR; | |
| 680 | 	f->flags &= ~F_ERR; | |
| 676 | 681 | 	if (!f->buf_size) { |
| 677 | 682 | 		saved_buf = f->buf; |
| 678 | 683 | 		f->buf = internal_buf; |
| ... | ... | @@ -688,7 +693,7 @@ int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap) |
| 688 | 693 | 		f->buf_size = 0; |
| 689 | 694 | 		f->wpos = f->wbase = f->wend = 0; |
| 690 | 695 | 	} |
| 691 | 	if (f->flags & F_ERR) ret = -1; | |
| 696 | 	if (ferror(f)) ret = -1; | |
| 692 | 697 | 	f->flags |= olderr; |
| 693 | 698 | 	FUNLOCK(f); |
| 694 | 699 | 	va_end(ap2); |
lib/libc/musl/src/stdio/vfwprintf.c+23-16| ... | ... | @@ -125,7 +125,13 @@ static void pop_arg(union arg *arg, int type, va_list *ap) |
| 125 | 125 | |
| 126 | 126 | static void out(FILE *f, const wchar_t *s, size_t l) |
| 127 | 127 | { |
| 128 | 	while (l-- && !(f->flags & F_ERR)) fputwc(*s++, f); | |
| 128 | 	while (l-- && !ferror(f)) fputwc(*s++, f); | |
| 129 | } | |
| 130 | ||
| 131 | static void pad(FILE *f, int n, int fl) | |
| 132 | { | |
| 133 | 	if ((fl & LEFT_ADJ) || !n || ferror(f)) return; | |
| 134 | 	fprintf(f, "%*s", n, ""); | |
| 129 | 135 | } |
| 130 | 136 | |
| 131 | 137 | static int getint(wchar_t **s) { |
| ... | ... | @@ -242,6 +248,10 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ |
| 242 | 248 | 		} |
| 243 | 249 | |
| 244 | 250 | 		if (!f) continue; |
| 251 | ||
| 252 | 		/* Do not process any new directives once in error state. */ | |
| 253 | 		if (ferror(f)) return -1; | |
| 254 | ||
| 245 | 255 | 		t = s[-1]; |
| 246 | 256 | 		if (ps && (t&15)==3) t&=~32; |
| 247 | 257 | |
| ... | ... | @@ -258,25 +268,22 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ |
| 258 | 268 | 			} |
| 259 | 269 | 			continue; |
| 260 | 270 | 		case 'c': |
| 271 | 		case 'C': | |
| 261 | 272 | 			if (w<1) w=1; |
| 262 | 			if (w>1 && !(fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, ""); | |
| 263 | 			fputwc(btowc(arg.i), f); | |
| 264 | 			if (w>1 && (fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, ""); | |
| 273 | 			pad(f, w-1, fl); | |
| 274 | 			out(f, &(wchar_t){t=='C' ? arg.i : btowc(arg.i)}, 1); | |
| 275 | 			pad(f, w-1, fl^LEFT_ADJ); | |
| 265 | 276 | 			l = w; |
| 266 | 277 | 			continue; |
| 267 | 		case 'C': | |
| 268 | 			fputwc(arg.i, f); | |
| 269 | 			l = 1; | |
| 270 | 			continue; | |
| 271 | 278 | 		case 'S': |
| 272 | 279 | 			a = arg.p; |
| 273 | 280 | 			z = a + wcsnlen(a, p<0 ? INT_MAX : p); |
| 274 | 281 | 			if (p<0 && *z) goto overflow; |
| 275 | 282 | 			p = z-a; |
| 276 | 283 | 			if (w<p) w=p; |
| 277 | 			if (!(fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, ""); | |
| 284 | 			pad(f, w-p, fl); | |
| 278 | 285 | 			out(f, a, p); |
| 279 | 			if ((fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, ""); | |
| 286 | 			pad(f, w-p, fl^LEFT_ADJ); | |
| 280 | 287 | 			l=w; |
| 281 | 288 | 			continue; |
| 282 | 289 | 		case 'm': |
| ... | ... | @@ -289,14 +296,14 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ |
| 289 | 296 | 			if (p<0 && *bs) goto overflow; |
| 290 | 297 | 			p=l; |
| 291 | 298 | 			if (w<p) w=p; |
| 292 | 			if (!(fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, ""); | |
| 299 | 			pad(f, w-p, fl); | |
| 293 | 300 | 			bs = arg.p; |
| 294 | 301 | 			while (l--) { |
| 295 | 302 | 				i=mbtowc(&wc, bs, MB_LEN_MAX); |
| 296 | 303 | 				bs+=i; |
| 297 | 				fputwc(wc, f); | |
| 304 | 				out(f, &wc, 1); | |
| 298 | 305 | 			} |
| 299 | 			if ((fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, ""); | |
| 306 | 			pad(f, w-p, fl^LEFT_ADJ); | |
| 300 | 307 | 			l=w; |
| 301 | 308 | 			continue; |
| 302 | 309 | 		} |
| ... | ... | @@ -340,8 +347,8 @@ overflow: |
| 340 | 347 | int vfwprintf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap) |
| 341 | 348 | { |
| 342 | 349 | 	va_list ap2; |
| 343 | 	int nl_type[NL_ARGMAX] = {0}; | |
| 344 | 	union arg nl_arg[NL_ARGMAX]; | |
| 350 | 	int nl_type[NL_ARGMAX+1] = {0}; | |
| 351 | 	union arg nl_arg[NL_ARGMAX+1]; | |
| 345 | 352 | 	int olderr; |
| 346 | 353 | 	int ret; |
| 347 | 354 | |
| ... | ... | @@ -357,7 +364,7 @@ int vfwprintf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap) |
| 357 | 364 | 	olderr = f->flags & F_ERR; |
| 358 | 365 | 	f->flags &= ~F_ERR; |
| 359 | 366 | 	ret = wprintf_core(f, fmt, &ap2, nl_arg, nl_type); |
| 360 | 	if (f->flags & F_ERR) ret = -1; | |
| 367 | 	if (ferror(f)) ret = -1; | |
| 361 | 368 | 	f->flags |= olderr; |
| 362 | 369 | 	FUNLOCK(f); |
| 363 | 370 | 	va_end(ap2); |
lib/libc/musl/src/stdio/vswprintf.c+1| ... | ... | @@ -18,6 +18,7 @@ static size_t sw_write(FILE *f, const unsigned char *s, size_t l) |
| 18 | 18 | 	if (s!=f->wbase && sw_write(f, f->wbase, f->wpos-f->wbase)==-1) |
| 19 | 19 | 		return -1; |
| 20 | 20 | 	while (c->l && l && (i=mbtowc(c->ws, (void *)s, l))>=0) { |
| 21 | 		if (!i) i=1; | |
| 21 | 22 | 		s+=i; |
| 22 | 23 | 		l-=i; |
| 23 | 24 | 		c->l--; |
lib/libc/musl/src/stdlib/qsort_nr.c+1-1| ... | ... | @@ -10,5 +10,5 @@ static int wrapper_cmp(const void *v1, const void *v2, void *cmp) |
| 10 | 10 | |
| 11 | 11 | void qsort(void *base, size_t nel, size_t width, cmpfun cmp) |
| 12 | 12 | { |
| 13 | 	__qsort_r(base, nel, width, wrapper_cmp, cmp); | |
| 13 | 	__qsort_r(base, nel, width, wrapper_cmp, (void *)cmp); | |
| 14 | 14 | } |
lib/libc/musl/src/string/strverscmp.c+3-3| ... | ... | @@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0) |
| 18 | 18 | 		else if (c!='0') z=0; |
| 19 | 19 | 	} |
| 20 | 20 | |
| 21 | 	if (l[dp]!='0' && r[dp]!='0') { | |
| 22 | 		/* If we're not looking at a digit sequence that began | |
| 23 | 		 * with a zero, longest digit string is greater. */ | |
| 21 | 	if (l[dp]-'1'<9U && r[dp]-'1'<9U) { | |
| 22 | 		/* If we're looking at non-degenerate digit sequences starting | |
| 23 | 		 * with nonzero digits, longest digit string is greater. */ | |
| 24 | 24 | 		for (j=i; isdigit(l[j]); j++) |
| 25 | 25 | 			if (!isdigit(r[j])) return 1; |
| 26 | 26 | 		if (isdigit(r[j])) return -1; |
lib/libc/musl/src/string/wcscmp.c+1-1| ... | ... | @@ -3,5 +3,5 @@ |
| 3 | 3 | int wcscmp(const wchar_t *l, const wchar_t *r) |
| 4 | 4 | { |
| 5 | 5 | 	for (; *l==*r && *l && *r; l++, r++); |
| 6 | 	return *l - *r; | |
| 6 | 	return *l < *r ? -1 : *l > *r; | |
| 7 | 7 | } |
lib/libc/musl/src/string/wcsncmp.c+1-1| ... | ... | @@ -3,5 +3,5 @@ |
| 3 | 3 | int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n) |
| 4 | 4 | { |
| 5 | 5 | 	for (; n && *l==*r && *l && *r; n--, l++, r++); |
| 6 | 	return n ? *l - *r : 0; | |
| 6 | 	return n ? (*l < *r ? -1 : *l > *r) : 0; | |
| 7 | 7 | } |
lib/libc/musl/src/string/wmemcmp.c+1-1| ... | ... | @@ -3,5 +3,5 @@ |
| 3 | 3 | int wmemcmp(const wchar_t *l, const wchar_t *r, size_t n) |
| 4 | 4 | { |
| 5 | 5 | 	for (; n && *l==*r; n--, l++, r++); |
| 6 | 	return n ? *l-*r : 0; | |
| 6 | 	return n ? (*l < *r ? -1 : *l > *r) : 0; | |
| 7 | 7 | } |
lib/libc/musl/src/temp/__randname.c+2-1| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | #include <time.h> |
| 2 | 2 | #include <stdint.h> |
| 3 | #include "pthread_impl.h" | |
| 3 | 4 | |
| 4 | 5 | /* This assumes that a check for the |
| 5 | 6 | template size has already been made */ |
| ... | ... | @@ -10,7 +11,7 @@ char *__randname(char *template) |
| 10 | 11 | 	unsigned long r; |
| 11 | 12 | |
| 12 | 13 | 	__clock_gettime(CLOCK_REALTIME, &ts); |
| 13 | 	r = ts.tv_nsec*65537 ^ (uintptr_t)&ts / 16 + (uintptr_t)template; | |
| 14 | 	r = ts.tv_sec + ts.tv_nsec + __pthread_self()->tid * 65537UL; | |
| 14 | 15 | 	for (i=0; i<6; i++, r>>=5) |
| 15 | 16 | 		template[i] = 'A'+(r&15)+(r&16)*2; |
| 16 | 17 |
lib/libc/musl/src/temp/mkostemp.c-2| ... | ... | @@ -5,5 +5,3 @@ int mkostemp(char *template, int flags) |
| 5 | 5 | { |
| 6 | 6 | 	return __mkostemps(template, 0, flags); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(mkostemp, mkostemp64); |
lib/libc/musl/src/temp/mkostemps.c-1| ... | ... | @@ -26,4 +26,3 @@ int __mkostemps(char *template, int len, int flags) |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | weak_alias(__mkostemps, mkostemps); |
| 29 | weak_alias(__mkostemps, mkostemps64); |
lib/libc/musl/src/temp/mkstemp.c-2| ... | ... | @@ -4,5 +4,3 @@ int mkstemp(char *template) |
| 4 | 4 | { |
| 5 | 5 | 	return __mkostemps(template, 0, 0); |
| 6 | 6 | } |
| 7 | ||
| 8 | weak_alias(mkstemp, mkstemp64); |
lib/libc/musl/src/temp/mkstemps.c-2| ... | ... | @@ -5,5 +5,3 @@ int mkstemps(char *template, int len) |
| 5 | 5 | { |
| 6 | 6 | 	return __mkostemps(template, len, 0); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(mkstemps, mkstemps64); |
lib/libc/musl/src/thread/pthread_atfork.c+7-1| ... | ... | @@ -1,7 +1,13 @@ |
| 1 | 1 | #include <pthread.h> |
| 2 | #include <errno.h> | |
| 2 | 3 | #include "libc.h" |
| 3 | 4 | #include "lock.h" |
| 4 | 5 | |
| 6 | #define malloc __libc_malloc | |
| 7 | #define calloc undef | |
| 8 | #define realloc undef | |
| 9 | #define free undef | |
| 10 | ||
| 5 | 11 | static struct atfork_funcs { |
| 6 | 12 | 	void (*prepare)(void); |
| 7 | 13 | 	void (*parent)(void); |
| ... | ... | @@ -34,7 +40,7 @@ void __fork_handler(int who) |
| 34 | 40 | int pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) |
| 35 | 41 | { |
| 36 | 42 | 	struct atfork_funcs *new = malloc(sizeof *new); |
| 37 | 	if (!new) return -1; | |
| 43 | 	if (!new) return ENOMEM; | |
| 38 | 44 | |
| 39 | 45 | 	LOCK(lock); |
| 40 | 46 | 	new->next = funcs; |
lib/libc/musl/src/thread/pthread_cancel.c+7-2| ... | ... | @@ -56,7 +56,12 @@ static void cancel_handler(int sig, siginfo_t *si, void *ctx) |
| 56 | 56 | |
| 57 | 57 | 	_sigaddset(&uc->uc_sigmask, SIGCANCEL); |
| 58 | 58 | |
| 59 | 	if (self->cancelasync || pc >= (uintptr_t)__cp_begin && pc < (uintptr_t)__cp_end) { | |
| 59 | 	if (self->cancelasync) { | |
| 60 | 		pthread_sigmask(SIG_SETMASK, &uc->uc_sigmask, 0); | |
| 61 | 		__cancel(); | |
| 62 | 	} | |
| 63 | ||
| 64 | 	if (pc >= (uintptr_t)__cp_begin && pc < (uintptr_t)__cp_end) { | |
| 60 | 65 | 		uc->uc_mcontext.MC_PC = (uintptr_t)__cp_cancel; |
| 61 | 66 | #ifdef CANCEL_GOT |
| 62 | 67 | 		uc->uc_mcontext.MC_GOT = CANCEL_GOT; |
| ... | ... | @@ -77,7 +82,7 @@ void __testcancel() |
| 77 | 82 | static void init_cancellation() |
| 78 | 83 | { |
| 79 | 84 | 	struct sigaction sa = { |
| 80 | 		.sa_flags = SA_SIGINFO | SA_RESTART, | |
| 85 | 		.sa_flags = SA_SIGINFO | SA_RESTART | SA_ONSTACK, | |
| 81 | 86 | 		.sa_sigaction = cancel_handler |
| 82 | 87 | 	}; |
| 83 | 88 | 	memset(&sa.sa_mask, -1, _NSIG/8); |
lib/libc/musl/src/thread/pthread_create.c+10-6| ... | ... | @@ -107,6 +107,16 @@ _Noreturn void __pthread_exit(void *result) |
| 107 | 107 | |
| 108 | 108 | 	/* At this point we are committed to thread termination. */ |
| 109 | 109 | |
| 110 | 	/* After the kernel thread exits, its tid may be reused. Clear it | |
| 111 | 	 * to prevent inadvertent use and inform functions that would use | |
| 112 | 	 * it that it's no longer available. At this point the killlock | |
| 113 | 	 * may be released, since functions that use it will consistently | |
| 114 | 	 * see the thread as having exited. Release it now so that no | |
| 115 | 	 * remaining locks (except thread list) are held if we end up | |
| 116 | 	 * resetting need_locks below. */ | |
| 117 | 	self->tid = 0; | |
| 118 | 	UNLOCK(self->killlock); | |
| 119 | ||
| 110 | 120 | 	/* Process robust list in userspace to handle non-pshared mutexes |
| 111 | 121 | 	 * and the detached thread case where the robust list head will |
| 112 | 122 | 	 * be invalid when the kernel would process it. */ |
| ... | ... | @@ -159,12 +169,6 @@ _Noreturn void __pthread_exit(void *result) |
| 159 | 169 | 	a_store(&self->detach_state, DT_EXITED); |
| 160 | 170 | 	__wake(&self->detach_state, 1, 1); |
| 161 | 171 | |
| 162 | 	/* After the kernel thread exits, its tid may be reused. Clear it | |
| 163 | 	 * to prevent inadvertent use and inform functions that would use | |
| 164 | 	 * it that it's no longer available. */ | |
| 165 | 	self->tid = 0; | |
| 166 | 	UNLOCK(self->killlock); | |
| 167 | ||
| 168 | 172 | 	for (;;) __syscall(SYS_exit, 0); |
| 169 | 173 | } |
| 170 | 174 |
lib/libc/musl/src/thread/pthread_detach.c+6-2| ... | ... | @@ -5,8 +5,12 @@ static int __pthread_detach(pthread_t t) |
| 5 | 5 | { |
| 6 | 6 | 	/* If the cas fails, detach state is either already-detached |
| 7 | 7 | 	 * or exiting/exited, and pthread_join will trap or cleanup. */ |
| 8 | 	if (a_cas(&t->detach_state, DT_JOINABLE, DT_DETACHED) != DT_JOINABLE) | |
| 9 | 		return __pthread_join(t, 0); | |
| 8 | 	if (a_cas(&t->detach_state, DT_JOINABLE, DT_DETACHED) != DT_JOINABLE) { | |
| 9 | 		int cs; | |
| 10 | 		__pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); | |
| 11 | 		__pthread_join(t, 0); | |
| 12 | 		__pthread_setcancelstate(cs, 0); | |
| 13 | 	} | |
| 10 | 14 | 	return 0; |
| 11 | 15 | } |
| 12 | 16 |
lib/libc/musl/src/thread/pthread_key_create.c+8| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | #include "pthread_impl.h" |
| 2 | #include "fork_impl.h" | |
| 2 | 3 | |
| 3 | 4 | volatile size_t __pthread_tsd_size = sizeof(void *) * PTHREAD_KEYS_MAX; |
| 4 | 5 | void *__pthread_tsd_main[PTHREAD_KEYS_MAX] = { 0 }; |
| ... | ... | @@ -20,6 +21,13 @@ static void dummy_0(void) |
| 20 | 21 | weak_alias(dummy_0, __tl_lock); |
| 21 | 22 | weak_alias(dummy_0, __tl_unlock); |
| 22 | 23 | |
| 24 | void __pthread_key_atfork(int who) | |
| 25 | { | |
| 26 | 	if (who<0) __pthread_rwlock_rdlock(&key_lock); | |
| 27 | 	else if (!who) __pthread_rwlock_unlock(&key_lock); | |
| 28 | 	else key_lock = (pthread_rwlock_t)PTHREAD_RWLOCK_INITIALIZER; | |
| 29 | } | |
| 30 | ||
| 23 | 31 | int __pthread_key_create(pthread_key_t *k, void (*dtor)(void *)) |
| 24 | 32 | { |
| 25 | 33 | 	pthread_t self = __pthread_self(); |
lib/libc/musl/src/thread/sem_getvalue.c+2-1| ... | ... | @@ -1,8 +1,9 @@ |
| 1 | 1 | #include <semaphore.h> |
| 2 | #include <limits.h> | |
| 2 | 3 | |
| 3 | 4 | int sem_getvalue(sem_t *restrict sem, int *restrict valp) |
| 4 | 5 | { |
| 5 | 6 | 	int val = sem->__val[0]; |
| 6 | 	*valp = val < 0 ? 0 : val; | |
| 7 | 	*valp = val & SEM_VALUE_MAX; | |
| 7 | 8 | 	return 0; |
| 8 | 9 | } |
lib/libc/musl/src/thread/sem_post.c+8-4| ... | ... | @@ -1,17 +1,21 @@ |
| 1 | 1 | #include <semaphore.h> |
| 2 | #include <limits.h> | |
| 2 | 3 | #include "pthread_impl.h" |
| 3 | 4 | |
| 4 | 5 | int sem_post(sem_t *sem) |
| 5 | 6 | { |
| 6 | 	int val, waiters, priv = sem->__val[2]; | |
| 7 | 	int val, new, waiters, priv = sem->__val[2]; | |
| 7 | 8 | 	do { |
| 8 | 9 | 		val = sem->__val[0]; |
| 9 | 10 | 		waiters = sem->__val[1]; |
| 10 | 		if (val == SEM_VALUE_MAX) { | |
| 11 | 		if ((val & SEM_VALUE_MAX) == SEM_VALUE_MAX) { | |
| 11 | 12 | 			errno = EOVERFLOW; |
| 12 | 13 | 			return -1; |
| 13 | 14 | 		} |
| 14 | 	} while (a_cas(sem->__val, val, val+1+(val<0)) != val); | |
| 15 | 	if (val<0 || waiters) __wake(sem->__val, 1, priv); | |
| 15 | 		new = val + 1; | |
| 16 | 		if (waiters <= 1) | |
| 17 | 			new &= ~0x80000000; | |
| 18 | 	} while (a_cas(sem->__val, val, new) != val); | |
| 19 | 	if (val<0) __wake(sem->__val, waiters>1 ? 1 : -1, priv); | |
| 16 | 20 | 	return 0; |
| 17 | 21 | } |
lib/libc/musl/src/thread/sem_timedwait.c+6-4| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | #include <semaphore.h> |
| 2 | #include <limits.h> | |
| 2 | 3 | #include "pthread_impl.h" |
| 3 | 4 | |
| 4 | 5 | static void cleanup(void *p) |
| ... | ... | @@ -13,14 +14,15 @@ int sem_timedwait(sem_t *restrict sem, const struct timespec *restrict at) |
| 13 | 14 | 	if (!sem_trywait(sem)) return 0; |
| 14 | 15 | |
| 15 | 16 | 	int spins = 100; |
| 16 | 	while (spins-- && sem->__val[0] <= 0 && !sem->__val[1]) a_spin(); | |
| 17 | 	while (spins-- && !(sem->__val[0] & SEM_VALUE_MAX) && !sem->__val[1]) | |
| 18 | 		a_spin(); | |
| 17 | 19 | |
| 18 | 20 | 	while (sem_trywait(sem)) { |
| 19 | 		int r; | |
| 21 | 		int r, priv = sem->__val[2]; | |
| 20 | 22 | 		a_inc(sem->__val+1); |
| 21 | 		a_cas(sem->__val, 0, -1); | |
| 23 | 		a_cas(sem->__val, 0, 0x80000000); | |
| 22 | 24 | 		pthread_cleanup_push(cleanup, (void *)(sem->__val+1)); |
| 23 | 		r = __timedwait_cp(sem->__val, -1, CLOCK_REALTIME, at, sem->__val[2]); | |
| 25 | 		r = __timedwait_cp(sem->__val, 0x80000000, CLOCK_REALTIME, at, priv); | |
| 24 | 26 | 		pthread_cleanup_pop(1); |
| 25 | 27 | 		if (r) { |
| 26 | 28 | 			errno = r; |
lib/libc/musl/src/thread/sem_trywait.c+3-3| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | #include <semaphore.h> |
| 2 | #include <limits.h> | |
| 2 | 3 | #include "pthread_impl.h" |
| 3 | 4 | |
| 4 | 5 | int sem_trywait(sem_t *sem) |
| 5 | 6 | { |
| 6 | 7 | 	int val; |
| 7 | 	while ((val=sem->__val[0]) > 0) { | |
| 8 | 		int new = val-1-(val==1 && sem->__val[1]); | |
| 9 | 		if (a_cas(sem->__val, val, new)==val) return 0; | |
| 8 | 	while ((val=sem->__val[0]) & SEM_VALUE_MAX) { | |
| 9 | 		if (a_cas(sem->__val, val, val-1)==val) return 0; | |
| 10 | 10 | 	} |
| 11 | 11 | 	errno = EAGAIN; |
| 12 | 12 | 	return -1; |
lib/libc/musl/src/thread/synccall.c+1-1| ... | ... | @@ -45,7 +45,7 @@ void __synccall(void (*func)(void *), void *ctx) |
| 45 | 45 | { |
| 46 | 46 | 	sigset_t oldmask; |
| 47 | 47 | 	int cs, i, r; |
| 48 | 	struct sigaction sa = { .sa_flags = SA_RESTART, .sa_handler = handler }; | |
| 48 | 	struct sigaction sa = { .sa_flags = SA_RESTART | SA_ONSTACK, .sa_handler = handler }; | |
| 49 | 49 | 	pthread_t self = __pthread_self(), td; |
| 50 | 50 | 	int count = 0; |
| 51 | 51 |
lib/libc/musl/src/time/__map_file.c+2-3| ... | ... | @@ -2,15 +2,14 @@ |
| 2 | 2 | #include <fcntl.h> |
| 3 | 3 | #include <sys/stat.h> |
| 4 | 4 | #include "syscall.h" |
| 5 | #include "kstat.h" | |
| 6 | 5 | |
| 7 | 6 | const char unsigned *__map_file(const char *pathname, size_t *size) |
| 8 | 7 | { |
| 9 | 	struct kstat st; | |
| 8 | 	struct stat st; | |
| 10 | 9 | 	const unsigned char *map = MAP_FAILED; |
| 11 | 10 | 	int fd = sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK); |
| 12 | 11 | 	if (fd < 0) return 0; |
| 13 | 	if (!syscall(SYS_fstat, fd, &st)) { | |
| 12 | 	if (!__fstat(fd, &st)) { | |
| 14 | 13 | 		map = __mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); |
| 15 | 14 | 		*size = st.st_size; |
| 16 | 15 | 	} |
lib/libc/musl/src/time/clock_getcpuclockid.c+1| ... | ... | @@ -8,6 +8,7 @@ int clock_getcpuclockid(pid_t pid, clockid_t *clk) |
| 8 | 8 | 	struct timespec ts; |
| 9 | 9 | 	clockid_t id = (-pid-1)*8U + 2; |
| 10 | 10 | 	int ret = __syscall(SYS_clock_getres, id, &ts); |
| 11 | 	if (ret == -EINVAL) ret = -ESRCH; | |
| 11 | 12 | 	if (ret) return -ret; |
| 12 | 13 | 	*clk = id; |
| 13 | 14 | 	return 0; |
lib/libc/musl/src/time/clock_gettime.c+7| ... | ... | @@ -42,6 +42,9 @@ static int cgt_init(clockid_t clk, struct timespec *ts) |
| 42 | 42 | 			p = cgt_time32_wrap; |
| 43 | 43 | 		} |
| 44 | 44 | 	} |
| 45 | #ifdef VDSO_CGT_WORKAROUND | |
| 46 | 	if (!__vdsosym(VDSO_CGT32_VER, VDSO_CGT32_SYM)) p = 0; | |
| 47 | #endif | |
| 45 | 48 | #endif |
| 46 | 49 | 	int (*f)(clockid_t, struct timespec *) = |
| 47 | 50 | 		(int (*)(clockid_t, struct timespec *))p; |
| ... | ... | @@ -80,10 +83,12 @@ int __clock_gettime(clockid_t clk, struct timespec *ts) |
| 80 | 83 | 		return __syscall_ret(r); |
| 81 | 84 | 	long ts32[2]; |
| 82 | 85 | 	r = __syscall(SYS_clock_gettime, clk, ts32); |
| 86 | #ifdef SYS_gettimeofday | |
| 83 | 87 | 	if (r==-ENOSYS && clk==CLOCK_REALTIME) { |
| 84 | 88 | 		r = __syscall(SYS_gettimeofday, ts32, 0); |
| 85 | 89 | 		ts32[1] *= 1000; |
| 86 | 90 | 	} |
| 91 | #endif | |
| 87 | 92 | 	if (!r) { |
| 88 | 93 | 		ts->tv_sec = ts32[0]; |
| 89 | 94 | 		ts->tv_nsec = ts32[1]; |
| ... | ... | @@ -92,6 +97,7 @@ int __clock_gettime(clockid_t clk, struct timespec *ts) |
| 92 | 97 | 	return __syscall_ret(r); |
| 93 | 98 | #else |
| 94 | 99 | 	r = __syscall(SYS_clock_gettime, clk, ts); |
| 100 | #ifdef SYS_gettimeofday | |
| 95 | 101 | 	if (r == -ENOSYS) { |
| 96 | 102 | 		if (clk == CLOCK_REALTIME) { |
| 97 | 103 | 			__syscall(SYS_gettimeofday, ts, 0); |
| ... | ... | @@ -100,6 +106,7 @@ int __clock_gettime(clockid_t clk, struct timespec *ts) |
| 100 | 106 | 		} |
| 101 | 107 | 		r = -EINVAL; |
| 102 | 108 | 	} |
| 109 | #endif | |
| 103 | 110 | 	return __syscall_ret(r); |
| 104 | 111 | #endif |
| 105 | 112 | } |
lib/libc/musl/src/time/timer_create.c+5-1| ... | ... | @@ -43,6 +43,8 @@ static void *start(void *arg) |
| 43 | 43 | 	union sigval val = args->sev->sigev_value; |
| 44 | 44 | |
| 45 | 45 | 	pthread_barrier_wait(&args->b); |
| 46 | 	if (self->cancel) | |
| 47 | 		return 0; | |
| 46 | 48 | 	for (;;) { |
| 47 | 49 | 		siginfo_t si; |
| 48 | 50 | 		while (sigwaitinfo(SIGTIMER_SET, &si) < 0); |
| ... | ... | @@ -113,8 +115,10 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict |
| 113 | 115 | 		ksev.sigev_signo = SIGTIMER; |
| 114 | 116 | 		ksev.sigev_notify = SIGEV_THREAD_ID; |
| 115 | 117 | 		ksev.sigev_tid = td->tid; |
| 116 | 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0) | |
| 118 | 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0) { | |
| 117 | 119 | 			timerid = -1; |
| 120 | 			td->cancel = 1; | |
| 121 | 		} | |
| 118 | 122 | 		td->timer_id = timerid; |
| 119 | 123 | 		pthread_barrier_wait(&args.b); |
| 120 | 124 | 		if (timerid < 0) return -1; |
lib/libc/musl/src/unistd/dup3.c+4-2| ... | ... | @@ -9,12 +9,14 @@ int __dup3(int old, int new, int flags) |
| 9 | 9 | 	int r; |
| 10 | 10 | #ifdef SYS_dup2 |
| 11 | 11 | 	if (old==new) return __syscall_ret(-EINVAL); |
| 12 | 	if (flags & O_CLOEXEC) { | |
| 12 | 	if (flags) { | |
| 13 | 13 | 		while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY); |
| 14 | 14 | 		if (r!=-ENOSYS) return __syscall_ret(r); |
| 15 | 		if (flags & ~O_CLOEXEC) return __syscall_ret(-EINVAL); | |
| 15 | 16 | 	} |
| 16 | 17 | 	while ((r=__syscall(SYS_dup2, old, new))==-EBUSY); |
| 17 | 	if (flags & O_CLOEXEC) __syscall(SYS_fcntl, new, F_SETFD, FD_CLOEXEC); | |
| 18 | 	if (r >= 0 && (flags & O_CLOEXEC)) | |
| 19 | 		__syscall(SYS_fcntl, new, F_SETFD, FD_CLOEXEC); | |
| 18 | 20 | #else |
| 19 | 21 | 	while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY); |
| 20 | 22 | #endif |
lib/libc/musl/src/unistd/ftruncate.c-2| ... | ... | @@ -5,5 +5,3 @@ int ftruncate(int fd, off_t length) |
| 5 | 5 | { |
| 6 | 6 | 	return syscall(SYS_ftruncate, fd, __SYSCALL_LL_O(length)); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(ftruncate, ftruncate64); |
lib/libc/musl/src/unistd/lseek.c-1| ... | ... | @@ -12,4 +12,3 @@ off_t __lseek(int fd, off_t offset, int whence) |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | weak_alias(__lseek, lseek); |
| 15 | weak_alias(__lseek, lseek64); |
lib/libc/musl/src/unistd/mipsn32/lseek.c-1| ... | ... | @@ -17,4 +17,3 @@ off_t __lseek(int fd, off_t offset, int whence) |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | weak_alias(__lseek, lseek); |
| 20 | weak_alias(__lseek, lseek64); |
lib/libc/musl/src/unistd/pipe2.c+1| ... | ... | @@ -8,6 +8,7 @@ int pipe2(int fd[2], int flag) |
| 8 | 8 | 	if (!flag) return pipe(fd); |
| 9 | 9 | 	int ret = __syscall(SYS_pipe2, fd, flag); |
| 10 | 10 | 	if (ret != -ENOSYS) return __syscall_ret(ret); |
| 11 | 	if (flag & ~(O_CLOEXEC|O_NONBLOCK)) return __syscall_ret(-EINVAL); | |
| 11 | 12 | 	ret = pipe(fd); |
| 12 | 13 | 	if (ret) return ret; |
| 13 | 14 | 	if (flag & O_CLOEXEC) { |
lib/libc/musl/src/unistd/pread.c-2| ... | ... | @@ -5,5 +5,3 @@ ssize_t pread(int fd, void *buf, size_t size, off_t ofs) |
| 5 | 5 | { |
| 6 | 6 | 	return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_PRW(ofs)); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(pread, pread64); |
lib/libc/musl/src/unistd/preadv.c-2| ... | ... | @@ -8,5 +8,3 @@ ssize_t preadv(int fd, const struct iovec *iov, int count, off_t ofs) |
| 8 | 8 | 	return syscall_cp(SYS_preadv, fd, iov, count, |
| 9 | 9 | 		(long)(ofs), (long)(ofs>>32)); |
| 10 | 10 | } |
| 11 | ||
| 12 | weak_alias(preadv, preadv64); |
lib/libc/musl/src/unistd/pwrite.c-2| ... | ... | @@ -5,5 +5,3 @@ ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs) |
| 5 | 5 | { |
| 6 | 6 | 	return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_PRW(ofs)); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(pwrite, pwrite64); |
lib/libc/musl/src/unistd/pwritev.c-2| ... | ... | @@ -8,5 +8,3 @@ ssize_t pwritev(int fd, const struct iovec *iov, int count, off_t ofs) |
| 8 | 8 | 	return syscall_cp(SYS_pwritev, fd, iov, count, |
| 9 | 9 | 		(long)(ofs), (long)(ofs>>32)); |
| 10 | 10 | } |
| 11 | ||
| 12 | weak_alias(pwritev, pwritev64); |
lib/libc/musl/src/unistd/truncate.c-2| ... | ... | @@ -5,5 +5,3 @@ int truncate(const char *path, off_t length) |
| 5 | 5 | { |
| 6 | 6 | 	return syscall(SYS_truncate, path, __SYSCALL_LL_O(length)); |
| 7 | 7 | } |
| 8 | ||
| 9 | weak_alias(truncate, truncate64); |
lib/libc/musl/src/unistd/x32/lseek.c-1| ... | ... | @@ -12,4 +12,3 @@ off_t __lseek(int fd, off_t offset, int whence) |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | weak_alias(__lseek, lseek); |
| 15 | weak_alias(__lseek, lseek64); |
lib/std/os.zig+19-68| ... | ... | @@ -890,10 +890,7 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize { |
| 890 | 890 | }; |
| 891 | 891 | const adjusted_len = @min(max_count, buf.len); |
| 892 | 892 | |
| 893 | const pread_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 894 | system.pread64 | |
| 895 | else | |
| 896 | system.pread; | |
| 893 | const pread_sym = if (lfs64_abi) system.pread64 else system.pread; | |
| 897 | 894 | |
| 898 | 895 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 899 | 896 | while (true) { |
| ... | ... | @@ -966,10 +963,7 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void { |
| 966 | 963 | } |
| 967 | 964 | |
| 968 | 965 | while (true) { |
| 969 | const ftruncate_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 970 | system.ftruncate64 | |
| 971 | else | |
| 972 | system.ftruncate; | |
| 966 | const ftruncate_sym = if (lfs64_abi) system.ftruncate64 else system.ftruncate; | |
| 973 | 967 | |
| 974 | 968 | const ilen = @bitCast(i64, length); // the OS treats this as unsigned |
| 975 | 969 | switch (errno(ftruncate_sym(fd, ilen))) { |
| ... | ... | @@ -1034,10 +1028,7 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { |
| 1034 | 1028 | |
| 1035 | 1029 | const iov_count = math.cast(u31, iov.len) orelse math.maxInt(u31); |
| 1036 | 1030 | |
| 1037 | const preadv_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 1038 | system.preadv64 | |
| 1039 | else | |
| 1040 | system.preadv; | |
| 1031 | const preadv_sym = if (lfs64_abi) system.preadv64 else system.preadv; | |
| 1041 | 1032 | |
| 1042 | 1033 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 1043 | 1034 | while (true) { |
| ... | ... | @@ -1311,10 +1302,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { |
| 1311 | 1302 | }; |
| 1312 | 1303 | const adjusted_len = @min(max_count, bytes.len); |
| 1313 | 1304 | |
| 1314 | const pwrite_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 1315 | system.pwrite64 | |
| 1316 | else | |
| 1317 | system.pwrite; | |
| 1305 | const pwrite_sym = if (lfs64_abi) system.pwrite64 else system.pwrite; | |
| 1318 | 1306 | |
| 1319 | 1307 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 1320 | 1308 | while (true) { |
| ... | ... | @@ -1400,10 +1388,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz |
| 1400 | 1388 | } |
| 1401 | 1389 | } |
| 1402 | 1390 | |
| 1403 | const pwritev_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 1404 | system.pwritev64 | |
| 1405 | else | |
| 1406 | system.pwritev; | |
| 1391 | const pwritev_sym = if (lfs64_abi) system.pwritev64 else system.pwritev; | |
| 1407 | 1392 | |
| 1408 | 1393 | const iov_count = if (iov.len > IOV_MAX) IOV_MAX else @intCast(u31, iov.len); |
| 1409 | 1394 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| ... | ... | @@ -1514,10 +1499,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: u32, perm: mode_t) OpenError!fd_t |
| 1514 | 1499 | return open(mem.sliceTo(file_path, 0), flags, perm); |
| 1515 | 1500 | } |
| 1516 | 1501 | |
| 1517 | const open_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 1518 | system.open64 | |
| 1519 | else | |
| 1520 | system.open; | |
| 1502 | const open_sym = if (lfs64_abi) system.open64 else system.open; | |
| 1521 | 1503 | |
| 1522 | 1504 | while (true) { |
| 1523 | 1505 | const rc = open_sym(file_path, flags, perm); |
| ... | ... | @@ -1730,10 +1712,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: u32, mode: mode_t) |
| 1730 | 1712 | return openat(dir_fd, mem.sliceTo(file_path, 0), flags, mode); |
| 1731 | 1713 | } |
| 1732 | 1714 | |
| 1733 | const openat_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 1734 | system.openat64 | |
| 1735 | else | |
| 1736 | system.openat; | |
| 1715 | const openat_sym = if (lfs64_abi) system.openat64 else system.openat; | |
| 1737 | 1716 | |
| 1738 | 1717 | while (true) { |
| 1739 | 1718 | const rc = openat_sym(dir_fd, file_path, flags, mode); |
| ... | ... | @@ -4117,10 +4096,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat { |
| 4117 | 4096 | @compileError("fstat is not yet implemented on Windows"); |
| 4118 | 4097 | } |
| 4119 | 4098 | |
| 4120 | const fstat_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4121 | system.fstat64 | |
| 4122 | else | |
| 4123 | system.fstat; | |
| 4099 | const fstat_sym = if (lfs64_abi) system.fstat64 else system.fstat; | |
| 4124 | 4100 | |
| 4125 | 4101 | var stat = mem.zeroes(Stat); |
| 4126 | 4102 | switch (errno(fstat_sym(fd, &stat))) { |
| ... | ... | @@ -4176,10 +4152,7 @@ pub fn fstatatZ(dirfd: fd_t, pathname: [*:0]const u8, flags: u32) FStatAtError!S |
| 4176 | 4152 | return fstatatWasi(dirfd, mem.sliceTo(pathname), flags); |
| 4177 | 4153 | } |
| 4178 | 4154 | |
| 4179 | const fstatat_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4180 | system.fstatat64 | |
| 4181 | else | |
| 4182 | system.fstatat; | |
| 4155 | const fstatat_sym = if (lfs64_abi) system.fstatat64 else system.fstatat; | |
| 4183 | 4156 | |
| 4184 | 4157 | var stat = mem.zeroes(Stat); |
| 4185 | 4158 | switch (errno(fstatat_sym(dirfd, pathname, &stat, flags))) { |
| ... | ... | @@ -4416,10 +4389,7 @@ pub fn mmap( |
| 4416 | 4389 | fd: fd_t, |
| 4417 | 4390 | offset: u64, |
| 4418 | 4391 | ) MMapError![]align(mem.page_size) u8 { |
| 4419 | const mmap_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4420 | system.mmap64 | |
| 4421 | else | |
| 4422 | system.mmap; | |
| 4392 | const mmap_sym = if (lfs64_abi) system.mmap64 else system.mmap; | |
| 4423 | 4393 | |
| 4424 | 4394 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 4425 | 4395 | const rc = mmap_sym(ptr, length, prot, flags, fd, ioffset); |
| ... | ... | @@ -4823,10 +4793,7 @@ pub fn lseek_SET(fd: fd_t, offset: u64) SeekError!void { |
| 4823 | 4793 | } |
| 4824 | 4794 | } |
| 4825 | 4795 | |
| 4826 | const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4827 | system.lseek64 | |
| 4828 | else | |
| 4829 | system.lseek; | |
| 4796 | const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; | |
| 4830 | 4797 | |
| 4831 | 4798 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 4832 | 4799 | switch (errno(lseek_sym(fd, ioffset, SEEK.SET))) { |
| ... | ... | @@ -4870,10 +4837,7 @@ pub fn lseek_CUR(fd: fd_t, offset: i64) SeekError!void { |
| 4870 | 4837 | else => |err| return unexpectedErrno(err), |
| 4871 | 4838 | } |
| 4872 | 4839 | } |
| 4873 | const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4874 | system.lseek64 | |
| 4875 | else | |
| 4876 | system.lseek; | |
| 4840 | const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; | |
| 4877 | 4841 | |
| 4878 | 4842 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 4879 | 4843 | switch (errno(lseek_sym(fd, ioffset, SEEK.CUR))) { |
| ... | ... | @@ -4917,10 +4881,7 @@ pub fn lseek_END(fd: fd_t, offset: i64) SeekError!void { |
| 4917 | 4881 | else => |err| return unexpectedErrno(err), |
| 4918 | 4882 | } |
| 4919 | 4883 | } |
| 4920 | const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4921 | system.lseek64 | |
| 4922 | else | |
| 4923 | system.lseek; | |
| 4884 | const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; | |
| 4924 | 4885 | |
| 4925 | 4886 | const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned |
| 4926 | 4887 | switch (errno(lseek_sym(fd, ioffset, SEEK.END))) { |
| ... | ... | @@ -4964,10 +4925,7 @@ pub fn lseek_CUR_get(fd: fd_t) SeekError!u64 { |
| 4964 | 4925 | else => |err| return unexpectedErrno(err), |
| 4965 | 4926 | } |
| 4966 | 4927 | } |
| 4967 | const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 4968 | system.lseek64 | |
| 4969 | else | |
| 4970 | system.lseek; | |
| 4928 | const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; | |
| 4971 | 4929 | |
| 4972 | 4930 | const rc = lseek_sym(fd, 0, SEEK.CUR); |
| 4973 | 4931 | switch (errno(rc)) { |
| ... | ... | @@ -6169,10 +6127,7 @@ pub fn sendfile( |
| 6169 | 6127 | // TODO we should not need this cast; improve return type of @min |
| 6170 | 6128 | const adjusted_count = @intCast(usize, adjusted_count_tmp); |
| 6171 | 6129 | |
| 6172 | const sendfile_sym = if (builtin.link_libc) | |
| 6173 | system.sendfile64 | |
| 6174 | else | |
| 6175 | system.sendfile; | |
| 6130 | const sendfile_sym = if (lfs64_abi) system.sendfile64 else system.sendfile; | |
| 6176 | 6131 | |
| 6177 | 6132 | while (true) { |
| 6178 | 6133 | var offset: off_t = @bitCast(off_t, in_offset); |
| ... | ... | @@ -7050,10 +7005,7 @@ pub fn prctl(option: PR, args: anytype) PrctlError!u31 { |
| 7050 | 7005 | pub const GetrlimitError = UnexpectedError; |
| 7051 | 7006 | |
| 7052 | 7007 | pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit { |
| 7053 | const getrlimit_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 7054 | system.getrlimit64 | |
| 7055 | else | |
| 7056 | system.getrlimit; | |
| 7008 | const getrlimit_sym = if (lfs64_abi) system.getrlimit64 else system.getrlimit; | |
| 7057 | 7009 | |
| 7058 | 7010 | var limits: rlimit = undefined; |
| 7059 | 7011 | switch (errno(getrlimit_sym(resource, &limits))) { |
| ... | ... | @@ -7067,10 +7019,7 @@ pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit { |
| 7067 | 7019 | pub const SetrlimitError = error{ PermissionDenied, LimitTooBig } || UnexpectedError; |
| 7068 | 7020 | |
| 7069 | 7021 | pub fn setrlimit(resource: rlimit_resource, limits: rlimit) SetrlimitError!void { |
| 7070 | const setrlimit_sym = if (builtin.os.tag == .linux and builtin.link_libc) | |
| 7071 | system.setrlimit64 | |
| 7072 | else | |
| 7073 | system.setrlimit; | |
| 7022 | const setrlimit_sym = if (lfs64_abi) system.setrlimit64 else system.setrlimit; | |
| 7074 | 7023 | |
| 7075 | 7024 | switch (errno(setrlimit_sym(resource, &limits))) { |
| 7076 | 7025 | .SUCCESS => return, |
| ... | ... | @@ -7339,3 +7288,5 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, signal: usize) PtraceError! |
| 7339 | 7288 | }, |
| 7340 | 7289 | }; |
| 7341 | 7290 | } |
| 7291 | ||
| 7292 | const lfs64_abi = builtin.os.tag == .linux and builtin.link_libc and builtin.abi.isGnu(); |
src/Compilation.zig+1-1| ... | ... | @@ -4918,7 +4918,7 @@ fn detectLibCFromBuilding( |
| 4918 | 4918 | const generic_name = target_util.libCGenericName(target); |
| 4919 | 4919 | // Some architectures are handled by the same set of headers. |
| 4920 | 4920 | const arch_name = if (target.abi.isMusl()) |
| 4921 | musl.archName(target.cpu.arch) | |
| 4921 | musl.archNameHeaders(target.cpu.arch) | |
| 4922 | 4922 | else if (target.cpu.arch.isThumb()) |
| 4923 | 4923 | // ARM headers are valid for Thumb too. |
| 4924 | 4924 | switch (target.cpu.arch) { |
src/musl.zig+13-5| ... | ... | @@ -258,7 +258,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: *std.Progr |
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | pub fn archName(arch: std.Target.Cpu.Arch) [:0]const u8 { | |
| 261 | fn archName(arch: std.Target.Cpu.Arch) [:0]const u8 { | |
| 262 | 262 | switch (arch) { |
| 263 | 263 | .aarch64, .aarch64_be => return "aarch64", |
| 264 | 264 | .arm, .armeb, .thumb, .thumbeb => return "arm", |
| ... | ... | @@ -275,6 +275,13 @@ pub fn archName(arch: std.Target.Cpu.Arch) [:0]const u8 { |
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | pub fn archNameHeaders(arch: std.Target.Cpu.Arch) [:0]const u8 { | |
| 279 | return switch (arch) { | |
| 280 | .x86 => return "x86", | |
| 281 | else => archName(arch), | |
| 282 | }; | |
| 283 | } | |
| 284 | ||
| 278 | 285 | // Return true if musl has arch-specific crti/crtn sources. |
| 279 | 286 | // See lib/libc/musl/crt/ARCH/crt?.s . |
| 280 | 287 | pub fn needsCrtiCrtn(target: std.Target) bool { |
| ... | ... | @@ -361,7 +368,9 @@ fn addCcArgs( |
| 361 | 368 | const target = comp.getTarget(); |
| 362 | 369 | const arch_name = archName(target.cpu.arch); |
| 363 | 370 | const os_name = @tagName(target.os.tag); |
| 364 | const triple = try std.fmt.allocPrint(arena, "{s}-{s}-musl", .{ arch_name, os_name }); | |
| 371 | const triple = try std.fmt.allocPrint(arena, "{s}-{s}-musl", .{ | |
| 372 | archNameHeaders(target.cpu.arch), os_name, | |
| 373 | }); | |
| 365 | 374 | const o_arg = if (want_O3) "-O3" else "-Os"; |
| 366 | 375 | |
| 367 | 376 | try args.appendSlice(&[_][]const u8{ |
| ... | ... | @@ -1457,6 +1466,7 @@ const src_files = [_][]const u8{ |
| 1457 | 1466 | "musl/src/prng/seed48.c", |
| 1458 | 1467 | "musl/src/prng/srand48.c", |
| 1459 | 1468 | "musl/src/process/_Fork.c", |
| 1469 | "musl/src/process/aarch64/vfork.s", | |
| 1460 | 1470 | "musl/src/process/arm/vfork.s", |
| 1461 | 1471 | "musl/src/process/execl.c", |
| 1462 | 1472 | "musl/src/process/execle.c", |
| ... | ... | @@ -1487,6 +1497,7 @@ const src_files = [_][]const u8{ |
| 1487 | 1497 | "musl/src/process/posix_spawnattr_setsigdefault.c", |
| 1488 | 1498 | "musl/src/process/posix_spawnattr_setsigmask.c", |
| 1489 | 1499 | "musl/src/process/posix_spawnp.c", |
| 1500 | "musl/src/process/riscv64/vfork.s", | |
| 1490 | 1501 | "musl/src/process/s390x/vfork.s", |
| 1491 | 1502 | "musl/src/process/sh/vfork.s", |
| 1492 | 1503 | "musl/src/process/system.c", |
| ... | ... | @@ -1570,11 +1581,8 @@ const src_files = [_][]const u8{ |
| 1570 | 1581 | "musl/src/signal/m68k/sigsetjmp.s", |
| 1571 | 1582 | "musl/src/signal/microblaze/restore.s", |
| 1572 | 1583 | "musl/src/signal/microblaze/sigsetjmp.s", |
| 1573 | "musl/src/signal/mips/restore.s", | |
| 1574 | 1584 | "musl/src/signal/mips/sigsetjmp.s", |
| 1575 | "musl/src/signal/mips64/restore.s", | |
| 1576 | 1585 | "musl/src/signal/mips64/sigsetjmp.s", |
| 1577 | "musl/src/signal/mipsn32/restore.s", | |
| 1578 | 1586 | "musl/src/signal/mipsn32/sigsetjmp.s", |
| 1579 | 1587 | "musl/src/signal/or1k/sigsetjmp.s", |
| 1580 | 1588 | "musl/src/signal/powerpc/restore.s", |
src/wasi_libc.zig+1-1| ... | ... | @@ -256,7 +256,7 @@ fn addCCArgs( |
| 256 | 256 | want_O3: bool, |
| 257 | 257 | ) error{OutOfMemory}!void { |
| 258 | 258 | const target = comp.getTarget(); |
| 259 | const arch_name = musl.archName(target.cpu.arch); | |
| 259 | const arch_name = musl.archNameHeaders(target.cpu.arch); | |
| 260 | 260 | const os_name = @tagName(target.os.tag); |
| 261 | 261 | const triple = try std.fmt.allocPrint(arena, "{s}-{s}-musl", .{ arch_name, os_name }); |
| 262 | 262 | const o_arg = if (want_O3) "-O3" else "-Os"; |
tools/gen_stubs.zig+218-15| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | //! * One of the following, corresponding to the CPU architecture: |
| 12 | 12 | //! - `-DARCH_riscv64` |
| 13 | 13 | //! - `-DARCH_mips` |
| 14 | //! - `-DARCH_mips64` | |
| 14 | 15 | //! - `-DARCH_i386` |
| 15 | 16 | //! - `-DARCH_x86_64` |
| 16 | 17 | //! - `-DARCH_powerpc` |
| ... | ... | @@ -28,9 +29,20 @@ const log = std.log; |
| 28 | 29 | const elf = std.elf; |
| 29 | 30 | const native_endian = @import("builtin").target.cpu.arch.endian(); |
| 30 | 31 | |
| 31 | const arches: [7]std.Target.Cpu.Arch = blk: { | |
| 32 | var result: [7]std.Target.Cpu.Arch = undefined; | |
| 33 | for (.{ .riscv64, .mips, .x86, .x86_64, .powerpc, .powerpc64, .aarch64 }) |arch| { | |
| 32 | const inputs = .{ | |
| 33 | .riscv64, | |
| 34 | .mips, | |
| 35 | .mips64, | |
| 36 | .x86, | |
| 37 | .x86_64, | |
| 38 | .powerpc, | |
| 39 | .powerpc64, | |
| 40 | .aarch64, | |
| 41 | }; | |
| 42 | ||
| 43 | const arches: [inputs.len]std.Target.Cpu.Arch = blk: { | |
| 44 | var result: [inputs.len]std.Target.Cpu.Arch = undefined; | |
| 45 | for (inputs) |arch| { | |
| 34 | 46 | result[archIndex(arch)] = arch; |
| 35 | 47 | } |
| 36 | 48 | break :blk result; |
| ... | ... | @@ -56,6 +68,7 @@ const MultiSym = struct { |
| 56 | 68 | fn is32Only(ms: MultiSym) bool { |
| 57 | 69 | return ms.present[archIndex(.riscv64)] == false and |
| 58 | 70 | ms.present[archIndex(.mips)] == true and |
| 71 | ms.present[archIndex(.mips64)] == false and | |
| 59 | 72 | ms.present[archIndex(.x86)] == true and |
| 60 | 73 | ms.present[archIndex(.x86_64)] == false and |
| 61 | 74 | ms.present[archIndex(.powerpc)] == true and |
| ... | ... | @@ -97,6 +110,7 @@ const MultiSym = struct { |
| 97 | 110 | const map = .{ |
| 98 | 111 | .{ .riscv64, 8 }, |
| 99 | 112 | .{ .mips, 4 }, |
| 113 | .{ .mips64, 8 }, | |
| 100 | 114 | .{ .x86, 4 }, |
| 101 | 115 | .{ .x86_64, 8 }, |
| 102 | 116 | .{ .powerpc, 4 }, |
| ... | ... | @@ -118,6 +132,7 @@ const MultiSym = struct { |
| 118 | 132 | const map = .{ |
| 119 | 133 | .{ .riscv64, 16 }, |
| 120 | 134 | .{ .mips, 8 }, |
| 135 | .{ .mips64, 16 }, | |
| 121 | 136 | .{ .x86, 8 }, |
| 122 | 137 | .{ .x86_64, 16 }, |
| 123 | 138 | .{ .powerpc, 8 }, |
| ... | ... | @@ -139,6 +154,7 @@ const MultiSym = struct { |
| 139 | 154 | const map = .{ |
| 140 | 155 | .{ .riscv64, 2 }, |
| 141 | 156 | .{ .mips, 1 }, |
| 157 | .{ .mips64, 2 }, | |
| 142 | 158 | .{ .x86, 1 }, |
| 143 | 159 | .{ .x86_64, 2 }, |
| 144 | 160 | .{ .powerpc, 1 }, |
| ... | ... | @@ -187,17 +203,23 @@ pub fn main() !void { |
| 187 | 203 | } |
| 188 | 204 | |
| 189 | 205 | for (arches) |arch| { |
| 190 | const libc_so_path = try std.fmt.allocPrint(arena, "{s}/lib/libc.so", .{@tagName(arch)}); | |
| 206 | const libc_so_path = try std.fmt.allocPrint(arena, "{s}/lib/libc.so", .{ | |
| 207 | archMuslName(arch), | |
| 208 | }); | |
| 191 | 209 | |
| 192 | 210 | // Read the ELF header. |
| 193 | const elf_bytes = try build_all_dir.readFileAllocOptions( | |
| 211 | const elf_bytes = build_all_dir.readFileAllocOptions( | |
| 194 | 212 | arena, |
| 195 | 213 | libc_so_path, |
| 196 | 214 | 100 * 1024 * 1024, |
| 197 | 215 | 1 * 1024 * 1024, |
| 198 | 216 | @alignOf(elf.Elf64_Ehdr), |
| 199 | 217 | null, |
| 200 | ); | |
| 218 | ) catch |err| { | |
| 219 | std.debug.panic("unable to read '{s}/{s}': {s}", .{ | |
| 220 | build_all_path, libc_so_path, @errorName(err), | |
| 221 | }); | |
| 222 | }; | |
| 201 | 223 | const header = try elf.Header.parse(elf_bytes[0..@sizeOf(elf.Elf64_Ehdr)]); |
| 202 | 224 | |
| 203 | 225 | const parse: Parse = .{ |
| ... | ... | @@ -437,9 +459,15 @@ fn parseElf(parse: Parse, comptime is_64: bool, comptime endian: builtin.Endian) |
| 437 | 459 | const dynstr = elf_bytes[dynstr_offset..]; |
| 438 | 460 | |
| 439 | 461 | // Sort the list by address, ascending. |
| 440 | mem.sort(Sym, @alignCast(8, dyn_syms), {}, S.symbolAddrLessThan); | |
| 462 | // We need a copy to fix alignment. | |
| 463 | const copied_dyn_syms = copy: { | |
| 464 | const ptr = try arena.alloc(Sym, dyn_syms.len); | |
| 465 | @memcpy(ptr, dyn_syms); | |
| 466 | break :copy ptr; | |
| 467 | }; | |
| 468 | mem.sort(Sym, copied_dyn_syms, {}, S.symbolAddrLessThan); | |
| 441 | 469 | |
| 442 | for (dyn_syms) |sym| { | |
| 470 | for (copied_dyn_syms) |sym| { | |
| 443 | 471 | const this_section = s(sym.st_shndx); |
| 444 | 472 | const name = try arena.dupe(u8, mem.sliceTo(dynstr[s(sym.st_name)..], 0)); |
| 445 | 473 | const ty = @truncate(u4, sym.st_info); |
| ... | ... | @@ -555,19 +583,36 @@ fn archIndex(arch: std.Target.Cpu.Arch) u8 { |
| 555 | 583 | // zig fmt: off |
| 556 | 584 | .riscv64 => 0, |
| 557 | 585 | .mips => 1, |
| 558 | .x86 => 2, | |
| 559 | .x86_64 => 3, | |
| 560 | .powerpc => 4, | |
| 561 | .powerpc64 => 5, | |
| 562 | .aarch64 => 6, | |
| 586 | .mips64 => 2, | |
| 587 | .x86 => 3, | |
| 588 | .x86_64 => 4, | |
| 589 | .powerpc => 5, | |
| 590 | .powerpc64 => 6, | |
| 591 | .aarch64 => 7, | |
| 592 | else => unreachable, | |
| 593 | // zig fmt: on | |
| 594 | }; | |
| 595 | } | |
| 596 | ||
| 597 | fn archMuslName(arch: std.Target.Cpu.Arch) []const u8 { | |
| 598 | return switch (arch) { | |
| 599 | // zig fmt: off | |
| 600 | .riscv64 => "riscv64", | |
| 601 | .mips => "mips", | |
| 602 | .mips64 => "mips64", | |
| 603 | .x86 => "i386", | |
| 604 | .x86_64 => "x86_64", | |
| 605 | .powerpc => "powerpc", | |
| 606 | .powerpc64 => "powerpc64", | |
| 607 | .aarch64 => "aarch64", | |
| 563 | 608 | else => unreachable, |
| 564 | 609 | // zig fmt: on |
| 565 | 610 | }; |
| 566 | 611 | } |
| 567 | 612 | |
| 568 | 613 | fn archSetName(arch_set: [arches.len]bool) []const u8 { |
| 569 | for (arches, 0..) |arch, i| { | |
| 570 | if (arch_set[i]) { | |
| 614 | for (arches, arch_set) |arch, set_item| { | |
| 615 | if (set_item) { | |
| 571 | 616 | return @tagName(arch); |
| 572 | 617 | } |
| 573 | 618 | } |
| ... | ... | @@ -913,4 +958,162 @@ const blacklisted_symbols = [_][]const u8{ |
| 913 | 958 | "sinf128", |
| 914 | 959 | "sqrtf128", |
| 915 | 960 | "truncf128", |
| 961 | "__aarch64_cas16_acq", | |
| 962 | "__aarch64_cas16_acq_rel", | |
| 963 | "__aarch64_cas16_rel", | |
| 964 | "__aarch64_cas16_relax", | |
| 965 | "__aarch64_cas1_acq", | |
| 966 | "__aarch64_cas1_acq_rel", | |
| 967 | "__aarch64_cas1_rel", | |
| 968 | "__aarch64_cas1_relax", | |
| 969 | "__aarch64_cas2_acq", | |
| 970 | "__aarch64_cas2_acq_rel", | |
| 971 | "__aarch64_cas2_rel", | |
| 972 | "__aarch64_cas2_relax", | |
| 973 | "__aarch64_cas4_acq", | |
| 974 | "__aarch64_cas4_acq_rel", | |
| 975 | "__aarch64_cas4_rel", | |
| 976 | "__aarch64_cas4_relax", | |
| 977 | "__aarch64_cas8_acq", | |
| 978 | "__aarch64_cas8_acq_rel", | |
| 979 | "__aarch64_cas8_rel", | |
| 980 | "__aarch64_cas8_relax", | |
| 981 | "__aarch64_ldadd1_acq", | |
| 982 | "__aarch64_ldadd1_acq_rel", | |
| 983 | "__aarch64_ldadd1_rel", | |
| 984 | "__aarch64_ldadd1_relax", | |
| 985 | "__aarch64_ldadd2_acq", | |
| 986 | "__aarch64_ldadd2_acq_rel", | |
| 987 | "__aarch64_ldadd2_rel", | |
| 988 | "__aarch64_ldadd2_relax", | |
| 989 | "__aarch64_ldadd4_acq", | |
| 990 | "__aarch64_ldadd4_acq_rel", | |
| 991 | "__aarch64_ldadd4_rel", | |
| 992 | "__aarch64_ldadd4_relax", | |
| 993 | "__aarch64_ldadd8_acq", | |
| 994 | "__aarch64_ldadd8_acq_rel", | |
| 995 | "__aarch64_ldadd8_rel", | |
| 996 | "__aarch64_ldadd8_relax", | |
| 997 | "__aarch64_ldclr1_acq", | |
| 998 | "__aarch64_ldclr1_acq_rel", | |
| 999 | "__aarch64_ldclr1_rel", | |
| 1000 | "__aarch64_ldclr1_relax", | |
| 1001 | "__aarch64_ldclr2_acq", | |
| 1002 | "__aarch64_ldclr2_acq_rel", | |
| 1003 | "__aarch64_ldclr2_rel", | |
| 1004 | "__aarch64_ldclr2_relax", | |
| 1005 | "__aarch64_ldclr4_acq", | |
| 1006 | "__aarch64_ldclr4_acq_rel", | |
| 1007 | "__aarch64_ldclr4_rel", | |
| 1008 | "__aarch64_ldclr4_relax", | |
| 1009 | "__aarch64_ldclr8_acq", | |
| 1010 | "__aarch64_ldclr8_acq_rel", | |
| 1011 | "__aarch64_ldclr8_rel", | |
| 1012 | "__aarch64_ldclr8_relax", | |
| 1013 | "__aarch64_ldeor1_acq", | |
| 1014 | "__aarch64_ldeor1_acq_rel", | |
| 1015 | "__aarch64_ldeor1_rel", | |
| 1016 | "__aarch64_ldeor1_relax", | |
| 1017 | "__aarch64_ldeor2_acq", | |
| 1018 | "__aarch64_ldeor2_acq_rel", | |
| 1019 | "__aarch64_ldeor2_rel", | |
| 1020 | "__aarch64_ldeor2_relax", | |
| 1021 | "__aarch64_ldeor4_acq", | |
| 1022 | "__aarch64_ldeor4_acq_rel", | |
| 1023 | "__aarch64_ldeor4_rel", | |
| 1024 | "__aarch64_ldeor4_relax", | |
| 1025 | "__aarch64_ldeor8_acq", | |
| 1026 | "__aarch64_ldeor8_acq_rel", | |
| 1027 | "__aarch64_ldeor8_rel", | |
| 1028 | "__aarch64_ldeor8_relax", | |
| 1029 | "__aarch64_ldset1_acq", | |
| 1030 | "__aarch64_ldset1_acq_rel", | |
| 1031 | "__aarch64_ldset1_rel", | |
| 1032 | "__aarch64_ldset1_relax", | |
| 1033 | "__aarch64_ldset2_acq", | |
| 1034 | "__aarch64_ldset2_acq_rel", | |
| 1035 | "__aarch64_ldset2_rel", | |
| 1036 | "__aarch64_ldset2_relax", | |
| 1037 | "__aarch64_ldset4_acq", | |
| 1038 | "__aarch64_ldset4_acq_rel", | |
| 1039 | "__aarch64_ldset4_rel", | |
| 1040 | "__aarch64_ldset4_relax", | |
| 1041 | "__aarch64_ldset8_acq", | |
| 1042 | "__aarch64_ldset8_acq_rel", | |
| 1043 | "__aarch64_ldset8_rel", | |
| 1044 | "__aarch64_ldset8_relax", | |
| 1045 | "__aarch64_swp1_acq", | |
| 1046 | "__aarch64_swp1_acq_rel", | |
| 1047 | "__aarch64_swp1_rel", | |
| 1048 | "__aarch64_swp1_relax", | |
| 1049 | "__aarch64_swp2_acq", | |
| 1050 | "__aarch64_swp2_acq_rel", | |
| 1051 | "__aarch64_swp2_rel", | |
| 1052 | "__aarch64_swp2_relax", | |
| 1053 | "__aarch64_swp4_acq", | |
| 1054 | "__aarch64_swp4_acq_rel", | |
| 1055 | "__aarch64_swp4_rel", | |
| 1056 | "__aarch64_swp4_relax", | |
| 1057 | "__aarch64_swp8_acq", | |
| 1058 | "__aarch64_swp8_acq_rel", | |
| 1059 | "__aarch64_swp8_rel", | |
| 1060 | "__aarch64_swp8_relax", | |
| 1061 | "__addhf3", | |
| 1062 | "__atomic_compare_exchange_16", | |
| 1063 | "__atomic_exchange_16", | |
| 1064 | "__atomic_fetch_add_16", | |
| 1065 | "__atomic_fetch_and_16", | |
| 1066 | "__atomic_fetch_nand_16", | |
| 1067 | "__atomic_fetch_or_16", | |
| 1068 | "__atomic_fetch_sub_16", | |
| 1069 | "__atomic_fetch_umax_1", | |
| 1070 | "__atomic_fetch_umax_16", | |
| 1071 | "__atomic_fetch_umax_2", | |
| 1072 | "__atomic_fetch_umax_4", | |
| 1073 | "__atomic_fetch_umax_8", | |
| 1074 | "__atomic_fetch_umin_1", | |
| 1075 | "__atomic_fetch_umin_16", | |
| 1076 | "__atomic_fetch_umin_2", | |
| 1077 | "__atomic_fetch_umin_4", | |
| 1078 | "__atomic_fetch_umin_8", | |
| 1079 | "__atomic_fetch_xor_16", | |
| 1080 | "__atomic_load_16", | |
| 1081 | "__atomic_store_16", | |
| 1082 | "__cmphf2", | |
| 1083 | "__cmpxf2", | |
| 1084 | "__divdc3", | |
| 1085 | "__divhc3", | |
| 1086 | "__divhf3", | |
| 1087 | "__divkc3", | |
| 1088 | "__divsc3", | |
| 1089 | "__divtc3", | |
| 1090 | "__divxc3", | |
| 1091 | "__eqhf2", | |
| 1092 | "__extendhfdf2", | |
| 1093 | "__fixhfdi", | |
| 1094 | "__fixhfsi", | |
| 1095 | "__fixhfti", | |
| 1096 | "__fixunshfdi", | |
| 1097 | "__fixunshfsi", | |
| 1098 | "__fixunshfti", | |
| 1099 | "__floatdihf", | |
| 1100 | "__floatsihf", | |
| 1101 | "__floattihf", | |
| 1102 | "__floatundihf", | |
| 1103 | "__floatunsihf", | |
| 1104 | "__floatuntihf", | |
| 1105 | "__gehf2", | |
| 1106 | "__gthf2", | |
| 1107 | "__lehf2", | |
| 1108 | "__lthf2", | |
| 1109 | "__mulhc3", | |
| 1110 | "__mulhf3", | |
| 1111 | "__neghf2", | |
| 1112 | "__negkf2", | |
| 1113 | "__negtf2", | |
| 1114 | "__negxf2", | |
| 1115 | "__nehf2", | |
| 1116 | "__subhf3", | |
| 1117 | "__unordhf2", | |
| 1118 | "__unordxf2", | |
| 916 | 1119 | }; |
tools/process_headers.zig+1-1| ... | ... | @@ -208,7 +208,7 @@ const musl_targets = [_]LibCTarget{ |
| 208 | 208 | .abi = MultiAbi.musl, |
| 209 | 209 | }, |
| 210 | 210 | LibCTarget{ |
| 211 | .name = "x86", | |
| 211 | .name = "i386", | |
| 212 | 212 | .arch = MultiArch{ .specific = .x86 }, |
| 213 | 213 | .abi = MultiAbi.musl, |
| 214 | 214 | }, |