authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-12 19:56:38-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-03-12 19:56:38-04:00
log2f06971a7e2f004b76c0ac4502c3e84cd63a1fba
treeda060f6ddc854c15aec976b7311f5d27245899d6
parentf51bec321b1ef9196b143295d47a9ea919cdba28
parent6e25ac2a2bc74aa6ec9b0d369c5583c98d6a1de8
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #4725 from ziglang/update-musl

Upgrade musl libc to 1.2.0

399 files changed, 4392 insertions(+), 2701 deletions(-)

lib/libc/include/aarch64-linux-musl/bits/alltypes.h+66-55
......@@ -2,16 +2,13 @@
22#define _Int64 long
33#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
5#if __AARCH64EB__
6#define __BYTE_ORDER 4321
7#else
8#define __BYTE_ORDER 1234
139#endif
1410
11#define __LONG_MAX 0x7fffffffffffffffL
1512
1613#ifndef __cplusplus
1714#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -53,52 +50,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
5350#define __DEFINED_max_align_t
5451#endif
5552
56
57#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
58typedef long time_t;
59#define __DEFINED_time_t
60#endif
61
62#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
63typedef long suseconds_t;
64#define __DEFINED_suseconds_t
65#endif
66
67
68#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
69typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
70#define __DEFINED_pthread_attr_t
71#endif
72
73#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
74typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
75#define __DEFINED_pthread_mutex_t
76#endif
77
78#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
79typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
80#define __DEFINED_mtx_t
81#endif
82
83#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
84typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
85#define __DEFINED_pthread_cond_t
86#endif
87
88#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
89typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
90#define __DEFINED_cnd_t
91#endif
92
93#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
94typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
95#define __DEFINED_pthread_rwlock_t
96#endif
97
98#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
99typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
100#define __DEFINED_pthread_barrier_t
101#endif
53#define __LITTLE_ENDIAN 1234
54#define __BIG_ENDIAN 4321
55#define __USE_TIME_BITS64 1
10256
10357#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
10458typedef unsigned _Addr size_t;
......@@ -135,6 +89,16 @@ typedef _Reg register_t;
13589#define __DEFINED_register_t
13690#endif
13791
92#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
93typedef _Int64 time_t;
94#define __DEFINED_time_t
95#endif
96
97#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
98typedef _Int64 suseconds_t;
99#define __DEFINED_suseconds_t
100#endif
101
138102
139103#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
140104typedef signed char int8_t;
......@@ -270,7 +234,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
270234#endif
271235
272236#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
273struct timespec { time_t tv_sec; long tv_nsec; };
237struct 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); };
274238#define __DEFINED_struct_timespec
275239#endif
276240
......@@ -366,6 +330,17 @@ typedef struct _IO_FILE FILE;
366330#endif
367331
368332
333#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
334typedef __builtin_va_list va_list;
335#define __DEFINED_va_list
336#endif
337
338#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
339typedef __builtin_va_list __isoc_va_list;
340#define __DEFINED___isoc_va_list
341#endif
342
343
369344#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
370345typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
371346#define __DEFINED_mbstate_t
......@@ -401,6 +376,42 @@ typedef unsigned short sa_family_t;
401376#endif
402377
403378
379#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
380typedef 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;
381#define __DEFINED_pthread_attr_t
382#endif
383
384#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
385typedef 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;
386#define __DEFINED_pthread_mutex_t
387#endif
388
389#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
390typedef 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;
391#define __DEFINED_mtx_t
392#endif
393
394#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
395typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
396#define __DEFINED_pthread_cond_t
397#endif
398
399#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
400typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
401#define __DEFINED_cnd_t
402#endif
403
404#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
405typedef 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;
406#define __DEFINED_pthread_rwlock_t
407#endif
408
409#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
410typedef 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;
411#define __DEFINED_pthread_barrier_t
412#endif
413
414
404415#undef _Addr
405416#undef _Int64
406417#undef _Reg
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if __AARCH64EB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/socket.h deleted-33
......@@ -1,33 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/syscall.h+5-1
......@@ -287,6 +287,8 @@
287287#define __NR_fsconfig 431
288288#define __NR_fsmount 432
289289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
290292
291293#define SYS_io_setup 0
292294#define SYS_io_destroy 1
......@@ -576,4 +578,6 @@
576578#define SYS_fsopen 430
577579#define SYS_fsconfig 431
578580#define SYS_fsmount 432
579#define SYS_fspick 433
\ No newline at end of file
581#define SYS_fspick 433
582#define SYS_pidfd_open 434
583#define SYS_clone3 435
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/alltypes.h+67-55
......@@ -1,17 +1,15 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
6#if __ARMEB__
7#define __BYTE_ORDER 4321
8#else
9#define __BYTE_ORDER 1234
1310#endif
1411
12#define __LONG_MAX 0x7fffffffL
1513
1614#ifndef __cplusplus
1715#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -37,52 +35,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
3735#define __DEFINED_max_align_t
3836#endif
3937
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
38#define __LITTLE_ENDIAN 1234
39#define __BIG_ENDIAN 4321
40#define __USE_TIME_BITS64 1
8641
8742#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
8843typedef unsigned _Addr size_t;
......@@ -119,6 +74,16 @@ typedef _Reg register_t;
11974#define __DEFINED_register_t
12075#endif
12176
77#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
78typedef _Int64 time_t;
79#define __DEFINED_time_t
80#endif
81
82#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
83typedef _Int64 suseconds_t;
84#define __DEFINED_suseconds_t
85#endif
86
12287
12388#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
12489typedef signed char int8_t;
......@@ -254,7 +219,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
254219#endif
255220
256221#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
222struct 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); };
258223#define __DEFINED_struct_timespec
259224#endif
260225
......@@ -350,6 +315,17 @@ typedef struct _IO_FILE FILE;
350315#endif
351316
352317
318#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
319typedef __builtin_va_list va_list;
320#define __DEFINED_va_list
321#endif
322
323#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
324typedef __builtin_va_list __isoc_va_list;
325#define __DEFINED___isoc_va_list
326#endif
327
328
353329#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
354330typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
355331#define __DEFINED_mbstate_t
......@@ -385,6 +361,42 @@ typedef unsigned short sa_family_t;
385361#endif
386362
387363
364#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
365typedef 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;
366#define __DEFINED_pthread_attr_t
367#endif
368
369#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
370typedef 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;
371#define __DEFINED_pthread_mutex_t
372#endif
373
374#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
375typedef 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;
376#define __DEFINED_mtx_t
377#endif
378
379#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
380typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
381#define __DEFINED_pthread_cond_t
382#endif
383
384#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
385typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
386#define __DEFINED_cnd_t
387#endif
388
389#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
390typedef 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;
391#define __DEFINED_pthread_rwlock_t
392#endif
393
394#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
395typedef 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;
396#define __DEFINED_pthread_barrier_t
397#endif
398
399
388400#undef _Addr
389401#undef _Int64
390402#undef _Reg
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if __ARMEB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 32
4#endif
5
6#define LONG_MAX 0x7fffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/msg.h+9-6
......@@ -1,15 +1,18 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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;
99 unsigned long msg_cbytes;
1010 msgqnum_t msg_qnum;
1111 msglen_t msg_qbytes;
1212 pid_t msg_lspid;
1313 pid_t msg_lrpid;
1414 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
1518};
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/sem.h+6-4
......@@ -1,9 +1,9 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 long __unused1;
5 time_t sem_ctime;
6 long __unused2;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
77#if __BYTE_ORDER == __LITTLE_ENDIAN
88 unsigned short sem_nsems;
99 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
......@@ -13,4 +13,6 @@ struct semid_ds {
1313#endif
1414 long __unused3;
1515 long __unused4;
16 time_t sem_otime;
17 time_t sem_ctime;
1618};
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/shm.h+10-6
......@@ -3,17 +3,21 @@
33struct shmid_ds {
44 struct ipc_perm shm_perm;
55 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
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;
1212 pid_t shm_cpid;
1313 pid_t shm_lpid;
1414 unsigned long shm_nattch;
1515 unsigned long __pad1;
1616 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
1721};
1822
1923struct shminfo {
lib/libc/include/arm-linux-musl/bits/stat.h+5-1
......@@ -14,8 +14,12 @@ struct stat {
1414 off_t st_size;
1515 blksize_t st_blksize;
1616 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;
1722 struct timespec st_atim;
1823 struct timespec st_mtim;
1924 struct timespec st_ctim;
20 ino_t st_ino;
2125};
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/syscall.h+25-21
......@@ -55,8 +55,8 @@
5555#define __NR_sethostname 74
5656#define __NR_setrlimit 75
5757#define __NR_getrusage 77
58#define __NR_gettimeofday 78
59#define __NR_settimeofday 79
58#define __NR_gettimeofday_time32 78
59#define __NR_settimeofday_time32 79
6060#define __NR_getgroups 80
6161#define __NR_setgroups 81
6262#define __NR_symlink 83
......@@ -211,14 +211,14 @@
211211#define __NR_remap_file_pages 253
212212#define __NR_set_tid_address 256
213213#define __NR_timer_create 257
214#define __NR_timer_settime 258
215#define __NR_timer_gettime 259
214#define __NR_timer_settime32 258
215#define __NR_timer_gettime32 259
216216#define __NR_timer_getoverrun 260
217217#define __NR_timer_delete 261
218#define __NR_clock_settime 262
219#define __NR_clock_gettime 263
220#define __NR_clock_getres 264
221#define __NR_clock_nanosleep 265
218#define __NR_clock_settime32 262
219#define __NR_clock_gettime32 263
220#define __NR_clock_getres_time32 264
221#define __NR_clock_nanosleep_time32 265
222222#define __NR_statfs64 266
223223#define __NR_fstatfs64 267
224224#define __NR_tgkill 268
......@@ -308,8 +308,8 @@
308308#define __NR_timerfd_create 350
309309#define __NR_eventfd 351
310310#define __NR_fallocate 352
311#define __NR_timerfd_settime 353
312#define __NR_timerfd_gettime 354
311#define __NR_timerfd_settime32 353
312#define __NR_timerfd_gettime32 354
313313#define __NR_signalfd4 355
314314#define __NR_eventfd2 356
315315#define __NR_epoll_create1 357
......@@ -387,6 +387,8 @@
387387#define __NR_fsconfig 431
388388#define __NR_fsmount 432
389389#define __NR_fspick 433
390#define __NR_pidfd_open 434
391#define __NR_clone3 435
390392
391393#define __ARM_NR_breakpoint 0x0f0001
392394#define __ARM_NR_cacheflush 0x0f0002
......@@ -452,8 +454,8 @@
452454#define SYS_sethostname 74
453455#define SYS_setrlimit 75
454456#define SYS_getrusage 77
455#define SYS_gettimeofday 78
456#define SYS_settimeofday 79
457#define SYS_gettimeofday_time32 78
458#define SYS_settimeofday_time32 79
457459#define SYS_getgroups 80
458460#define SYS_setgroups 81
459461#define SYS_symlink 83
......@@ -608,14 +610,14 @@
608610#define SYS_remap_file_pages 253
609611#define SYS_set_tid_address 256
610612#define SYS_timer_create 257
611#define SYS_timer_settime 258
612#define SYS_timer_gettime 259
613#define SYS_timer_settime32 258
614#define SYS_timer_gettime32 259
613615#define SYS_timer_getoverrun 260
614616#define SYS_timer_delete 261
615#define SYS_clock_settime 262
616#define SYS_clock_gettime 263
617#define SYS_clock_getres 264
618#define SYS_clock_nanosleep 265
617#define SYS_clock_settime32 262
618#define SYS_clock_gettime32 263
619#define SYS_clock_getres_time32 264
620#define SYS_clock_nanosleep_time32 265
619621#define SYS_statfs64 266
620622#define SYS_fstatfs64 267
621623#define SYS_tgkill 268
......@@ -705,8 +707,8 @@
705707#define SYS_timerfd_create 350
706708#define SYS_eventfd 351
707709#define SYS_fallocate 352
708#define SYS_timerfd_settime 353
709#define SYS_timerfd_gettime 354
710#define SYS_timerfd_settime32 353
711#define SYS_timerfd_gettime32 354
710712#define SYS_signalfd4 355
711713#define SYS_eventfd2 356
712714#define SYS_epoll_create1 357
......@@ -783,4 +785,6 @@
783785#define SYS_fsopen 430
784786#define SYS_fsconfig 431
785787#define SYS_fsmount 432
786#define SYS_fspick 433
\ No newline at end of file
788#define SYS_fspick 433
789#define SYS_pidfd_open 434
790#define SYS_clone3 435
\ No newline at end of file
lib/libc/include/generic-musl/aio.h+4
......@@ -62,6 +62,10 @@ int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sige
6262#define off64_t off_t
6363#endif
6464
65#if _REDIR_TIME64
66__REDIR(aio_suspend, __aio_suspend_time64);
67#endif
68
6569#ifdef __cplusplus
6670}
6771#endif
lib/libc/include/generic-musl/alloca.h-2
......@@ -10,9 +10,7 @@ extern "C" {
1010
1111void *alloca(size_t);
1212
13#ifdef __GNUC__
1413#define alloca __builtin_alloca
15#endif
1614
1715#ifdef __cplusplus
1816}
lib/libc/include/generic-musl/arpa/nameser.h-1
......@@ -7,7 +7,6 @@ extern "C" {
77
88#include <stddef.h>
99#include <stdint.h>
10#include <endian.h>
1110
1211#define __NAMESER 19991006
1312#define NS_PACKETSZ 512
lib/libc/include/generic-musl/bits/dirent.h created+11
......@@ -0,0 +1,11 @@
1#define _DIRENT_HAVE_D_RECLEN
2#define _DIRENT_HAVE_D_OFF
3#define _DIRENT_HAVE_D_TYPE
4
5struct dirent {
6 ino_t d_ino;
7 off_t d_off;
8 unsigned short d_reclen;
9 unsigned char d_type;
10 char d_name[256];
11};
\ No newline at end of file
lib/libc/include/generic-musl/bits/endian.h deleted-1
......@@ -1 +0,0 @@
1#define __BYTE_ORDER __LITTLE_ENDIAN
\ No newline at end of file
lib/libc/include/generic-musl/bits/ioctl.h+5
......@@ -104,7 +104,12 @@
104104#define FIOGETOWN 0x8903
105105#define SIOCGPGRP 0x8904
106106#define SIOCATMARK 0x8905
107#if __LONG_MAX == 0x7fffffff
108#define SIOCGSTAMP _IOR(0x89, 6, char[16])
109#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
110#else
107111#define SIOCGSTAMP 0x8906
108112#define SIOCGSTAMPNS 0x8907
113#endif
109114
110115#include <bits/ioctl_fix.h>
\ No newline at end of file
lib/libc/include/generic-musl/bits/limits.h-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/generic-musl/bits/socket.h-15
......@@ -1,15 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
\ No newline at end of file
lib/libc/include/generic-musl/dirent.h+2-12
......@@ -15,19 +15,9 @@ extern "C" {
1515
1616#include <bits/alltypes.h>
1717
18typedef struct __dirstream DIR;
19
20#define _DIRENT_HAVE_D_RECLEN
21#define _DIRENT_HAVE_D_OFF
22#define _DIRENT_HAVE_D_TYPE
18#include <bits/dirent.h>
2319
24struct dirent {
25 ino_t d_ino;
26 off_t d_off;
27 unsigned short d_reclen;
28 unsigned char d_type;
29 char d_name[256];
30};
20typedef struct __dirstream DIR;
3121
3222#define d_fileno d_ino
3323
lib/libc/include/generic-musl/dlfcn.h+4
......@@ -35,6 +35,10 @@ int dladdr(const void *, Dl_info *);
3535int dlinfo(void *, int, void *);
3636#endif
3737
38#if _REDIR_TIME64
39__REDIR(dlsym, __dlsym_time64);
40#endif
41
3842#ifdef __cplusplus
3943}
4044#endif
lib/libc/include/generic-musl/endian.h+21-23
......@@ -3,25 +3,19 @@
33
44#include <features.h>
55
6#define __LITTLE_ENDIAN 1234
7#define __BIG_ENDIAN 4321
8#define __PDP_ENDIAN 3412
6#define __NEED_uint16_t
7#define __NEED_uint32_t
8#define __NEED_uint64_t
99
10#if defined(__GNUC__) && defined(__BYTE_ORDER__)
11#define __BYTE_ORDER __BYTE_ORDER__
12#else
13#include <bits/endian.h>
14#endif
10#include <bits/alltypes.h>
1511
16#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
12#define __PDP_ENDIAN 3412
1713
1814#define BIG_ENDIAN __BIG_ENDIAN
1915#define LITTLE_ENDIAN __LITTLE_ENDIAN
2016#define PDP_ENDIAN __PDP_ENDIAN
2117#define BYTE_ORDER __BYTE_ORDER
2218
23#include <stdint.h>
24
2519static __inline uint16_t __bswap16(uint16_t __x)
2620{
2721 return __x<<8 | __x>>8;
......@@ -40,43 +34,47 @@ static __inline uint64_t __bswap64(uint64_t __x)
4034#if __BYTE_ORDER == __LITTLE_ENDIAN
4135#define htobe16(x) __bswap16(x)
4236#define be16toh(x) __bswap16(x)
43#define betoh16(x) __bswap16(x)
4437#define htobe32(x) __bswap32(x)
4538#define be32toh(x) __bswap32(x)
46#define betoh32(x) __bswap32(x)
4739#define htobe64(x) __bswap64(x)
4840#define be64toh(x) __bswap64(x)
49#define betoh64(x) __bswap64(x)
5041#define htole16(x) (uint16_t)(x)
5142#define le16toh(x) (uint16_t)(x)
52#define letoh16(x) (uint16_t)(x)
5343#define htole32(x) (uint32_t)(x)
5444#define le32toh(x) (uint32_t)(x)
55#define letoh32(x) (uint32_t)(x)
5645#define htole64(x) (uint64_t)(x)
5746#define le64toh(x) (uint64_t)(x)
58#define letoh64(x) (uint64_t)(x)
5947#else
6048#define htobe16(x) (uint16_t)(x)
6149#define be16toh(x) (uint16_t)(x)
62#define betoh16(x) (uint16_t)(x)
6350#define htobe32(x) (uint32_t)(x)
6451#define be32toh(x) (uint32_t)(x)
65#define betoh32(x) (uint32_t)(x)
6652#define htobe64(x) (uint64_t)(x)
6753#define be64toh(x) (uint64_t)(x)
68#define betoh64(x) (uint64_t)(x)
6954#define htole16(x) __bswap16(x)
7055#define le16toh(x) __bswap16(x)
71#define letoh16(x) __bswap16(x)
7256#define htole32(x) __bswap32(x)
7357#define le32toh(x) __bswap32(x)
74#define letoh32(x) __bswap32(x)
7558#define htole64(x) __bswap64(x)
7659#define le64toh(x) __bswap64(x)
77#define letoh64(x) __bswap64(x)
7860#endif
7961
62#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
63#if __BYTE_ORDER == __LITTLE_ENDIAN
64#define betoh16(x) __bswap16(x)
65#define betoh32(x) __bswap32(x)
66#define betoh64(x) __bswap64(x)
67#define letoh16(x) (uint16_t)(x)
68#define letoh32(x) (uint32_t)(x)
69#define letoh64(x) (uint64_t)(x)
70#else
71#define betoh16(x) (uint16_t)(x)
72#define betoh32(x) (uint32_t)(x)
73#define betoh64(x) (uint64_t)(x)
74#define letoh16(x) __bswap16(x)
75#define letoh32(x) __bswap32(x)
76#define letoh64(x) __bswap64(x)
77#endif
8078#endif
8179
8280#endif
\ No newline at end of file
lib/libc/include/generic-musl/features.h+2
......@@ -35,4 +35,6 @@
3535#define _Noreturn
3636#endif
3737
38#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
39
3840#endif
\ No newline at end of file
lib/libc/include/generic-musl/limits.h+13-5
......@@ -3,9 +3,7 @@
33
44#include <features.h>
55
6/* Most limits are system-specific */
7
8#include <bits/limits.h>
6#include <bits/alltypes.h> /* __LONG_MAX */
97
108/* Support signed or unsigned plain-char */
119
......@@ -17,8 +15,6 @@
1715#define CHAR_MAX 127
1816#endif
1917
20/* Some universal constants... */
21
2218#define CHAR_BIT 8
2319#define SCHAR_MIN (-128)
2420#define SCHAR_MAX 127
......@@ -30,8 +26,10 @@
3026#define INT_MAX 0x7fffffff
3127#define UINT_MAX 0xffffffffU
3228#define LONG_MIN (-LONG_MAX-1)
29#define LONG_MAX __LONG_MAX
3330#define ULONG_MAX (2UL*LONG_MAX+1)
3431#define LLONG_MIN (-LLONG_MAX-1)
32#define LLONG_MAX 0x7fffffffffffffffLL
3533#define ULLONG_MAX (2ULL*LLONG_MAX+1)
3634
3735#define MB_LEN_MAX 4
......@@ -39,9 +37,13 @@
3937#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
4038 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
4139
40#include <bits/limits.h>
41
4242#define PIPE_BUF 4096
4343#define FILESIZEBITS 64
44#ifndef NAME_MAX
4445#define NAME_MAX 255
46#endif
4547#define PATH_MAX 4096
4648#define NGROUPS_MAX 32
4749#define ARG_MAX 131072
......@@ -53,6 +55,12 @@
5355#define TTY_NAME_MAX 32
5456#define HOST_NAME_MAX 255
5557
58#if LONG_MAX == 0x7fffffffL
59#define LONG_BIT 32
60#else
61#define LONG_BIT 64
62#endif
63
5664/* Implementation choices... */
5765
5866#define PTHREAD_KEYS_MAX 128
lib/libc/include/generic-musl/mqueue.h+5
......@@ -30,6 +30,11 @@ ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, c
3030int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *);
3131int mq_unlink(const char *);
3232
33#if _REDIR_TIME64
34__REDIR(mq_timedreceive, __mq_timedreceive_time64);
35__REDIR(mq_timedsend, __mq_timedsend_time64);
36#endif
37
3338#ifdef __cplusplus
3439}
3540#endif
lib/libc/include/generic-musl/netinet/icmp6.h-1
......@@ -9,7 +9,6 @@ extern "C" {
99#include <string.h>
1010#include <sys/types.h>
1111#include <netinet/in.h>
12#include <endian.h>
1312
1413#define ICMP6_FILTER 1
1514
lib/libc/include/generic-musl/netinet/if_ether.h+1
......@@ -58,6 +58,7 @@
5858#define ETH_P_ERSPAN 0x88BE
5959#define ETH_P_PREAUTH 0x88C7
6060#define ETH_P_TIPC 0x88CA
61#define ETH_P_LLDP 0x88CC
6162#define ETH_P_MACSEC 0x88E5
6263#define ETH_P_8021AH 0x88E7
6364#define ETH_P_MVRP 0x88F5
lib/libc/include/generic-musl/netinet/ip.h+2-1
......@@ -7,7 +7,6 @@ extern "C" {
77
88#include <stdint.h>
99#include <netinet/in.h>
10#include <endian.h>
1110
1211struct timestamp {
1312 uint8_t len;
......@@ -191,6 +190,8 @@ struct ip_timestamp {
191190
192191#define IP_MSS 576
193192
193#define __UAPI_DEF_IPHDR 0
194
194195#ifdef __cplusplus
195196}
196197#endif
lib/libc/include/generic-musl/netinet/ip6.h-1
......@@ -7,7 +7,6 @@ extern "C" {
77
88#include <stdint.h>
99#include <netinet/in.h>
10#include <endian.h>
1110
1211struct ip6_hdr {
1312 union {
lib/libc/include/generic-musl/netinet/tcp.h+3-1
......@@ -38,6 +38,7 @@
3838#define TCP_FASTOPEN_NO_COOKIE 34
3939#define TCP_ZEROCOPY_RECEIVE 35
4040#define TCP_INQ 36
41#define TCP_TX_DELAY 37
4142
4243#define TCP_CM_INQ TCP_INQ
4344
......@@ -97,7 +98,6 @@ enum {
9798#include <sys/types.h>
9899#include <sys/socket.h>
99100#include <stdint.h>
100#include <endian.h>
101101
102102typedef uint32_t tcp_seq;
103103
......@@ -234,6 +234,8 @@ struct tcp_info {
234234 uint64_t tcpi_bytes_retrans;
235235 uint32_t tcpi_dsack_dups;
236236 uint32_t tcpi_reord_seen;
237 uint32_t tcpi_rcv_ooopack;
238 uint32_t tcpi_snd_wnd;
237239};
238240
239241#define TCP_MD5SIG_MAXKEYLEN 80
lib/libc/include/generic-musl/poll.h+6
......@@ -44,6 +44,12 @@ int poll (struct pollfd *, nfds_t, int);
4444int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
4545#endif
4646
47#if _REDIR_TIME64
48#ifdef _GNU_SOURCE
49__REDIR(ppoll, __ppoll_time64);
50#endif
51#endif
52
4753#ifdef __cplusplus
4854}
4955#endif
lib/libc/include/generic-musl/pthread.h+10
......@@ -224,6 +224,16 @@ int pthread_tryjoin_np(pthread_t, void **);
224224int pthread_timedjoin_np(pthread_t, void **, const struct timespec *);
225225#endif
226226
227#if _REDIR_TIME64
228__REDIR(pthread_mutex_timedlock, __pthread_mutex_timedlock_time64);
229__REDIR(pthread_cond_timedwait, __pthread_cond_timedwait_time64);
230__REDIR(pthread_rwlock_timedrdlock, __pthread_rwlock_timedrdlock_time64);
231__REDIR(pthread_rwlock_timedwrlock, __pthread_rwlock_timedwrlock_time64);
232#ifdef _GNU_SOURCE
233__REDIR(pthread_timedjoin_np, __pthread_timedjoin_np_time64);
234#endif
235#endif
236
227237#ifdef __cplusplus
228238}
229239#endif
lib/libc/include/generic-musl/sched.h+8
......@@ -19,10 +19,14 @@ extern "C" {
1919struct sched_param {
2020 int sched_priority;
2121 int __reserved1;
22#if _REDIR_TIME64
23 long __reserved2[4];
24#else
2225 struct {
2326 time_t __reserved1;
2427 long __reserved2;
2528 } __reserved2[2];
29#endif
2630 int __reserved3;
2731};
2832
......@@ -133,6 +137,10 @@ __CPU_op_func_S(XOR, ^)
133137
134138#endif
135139
140#if _REDIR_TIME64
141__REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64);
142#endif
143
136144#ifdef __cplusplus
137145}
138146#endif
lib/libc/include/generic-musl/semaphore.h+4
......@@ -29,6 +29,10 @@ int sem_trywait(sem_t *);
2929int sem_unlink(const char *);
3030int sem_wait(sem_t *);
3131
32#if _REDIR_TIME64
33__REDIR(sem_timedwait, __sem_timedwait_time64);
34#endif
35
3236#ifdef __cplusplus
3337}
3438#endif
lib/libc/include/generic-musl/signal.h+8
......@@ -271,6 +271,14 @@ typedef int sig_atomic_t;
271271void (*signal(int, void (*)(int)))(int);
272272int raise(int);
273273
274#if _REDIR_TIME64
275#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
276 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
277 || defined(_BSD_SOURCE)
278__REDIR(sigtimedwait, __sigtimedwait_time64);
279#endif
280#endif
281
274282#ifdef __cplusplus
275283}
276284#endif
lib/libc/include/generic-musl/sys/acct.h-1
......@@ -6,7 +6,6 @@ extern "C" {
66#endif
77
88#include <features.h>
9#include <endian.h>
109#include <time.h>
1110#include <stdint.h>
1211
lib/libc/include/generic-musl/sys/ioctl.h+1
......@@ -4,6 +4,7 @@
44extern "C" {
55#endif
66
7#include <bits/alltypes.h>
78#include <bits/ioctl.h>
89
910#define N_TTY 0
lib/libc/include/generic-musl/sys/mman.h+2
......@@ -92,6 +92,8 @@ extern "C" {
9292#define MADV_DODUMP 17
9393#define MADV_WIPEONFORK 18
9494#define MADV_KEEPONFORK 19
95#define MADV_COLD 20
96#define MADV_PAGEOUT 21
9597#define MADV_HWPOISON 100
9698#define MADV_SOFT_OFFLINE 101
9799#endif
lib/libc/include/generic-musl/sys/prctl.h+4
......@@ -154,6 +154,10 @@ struct prctl_mm_map {
154154#define PR_PAC_APDBKEY (1UL << 3)
155155#define PR_PAC_APGAKEY (1UL << 4)
156156
157#define PR_SET_TAGGED_ADDR_CTRL 55
158#define PR_GET_TAGGED_ADDR_CTRL 56
159#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
160
157161int prctl (int, ...);
158162
159163#ifdef __cplusplus
lib/libc/include/generic-musl/sys/procfs.h+3-4
......@@ -23,10 +23,9 @@ struct elf_prstatus {
2323 pid_t pr_ppid;
2424 pid_t pr_pgrp;
2525 pid_t pr_sid;
26 struct timeval pr_utime;
27 struct timeval pr_stime;
28 struct timeval pr_cutime;
29 struct timeval pr_cstime;
26 struct {
27 long tv_sec, tv_usec;
28 } pr_utime, pr_stime, pr_cutime, pr_cstime;
3029 elf_gregset_t pr_reg;
3130 int pr_fpvalid;
3231};
lib/libc/include/generic-musl/sys/ptrace.h+29
......@@ -41,6 +41,7 @@ extern "C" {
4141#define PTRACE_SETSIGMASK 0x420b
4242#define PTRACE_SECCOMP_GET_FILTER 0x420c
4343#define PTRACE_SECCOMP_GET_METADATA 0x420d
44#define PTRACE_GET_SYSCALL_INFO 0x420e
4445
4546#define PT_READ_I PTRACE_PEEKTEXT
4647#define PT_READ_D PTRACE_PEEKDATA
......@@ -88,6 +89,11 @@ extern "C" {
8889
8990#define PTRACE_PEEKSIGINFO_SHARED 1
9091
92#define PTRACE_SYSCALL_INFO_NONE 0
93#define PTRACE_SYSCALL_INFO_ENTRY 1
94#define PTRACE_SYSCALL_INFO_EXIT 2
95#define PTRACE_SYSCALL_INFO_SECCOMP 3
96
9197#include <bits/ptrace.h>
9298
9399struct __ptrace_peeksiginfo_args {
......@@ -101,6 +107,29 @@ struct __ptrace_seccomp_metadata {
101107 uint64_t flags;
102108};
103109
110struct __ptrace_syscall_info {
111 uint8_t op;
112 uint8_t __pad[3];
113 uint32_t arch;
114 uint64_t instruction_pointer;
115 uint64_t stack_pointer;
116 union {
117 struct {
118 uint64_t nr;
119 uint64_t args[6];
120 } entry;
121 struct {
122 int64_t rval;
123 uint8_t is_error;
124 } exit;
125 struct {
126 uint64_t nr;
127 uint64_t args[6];
128 uint32_t ret_data;
129 } seccomp;
130 };
131};
132
104133long ptrace(int, ...);
105134
106135#ifdef __cplusplus
lib/libc/include/generic-musl/sys/resource.h+6-1
......@@ -90,7 +90,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
9090#define RLIMIT_MSGQUEUE 12
9191#define RLIMIT_NICE 13
9292#define RLIMIT_RTPRIO 14
93#define RLIMIT_NLIMITS 15
93#define RLIMIT_RTTIME 15
94#define RLIMIT_NLIMITS 16
9495
9596#define RLIM_NLIMITS RLIMIT_NLIMITS
9697
......@@ -104,6 +105,10 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
104105#define rlim64_t rlim_t
105106#endif
106107
108#if _REDIR_TIME64
109__REDIR(getrusage, __getrusage_time64);
110#endif
111
107112#ifdef __cplusplus
108113}
109114#endif
lib/libc/include/generic-musl/sys/select.h+5
......@@ -35,6 +35,11 @@ int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, co
3535#define NFDBITS (8*(int)sizeof(long))
3636#endif
3737
38#if _REDIR_TIME64
39__REDIR(select, __select_time64);
40__REDIR(pselect, __pselect_time64);
41#endif
42
3843#ifdef __cplusplus
3944}
4045#endif
lib/libc/include/generic-musl/sys/sem.h+6-2
......@@ -25,8 +25,6 @@ extern "C" {
2525#define SETVAL 16
2626#define SETALL 17
2727
28#include <endian.h>
29
3028#include <bits/sem.h>
3129
3230#define _SEM_SEMUN_UNDEFINED 1
......@@ -62,6 +60,12 @@ int semop(int, struct sembuf *, size_t);
6260int semtimedop(int, struct sembuf *, size_t, const struct timespec *);
6361#endif
6462
63#if _REDIR_TIME64
64#ifdef _GNU_SOURCE
65__REDIR(semtimedop, __semtimedop_time64);
66#endif
67#endif
68
6569#ifdef __cplusplus
6670}
6771#endif
lib/libc/include/generic-musl/sys/socket.h+63-6
......@@ -19,6 +19,40 @@ extern "C" {
1919
2020#include <bits/socket.h>
2121
22struct msghdr {
23 void *msg_name;
24 socklen_t msg_namelen;
25 struct iovec *msg_iov;
26#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
27 int __pad1;
28#endif
29 int msg_iovlen;
30#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
31 int __pad1;
32#endif
33 void *msg_control;
34#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
35 int __pad2;
36#endif
37 socklen_t msg_controllen;
38#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
39 int __pad2;
40#endif
41 int msg_flags;
42};
43
44struct cmsghdr {
45#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
46 int __pad1;
47#endif
48 socklen_t cmsg_len;
49#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
50 int __pad1;
51#endif
52 int cmsg_level;
53 int cmsg_type;
54};
55
2256#ifdef _GNU_SOURCE
2357struct ucred {
2458 pid_t pid;
......@@ -182,8 +216,6 @@ struct linger {
182216#define SO_PEERCRED 17
183217#define SO_RCVLOWAT 18
184218#define SO_SNDLOWAT 19
185#define SO_RCVTIMEO 20
186#define SO_SNDTIMEO 21
187219#define SO_ACCEPTCONN 30
188220#define SO_PEERSEC 31
189221#define SO_SNDBUFFORCE 32
......@@ -192,6 +224,28 @@ struct linger {
192224#define SO_DOMAIN 39
193225#endif
194226
227#ifndef SO_RCVTIMEO
228#if __LONG_MAX == 0x7fffffff
229#define SO_RCVTIMEO 66
230#define SO_SNDTIMEO 67
231#else
232#define SO_RCVTIMEO 20
233#define SO_SNDTIMEO 21
234#endif
235#endif
236
237#ifndef SO_TIMESTAMP
238#if __LONG_MAX == 0x7fffffff
239#define SO_TIMESTAMP 63
240#define SO_TIMESTAMPNS 64
241#define SO_TIMESTAMPING 65
242#else
243#define SO_TIMESTAMP 29
244#define SO_TIMESTAMPNS 35
245#define SO_TIMESTAMPING 37
246#endif
247#endif
248
195249#define SO_SECURITY_AUTHENTICATION 22
196250#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
197251#define SO_SECURITY_ENCRYPTION_NETWORK 24
......@@ -203,14 +257,10 @@ struct linger {
203257#define SO_GET_FILTER SO_ATTACH_FILTER
204258
205259#define SO_PEERNAME 28
206#define SO_TIMESTAMP 29
207260#define SCM_TIMESTAMP SO_TIMESTAMP
208
209261#define SO_PASSSEC 34
210#define SO_TIMESTAMPNS 35
211262#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
212263#define SO_MARK 36
213#define SO_TIMESTAMPING 37
214264#define SCM_TIMESTAMPING SO_TIMESTAMPING
215265#define SO_RXQ_OVFL 40
216266#define SO_WIFI_STATUS 41
......@@ -238,6 +288,7 @@ struct linger {
238288#define SO_TXTIME 61
239289#define SCM_TXTIME SO_TXTIME
240290#define SO_BINDTOIFINDEX 62
291#define SO_DETACH_REUSEPORT_BPF 68
241292
242293#ifndef SOL_SOCKET
243294#define SOL_SOCKET 1
......@@ -350,6 +401,12 @@ int setsockopt (int, int, int, const void *, socklen_t);
350401
351402int sockatmark (int);
352403
404#if _REDIR_TIME64
405#ifdef _GNU_SOURCE
406__REDIR(recvmmsg, __recvmmsg_time64);
407#endif
408#endif
409
353410#ifdef __cplusplus
354411}
355412#endif
lib/libc/include/generic-musl/sys/stat.h+9
......@@ -110,6 +110,15 @@ int lchmod(const char *, mode_t);
110110#define off64_t off_t
111111#endif
112112
113#if _REDIR_TIME64
114__REDIR(stat, __stat_time64);
115__REDIR(fstat, __fstat_time64);
116__REDIR(lstat, __lstat_time64);
117__REDIR(fstatat, __fstatat_time64);
118__REDIR(futimens, __futimens_time64);
119__REDIR(utimensat, __utimensat_time64);
120#endif
121
113122#ifdef __cplusplus
114123}
115124#endif
lib/libc/include/generic-musl/sys/statvfs.h-2
......@@ -11,8 +11,6 @@ extern "C" {
1111#define __NEED_fsfilcnt_t
1212#include <bits/alltypes.h>
1313
14#include <endian.h>
15
1614struct statvfs {
1715 unsigned long f_bsize, f_frsize;
1816 fsblkcnt_t f_blocks, f_bfree, f_bavail;
lib/libc/include/generic-musl/sys/time.h+14
......@@ -56,6 +56,20 @@ int adjtime (const struct timeval *, struct timeval *);
5656 (void)0 )
5757#endif
5858
59#if _REDIR_TIME64
60__REDIR(gettimeofday, __gettimeofday_time64);
61__REDIR(getitimer, __getitimer_time64);
62__REDIR(setitimer, __setitimer_time64);
63__REDIR(utimes, __utimes_time64);
64#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
65__REDIR(futimes, __futimes_time64);
66__REDIR(futimesat, __futimesat_time64);
67__REDIR(lutimes, __lutimes_time64);
68__REDIR(settimeofday, __settimeofday_time64);
69__REDIR(adjtime, __adjtime64);
70#endif
71#endif
72
5973#ifdef __cplusplus
6074}
6175#endif
lib/libc/include/generic-musl/sys/timeb.h+6
......@@ -4,6 +4,8 @@
44extern "C" {
55#endif
66
7#include <features.h>
8
79#define __NEED_time_t
810
911#include <bits/alltypes.h>
......@@ -16,6 +18,10 @@ struct timeb {
1618
1719int ftime(struct timeb *);
1820
21#if _REDIR_TIME64
22__REDIR(ftime, __ftime64);
23#endif
24
1925#ifdef __cplusplus
2026}
2127#endif
lib/libc/include/generic-musl/sys/timerfd.h+5
......@@ -20,6 +20,11 @@ int timerfd_create(int, int);
2020int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *);
2121int timerfd_gettime(int, struct itimerspec *);
2222
23#if _REDIR_TIME64
24__REDIR(timerfd_settime, __timerfd_settime64);
25__REDIR(timerfd_gettime, __timerfd_gettime64);
26#endif
27
2328#ifdef __cplusplus
2429}
2530#endif
lib/libc/include/generic-musl/sys/timex.h+5
......@@ -91,6 +91,11 @@ struct timex {
9191int adjtimex(struct timex *);
9292int clock_adjtime(clockid_t, struct timex *);
9393
94#if _REDIR_TIME64
95__REDIR(adjtimex, __adjtimex_time64);
96__REDIR(clock_adjtime, __clock_adjtime64);
97#endif
98
9499#ifdef __cplusplus
95100}
96101#endif
lib/libc/include/generic-musl/sys/ttydefaults.h+1-6
......@@ -6,16 +6,11 @@
66#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
77#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
88#define TTYDEF_SPEED (B9600)
9#define CTRL(x) (x&037)
9#define CTRL(x) ((x)&037)
1010#define CEOF CTRL('d')
1111
12#ifdef _POSIX_VDISABLE
13#define CEOL _POSIX_VDISABLE
14#define CSTATUS _POSIX_VDISABLE
15#else
1612#define CEOL '\0'
1713#define CSTATUS '\0'
18#endif
1914
2015#define CERASE 0177
2116#define CINTR CTRL('c')
lib/libc/include/generic-musl/sys/wait.h+9-1
......@@ -13,7 +13,8 @@ extern "C" {
1313typedef enum {
1414 P_ALL = 0,
1515 P_PID = 1,
16 P_PGID = 2
16 P_PGID = 2,
17 P_PIDFD = 3
1718} idtype_t;
1819
1920pid_t wait (int *);
......@@ -53,6 +54,13 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
5354#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
5455#define WIFCONTINUED(s) ((s) == 0xffff)
5556
57#if _REDIR_TIME64
58#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
59__REDIR(wait3, __wait3_time64);
60__REDIR(wait4, __wait4_time64);
61#endif
62#endif
63
5664#ifdef __cplusplus
5765}
5866#endif
lib/libc/include/generic-musl/threads.h+6
......@@ -80,6 +80,12 @@ void tss_delete(tss_t);
8080int tss_set(tss_t, void *);
8181void *tss_get(tss_t);
8282
83#if _REDIR_TIME64
84__REDIR(thrd_sleep, __thrd_sleep_time64);
85__REDIR(mtx_timedlock, __mtx_timedlock_time64);
86__REDIR(cnd_timedwait, __cnd_timedwait_time64);
87#endif
88
8389#ifdef __cplusplus
8490}
8591#endif
lib/libc/include/generic-musl/time.h+28
......@@ -130,6 +130,34 @@ int stime(const time_t *);
130130time_t timegm(struct tm *);
131131#endif
132132
133#if _REDIR_TIME64
134__REDIR(time, __time64);
135__REDIR(difftime, __difftime64);
136__REDIR(mktime, __mktime64);
137__REDIR(gmtime, __gmtime64);
138__REDIR(localtime, __localtime64);
139__REDIR(ctime, __ctime64);
140__REDIR(timespec_get, __timespec_get_time64);
141#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
142 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
143 || defined(_BSD_SOURCE)
144__REDIR(gmtime_r, __gmtime64_r);
145__REDIR(localtime_r, __localtime64_r);
146__REDIR(ctime_r, __ctime64_r);
147__REDIR(nanosleep, __nanosleep_time64);
148__REDIR(clock_getres, __clock_getres_time64);
149__REDIR(clock_gettime, __clock_gettime64);
150__REDIR(clock_settime, __clock_settime64);
151__REDIR(clock_nanosleep, __clock_nanosleep_time64);
152__REDIR(timer_settime, __timer_settime64);
153__REDIR(timer_gettime, __timer_gettime64);
154#endif
155#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
156__REDIR(stime, __stime64);
157__REDIR(timegm, __timegm_time64);
158#endif
159#endif
160
133161#ifdef __cplusplus
134162}
135163#endif
lib/libc/include/generic-musl/utime.h+6
......@@ -5,6 +5,8 @@
55extern "C" {
66#endif
77
8#include <features.h>
9
810#define __NEED_time_t
911
1012#include <bits/alltypes.h>
......@@ -16,6 +18,10 @@ struct utimbuf {
1618
1719int utime (const char *, const struct utimbuf *);
1820
21#if _REDIR_TIME64
22__REDIR(utime, __utime64);
23#endif
24
1925#ifdef __cplusplus
2026}
2127#endif
lib/libc/include/generic-musl/utmpx.h+6-1
......@@ -16,6 +16,7 @@ extern "C" {
1616
1717struct utmpx {
1818 short ut_type;
19 short __ut_pad1;
1920 pid_t ut_pid;
2021 char ut_line[32];
2122 char ut_id[4];
......@@ -25,7 +26,11 @@ struct utmpx {
2526 short __e_termination;
2627 short __e_exit;
2728 } ut_exit;
28 long ut_session;
29#if __BYTE_ORDER == 1234
30 int ut_session, __ut_pad2;
31#else
32 int __ut_pad2, ut_session;
33#endif
2934 struct timeval ut_tv;
3035 unsigned ut_addr_v6[4];
3136 char __unused[20];
lib/libc/include/i386-linux-musl/bits/alltypes.h+64-70
......@@ -1,30 +1,10 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5#if __GNUC__ >= 3
6#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
7typedef __builtin_va_list va_list;
8#define __DEFINED_va_list
9#endif
10
11#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
12typedef __builtin_va_list __isoc_va_list;
13#define __DEFINED___isoc_va_list
14#endif
15
16#else
17#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
18typedef struct __va_list * va_list;
19#define __DEFINED_va_list
20#endif
21
22#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
23typedef struct __va_list * __isoc_va_list;
24#define __DEFINED___isoc_va_list
25#endif
26
27#endif
6#define __BYTE_ORDER 1234
7#define __LONG_MAX 0x7fffffffL
288
299#ifndef __cplusplus
3010#ifdef __WCHAR_TYPE__
......@@ -85,52 +65,9 @@ typedef struct { alignas(8) long long __ll; long double __ld; } max_align_t;
8565#endif
8666
8767#endif
88
89#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
90typedef long time_t;
91#define __DEFINED_time_t
92#endif
93
94#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
95typedef long suseconds_t;
96#define __DEFINED_suseconds_t
97#endif
98
99
100#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
101typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
102#define __DEFINED_pthread_attr_t
103#endif
104
105#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
106typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
107#define __DEFINED_pthread_mutex_t
108#endif
109
110#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
111typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
112#define __DEFINED_mtx_t
113#endif
114
115#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
116typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
117#define __DEFINED_pthread_cond_t
118#endif
119
120#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
121typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
122#define __DEFINED_cnd_t
123#endif
124
125#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
126typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
127#define __DEFINED_pthread_rwlock_t
128#endif
129
130#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
131typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
132#define __DEFINED_pthread_barrier_t
133#endif
68#define __LITTLE_ENDIAN 1234
69#define __BIG_ENDIAN 4321
70#define __USE_TIME_BITS64 1
13471
13572#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
13673typedef unsigned _Addr size_t;
......@@ -167,6 +104,16 @@ typedef _Reg register_t;
167104#define __DEFINED_register_t
168105#endif
169106
107#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
108typedef _Int64 time_t;
109#define __DEFINED_time_t
110#endif
111
112#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
113typedef _Int64 suseconds_t;
114#define __DEFINED_suseconds_t
115#endif
116
170117
171118#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
172119typedef signed char int8_t;
......@@ -302,7 +249,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
302249#endif
303250
304251#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
305struct timespec { time_t tv_sec; long tv_nsec; };
252struct 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); };
306253#define __DEFINED_struct_timespec
307254#endif
308255
......@@ -398,6 +345,17 @@ typedef struct _IO_FILE FILE;
398345#endif
399346
400347
348#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
349typedef __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)
354typedef __builtin_va_list __isoc_va_list;
355#define __DEFINED___isoc_va_list
356#endif
357
358
401359#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
402360typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
403361#define __DEFINED_mbstate_t
......@@ -433,6 +391,42 @@ typedef unsigned short sa_family_t;
433391#endif
434392
435393
394#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
395typedef 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;
396#define __DEFINED_pthread_attr_t
397#endif
398
399#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
400typedef 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;
401#define __DEFINED_pthread_mutex_t
402#endif
403
404#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
405typedef 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;
406#define __DEFINED_mtx_t
407#endif
408
409#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
410typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
411#define __DEFINED_pthread_cond_t
412#endif
413
414#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
415typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
416#define __DEFINED_cnd_t
417#endif
418
419#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
420typedef 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;
421#define __DEFINED_pthread_rwlock_t
422#endif
423
424#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
425typedef 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;
426#define __DEFINED_pthread_barrier_t
427#endif
428
429
436430#undef _Addr
437431#undef _Int64
438432#undef _Reg
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/limits.h+1-8
......@@ -1,8 +1 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define PAGESIZE 4096
4#define LONG_BIT 32
5#endif
6
7#define LONG_MAX 0x7fffffffL
8#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
1#define PAGESIZE 4096
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/msg.h+9-6
......@@ -1,15 +1,18 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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;
99 unsigned long msg_cbytes;
1010 msgqnum_t msg_qnum;
1111 msglen_t msg_qbytes;
1212 pid_t msg_lspid;
1313 pid_t msg_lrpid;
1414 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
1518};
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/sem.h+6-4
......@@ -1,11 +1,13 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 long __unused1;
5 time_t sem_ctime;
6 long __unused2;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
77 unsigned short sem_nsems;
88 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
99 long __unused3;
1010 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
1113};
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/shm.h+10-6
......@@ -3,17 +3,21 @@
33struct shmid_ds {
44 struct ipc_perm shm_perm;
55 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
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;
1212 pid_t shm_cpid;
1313 pid_t shm_lpid;
1414 unsigned long shm_nattch;
1515 unsigned long __pad1;
1616 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
1721};
1822
1923struct shminfo {
lib/libc/include/i386-linux-musl/bits/stat.h+5-1
......@@ -14,8 +14,12 @@ struct stat {
1414 off_t st_size;
1515 blksize_t st_blksize;
1616 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;
1722 struct timespec st_atim;
1823 struct timespec st_mtim;
1924 struct timespec st_ctim;
20 ino_t st_ino;
2125};
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/syscall.h+25-21
......@@ -76,8 +76,8 @@
7676#define __NR_setrlimit 75
7777#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
7878#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
8181#define __NR_getgroups 80
8282#define __NR_setgroups 81
8383#define __NR_select 82
......@@ -257,14 +257,14 @@
257257#define __NR_remap_file_pages 257
258258#define __NR_set_tid_address 258
259259#define __NR_timer_create 259
260#define __NR_timer_settime (__NR_timer_create+1)
261#define __NR_timer_gettime (__NR_timer_create+2)
260#define __NR_timer_settime32 (__NR_timer_create+1)
261#define __NR_timer_gettime32 (__NR_timer_create+2)
262262#define __NR_timer_getoverrun (__NR_timer_create+3)
263263#define __NR_timer_delete (__NR_timer_create+4)
264#define __NR_clock_settime (__NR_timer_create+5)
265#define __NR_clock_gettime (__NR_timer_create+6)
266#define __NR_clock_getres (__NR_timer_create+7)
267#define __NR_clock_nanosleep (__NR_timer_create+8)
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)
268268#define __NR_statfs64 268
269269#define __NR_fstatfs64 269
270270#define __NR_tgkill 270
......@@ -322,8 +322,8 @@
322322#define __NR_timerfd_create 322
323323#define __NR_eventfd 323
324324#define __NR_fallocate 324
325#define __NR_timerfd_settime 325
326#define __NR_timerfd_gettime 326
325#define __NR_timerfd_settime32 325
326#define __NR_timerfd_gettime32 326
327327#define __NR_signalfd4 327
328328#define __NR_eventfd2 328
329329#define __NR_epoll_create1 329
......@@ -424,6 +424,8 @@
424424#define __NR_fsconfig 431
425425#define __NR_fsmount 432
426426#define __NR_fspick 433
427#define __NR_pidfd_open 434
428#define __NR_clone3 435
427429
428430#define SYS_restart_syscall 0
429431#define SYS_exit 1
......@@ -503,8 +505,8 @@
503505#define SYS_setrlimit 75
504506#define SYS_getrlimit 76 /* Back compatible 2Gig limited rlimit */
505507#define SYS_getrusage 77
506#define SYS_gettimeofday 78
507#define SYS_settimeofday 79
508#define SYS_gettimeofday_time32 78
509#define SYS_settimeofday_time32 79
508510#define SYS_getgroups 80
509511#define SYS_setgroups 81
510512#define SYS_select 82
......@@ -682,14 +684,14 @@
682684#define SYS_remap_file_pages 257
683685#define SYS_set_tid_address 258
684686#define SYS_timer_create 259
685#define SYS_timer_settime (__NR_timer_create+1)
686#define SYS_timer_gettime (__NR_timer_create+2)
687#define SYS_timer_settime32 (__NR_timer_create+1)
688#define SYS_timer_gettime32 (__NR_timer_create+2)
687689#define SYS_timer_getoverrun (__NR_timer_create+3)
688690#define SYS_timer_delete (__NR_timer_create+4)
689#define SYS_clock_settime (__NR_timer_create+5)
690#define SYS_clock_gettime (__NR_timer_create+6)
691#define SYS_clock_getres (__NR_timer_create+7)
692#define SYS_clock_nanosleep (__NR_timer_create+8)
691#define SYS_clock_settime32 (__NR_timer_create+5)
692#define SYS_clock_gettime32 (__NR_timer_create+6)
693#define SYS_clock_getres_time32 (__NR_timer_create+7)
694#define SYS_clock_nanosleep_time32 (__NR_timer_create+8)
693695#define SYS_statfs64 268
694696#define SYS_fstatfs64 269
695697#define SYS_tgkill 270
......@@ -747,8 +749,8 @@
747749#define SYS_timerfd_create 322
748750#define SYS_eventfd 323
749751#define SYS_fallocate 324
750#define SYS_timerfd_settime 325
751#define SYS_timerfd_gettime 326
752#define SYS_timerfd_settime32 325
753#define SYS_timerfd_gettime32 326
752754#define SYS_signalfd4 327
753755#define SYS_eventfd2 328
754756#define SYS_epoll_create1 329
......@@ -848,4 +850,6 @@
848850#define SYS_fsopen 430
849851#define SYS_fsconfig 431
850852#define SYS_fsmount 432
851#define SYS_fspick 433
\ No newline at end of file
853#define SYS_fspick 433
854#define SYS_pidfd_open 434
855#define SYS_clone3 435
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/alltypes.h+67-55
......@@ -1,17 +1,15 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
6#if _MIPSEL || __MIPSEL || __MIPSEL__
7#define __BYTE_ORDER 1234
8#else
9#define __BYTE_ORDER 4321
1310#endif
1411
12#define __LONG_MAX 0x7fffffffL
1513
1614#ifndef __cplusplus
1715#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -37,52 +35,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
3735#define __DEFINED_max_align_t
3836#endif
3937
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
38#define __LITTLE_ENDIAN 1234
39#define __BIG_ENDIAN 4321
40#define __USE_TIME_BITS64 1
8641
8742#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
8843typedef unsigned _Addr size_t;
......@@ -119,6 +74,16 @@ typedef _Reg register_t;
11974#define __DEFINED_register_t
12075#endif
12176
77#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
78typedef _Int64 time_t;
79#define __DEFINED_time_t
80#endif
81
82#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
83typedef _Int64 suseconds_t;
84#define __DEFINED_suseconds_t
85#endif
86
12287
12388#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
12489typedef signed char int8_t;
......@@ -254,7 +219,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
254219#endif
255220
256221#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
222struct 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); };
258223#define __DEFINED_struct_timespec
259224#endif
260225
......@@ -350,6 +315,17 @@ typedef struct _IO_FILE FILE;
350315#endif
351316
352317
318#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
319typedef __builtin_va_list va_list;
320#define __DEFINED_va_list
321#endif
322
323#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
324typedef __builtin_va_list __isoc_va_list;
325#define __DEFINED___isoc_va_list
326#endif
327
328
353329#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
354330typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
355331#define __DEFINED_mbstate_t
......@@ -385,6 +361,42 @@ typedef unsigned short sa_family_t;
385361#endif
386362
387363
364#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
365typedef 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;
366#define __DEFINED_pthread_attr_t
367#endif
368
369#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
370typedef 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;
371#define __DEFINED_pthread_mutex_t
372#endif
373
374#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
375typedef 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;
376#define __DEFINED_mtx_t
377#endif
378
379#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
380typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
381#define __DEFINED_pthread_cond_t
382#endif
383
384#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
385typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
386#define __DEFINED_cnd_t
387#endif
388
389#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
390typedef 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;
391#define __DEFINED_pthread_rwlock_t
392#endif
393
394#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
395typedef 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;
396#define __DEFINED_pthread_barrier_t
397#endif
398
399
388400#undef _Addr
389401#undef _Int64
390402#undef _Reg
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if _MIPSEL || __MIPSEL || __MIPSEL__
2#define __BYTE_ORDER __LITTLE_ENDIAN
3#else
4#define __BYTE_ORDER __BIG_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/hwcap.h+12-1
......@@ -1,3 +1,14 @@
11#define HWCAP_MIPS_R6 (1 << 0)
22#define HWCAP_MIPS_MSA (1 << 1)
3#define HWCAP_MIPS_CRC32 (1 << 2)
\ No newline at end of file
3#define HWCAP_MIPS_CRC32 (1 << 2)
4#define HWCAP_MIPS_MIPS16 (1 << 3)
5#define HWCAP_MIPS_MDMX (1 << 4)
6#define HWCAP_MIPS_MIPS3D (1 << 5)
7#define HWCAP_MIPS_SMARTMIPS (1 << 6)
8#define HWCAP_MIPS_DSP (1 << 7)
9#define HWCAP_MIPS_DSP2 (1 << 8)
10#define HWCAP_MIPS_DSP3 (1 << 9)
11#define HWCAP_MIPS_MIPS16E2 (1 << 10)
12#define HWCAP_LOONGSON_MMI (1 << 11)
13#define HWCAP_LOONGSON_EXT (1 << 12)
14#define HWCAP_LOONGSON_EXT2 (1 << 13)
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/ioctl.h+2-2
......@@ -110,5 +110,5 @@
110110#define SIOCATMARK _IOR('s', 7, int)
111111#define SIOCSPGRP _IOW('s', 8, pid_t)
112112#define SIOCGPGRP _IOR('s', 9, pid_t)
113#define SIOCGSTAMP 0x8906
114#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
113#define SIOCGSTAMP _IOR(0x89, 6, char[16])
114#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 32
4#endif
5
6#define LONG_MAX 0x7fffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/msg.h+15-12
......@@ -1,19 +1,19 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
33#if _MIPSEL || __MIPSEL || __MIPSEL__
4 time_t msg_stime;
5 int __unused1;
6 time_t msg_rtime;
7 int __unused2;
8 time_t msg_ctime;
9 int __unused3;
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_stime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_rtime_hi;
8 unsigned long __msg_ctime_lo;
9 unsigned long __msg_ctime_hi;
1010#else
11 int __unused1;
12 time_t msg_stime;
13 int __unused2;
14 time_t msg_rtime;
15 int __unused3;
16 time_t msg_ctime;
11 unsigned long __msg_stime_hi;
12 unsigned long __msg_stime_lo;
13 unsigned long __msg_rtime_hi;
14 unsigned long __msg_rtime_lo;
15 unsigned long __msg_ctime_hi;
16 unsigned long __msg_ctime_lo;
1717#endif
1818 unsigned long msg_cbytes;
1919 msgqnum_t msg_qnum;
......@@ -21,4 +21,7 @@ struct msqid_ds {
2121 pid_t msg_lspid;
2222 pid_t msg_lrpid;
2323 unsigned long __unused[2];
24 time_t msg_stime;
25 time_t msg_rtime;
26 time_t msg_ctime;
2427};
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/sem.h created+16
......@@ -0,0 +1,16 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_ctime_lo;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 unsigned long __sem_otime_hi;
13 unsigned long __sem_ctime_hi;
14 time_t sem_otime;
15 time_t sem_ctime;
16};
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/shm.h created+29
......@@ -0,0 +1,29 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_lo;
8 unsigned long __shm_ctime_lo;
9 pid_t shm_cpid;
10 pid_t shm_lpid;
11 unsigned long shm_nattch;
12 unsigned short __shm_atime_hi;
13 unsigned short __shm_dtime_hi;
14 unsigned short __shm_ctime_hi;
15 unsigned short __pad1;
16 time_t shm_atime;
17 time_t shm_dtime;
18 time_t shm_ctime;
19};
20
21struct shminfo {
22 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
23};
24
25struct shm_info {
26 int __used_ids;
27 unsigned long shm_tot, shm_rss, shm_swp;
28 unsigned long __swap_attempts, __swap_successes;
29};
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/signal.h+6-2
......@@ -19,14 +19,18 @@ typedef struct {
1919} fpregset_t;
2020struct sigcontext {
2121 unsigned sc_regmask, sc_status;
22 unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
22 unsigned long long sc_pc;
23 gregset_t sc_regs;
24 fpregset_t sc_fpregs;
2325 unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
2426 unsigned long long sc_mdhi, sc_mdlo;
2527 unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
2628};
2729typedef struct {
2830 unsigned regmask, status;
29 unsigned long long pc, gregs[32], fpregs[32];
31 unsigned long long pc;
32 gregset_t gregs;
33 fpregset_t fpregs;
3034 unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
3135 unsigned long long mdhi, mdlo;
3236 unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
lib/libc/include/mips-linux-musl/bits/socket.h-18
......@@ -1,19 +1,3 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
16
171#define SOCK_STREAM 2
182#define SOCK_DGRAM 1
193
......@@ -32,8 +16,6 @@ struct cmsghdr {
3216#define SO_RCVBUF 0x1002
3317#define SO_SNDLOWAT 0x1003
3418#define SO_RCVLOWAT 0x1004
35#define SO_RCVTIMEO 0x1006
36#define SO_SNDTIMEO 0x1005
3719#define SO_ERROR 0x1007
3820#define SO_TYPE 0x1008
3921#define SO_ACCEPTCONN 0x1009
lib/libc/include/mips-linux-musl/bits/stat.h+8-4
......@@ -12,11 +12,15 @@ struct stat {
1212 dev_t st_rdev;
1313 long __st_padding2[2];
1414 off_t st_size;
15 struct timespec st_atim;
16 struct timespec st_mtim;
17 struct timespec st_ctim;
15 struct {
16 long tv_sec;
17 long tv_nsec;
18 } __st_atim32, __st_mtim32, __st_ctim32;
1819 blksize_t st_blksize;
1920 long __st_padding3;
2021 blkcnt_t st_blocks;
21 long __st_padding4[14];
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25 long __st_padding4[2];
2226};
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/syscall.h+25-21
......@@ -76,8 +76,8 @@
7676#define __NR_setrlimit 4075
7777#define __NR_getrlimit 4076
7878#define __NR_getrusage 4077
79#define __NR_gettimeofday 4078
80#define __NR_settimeofday 4079
79#define __NR_gettimeofday_time32 4078
80#define __NR_settimeofday_time32 4079
8181#define __NR_getgroups 4080
8282#define __NR_setgroups 4081
8383#define __NR_reserved82 4082
......@@ -256,14 +256,14 @@
256256#define __NR_statfs64 4255
257257#define __NR_fstatfs64 4256
258258#define __NR_timer_create 4257
259#define __NR_timer_settime 4258
260#define __NR_timer_gettime 4259
259#define __NR_timer_settime32 4258
260#define __NR_timer_gettime32 4259
261261#define __NR_timer_getoverrun 4260
262262#define __NR_timer_delete 4261
263#define __NR_clock_settime 4262
264#define __NR_clock_gettime 4263
265#define __NR_clock_getres 4264
266#define __NR_clock_nanosleep 4265
263#define __NR_clock_settime32 4262
264#define __NR_clock_gettime32 4263
265#define __NR_clock_getres_time32 4264
266#define __NR_clock_nanosleep_time32 4265
267267#define __NR_tgkill 4266
268268#define __NR_utimes 4267
269269#define __NR_mbind 4268
......@@ -319,8 +319,8 @@
319319#define __NR_eventfd 4319
320320#define __NR_fallocate 4320
321321#define __NR_timerfd_create 4321
322#define __NR_timerfd_gettime 4322
323#define __NR_timerfd_settime 4323
322#define __NR_timerfd_gettime32 4322
323#define __NR_timerfd_settime32 4323
324324#define __NR_signalfd4 4324
325325#define __NR_eventfd2 4325
326326#define __NR_epoll_create1 4326
......@@ -406,6 +406,8 @@
406406#define __NR_fsconfig 4431
407407#define __NR_fsmount 4432
408408#define __NR_fspick 4433
409#define __NR_pidfd_open 4434
410#define __NR_clone3 4435
409411
410412#define SYS_syscall 4000
411413#define SYS_exit 4001
......@@ -485,8 +487,8 @@
485487#define SYS_setrlimit 4075
486488#define SYS_getrlimit 4076
487489#define SYS_getrusage 4077
488#define SYS_gettimeofday 4078
489#define SYS_settimeofday 4079
490#define SYS_gettimeofday_time32 4078
491#define SYS_settimeofday_time32 4079
490492#define SYS_getgroups 4080
491493#define SYS_setgroups 4081
492494#define SYS_reserved82 4082
......@@ -665,14 +667,14 @@
665667#define SYS_statfs64 4255
666668#define SYS_fstatfs64 4256
667669#define SYS_timer_create 4257
668#define SYS_timer_settime 4258
669#define SYS_timer_gettime 4259
670#define SYS_timer_settime32 4258
671#define SYS_timer_gettime32 4259
670672#define SYS_timer_getoverrun 4260
671673#define SYS_timer_delete 4261
672#define SYS_clock_settime 4262
673#define SYS_clock_gettime 4263
674#define SYS_clock_getres 4264
675#define SYS_clock_nanosleep 4265
674#define SYS_clock_settime32 4262
675#define SYS_clock_gettime32 4263
676#define SYS_clock_getres_time32 4264
677#define SYS_clock_nanosleep_time32 4265
676678#define SYS_tgkill 4266
677679#define SYS_utimes 4267
678680#define SYS_mbind 4268
......@@ -728,8 +730,8 @@
728730#define SYS_eventfd 4319
729731#define SYS_fallocate 4320
730732#define SYS_timerfd_create 4321
731#define SYS_timerfd_gettime 4322
732#define SYS_timerfd_settime 4323
733#define SYS_timerfd_gettime32 4322
734#define SYS_timerfd_settime32 4323
733735#define SYS_signalfd4 4324
734736#define SYS_eventfd2 4325
735737#define SYS_epoll_create1 4326
......@@ -814,4 +816,6 @@
814816#define SYS_fsopen 4430
815817#define SYS_fsconfig 4431
816818#define SYS_fsmount 4432
817#define SYS_fspick 4433
\ No newline at end of file
819#define SYS_fspick 4433
820#define SYS_pidfd_open 4434
821#define SYS_clone3 4435
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/alltypes.h+66-55
......@@ -2,16 +2,13 @@
22#define _Int64 long
33#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
5#if _MIPSEL || __MIPSEL || __MIPSEL__
6#define __BYTE_ORDER 1234
7#else
8#define __BYTE_ORDER 4321
139#endif
1410
11#define __LONG_MAX 0x7fffffffffffffffL
1512
1613#ifndef __cplusplus
1714#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -38,57 +35,14 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
3835#endif
3936
4037
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
5238#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
5339typedef unsigned nlink_t;
5440#define __DEFINED_nlink_t
5541#endif
5642
57
58#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
59typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
60#define __DEFINED_pthread_attr_t
61#endif
62
63#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
64typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
65#define __DEFINED_pthread_mutex_t
66#endif
67
68#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
69typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
70#define __DEFINED_mtx_t
71#endif
72
73#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
74typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
75#define __DEFINED_pthread_cond_t
76#endif
77
78#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
79typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
80#define __DEFINED_cnd_t
81#endif
82
83#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
84typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
85#define __DEFINED_pthread_rwlock_t
86#endif
87
88#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
89typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
90#define __DEFINED_pthread_barrier_t
91#endif
43#define __LITTLE_ENDIAN 1234
44#define __BIG_ENDIAN 4321
45#define __USE_TIME_BITS64 1
9246
9347#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
9448typedef unsigned _Addr size_t;
......@@ -125,6 +79,16 @@ typedef _Reg register_t;
12579#define __DEFINED_register_t
12680#endif
12781
82#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
83typedef _Int64 time_t;
84#define __DEFINED_time_t
85#endif
86
87#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
88typedef _Int64 suseconds_t;
89#define __DEFINED_suseconds_t
90#endif
91
12892
12993#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
13094typedef signed char int8_t;
......@@ -260,7 +224,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
260224#endif
261225
262226#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
263struct timespec { time_t tv_sec; long tv_nsec; };
227struct 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); };
264228#define __DEFINED_struct_timespec
265229#endif
266230
......@@ -356,6 +320,17 @@ typedef struct _IO_FILE FILE;
356320#endif
357321
358322
323#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
324typedef __builtin_va_list va_list;
325#define __DEFINED_va_list
326#endif
327
328#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
329typedef __builtin_va_list __isoc_va_list;
330#define __DEFINED___isoc_va_list
331#endif
332
333
359334#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
360335typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
361336#define __DEFINED_mbstate_t
......@@ -391,6 +366,42 @@ typedef unsigned short sa_family_t;
391366#endif
392367
393368
369#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
370typedef 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;
371#define __DEFINED_pthread_attr_t
372#endif
373
374#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
375typedef 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;
376#define __DEFINED_pthread_mutex_t
377#endif
378
379#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
380typedef 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;
381#define __DEFINED_mtx_t
382#endif
383
384#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
385typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
386#define __DEFINED_pthread_cond_t
387#endif
388
389#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
390typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
391#define __DEFINED_cnd_t
392#endif
393
394#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
395typedef 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;
396#define __DEFINED_pthread_rwlock_t
397#endif
398
399#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
400typedef 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;
401#define __DEFINED_pthread_barrier_t
402#endif
403
404
394405#undef _Addr
395406#undef _Int64
396407#undef _Reg
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if _MIPSEL || __MIPSEL || __MIPSEL__
2#define __BYTE_ORDER __LITTLE_ENDIAN
3#else
4#define __BYTE_ORDER __BIG_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/socket.h-34
......@@ -1,37 +1,3 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
34
351#define SOCK_STREAM 2
362#define SOCK_DGRAM 1
373#define SOL_SOCKET 65535
lib/libc/include/mips64-linux-musl/bits/syscall.h+5-1
......@@ -336,6 +336,8 @@
336336#define __NR_fsconfig 5431
337337#define __NR_fsmount 5432
338338#define __NR_fspick 5433
339#define __NR_pidfd_open 5434
340#define __NR_clone3 5435
339341
340342#define SYS_read 5000
341343#define SYS_write 5001
......@@ -674,4 +676,6 @@
674676#define SYS_fsopen 5430
675677#define SYS_fsconfig 5431
676678#define SYS_fsmount 5432
677#define SYS_fspick 5433
\ No newline at end of file
679#define SYS_fspick 5433
680#define SYS_pidfd_open 5434
681#define SYS_clone3 5435
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/alltypes.h+64-57
......@@ -1,17 +1,10 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
6#define __BYTE_ORDER 4321
7#define __LONG_MAX 0x7fffffffL
158
169#ifndef __cplusplus
1710#ifdef __WCHAR_TYPE__
......@@ -45,52 +38,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
4538#define __DEFINED_max_align_t
4639#endif
4740
48
49#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
50typedef long time_t;
51#define __DEFINED_time_t
52#endif
53
54#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
55typedef long suseconds_t;
56#define __DEFINED_suseconds_t
57#endif
58
59
60#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
61typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
62#define __DEFINED_pthread_attr_t
63#endif
64
65#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
66typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
67#define __DEFINED_pthread_mutex_t
68#endif
69
70#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
71typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
72#define __DEFINED_mtx_t
73#endif
74
75#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
76typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
77#define __DEFINED_pthread_cond_t
78#endif
79
80#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
81typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
82#define __DEFINED_cnd_t
83#endif
84
85#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
86typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
87#define __DEFINED_pthread_rwlock_t
88#endif
89
90#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
91typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
92#define __DEFINED_pthread_barrier_t
93#endif
41#define __LITTLE_ENDIAN 1234
42#define __BIG_ENDIAN 4321
43#define __USE_TIME_BITS64 1
9444
9545#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
9646typedef unsigned _Addr size_t;
......@@ -127,6 +77,16 @@ typedef _Reg register_t;
12777#define __DEFINED_register_t
12878#endif
12979
80#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
81typedef _Int64 time_t;
82#define __DEFINED_time_t
83#endif
84
85#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
86typedef _Int64 suseconds_t;
87#define __DEFINED_suseconds_t
88#endif
89
13090
13191#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
13292typedef signed char int8_t;
......@@ -262,7 +222,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
262222#endif
263223
264224#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
265struct timespec { time_t tv_sec; long tv_nsec; };
225struct 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); };
266226#define __DEFINED_struct_timespec
267227#endif
268228
......@@ -358,6 +318,17 @@ typedef struct _IO_FILE FILE;
358318#endif
359319
360320
321#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
322typedef __builtin_va_list va_list;
323#define __DEFINED_va_list
324#endif
325
326#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
327typedef __builtin_va_list __isoc_va_list;
328#define __DEFINED___isoc_va_list
329#endif
330
331
361332#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
362333typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
363334#define __DEFINED_mbstate_t
......@@ -393,6 +364,42 @@ typedef unsigned short sa_family_t;
393364#endif
394365
395366
367#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
368typedef 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;
369#define __DEFINED_pthread_attr_t
370#endif
371
372#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
373typedef 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;
374#define __DEFINED_pthread_mutex_t
375#endif
376
377#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
378typedef 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;
379#define __DEFINED_mtx_t
380#endif
381
382#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
383typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
384#define __DEFINED_pthread_cond_t
385#endif
386
387#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
388typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
389#define __DEFINED_cnd_t
390#endif
391
392#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
393typedef 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;
394#define __DEFINED_pthread_rwlock_t
395#endif
396
397#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
398typedef 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;
399#define __DEFINED_pthread_barrier_t
400#endif
401
402
396403#undef _Addr
397404#undef _Int64
398405#undef _Reg
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/endian.h deleted-15
......@@ -1,15 +0,0 @@
1#ifdef __BIG_ENDIAN__
2 #if __BIG_ENDIAN__
3 #define __BYTE_ORDER __BIG_ENDIAN
4 #endif
5#endif /* __BIG_ENDIAN__ */
6
7#ifdef __LITTLE_ENDIAN__
8 #if __LITTLE_ENDIAN__
9 #define __BYTE_ORDER __LITTLE_ENDIAN
10 #endif
11#endif /* __LITTLE_ENDIAN__ */
12
13#ifndef __BYTE_ORDER
14 #define __BYTE_ORDER __BIG_ENDIAN
15#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/ioctl.h+2-2
......@@ -116,5 +116,5 @@
116116#define FIOGETOWN 0x8903
117117#define SIOCGPGRP 0x8904
118118#define SIOCATMARK 0x8905
119#define SIOCGSTAMP 0x8906
120#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
119#define SIOCGSTAMP _IOR(0x89, 6, char[16])
120#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 32
4#endif
5
6#define LONG_MAX 0x7fffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/msg.h+9-6
......@@ -1,15 +1,18 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
3 int __unused1;
4 time_t msg_stime;
5 int __unused2;
6 time_t msg_rtime;
7 int __unused3;
8 time_t msg_ctime;
3 unsigned long __msg_stime_hi;
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_rtime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_ctime_hi;
8 unsigned long __msg_ctime_lo;
99 unsigned long msg_cbytes;
1010 msgqnum_t msg_qnum;
1111 msglen_t msg_qbytes;
1212 pid_t msg_lspid;
1313 pid_t msg_lrpid;
1414 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
1518};
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/sem.h+6-4
......@@ -1,10 +1,12 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 int __unused1;
4 time_t sem_otime;
5 int __unused2;
6 time_t sem_ctime;
3 unsigned long __sem_otime_hi;
4 unsigned long __sem_otime_lo;
5 unsigned long __sem_ctime_hi;
6 unsigned long __sem_ctime_lo;
77 unsigned short __sem_nsems_pad, sem_nsems;
88 long __unused3;
99 long __unused4;
10 time_t sem_otime;
11 time_t sem_ctime;
1012};
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/shm.h+9-7
......@@ -2,19 +2,21 @@
22
33struct shmid_ds {
44 struct ipc_perm shm_perm;
5 int __unused1;
6 time_t shm_atime;
7 int __unused2;
8 time_t shm_dtime;
9 int __unused3;
10 time_t shm_ctime;
11 int __unused4;
5 unsigned long __shm_atime_hi;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_ctime_hi;
10 unsigned long __shm_ctime_lo;
1211 size_t shm_segsz;
1312 pid_t shm_cpid;
1413 pid_t shm_lpid;
1514 unsigned long shm_nattch;
1615 unsigned long __pad1;
1716 unsigned long __pad2;
17 time_t shm_atime;
18 time_t shm_dtime;
19 time_t shm_ctime;
1820};
1921
2022struct shminfo {
lib/libc/include/powerpc-linux-musl/bits/signal.h+1-1
......@@ -28,7 +28,7 @@ struct sigcontext {
2828 int signal;
2929 unsigned long handler;
3030 unsigned long oldmask;
31 void *regs;
31 struct pt_regs *regs;
3232};
3333
3434typedef struct {
lib/libc/include/powerpc-linux-musl/bits/socket.h-18
......@@ -1,19 +1,3 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
16
171#define SO_DEBUG 1
182#define SO_REUSEADDR 2
193#define SO_TYPE 3
......@@ -31,8 +15,6 @@ struct cmsghdr {
3115#define SO_REUSEPORT 15
3216#define SO_RCVLOWAT 16
3317#define SO_SNDLOWAT 17
34#define SO_RCVTIMEO 18
35#define SO_SNDTIMEO 19
3618#define SO_PASSCRED 20
3719#define SO_PEERCRED 21
3820#define SO_ACCEPTCONN 30
lib/libc/include/powerpc-linux-musl/bits/stat.h+5-1
......@@ -13,8 +13,12 @@ struct stat {
1313 off_t st_size;
1414 blksize_t st_blksize;
1515 blkcnt_t st_blocks;
16 struct {
17 long tv_sec;
18 long tv_nsec;
19 } __st_atim32, __st_mtim32, __st_ctim32;
20 unsigned __unused[2];
1621 struct timespec st_atim;
1722 struct timespec st_mtim;
1823 struct timespec st_ctim;
19 unsigned __unused[2];
2024};
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/syscall.h+25-21
......@@ -76,8 +76,8 @@
7676#define __NR_setrlimit 75
7777#define __NR_getrlimit 76
7878#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
8181#define __NR_getgroups 80
8282#define __NR_setgroups 81
8383#define __NR_select 82
......@@ -238,14 +238,14 @@
238238#define __NR_epoll_wait 238
239239#define __NR_remap_file_pages 239
240240#define __NR_timer_create 240
241#define __NR_timer_settime 241
242#define __NR_timer_gettime 242
241#define __NR_timer_settime32 241
242#define __NR_timer_gettime32 242
243243#define __NR_timer_getoverrun 243
244244#define __NR_timer_delete 244
245#define __NR_clock_settime 245
246#define __NR_clock_gettime 246
247#define __NR_clock_getres 247
248#define __NR_clock_nanosleep 248
245#define __NR_clock_settime32 245
246#define __NR_clock_gettime32 246
247#define __NR_clock_getres_time32 247
248#define __NR_clock_nanosleep_time32 248
249249#define __NR_swapcontext 249
250250#define __NR_tgkill 250
251251#define __NR_utimes 251
......@@ -307,8 +307,8 @@
307307#define __NR_sync_file_range2 308
308308#define __NR_fallocate 309
309309#define __NR_subpage_prot 310
310#define __NR_timerfd_settime 311
311#define __NR_timerfd_gettime 312
310#define __NR_timerfd_settime32 311
311#define __NR_timerfd_gettime32 312
312312#define __NR_signalfd4 313
313313#define __NR_eventfd2 314
314314#define __NR_epoll_create1 315
......@@ -413,6 +413,8 @@
413413#define __NR_fsconfig 431
414414#define __NR_fsmount 432
415415#define __NR_fspick 433
416#define __NR_pidfd_open 434
417#define __NR_clone3 435
416418
417419#define SYS_restart_syscall 0
418420#define SYS_exit 1
......@@ -492,8 +494,8 @@
492494#define SYS_setrlimit 75
493495#define SYS_getrlimit 76
494496#define SYS_getrusage 77
495#define SYS_gettimeofday 78
496#define SYS_settimeofday 79
497#define SYS_gettimeofday_time32 78
498#define SYS_settimeofday_time32 79
497499#define SYS_getgroups 80
498500#define SYS_setgroups 81
499501#define SYS_select 82
......@@ -654,14 +656,14 @@
654656#define SYS_epoll_wait 238
655657#define SYS_remap_file_pages 239
656658#define SYS_timer_create 240
657#define SYS_timer_settime 241
658#define SYS_timer_gettime 242
659#define SYS_timer_settime32 241
660#define SYS_timer_gettime32 242
659661#define SYS_timer_getoverrun 243
660662#define SYS_timer_delete 244
661#define SYS_clock_settime 245
662#define SYS_clock_gettime 246
663#define SYS_clock_getres 247
664#define SYS_clock_nanosleep 248
663#define SYS_clock_settime32 245
664#define SYS_clock_gettime32 246
665#define SYS_clock_getres_time32 247
666#define SYS_clock_nanosleep_time32 248
665667#define SYS_swapcontext 249
666668#define SYS_tgkill 250
667669#define SYS_utimes 251
......@@ -723,8 +725,8 @@
723725#define SYS_sync_file_range2 308
724726#define SYS_fallocate 309
725727#define SYS_subpage_prot 310
726#define SYS_timerfd_settime 311
727#define SYS_timerfd_gettime 312
728#define SYS_timerfd_settime32 311
729#define SYS_timerfd_gettime32 312
728730#define SYS_signalfd4 313
729731#define SYS_eventfd2 314
730732#define SYS_epoll_create1 315
......@@ -828,4 +830,6 @@
828830#define SYS_fsopen 430
829831#define SYS_fsconfig 431
830832#define SYS_fsmount 432
831#define SYS_fspick 433
\ No newline at end of file
833#define SYS_fspick 433
834#define SYS_pidfd_open 434
835#define SYS_clone3 435
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/alltypes.h+66-55
......@@ -2,16 +2,13 @@
22#define _Int64 long
33#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
5#if __BIG_ENDIAN__
6#define __BYTE_ORDER 4321
7#else
8#define __BYTE_ORDER 1234
139#endif
1410
11#define __LONG_MAX 0x7fffffffffffffffL
1512
1613#ifndef __cplusplus
1714#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -37,52 +34,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
3734#define __DEFINED_max_align_t
3835#endif
3936
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
37#define __LITTLE_ENDIAN 1234
38#define __BIG_ENDIAN 4321
39#define __USE_TIME_BITS64 1
8640
8741#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
8842typedef unsigned _Addr size_t;
......@@ -119,6 +73,16 @@ typedef _Reg register_t;
11973#define __DEFINED_register_t
12074#endif
12175
76#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
77typedef _Int64 time_t;
78#define __DEFINED_time_t
79#endif
80
81#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
82typedef _Int64 suseconds_t;
83#define __DEFINED_suseconds_t
84#endif
85
12286
12387#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
12488typedef signed char int8_t;
......@@ -254,7 +218,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
254218#endif
255219
256220#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
221struct 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); };
258222#define __DEFINED_struct_timespec
259223#endif
260224
......@@ -350,6 +314,17 @@ typedef struct _IO_FILE FILE;
350314#endif
351315
352316
317#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
318typedef __builtin_va_list va_list;
319#define __DEFINED_va_list
320#endif
321
322#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
323typedef __builtin_va_list __isoc_va_list;
324#define __DEFINED___isoc_va_list
325#endif
326
327
353328#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
354329typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
355330#define __DEFINED_mbstate_t
......@@ -385,6 +360,42 @@ typedef unsigned short sa_family_t;
385360#endif
386361
387362
363#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
364typedef 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;
365#define __DEFINED_pthread_attr_t
366#endif
367
368#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
369typedef 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;
370#define __DEFINED_pthread_mutex_t
371#endif
372
373#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
374typedef 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;
375#define __DEFINED_mtx_t
376#endif
377
378#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
379typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
380#define __DEFINED_pthread_cond_t
381#endif
382
383#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
384typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
385#define __DEFINED_cnd_t
386#endif
387
388#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
389typedef 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;
390#define __DEFINED_pthread_rwlock_t
391#endif
392
393#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
394typedef 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;
395#define __DEFINED_pthread_barrier_t
396#endif
397
398
388399#undef _Addr
389400#undef _Int64
390401#undef _Reg
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if __BIG_ENDIAN__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/signal.h+2-6
......@@ -9,11 +9,7 @@
99#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
1010
1111typedef unsigned long greg_t, gregset_t[48];
12
13typedef struct {
14 double fpregs[32];
15 double fpscr;
16} fpregset_t;
12typedef double fpregset_t[33];
1713
1814typedef struct {
1915#ifdef __GNUC__
......@@ -36,7 +32,7 @@ typedef struct sigcontext {
3632 int _pad0;
3733 unsigned long handler;
3834 unsigned long oldmask;
39 void *regs;
35 struct pt_regs *regs;
4036 gregset_t gp_regs;
4137 fpregset_t fp_regs;
4238 vrregset_t *v_regs;
lib/libc/include/powerpc64-linux-musl/bits/socket.h-34
......@@ -1,37 +1,3 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
34
351#define SO_DEBUG 1
362#define SO_REUSEADDR 2
373#define SO_TYPE 3
lib/libc/include/powerpc64-linux-musl/bits/syscall.h+5-1
......@@ -385,6 +385,8 @@
385385#define __NR_fsconfig 431
386386#define __NR_fsmount 432
387387#define __NR_fspick 433
388#define __NR_pidfd_open 434
389#define __NR_clone3 435
388390
389391#define SYS_restart_syscall 0
390392#define SYS_exit 1
......@@ -772,4 +774,6 @@
772774#define SYS_fsopen 430
773775#define SYS_fsconfig 431
774776#define SYS_fsmount 432
775#define SYS_fspick 433
\ No newline at end of file
777#define SYS_fspick 433
778#define SYS_pidfd_open 434
779#define SYS_clone3 435
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/alltypes.h+63-57
......@@ -2,16 +2,8 @@
22#define _Int64 long
33#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffffffffffL
157
168#ifndef __cplusplus
179#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -48,52 +40,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
4840#define __DEFINED_max_align_t
4941#endif
5042
51
52#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
53typedef long time_t;
54#define __DEFINED_time_t
55#endif
56
57#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
58typedef long suseconds_t;
59#define __DEFINED_suseconds_t
60#endif
61
62
63#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
64typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
65#define __DEFINED_pthread_attr_t
66#endif
67
68#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
69typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
70#define __DEFINED_pthread_mutex_t
71#endif
72
73#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
74typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
75#define __DEFINED_mtx_t
76#endif
77
78#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
79typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
80#define __DEFINED_pthread_cond_t
81#endif
82
83#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
84typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
85#define __DEFINED_cnd_t
86#endif
87
88#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
89typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
90#define __DEFINED_pthread_rwlock_t
91#endif
92
93#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
94typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
95#define __DEFINED_pthread_barrier_t
96#endif
43#define __LITTLE_ENDIAN 1234
44#define __BIG_ENDIAN 4321
45#define __USE_TIME_BITS64 1
9746
9847#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
9948typedef unsigned _Addr size_t;
......@@ -130,6 +79,16 @@ typedef _Reg register_t;
13079#define __DEFINED_register_t
13180#endif
13281
82#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
83typedef _Int64 time_t;
84#define __DEFINED_time_t
85#endif
86
87#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
88typedef _Int64 suseconds_t;
89#define __DEFINED_suseconds_t
90#endif
91
13392
13493#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
13594typedef signed char int8_t;
......@@ -265,7 +224,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
265224#endif
266225
267226#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
268struct timespec { time_t tv_sec; long tv_nsec; };
227struct 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); };
269228#define __DEFINED_struct_timespec
270229#endif
271230
......@@ -361,6 +320,17 @@ typedef struct _IO_FILE FILE;
361320#endif
362321
363322
323#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
324typedef __builtin_va_list va_list;
325#define __DEFINED_va_list
326#endif
327
328#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
329typedef __builtin_va_list __isoc_va_list;
330#define __DEFINED___isoc_va_list
331#endif
332
333
364334#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
365335typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
366336#define __DEFINED_mbstate_t
......@@ -396,6 +366,42 @@ typedef unsigned short sa_family_t;
396366#endif
397367
398368
369#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
370typedef 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;
371#define __DEFINED_pthread_attr_t
372#endif
373
374#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
375typedef 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;
376#define __DEFINED_pthread_mutex_t
377#endif
378
379#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
380typedef 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;
381#define __DEFINED_mtx_t
382#endif
383
384#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
385typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
386#define __DEFINED_pthread_cond_t
387#endif
388
389#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
390typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
391#define __DEFINED_cnd_t
392#endif
393
394#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
395typedef 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;
396#define __DEFINED_pthread_rwlock_t
397#endif
398
399#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
400typedef 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;
401#define __DEFINED_pthread_barrier_t
402#endif
403
404
399405#undef _Addr
400406#undef _Int64
401407#undef _Reg
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/reg.h deleted-8
......@@ -1,8 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3#define REG_PC 0
4#define REG_RA 1
5#define REG_SP 2
6#define REG_TP 4
7#define REG_S0 8
8#define REG_A0 10
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/signal.h+9
......@@ -35,6 +35,15 @@ typedef struct mcontext_t {
3535 union __riscv_mc_fp_state __fpregs;
3636} mcontext_t;
3737
38#if defined(_GNU_SOURCE)
39#define REG_PC 0
40#define REG_RA 1
41#define REG_SP 2
42#define REG_TP 4
43#define REG_S0 8
44#define REG_A0 10
45#endif
46
3847#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3948typedef unsigned long greg_t;
4049typedef unsigned long gregset_t[32];
lib/libc/include/riscv64-linux-musl/bits/socket.h deleted-19
......@@ -1,19 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7 int msg_iovlen, __pad1;
8 void *msg_control;
9 socklen_t msg_controllen;
10 int __pad2;
11 int msg_flags;
12};
13
14struct cmsghdr {
15 socklen_t cmsg_len;
16 int __pad1;
17 int cmsg_level;
18 int cmsg_type;
19};
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/syscall.h+4
......@@ -287,6 +287,8 @@
287287#define __NR_fsconfig 431
288288#define __NR_fsmount 432
289289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
290292
291293#define __NR_sysriscv __NR_arch_specific_syscall
292294#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
......@@ -579,5 +581,7 @@
579581#define SYS_fsconfig 431
580582#define SYS_fsmount 432
581583#define SYS_fspick 433
584#define SYS_pidfd_open 434
585#define SYS_clone3 435
582586#define SYS_sysriscv __NR_arch_specific_syscall
583587#define SYS_riscv_flush_icache (__NR_sysriscv + 15)
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/alltypes.h+63-57
......@@ -2,16 +2,8 @@
22#define _Int64 long
33#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
5#define __BYTE_ORDER 4321
6#define __LONG_MAX 0x7fffffffffffffffL
157
168#ifndef __cplusplus
179#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -37,52 +29,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
3729#define __DEFINED_max_align_t
3830#endif
3931
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
32#define __LITTLE_ENDIAN 1234
33#define __BIG_ENDIAN 4321
34#define __USE_TIME_BITS64 1
8635
8736#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
8837typedef unsigned _Addr size_t;
......@@ -119,6 +68,16 @@ typedef _Reg register_t;
11968#define __DEFINED_register_t
12069#endif
12170
71#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
72typedef _Int64 time_t;
73#define __DEFINED_time_t
74#endif
75
76#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
77typedef _Int64 suseconds_t;
78#define __DEFINED_suseconds_t
79#endif
80
12281
12382#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
12483typedef signed char int8_t;
......@@ -254,7 +213,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
254213#endif
255214
256215#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
216struct 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); };
258217#define __DEFINED_struct_timespec
259218#endif
260219
......@@ -350,6 +309,17 @@ typedef struct _IO_FILE FILE;
350309#endif
351310
352311
312#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
313typedef __builtin_va_list va_list;
314#define __DEFINED_va_list
315#endif
316
317#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
318typedef __builtin_va_list __isoc_va_list;
319#define __DEFINED___isoc_va_list
320#endif
321
322
353323#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
354324typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
355325#define __DEFINED_mbstate_t
......@@ -385,6 +355,42 @@ typedef unsigned short sa_family_t;
385355#endif
386356
387357
358#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
359typedef 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;
360#define __DEFINED_pthread_attr_t
361#endif
362
363#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
364typedef 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;
365#define __DEFINED_pthread_mutex_t
366#endif
367
368#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
369typedef 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;
370#define __DEFINED_mtx_t
371#endif
372
373#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
374typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
375#define __DEFINED_pthread_cond_t
376#endif
377
378#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
379typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
380#define __DEFINED_cnd_t
381#endif
382
383#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
384typedef 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;
385#define __DEFINED_pthread_rwlock_t
386#endif
387
388#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
389typedef 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;
390#define __DEFINED_pthread_barrier_t
391#endif
392
393
388394#undef _Addr
389395#undef _Int64
390396#undef _Reg
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/endian.h deleted-1
......@@ -1 +0,0 @@
1#define __BYTE_ORDER __BIG_ENDIAN
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/limits.h+1-8
......@@ -1,8 +1 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define PAGESIZE 4096
4#define LONG_BIT 64
5#endif
6
7#define LONG_MAX 0x7fffffffffffffffL
8#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
1#define PAGESIZE 4096
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/socket.h deleted-17
......@@ -1,17 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int __pad1, msg_iovlen;
6 void *msg_control;
7 int __pad2;
8 socklen_t msg_controllen;
9 int msg_flags;
10};
11
12struct cmsghdr {
13 int __pad1;
14 socklen_t cmsg_len;
15 int cmsg_level;
16 int cmsg_type;
17};
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/syscall.h+5-1
......@@ -350,6 +350,8 @@
350350#define __NR_fsconfig 431
351351#define __NR_fsmount 432
352352#define __NR_fspick 433
353#define __NR_pidfd_open 434
354#define __NR_clone3 435
353355
354356#define SYS_exit 1
355357#define SYS_fork 2
......@@ -702,4 +704,6 @@
702704#define SYS_fsopen 430
703705#define SYS_fsconfig 431
704706#define SYS_fsmount 432
705#define SYS_fspick 433
\ No newline at end of file
707#define SYS_fspick 433
708#define SYS_pidfd_open 434
709#define SYS_clone3 435
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/alltypes.h+63-57
......@@ -2,16 +2,8 @@
22#define _Int64 long
33#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffffffffffL
157
168#ifndef __cplusplus
179#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
......@@ -50,52 +42,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
5042#define __DEFINED_max_align_t
5143#endif
5244
53
54#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
55typedef long time_t;
56#define __DEFINED_time_t
57#endif
58
59#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
60typedef long suseconds_t;
61#define __DEFINED_suseconds_t
62#endif
63
64
65#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
66typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
67#define __DEFINED_pthread_attr_t
68#endif
69
70#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
71typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
72#define __DEFINED_pthread_mutex_t
73#endif
74
75#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
76typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
77#define __DEFINED_mtx_t
78#endif
79
80#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
81typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
82#define __DEFINED_pthread_cond_t
83#endif
84
85#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
86typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
87#define __DEFINED_cnd_t
88#endif
89
90#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
91typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
92#define __DEFINED_pthread_rwlock_t
93#endif
94
95#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
96typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
97#define __DEFINED_pthread_barrier_t
98#endif
45#define __LITTLE_ENDIAN 1234
46#define __BIG_ENDIAN 4321
47#define __USE_TIME_BITS64 1
9948
10049#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
10150typedef unsigned _Addr size_t;
......@@ -132,6 +81,16 @@ typedef _Reg register_t;
13281#define __DEFINED_register_t
13382#endif
13483
84#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
85typedef _Int64 time_t;
86#define __DEFINED_time_t
87#endif
88
89#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
90typedef _Int64 suseconds_t;
91#define __DEFINED_suseconds_t
92#endif
93
13594
13695#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
13796typedef signed char int8_t;
......@@ -267,7 +226,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
267226#endif
268227
269228#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
270struct timespec { time_t tv_sec; long tv_nsec; };
229struct 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); };
271230#define __DEFINED_struct_timespec
272231#endif
273232
......@@ -363,6 +322,17 @@ typedef struct _IO_FILE FILE;
363322#endif
364323
365324
325#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
326typedef __builtin_va_list va_list;
327#define __DEFINED_va_list
328#endif
329
330#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
331typedef __builtin_va_list __isoc_va_list;
332#define __DEFINED___isoc_va_list
333#endif
334
335
366336#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
367337typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
368338#define __DEFINED_mbstate_t
......@@ -398,6 +368,42 @@ typedef unsigned short sa_family_t;
398368#endif
399369
400370
371#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
372typedef 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;
373#define __DEFINED_pthread_attr_t
374#endif
375
376#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
377typedef 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;
378#define __DEFINED_pthread_mutex_t
379#endif
380
381#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
382typedef 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;
383#define __DEFINED_mtx_t
384#endif
385
386#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
387typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
388#define __DEFINED_pthread_cond_t
389#endif
390
391#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
392typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
393#define __DEFINED_cnd_t
394#endif
395
396#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
397typedef 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;
398#define __DEFINED_pthread_rwlock_t
399#endif
400
401#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
402typedef 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;
403#define __DEFINED_pthread_barrier_t
404#endif
405
406
401407#undef _Addr
402408#undef _Int64
403409#undef _Reg
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/limits.h+1-8
......@@ -1,8 +1 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define PAGESIZE 4096
4#define LONG_BIT 64
5#endif
6
7#define LONG_MAX 0x7fffffffffffffffL
8#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
1#define PAGESIZE 4096
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/socket.h deleted-16
......@@ -1,16 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen, __pad1;
6 void *msg_control;
7 socklen_t msg_controllen, __pad2;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int __pad1;
14 int cmsg_level;
15 int cmsg_type;
16};
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/syscall.h+5-1
......@@ -343,6 +343,8 @@
343343#define __NR_fsconfig 431
344344#define __NR_fsmount 432
345345#define __NR_fspick 433
346#define __NR_pidfd_open 434
347#define __NR_clone3 435
346348
347349#define SYS_read 0
348350#define SYS_write 1
......@@ -688,4 +690,6 @@
688690#define SYS_fsopen 430
689691#define SYS_fsconfig 431
690692#define SYS_fsmount 432
691#define SYS_fspick 433
\ No newline at end of file
693#define SYS_fspick 433
694#define SYS_pidfd_open 434
695#define SYS_clone3 435
\ No newline at end of file
lib/libc/musl/COPYRIGHT+2-2
......@@ -1,7 +1,7 @@
11musl as a whole is licensed under the following standard MIT license:
22
33----------------------------------------------------------------------
4Copyright © 2005-2019 Rich Felker, et al.
4Copyright © 2005-2020 Rich Felker, et al.
55
66Permission is hereby granted, free of charge, to any person obtaining
77a copy of this software and associated documentation files (the
......@@ -26,6 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2626Authors/contributors include:
2727
2828A. Wilcox
29Ada Worcester
2930Alex Dowad
3031Alex Suykov
3132Alexander Monakov
......@@ -65,7 +66,6 @@ Jeremy Huntwork
6566Jo-Philipp Wich
6667Joakim Sindholt
6768John Spencer
68Josiah Worcester
6969Julien Ramseier
7070Justin Cormack
7171Kaarle Ritvanen
lib/libc/musl/arch/aarch64/bits/alltypes.h.in+7-13
......@@ -2,8 +2,13 @@
22#define _Int64 long
33#define _Reg long
44
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
5#if __AARCH64EB__
6#define __BYTE_ORDER 4321
7#else
8#define __BYTE_ORDER 1234
9#endif
10
11#define __LONG_MAX 0x7fffffffffffffffL
712
813#ifndef __cplusplus
914TYPEDEF unsigned wchar_t;
......@@ -17,14 +22,3 @@ TYPEDEF float float_t;
1722TYPEDEF double double_t;
1823
1924TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
20
21TYPEDEF long time_t;
22TYPEDEF long suseconds_t;
23
24TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
25TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
26TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
27TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
28TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
29TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
30TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/aarch64/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if __AARCH64EB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
lib/libc/musl/arch/aarch64/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/aarch64/bits/socket.h deleted-33
......@@ -1,33 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
lib/libc/musl/arch/aarch64/bits/syscall.h.in+2
......@@ -287,4 +287,6 @@
287287#define __NR_fsconfig 431
288288#define __NR_fsmount 432
289289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
290292
lib/libc/musl/arch/aarch64/reloc.h-2
......@@ -1,5 +1,3 @@
1#include <endian.h>
2
31#if __BYTE_ORDER == __BIG_ENDIAN
42#define ENDIAN_SUFFIX "_be"
53#else
lib/libc/musl/arch/arm/bits/alltypes.h.in+8-13
......@@ -1,9 +1,15 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
6#if __ARMEB__
7#define __BYTE_ORDER 4321
8#else
9#define __BYTE_ORDER 1234
10#endif
11
12#define __LONG_MAX 0x7fffffffL
713
814#ifndef __cplusplus
915TYPEDEF unsigned wchar_t;
......@@ -13,14 +19,3 @@ TYPEDEF float float_t;
1319TYPEDEF double double_t;
1420
1521TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
16
17TYPEDEF long time_t;
18TYPEDEF long suseconds_t;
19
20TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
21TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
22TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
23TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
24TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
25TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
26TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/arm/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if __ARMEB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
lib/libc/musl/arch/arm/bits/ipcstat.h+1-1
......@@ -1 +1 @@
1#define IPC_STAT 2
1#define IPC_STAT 0x102
lib/libc/musl/arch/arm/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 32
4#endif
5
6#define LONG_MAX 0x7fffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/arm/bits/msg.h+9-6
......@@ -1,15 +1,18 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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;
99 unsigned long msg_cbytes;
1010 msgqnum_t msg_qnum;
1111 msglen_t msg_qbytes;
1212 pid_t msg_lspid;
1313 pid_t msg_lrpid;
1414 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
1518};
lib/libc/musl/arch/arm/bits/sem.h+6-4
......@@ -1,9 +1,9 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 long __unused1;
5 time_t sem_ctime;
6 long __unused2;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
77#if __BYTE_ORDER == __LITTLE_ENDIAN
88 unsigned short sem_nsems;
99 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
......@@ -13,4 +13,6 @@ struct semid_ds {
1313#endif
1414 long __unused3;
1515 long __unused4;
16 time_t sem_otime;
17 time_t sem_ctime;
1618};
lib/libc/musl/arch/arm/bits/shm.h+10-6
......@@ -3,17 +3,21 @@
33struct shmid_ds {
44 struct ipc_perm shm_perm;
55 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
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;
1212 pid_t shm_cpid;
1313 pid_t shm_lpid;
1414 unsigned long shm_nattch;
1515 unsigned long __pad1;
1616 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
1721};
1822
1923struct shminfo {
lib/libc/musl/arch/arm/bits/stat.h+5-1
......@@ -14,8 +14,12 @@ struct stat {
1414 off_t st_size;
1515 blksize_t st_blksize;
1616 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;
1722 struct timespec st_atim;
1823 struct timespec st_mtim;
1924 struct timespec st_ctim;
20 ino_t st_ino;
2125};
lib/libc/musl/arch/arm/bits/syscall.h.in+12-10
......@@ -55,8 +55,8 @@
5555#define __NR_sethostname 74
5656#define __NR_setrlimit 75
5757#define __NR_getrusage 77
58#define __NR_gettimeofday 78
59#define __NR_settimeofday 79
58#define __NR_gettimeofday_time32 78
59#define __NR_settimeofday_time32 79
6060#define __NR_getgroups 80
6161#define __NR_setgroups 81
6262#define __NR_symlink 83
......@@ -211,14 +211,14 @@
211211#define __NR_remap_file_pages 253
212212#define __NR_set_tid_address 256
213213#define __NR_timer_create 257
214#define __NR_timer_settime 258
215#define __NR_timer_gettime 259
214#define __NR_timer_settime32 258
215#define __NR_timer_gettime32 259
216216#define __NR_timer_getoverrun 260
217217#define __NR_timer_delete 261
218#define __NR_clock_settime 262
219#define __NR_clock_gettime 263
220#define __NR_clock_getres 264
221#define __NR_clock_nanosleep 265
218#define __NR_clock_settime32 262
219#define __NR_clock_gettime32 263
220#define __NR_clock_getres_time32 264
221#define __NR_clock_nanosleep_time32 265
222222#define __NR_statfs64 266
223223#define __NR_fstatfs64 267
224224#define __NR_tgkill 268
......@@ -308,8 +308,8 @@
308308#define __NR_timerfd_create 350
309309#define __NR_eventfd 351
310310#define __NR_fallocate 352
311#define __NR_timerfd_settime 353
312#define __NR_timerfd_gettime 354
311#define __NR_timerfd_settime32 353
312#define __NR_timerfd_gettime32 354
313313#define __NR_signalfd4 355
314314#define __NR_eventfd2 356
315315#define __NR_epoll_create1 357
......@@ -387,6 +387,8 @@
387387#define __NR_fsconfig 431
388388#define __NR_fsmount 432
389389#define __NR_fspick 433
390#define __NR_pidfd_open 434
391#define __NR_clone3 435
390392
391393#define __ARM_NR_breakpoint 0x0f0001
392394#define __ARM_NR_cacheflush 0x0f0002
lib/libc/musl/arch/arm/reloc.h-2
......@@ -1,5 +1,3 @@
1#include <endian.h>
2
31#if __BYTE_ORDER == __BIG_ENDIAN
42#define ENDIAN_SUFFIX "eb"
53#else
lib/libc/musl/arch/arm/syscall_arch.h+3-1
......@@ -99,7 +99,9 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
9999}
100100
101101#define VDSO_USEFUL
102#define VDSO_CGT_SYM "__vdso_clock_gettime"
102#define VDSO_CGT32_SYM "__vdso_clock_gettime"
103#define VDSO_CGT32_VER "LINUX_2.6"
104#define VDSO_CGT_SYM "__vdso_clock_gettime64"
103105#define VDSO_CGT_VER "LINUX_2.6"
104106
105107#define SYSCALL_FADVISE_6_ARG
lib/libc/musl/arch/generic/bits/dirent.h created+11
......@@ -0,0 +1,11 @@
1#define _DIRENT_HAVE_D_RECLEN
2#define _DIRENT_HAVE_D_OFF
3#define _DIRENT_HAVE_D_TYPE
4
5struct dirent {
6 ino_t d_ino;
7 off_t d_off;
8 unsigned short d_reclen;
9 unsigned char d_type;
10 char d_name[256];
11};
lib/libc/musl/arch/generic/bits/ioctl.h+5
......@@ -104,7 +104,12 @@
104104#define FIOGETOWN 0x8903
105105#define SIOCGPGRP 0x8904
106106#define SIOCATMARK 0x8905
107#if __LONG_MAX == 0x7fffffff
108#define SIOCGSTAMP _IOR(0x89, 6, char[16])
109#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
110#else
107111#define SIOCGSTAMP 0x8906
108112#define SIOCGSTAMPNS 0x8907
113#endif
109114
110115#include <bits/ioctl_fix.h>
lib/libc/musl/arch/generic/bits/limits.h created
lib/libc/musl/arch/generic/bits/socket.h-15
......@@ -1,15 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
lib/libc/musl/arch/i386/bits/alltypes.h.in+3-18
......@@ -1,14 +1,10 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5#if __GNUC__ >= 3
6TYPEDEF __builtin_va_list va_list;
7TYPEDEF __builtin_va_list __isoc_va_list;
8#else
9TYPEDEF struct __va_list * va_list;
10TYPEDEF struct __va_list * __isoc_va_list;
11#endif
6#define __BYTE_ORDER 1234
7#define __LONG_MAX 0x7fffffffL
128
139#ifndef __cplusplus
1410#ifdef __WCHAR_TYPE__
......@@ -33,14 +29,3 @@ TYPEDEF struct { __attribute__((__aligned__(8))) long long __ll; long double __l
3329#else
3430TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
3531#endif
36
37TYPEDEF long time_t;
38TYPEDEF long suseconds_t;
39
40TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
41TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
42TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
43TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
44TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
45TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
46TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/i386/bits/endian.h deleted-1
......@@ -1 +0,0 @@
1#define __BYTE_ORDER __LITTLE_ENDIAN
lib/libc/musl/arch/i386/bits/ipcstat.h+1-1
......@@ -1 +1 @@
1#define IPC_STAT 2
1#define IPC_STAT 0x102
lib/libc/musl/arch/i386/bits/limits.h-7
......@@ -1,8 +1 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
31#define PAGESIZE 4096
4#define LONG_BIT 32
5#endif
6
7#define LONG_MAX 0x7fffffffL
8#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/i386/bits/msg.h+9-6
......@@ -1,15 +1,18 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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;
99 unsigned long msg_cbytes;
1010 msgqnum_t msg_qnum;
1111 msglen_t msg_qbytes;
1212 pid_t msg_lspid;
1313 pid_t msg_lrpid;
1414 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
1518};
lib/libc/musl/arch/i386/bits/sem.h+6-4
......@@ -1,11 +1,13 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 long __unused1;
5 time_t sem_ctime;
6 long __unused2;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
77 unsigned short sem_nsems;
88 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
99 long __unused3;
1010 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
1113};
lib/libc/musl/arch/i386/bits/shm.h+10-6
......@@ -3,17 +3,21 @@
33struct shmid_ds {
44 struct ipc_perm shm_perm;
55 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
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;
1212 pid_t shm_cpid;
1313 pid_t shm_lpid;
1414 unsigned long shm_nattch;
1515 unsigned long __pad1;
1616 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
1721};
1822
1923struct shminfo {
lib/libc/musl/arch/i386/bits/stat.h+5-1
......@@ -14,8 +14,12 @@ struct stat {
1414 off_t st_size;
1515 blksize_t st_blksize;
1616 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;
1722 struct timespec st_atim;
1823 struct timespec st_mtim;
1924 struct timespec st_ctim;
20 ino_t st_ino;
2125};
lib/libc/musl/arch/i386/bits/syscall.h.in+12-10
......@@ -76,8 +76,8 @@
7676#define __NR_setrlimit 75
7777#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
7878#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
8181#define __NR_getgroups 80
8282#define __NR_setgroups 81
8383#define __NR_select 82
......@@ -257,14 +257,14 @@
257257#define __NR_remap_file_pages 257
258258#define __NR_set_tid_address 258
259259#define __NR_timer_create 259
260#define __NR_timer_settime (__NR_timer_create+1)
261#define __NR_timer_gettime (__NR_timer_create+2)
260#define __NR_timer_settime32 (__NR_timer_create+1)
261#define __NR_timer_gettime32 (__NR_timer_create+2)
262262#define __NR_timer_getoverrun (__NR_timer_create+3)
263263#define __NR_timer_delete (__NR_timer_create+4)
264#define __NR_clock_settime (__NR_timer_create+5)
265#define __NR_clock_gettime (__NR_timer_create+6)
266#define __NR_clock_getres (__NR_timer_create+7)
267#define __NR_clock_nanosleep (__NR_timer_create+8)
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)
268268#define __NR_statfs64 268
269269#define __NR_fstatfs64 269
270270#define __NR_tgkill 270
......@@ -322,8 +322,8 @@
322322#define __NR_timerfd_create 322
323323#define __NR_eventfd 323
324324#define __NR_fallocate 324
325#define __NR_timerfd_settime 325
326#define __NR_timerfd_gettime 326
325#define __NR_timerfd_settime32 325
326#define __NR_timerfd_gettime32 326
327327#define __NR_signalfd4 327
328328#define __NR_eventfd2 328
329329#define __NR_epoll_create1 329
......@@ -424,4 +424,6 @@
424424#define __NR_fsconfig 431
425425#define __NR_fsmount 432
426426#define __NR_fspick 433
427#define __NR_pidfd_open 434
428#define __NR_clone3 435
427429
lib/libc/musl/arch/i386/syscall_arch.h+3-1
......@@ -83,7 +83,9 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a
8383}
8484
8585#define VDSO_USEFUL
86#define VDSO_CGT_SYM "__vdso_clock_gettime"
86#define VDSO_CGT32_SYM "__vdso_clock_gettime"
87#define VDSO_CGT32_VER "LINUX_2.6"
88#define VDSO_CGT_SYM "__vdso_clock_gettime64"
8789#define VDSO_CGT_VER "LINUX_2.6"
8890
8991#define SYSCALL_USE_SOCKETCALL
lib/libc/musl/arch/mips/bits/alltypes.h.in+8-13
......@@ -1,9 +1,15 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
6#if _MIPSEL || __MIPSEL || __MIPSEL__
7#define __BYTE_ORDER 1234
8#else
9#define __BYTE_ORDER 4321
10#endif
11
12#define __LONG_MAX 0x7fffffffL
713
814#ifndef __cplusplus
915TYPEDEF int wchar_t;
......@@ -13,14 +19,3 @@ TYPEDEF float float_t;
1319TYPEDEF double double_t;
1420
1521TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
16
17TYPEDEF long time_t;
18TYPEDEF long suseconds_t;
19
20TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
21TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
22TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
23TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
24TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
25TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
26TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/mips/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if _MIPSEL || __MIPSEL || __MIPSEL__
2#define __BYTE_ORDER __LITTLE_ENDIAN
3#else
4#define __BYTE_ORDER __BIG_ENDIAN
5#endif
lib/libc/musl/arch/mips/bits/hwcap.h+11
......@@ -1,3 +1,14 @@
11#define HWCAP_MIPS_R6 (1 << 0)
22#define HWCAP_MIPS_MSA (1 << 1)
33#define HWCAP_MIPS_CRC32 (1 << 2)
4#define HWCAP_MIPS_MIPS16 (1 << 3)
5#define HWCAP_MIPS_MDMX (1 << 4)
6#define HWCAP_MIPS_MIPS3D (1 << 5)
7#define HWCAP_MIPS_SMARTMIPS (1 << 6)
8#define HWCAP_MIPS_DSP (1 << 7)
9#define HWCAP_MIPS_DSP2 (1 << 8)
10#define HWCAP_MIPS_DSP3 (1 << 9)
11#define HWCAP_MIPS_MIPS16E2 (1 << 10)
12#define HWCAP_LOONGSON_MMI (1 << 11)
13#define HWCAP_LOONGSON_EXT (1 << 12)
14#define HWCAP_LOONGSON_EXT2 (1 << 13)
lib/libc/musl/arch/mips/bits/ioctl.h+2-2
......@@ -110,5 +110,5 @@
110110#define SIOCATMARK _IOR('s', 7, int)
111111#define SIOCSPGRP _IOW('s', 8, pid_t)
112112#define SIOCGPGRP _IOR('s', 9, pid_t)
113#define SIOCGSTAMP 0x8906
114#define SIOCGSTAMPNS 0x8907
113#define SIOCGSTAMP _IOR(0x89, 6, char[16])
114#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
lib/libc/musl/arch/mips/bits/ipcstat.h+1-1
......@@ -1 +1 @@
1#define IPC_STAT 2
1#define IPC_STAT 0x102
lib/libc/musl/arch/mips/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 32
4#endif
5
6#define LONG_MAX 0x7fffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/mips/bits/msg.h+15-12
......@@ -1,19 +1,19 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
33#if _MIPSEL || __MIPSEL || __MIPSEL__
4 time_t msg_stime;
5 int __unused1;
6 time_t msg_rtime;
7 int __unused2;
8 time_t msg_ctime;
9 int __unused3;
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_stime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_rtime_hi;
8 unsigned long __msg_ctime_lo;
9 unsigned long __msg_ctime_hi;
1010#else
11 int __unused1;
12 time_t msg_stime;
13 int __unused2;
14 time_t msg_rtime;
15 int __unused3;
16 time_t msg_ctime;
11 unsigned long __msg_stime_hi;
12 unsigned long __msg_stime_lo;
13 unsigned long __msg_rtime_hi;
14 unsigned long __msg_rtime_lo;
15 unsigned long __msg_ctime_hi;
16 unsigned long __msg_ctime_lo;
1717#endif
1818 unsigned long msg_cbytes;
1919 msgqnum_t msg_qnum;
......@@ -21,4 +21,7 @@ struct msqid_ds {
2121 pid_t msg_lspid;
2222 pid_t msg_lrpid;
2323 unsigned long __unused[2];
24 time_t msg_stime;
25 time_t msg_rtime;
26 time_t msg_ctime;
2427};
lib/libc/musl/arch/mips/bits/sem.h+6-4
......@@ -1,7 +1,7 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_ctime_lo;
55#if __BYTE_ORDER == __LITTLE_ENDIAN
66 unsigned short sem_nsems;
77 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
......@@ -9,6 +9,8 @@ struct semid_ds {
99 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
1010 unsigned short sem_nsems;
1111#endif
12 long __unused3;
13 long __unused4;
12 unsigned long __sem_otime_hi;
13 unsigned long __sem_ctime_hi;
14 time_t sem_otime;
15 time_t sem_ctime;
1416};
lib/libc/musl/arch/mips/bits/shm.h+10-5
......@@ -3,14 +3,19 @@
33struct shmid_ds {
44 struct ipc_perm shm_perm;
55 size_t shm_segsz;
6 time_t shm_atime;
7 time_t shm_dtime;
8 time_t shm_ctime;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_lo;
8 unsigned long __shm_ctime_lo;
99 pid_t shm_cpid;
1010 pid_t shm_lpid;
1111 unsigned long shm_nattch;
12 unsigned long __pad1;
13 unsigned long __pad2;
12 unsigned short __shm_atime_hi;
13 unsigned short __shm_dtime_hi;
14 unsigned short __shm_ctime_hi;
15 unsigned short __pad1;
16 time_t shm_atime;
17 time_t shm_dtime;
18 time_t shm_ctime;
1419};
1520
1621struct shminfo {
lib/libc/musl/arch/mips/bits/signal.h+6-2
......@@ -19,14 +19,18 @@ typedef struct {
1919} fpregset_t;
2020struct sigcontext {
2121 unsigned sc_regmask, sc_status;
22 unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
22 unsigned long long sc_pc;
23 gregset_t sc_regs;
24 fpregset_t sc_fpregs;
2325 unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
2426 unsigned long long sc_mdhi, sc_mdlo;
2527 unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
2628};
2729typedef struct {
2830 unsigned regmask, status;
29 unsigned long long pc, gregs[32], fpregs[32];
31 unsigned long long pc;
32 gregset_t gregs;
33 fpregset_t fpregs;
3034 unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
3135 unsigned long long mdhi, mdlo;
3236 unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
lib/libc/musl/arch/mips/bits/socket.h-18
......@@ -1,19 +1,3 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
16
171#define SOCK_STREAM 2
182#define SOCK_DGRAM 1
193
......@@ -32,8 +16,6 @@ struct cmsghdr {
3216#define SO_RCVBUF 0x1002
3317#define SO_SNDLOWAT 0x1003
3418#define SO_RCVLOWAT 0x1004
35#define SO_RCVTIMEO 0x1006
36#define SO_SNDTIMEO 0x1005
3719#define SO_ERROR 0x1007
3820#define SO_TYPE 0x1008
3921#define SO_ACCEPTCONN 0x1009
lib/libc/musl/arch/mips/bits/stat.h+8-4
......@@ -12,11 +12,15 @@ struct stat {
1212 dev_t st_rdev;
1313 long __st_padding2[2];
1414 off_t st_size;
15 struct timespec st_atim;
16 struct timespec st_mtim;
17 struct timespec st_ctim;
15 struct {
16 long tv_sec;
17 long tv_nsec;
18 } __st_atim32, __st_mtim32, __st_ctim32;
1819 blksize_t st_blksize;
1920 long __st_padding3;
2021 blkcnt_t st_blocks;
21 long __st_padding4[14];
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25 long __st_padding4[2];
2226};
lib/libc/musl/arch/mips/bits/syscall.h.in+12-10
......@@ -76,8 +76,8 @@
7676#define __NR_setrlimit 4075
7777#define __NR_getrlimit 4076
7878#define __NR_getrusage 4077
79#define __NR_gettimeofday 4078
80#define __NR_settimeofday 4079
79#define __NR_gettimeofday_time32 4078
80#define __NR_settimeofday_time32 4079
8181#define __NR_getgroups 4080
8282#define __NR_setgroups 4081
8383#define __NR_reserved82 4082
......@@ -256,14 +256,14 @@
256256#define __NR_statfs64 4255
257257#define __NR_fstatfs64 4256
258258#define __NR_timer_create 4257
259#define __NR_timer_settime 4258
260#define __NR_timer_gettime 4259
259#define __NR_timer_settime32 4258
260#define __NR_timer_gettime32 4259
261261#define __NR_timer_getoverrun 4260
262262#define __NR_timer_delete 4261
263#define __NR_clock_settime 4262
264#define __NR_clock_gettime 4263
265#define __NR_clock_getres 4264
266#define __NR_clock_nanosleep 4265
263#define __NR_clock_settime32 4262
264#define __NR_clock_gettime32 4263
265#define __NR_clock_getres_time32 4264
266#define __NR_clock_nanosleep_time32 4265
267267#define __NR_tgkill 4266
268268#define __NR_utimes 4267
269269#define __NR_mbind 4268
......@@ -319,8 +319,8 @@
319319#define __NR_eventfd 4319
320320#define __NR_fallocate 4320
321321#define __NR_timerfd_create 4321
322#define __NR_timerfd_gettime 4322
323#define __NR_timerfd_settime 4323
322#define __NR_timerfd_gettime32 4322
323#define __NR_timerfd_settime32 4323
324324#define __NR_signalfd4 4324
325325#define __NR_eventfd2 4325
326326#define __NR_epoll_create1 4326
......@@ -406,4 +406,6 @@
406406#define __NR_fsconfig 4431
407407#define __NR_fsmount 4432
408408#define __NR_fspick 4433
409#define __NR_pidfd_open 4434
410#define __NR_clone3 4435
409411
lib/libc/musl/arch/mips/reloc.h-2
......@@ -1,5 +1,3 @@
1#include <endian.h>
2
31#if __mips_isa_rev >= 6
42#define ISA_SUFFIX "r6"
53#else
lib/libc/musl/arch/mips/syscall_arch.h+3-1
......@@ -142,7 +142,9 @@ static inline long __syscall7(long n, long a, long b, long c, long d, long e, lo
142142}
143143
144144#define VDSO_USEFUL
145#define VDSO_CGT_SYM "__vdso_clock_gettime"
145#define VDSO_CGT32_SYM "__vdso_clock_gettime"
146#define VDSO_CGT32_VER "LINUX_2.6"
147#define VDSO_CGT_SYM "__vdso_clock_gettime64"
146148#define VDSO_CGT_VER "LINUX_2.6"
147149
148150#define SO_SNDTIMEO_OLD 0x1005
lib/libc/musl/arch/mips64/bits/alltypes.h.in+7-13
......@@ -2,8 +2,13 @@
22#define _Int64 long
33#define _Reg long
44
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
5#if _MIPSEL || __MIPSEL || __MIPSEL__
6#define __BYTE_ORDER 1234
7#else
8#define __BYTE_ORDER 4321
9#endif
10
11#define __LONG_MAX 0x7fffffffffffffffL
712
813#ifndef __cplusplus
914TYPEDEF int wchar_t;
......@@ -14,15 +19,4 @@ TYPEDEF double double_t;
1419
1520TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
1621
17TYPEDEF long time_t;
18TYPEDEF long suseconds_t;
19
2022TYPEDEF unsigned nlink_t;
21
22TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
23TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
24TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
25TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
26TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
27TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
28TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/mips64/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if _MIPSEL || __MIPSEL || __MIPSEL__
2#define __BYTE_ORDER __LITTLE_ENDIAN
3#else
4#define __BYTE_ORDER __BIG_ENDIAN
5#endif
lib/libc/musl/arch/mips64/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/mips64/bits/socket.h-34
......@@ -1,37 +1,3 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
34
351#define SOCK_STREAM 2
362#define SOCK_DGRAM 1
373#define SOL_SOCKET 65535
lib/libc/musl/arch/mips64/bits/syscall.h.in+2
......@@ -336,4 +336,6 @@
336336#define __NR_fsconfig 5431
337337#define __NR_fsmount 5432
338338#define __NR_fspick 5433
339#define __NR_pidfd_open 5434
340#define __NR_clone3 5435
339341
lib/libc/musl/arch/mips64/reloc.h+2-8
......@@ -1,9 +1,3 @@
1#ifndef __RELOC_H__
2#define __RELOC_H__
3
4#define _GNU_SOURCE
5#include <endian.h>
6
71#if __mips_isa_rev >= 6
82#define ISA_SUFFIX "r6"
93#else
......@@ -33,6 +27,8 @@
3327#define REL_DTPOFF R_MIPS_TLS_DTPREL64
3428#define REL_TPOFF R_MIPS_TLS_TPREL64
3529
30#include <endian.h>
31
3632#undef R_TYPE
3733#undef R_SYM
3834#undef R_INFO
......@@ -62,5 +58,3 @@
6258 " daddu %0, %0, $ra \n" \
6359 ".set pop \n" \
6460 : "=r"(*(fp)) : : "memory", "ra" )
65
66#endif
lib/libc/musl/arch/powerpc/bits/alltypes.h.in+3-13
......@@ -1,9 +1,10 @@
1#define _REDIR_TIME64 1
12#define _Addr int
23#define _Int64 long long
34#define _Reg int
45
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
6#define __BYTE_ORDER 4321
7#define __LONG_MAX 0x7fffffffL
78
89#ifndef __cplusplus
910#ifdef __WCHAR_TYPE__
......@@ -17,14 +18,3 @@ TYPEDEF float float_t;
1718TYPEDEF double double_t;
1819
1920TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
20
21TYPEDEF long time_t;
22TYPEDEF long suseconds_t;
23
24TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
25TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
26TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
27TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
28TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
29TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
30TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/powerpc/bits/endian.h deleted-15
......@@ -1,15 +0,0 @@
1#ifdef __BIG_ENDIAN__
2 #if __BIG_ENDIAN__
3 #define __BYTE_ORDER __BIG_ENDIAN
4 #endif
5#endif /* __BIG_ENDIAN__ */
6
7#ifdef __LITTLE_ENDIAN__
8 #if __LITTLE_ENDIAN__
9 #define __BYTE_ORDER __LITTLE_ENDIAN
10 #endif
11#endif /* __LITTLE_ENDIAN__ */
12
13#ifndef __BYTE_ORDER
14 #define __BYTE_ORDER __BIG_ENDIAN
15#endif
lib/libc/musl/arch/powerpc/bits/ioctl.h+2-2
......@@ -116,5 +116,5 @@
116116#define FIOGETOWN 0x8903
117117#define SIOCGPGRP 0x8904
118118#define SIOCATMARK 0x8905
119#define SIOCGSTAMP 0x8906
120#define SIOCGSTAMPNS 0x8907
119#define SIOCGSTAMP _IOR(0x89, 6, char[16])
120#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
lib/libc/musl/arch/powerpc/bits/ipcstat.h+1-1
......@@ -1 +1 @@
1#define IPC_STAT 2
1#define IPC_STAT 0x102
lib/libc/musl/arch/powerpc/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 32
4#endif
5
6#define LONG_MAX 0x7fffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/powerpc/bits/msg.h+9-6
......@@ -1,15 +1,18 @@
11struct msqid_ds {
22 struct ipc_perm msg_perm;
3 int __unused1;
4 time_t msg_stime;
5 int __unused2;
6 time_t msg_rtime;
7 int __unused3;
8 time_t msg_ctime;
3 unsigned long __msg_stime_hi;
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_rtime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_ctime_hi;
8 unsigned long __msg_ctime_lo;
99 unsigned long msg_cbytes;
1010 msgqnum_t msg_qnum;
1111 msglen_t msg_qbytes;
1212 pid_t msg_lspid;
1313 pid_t msg_lrpid;
1414 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
1518};
lib/libc/musl/arch/powerpc/bits/sem.h+6-4
......@@ -1,10 +1,12 @@
11struct semid_ds {
22 struct ipc_perm sem_perm;
3 int __unused1;
4 time_t sem_otime;
5 int __unused2;
6 time_t sem_ctime;
3 unsigned long __sem_otime_hi;
4 unsigned long __sem_otime_lo;
5 unsigned long __sem_ctime_hi;
6 unsigned long __sem_ctime_lo;
77 unsigned short __sem_nsems_pad, sem_nsems;
88 long __unused3;
99 long __unused4;
10 time_t sem_otime;
11 time_t sem_ctime;
1012};
lib/libc/musl/arch/powerpc/bits/shm.h+9-7
......@@ -2,19 +2,21 @@
22
33struct shmid_ds {
44 struct ipc_perm shm_perm;
5 int __unused1;
6 time_t shm_atime;
7 int __unused2;
8 time_t shm_dtime;
9 int __unused3;
10 time_t shm_ctime;
11 int __unused4;
5 unsigned long __shm_atime_hi;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_ctime_hi;
10 unsigned long __shm_ctime_lo;
1211 size_t shm_segsz;
1312 pid_t shm_cpid;
1413 pid_t shm_lpid;
1514 unsigned long shm_nattch;
1615 unsigned long __pad1;
1716 unsigned long __pad2;
17 time_t shm_atime;
18 time_t shm_dtime;
19 time_t shm_ctime;
1820};
1921
2022struct shminfo {
lib/libc/musl/arch/powerpc/bits/signal.h+1-1
......@@ -28,7 +28,7 @@ struct sigcontext {
2828 int signal;
2929 unsigned long handler;
3030 unsigned long oldmask;
31 void *regs;
31 struct pt_regs *regs;
3232};
3333
3434typedef struct {
lib/libc/musl/arch/powerpc/bits/socket.h-18
......@@ -1,19 +1,3 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
16
171#define SO_DEBUG 1
182#define SO_REUSEADDR 2
193#define SO_TYPE 3
......@@ -31,8 +15,6 @@ struct cmsghdr {
3115#define SO_REUSEPORT 15
3216#define SO_RCVLOWAT 16
3317#define SO_SNDLOWAT 17
34#define SO_RCVTIMEO 18
35#define SO_SNDTIMEO 19
3618#define SO_PASSCRED 20
3719#define SO_PEERCRED 21
3820#define SO_ACCEPTCONN 30
lib/libc/musl/arch/powerpc/bits/stat.h+5-1
......@@ -13,8 +13,12 @@ struct stat {
1313 off_t st_size;
1414 blksize_t st_blksize;
1515 blkcnt_t st_blocks;
16 struct {
17 long tv_sec;
18 long tv_nsec;
19 } __st_atim32, __st_mtim32, __st_ctim32;
20 unsigned __unused[2];
1621 struct timespec st_atim;
1722 struct timespec st_mtim;
1823 struct timespec st_ctim;
19 unsigned __unused[2];
2024};
lib/libc/musl/arch/powerpc/bits/syscall.h.in+12-10
......@@ -76,8 +76,8 @@
7676#define __NR_setrlimit 75
7777#define __NR_getrlimit 76
7878#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
8181#define __NR_getgroups 80
8282#define __NR_setgroups 81
8383#define __NR_select 82
......@@ -238,14 +238,14 @@
238238#define __NR_epoll_wait 238
239239#define __NR_remap_file_pages 239
240240#define __NR_timer_create 240
241#define __NR_timer_settime 241
242#define __NR_timer_gettime 242
241#define __NR_timer_settime32 241
242#define __NR_timer_gettime32 242
243243#define __NR_timer_getoverrun 243
244244#define __NR_timer_delete 244
245#define __NR_clock_settime 245
246#define __NR_clock_gettime 246
247#define __NR_clock_getres 247
248#define __NR_clock_nanosleep 248
245#define __NR_clock_settime32 245
246#define __NR_clock_gettime32 246
247#define __NR_clock_getres_time32 247
248#define __NR_clock_nanosleep_time32 248
249249#define __NR_swapcontext 249
250250#define __NR_tgkill 250
251251#define __NR_utimes 251
......@@ -307,8 +307,8 @@
307307#define __NR_sync_file_range2 308
308308#define __NR_fallocate 309
309309#define __NR_subpage_prot 310
310#define __NR_timerfd_settime 311
311#define __NR_timerfd_gettime 312
310#define __NR_timerfd_settime32 311
311#define __NR_timerfd_gettime32 312
312312#define __NR_signalfd4 313
313313#define __NR_eventfd2 314
314314#define __NR_epoll_create1 315
......@@ -413,4 +413,6 @@
413413#define __NR_fsconfig 431
414414#define __NR_fsmount 432
415415#define __NR_fspick 433
416#define __NR_pidfd_open 434
417#define __NR_clone3 435
416418
lib/libc/musl/arch/powerpc64/bits/alltypes.h.in+7-13
......@@ -2,8 +2,13 @@
22#define _Int64 long
33#define _Reg long
44
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
5#if __BIG_ENDIAN__
6#define __BYTE_ORDER 4321
7#else
8#define __BYTE_ORDER 1234
9#endif
10
11#define __LONG_MAX 0x7fffffffffffffffL
712
813#ifndef __cplusplus
914TYPEDEF int wchar_t;
......@@ -13,14 +18,3 @@ TYPEDEF float float_t;
1318TYPEDEF double double_t;
1419
1520TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
16
17TYPEDEF long time_t;
18TYPEDEF long suseconds_t;
19
20TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
21TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
22TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
23TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
24TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
25TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
26TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/powerpc64/bits/endian.h deleted-5
......@@ -1,5 +0,0 @@
1#if __BIG_ENDIAN__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
lib/libc/musl/arch/powerpc64/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/powerpc64/bits/signal.h+2-6
......@@ -9,11 +9,7 @@
99#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
1010
1111typedef unsigned long greg_t, gregset_t[48];
12
13typedef struct {
14 double fpregs[32];
15 double fpscr;
16} fpregset_t;
12typedef double fpregset_t[33];
1713
1814typedef struct {
1915#ifdef __GNUC__
......@@ -36,7 +32,7 @@ typedef struct sigcontext {
3632 int _pad0;
3733 unsigned long handler;
3834 unsigned long oldmask;
39 void *regs;
35 struct pt_regs *regs;
4036 gregset_t gp_regs;
4137 fpregset_t fp_regs;
4238 vrregset_t *v_regs;
lib/libc/musl/arch/powerpc64/bits/socket.h-34
......@@ -1,37 +1,3 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
34
351#define SO_DEBUG 1
362#define SO_REUSEADDR 2
373#define SO_TYPE 3
lib/libc/musl/arch/powerpc64/bits/syscall.h.in+2
......@@ -385,4 +385,6 @@
385385#define __NR_fsconfig 431
386386#define __NR_fsmount 432
387387#define __NR_fspick 433
388#define __NR_pidfd_open 434
389#define __NR_clone3 435
388390
lib/libc/musl/arch/powerpc64/reloc.h-2
......@@ -1,5 +1,3 @@
1#include <endian.h>
2
31#if __BYTE_ORDER == __LITTLE_ENDIAN
42#define ENDIAN_SUFFIX "le"
53#else
lib/libc/musl/arch/riscv64/atomic_arch.h+1-1
......@@ -15,7 +15,7 @@ static inline int a_cas(volatile int *p, int t, int s)
1515 " bnez %1, 1b\n"
1616 "1:"
1717 : "=&r"(old), "=&r"(tmp)
18 : "r"(p), "r"(t), "r"(s)
18 : "r"(p), "r"((long)t), "r"((long)s)
1919 : "memory");
2020 return old;
2121}
lib/libc/musl/arch/riscv64/bits/alltypes.h.in+2-13
......@@ -2,8 +2,8 @@
22#define _Int64 long
33#define _Reg long
44
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffffffffffL
77
88#ifndef __cplusplus
99TYPEDEF int wchar_t;
......@@ -16,14 +16,3 @@ TYPEDEF float float_t;
1616TYPEDEF double double_t;
1717
1818TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
19
20TYPEDEF long time_t;
21TYPEDEF long suseconds_t;
22
23TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
24TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
25TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
26TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
27TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
28TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
29TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/riscv64/bits/endian.h deleted-1
......@@ -1 +0,0 @@
1#define __BYTE_ORDER __LITTLE_ENDIAN
lib/libc/musl/arch/riscv64/bits/limits.h deleted-7
......@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/riscv64/bits/reg.h-6
......@@ -1,8 +1,2 @@
11#undef __WORDSIZE
22#define __WORDSIZE 64
3#define REG_PC 0
4#define REG_RA 1
5#define REG_SP 2
6#define REG_TP 4
7#define REG_S0 8
8#define REG_A0 10
lib/libc/musl/arch/riscv64/bits/signal.h+9
......@@ -35,6 +35,15 @@ typedef struct mcontext_t {
3535 union __riscv_mc_fp_state __fpregs;
3636} mcontext_t;
3737
38#if defined(_GNU_SOURCE)
39#define REG_PC 0
40#define REG_RA 1
41#define REG_SP 2
42#define REG_TP 4
43#define REG_S0 8
44#define REG_A0 10
45#endif
46
3847#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3948typedef unsigned long greg_t;
4049typedef unsigned long gregset_t[32];
lib/libc/musl/arch/riscv64/bits/socket.h deleted-19
......@@ -1,19 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7 int msg_iovlen, __pad1;
8 void *msg_control;
9 socklen_t msg_controllen;
10 int __pad2;
11 int msg_flags;
12};
13
14struct cmsghdr {
15 socklen_t cmsg_len;
16 int __pad1;
17 int cmsg_level;
18 int cmsg_type;
19};
lib/libc/musl/arch/riscv64/bits/syscall.h.in+2
......@@ -287,6 +287,8 @@
287287#define __NR_fsconfig 431
288288#define __NR_fsmount 432
289289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
290292
291293#define __NR_sysriscv __NR_arch_specific_syscall
292294#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
lib/libc/musl/arch/s390x/bits/alltypes.h.in+2-13
......@@ -2,8 +2,8 @@
22#define _Int64 long
33#define _Reg long
44
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
5#define __BYTE_ORDER 4321
6#define __LONG_MAX 0x7fffffffffffffffL
77
88#ifndef __cplusplus
99TYPEDEF int wchar_t;
......@@ -13,14 +13,3 @@ TYPEDEF double float_t;
1313TYPEDEF double double_t;
1414
1515TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
16
17TYPEDEF long time_t;
18TYPEDEF long suseconds_t;
19
20TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
21TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
22TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
23TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
24TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
25TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
26TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/s390x/bits/endian.h deleted-1
......@@ -1 +0,0 @@
1#define __BYTE_ORDER __BIG_ENDIAN
lib/libc/musl/arch/s390x/bits/limits.h-7
......@@ -1,8 +1 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
31#define PAGESIZE 4096
4#define LONG_BIT 64
5#endif
6
7#define LONG_MAX 0x7fffffffffffffffL
8#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/s390x/bits/socket.h deleted-17
......@@ -1,17 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int __pad1, msg_iovlen;
6 void *msg_control;
7 int __pad2;
8 socklen_t msg_controllen;
9 int msg_flags;
10};
11
12struct cmsghdr {
13 int __pad1;
14 socklen_t cmsg_len;
15 int cmsg_level;
16 int cmsg_type;
17};
lib/libc/musl/arch/s390x/bits/syscall.h.in+2
......@@ -350,4 +350,6 @@
350350#define __NR_fsconfig 431
351351#define __NR_fsmount 432
352352#define __NR_fspick 433
353#define __NR_pidfd_open 434
354#define __NR_clone3 435
353355
lib/libc/musl/arch/s390x/reloc.h-2
......@@ -1,5 +1,3 @@
1#include <endian.h>
2
31#define LDSO_ARCH "s390x"
42
53#define REL_SYMBOLIC R_390_64
lib/libc/musl/arch/x86_64/bits/alltypes.h.in+2-13
......@@ -2,8 +2,8 @@
22#define _Int64 long
33#define _Reg long
44
5TYPEDEF __builtin_va_list va_list;
6TYPEDEF __builtin_va_list __isoc_va_list;
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffffffffffL
77
88#ifndef __cplusplus
99TYPEDEF int wchar_t;
......@@ -18,14 +18,3 @@ TYPEDEF double double_t;
1818#endif
1919
2020TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
21
22TYPEDEF long time_t;
23TYPEDEF long suseconds_t;
24
25TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
26TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
27TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
28TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
29TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
30TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
31TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
lib/libc/musl/arch/x86_64/bits/endian.h deleted-1
......@@ -1 +0,0 @@
1#define __BYTE_ORDER __LITTLE_ENDIAN
lib/libc/musl/arch/x86_64/bits/limits.h-7
......@@ -1,8 +1 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
31#define PAGESIZE 4096
4#define LONG_BIT 64
5#endif
6
7#define LONG_MAX 0x7fffffffffffffffL
8#define LLONG_MAX 0x7fffffffffffffffLL
lib/libc/musl/arch/x86_64/bits/socket.h deleted-16
......@@ -1,16 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen, __pad1;
6 void *msg_control;
7 socklen_t msg_controllen, __pad2;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int __pad1;
14 int cmsg_level;
15 int cmsg_type;
16};
lib/libc/musl/arch/x86_64/bits/syscall.h.in+2
......@@ -343,4 +343,6 @@
343343#define __NR_fsconfig 431
344344#define __NR_fsmount 432
345345#define __NR_fspick 433
346#define __NR_pidfd_open 434
347#define __NR_clone3 435
346348
lib/libc/musl/compat/time32/__xstat.c created+24
......@@ -0,0 +1,24 @@
1#include "time32.h"
2#include <sys/stat.h>
3
4struct stat32;
5
6int __fxstat64(int ver, int fd, struct stat32 *buf)
7{
8 return __fstat_time32(fd, buf);
9}
10
11int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf, int flag)
12{
13 return __fstatat_time32(fd, path, buf, flag);
14}
15
16int __lxstat64(int ver, const char *path, struct stat32 *buf)
17{
18 return __lstat_time32(path, buf);
19}
20
21int __xstat64(int ver, const char *path, struct stat32 *buf)
22{
23 return __stat_time32(path, buf);
24}
lib/libc/musl/compat/time32/adjtime32.c created+21
......@@ -0,0 +1,21 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/timex.h>
6
7int __adjtime32(const struct timeval32 *in32, struct timeval32 *out32)
8{
9 struct timeval out;
10 int r = adjtime((&(struct timeval){
11 .tv_sec = in32->tv_sec,
12 .tv_usec = in32->tv_usec}), &out);
13 if (r) return r;
14 /* We can't range-check the result because success was already
15 * committed by the above call. */
16 if (out32) {
17 out32->tv_sec = out.tv_sec;
18 out32->tv_usec = out.tv_usec;
19 }
20 return r;
21}
lib/libc/musl/compat/time32/adjtimex_time32.c created+10
......@@ -0,0 +1,10 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/timex.h>
4
5struct timex32;
6
7int __adjtimex_time32(struct timex32 *tx32)
8{
9 return __clock_adjtime32(CLOCK_REALTIME, tx32);
10}
lib/libc/musl/compat/time32/aio_suspend_time32.c created+11
......@@ -0,0 +1,11 @@
1#include "time32.h"
2#include <time.h>
3#include <aio.h>
4
5int __aio_suspend_time32(const struct aiocb *const cbs[], int cnt, const struct timespec32 *ts32)
6{
7 return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
10
11weak_alias(aio_suspend, aio_suspend64);
lib/libc/musl/compat/time32/clock_adjtime32.c created+70
......@@ -0,0 +1,70 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4#include <sys/timex.h>
5#include <string.h>
6#include <stddef.h>
7
8struct timex32 {
9 unsigned modes;
10 long offset, freq, maxerror, esterror;
11 int status;
12 long constant, precision, tolerance;
13 struct timeval32 time;
14 long tick, ppsfreq, jitter;
15 int shift;
16 long stabil, jitcnt, calcnt, errcnt, stbcnt;
17 int tai;
18 int __padding[11];
19};
20
21int __clock_adjtime32(clockid_t clock_id, struct timex32 *tx32)
22{
23 struct timex utx = {
24 .modes = tx32->modes,
25 .offset = tx32->offset,
26 .freq = tx32->freq,
27 .maxerror = tx32->maxerror,
28 .esterror = tx32->esterror,
29 .status = tx32->status,
30 .constant = tx32->constant,
31 .precision = tx32->precision,
32 .tolerance = tx32->tolerance,
33 .time.tv_sec = tx32->time.tv_sec,
34 .time.tv_usec = tx32->time.tv_usec,
35 .tick = tx32->tick,
36 .ppsfreq = tx32->ppsfreq,
37 .jitter = tx32->jitter,
38 .shift = tx32->shift,
39 .stabil = tx32->stabil,
40 .jitcnt = tx32->jitcnt,
41 .calcnt = tx32->calcnt,
42 .errcnt = tx32->errcnt,
43 .stbcnt = tx32->stbcnt,
44 .tai = tx32->tai,
45 };
46 int r = clock_adjtime(clock_id, &utx);
47 if (r<0) return r;
48 tx32->modes = utx.modes;
49 tx32->offset = utx.offset;
50 tx32->freq = utx.freq;
51 tx32->maxerror = utx.maxerror;
52 tx32->esterror = utx.esterror;
53 tx32->status = utx.status;
54 tx32->constant = utx.constant;
55 tx32->precision = utx.precision;
56 tx32->tolerance = utx.tolerance;
57 tx32->time.tv_sec = utx.time.tv_sec;
58 tx32->time.tv_usec = utx.time.tv_usec;
59 tx32->tick = utx.tick;
60 tx32->ppsfreq = utx.ppsfreq;
61 tx32->jitter = utx.jitter;
62 tx32->shift = utx.shift;
63 tx32->stabil = utx.stabil;
64 tx32->jitcnt = utx.jitcnt;
65 tx32->calcnt = utx.calcnt;
66 tx32->errcnt = utx.errcnt;
67 tx32->stbcnt = utx.stbcnt;
68 tx32->tai = utx.tai;
69 return r;
70}
lib/libc/musl/compat/time32/clock_getres_time32.c created+13
......@@ -0,0 +1,13 @@
1#include "time32.h"
2#include <time.h>
3
4int __clock_getres_time32(clockid_t clk, struct timespec32 *ts32)
5{
6 struct timespec ts;
7 int r = clock_getres(clk, &ts);
8 if (!r && ts32) {
9 ts32->tv_sec = ts.tv_sec;
10 ts32->tv_nsec = ts.tv_nsec;
11 }
12 return r;
13}
lib/libc/musl/compat/time32/clock_gettime32.c created+18
......@@ -0,0 +1,18 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6int __clock_gettime32(clockid_t clk, struct timespec32 *ts32)
7{
8 struct timespec ts;
9 int r = clock_gettime(clk, &ts);
10 if (r) return r;
11 if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) {
12 errno = EOVERFLOW;
13 return -1;
14 }
15 ts32->tv_sec = ts.tv_sec;
16 ts32->tv_nsec = ts.tv_nsec;
17 return 0;
18}
lib/libc/musl/compat/time32/clock_nanosleep_time32.c created+15
......@@ -0,0 +1,15 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4
5int __clock_nanosleep_time32(clockid_t clk, int flags, const struct timespec32 *req32, struct timespec32 *rem32)
6{
7 struct timespec rem;
8 int ret = clock_nanosleep(clk, flags, (&(struct timespec){
9 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
10 if (ret==EINTR && rem32 && !(flags & TIMER_ABSTIME)) {
11 rem32->tv_sec = rem.tv_sec;
12 rem32->tv_nsec = rem.tv_nsec;
13 }
14 return ret;
15}
lib/libc/musl/compat/time32/clock_settime32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3
4int __clock_settime32(clockid_t clk, const struct timespec32 *ts32)
5{
6 return clock_settime(clk, (&(struct timespec){
7 .tv_sec = ts32->tv_sec,
8 .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/cnd_timedwait_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <threads.h>
4
5int __cnd_timedwait_time32(cnd_t *restrict c, mtx_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return cnd_timedwait(c, m, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
lib/libc/musl/compat/time32/ctime32.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4char *__ctime32(time32_t *t)
5{
6 return ctime(&(time_t){*t});
7}
lib/libc/musl/compat/time32/ctime32_r.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4char *__ctime32_r(time32_t *t, char *buf)
5{
6 return ctime_r(&(time_t){*t}, buf);
7}
lib/libc/musl/compat/time32/difftime32.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4double __difftime32(time32_t t1, time32_t t2)
5{
6 return difftime(t1, t2);
7}
lib/libc/musl/compat/time32/fstat_time32.c created+17
......@@ -0,0 +1,17 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __fstat_time32(int fd, struct stat32 *restrict st32)
10{
11 struct stat st;
12 int r = fstat(fd, &st);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(fstat, fstat64);
lib/libc/musl/compat/time32/fstatat_time32.c created+17
......@@ -0,0 +1,17 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __fstatat_time32(int fd, const char *restrict path, struct stat32 *restrict st32, int flag)
10{
11 struct stat st;
12 int r = fstatat(fd, path, &st, flag);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(fstatat, fstatat64);
lib/libc/musl/compat/time32/ftime32.c created+25
......@@ -0,0 +1,25 @@
1#include "time32.h"
2#include <sys/timeb.h>
3#include <errno.h>
4#include <stdint.h>
5
6struct timeb32 {
7 int32_t time;
8 unsigned short millitm;
9 short timezone, dstflag;
10};
11
12int __ftime32(struct timeb32 *tp)
13{
14 struct timeb tb;
15 if (ftime(&tb) < 0) return -1;
16 if (tb.time < INT32_MIN || tb.time > INT32_MAX) {
17 errno = EOVERFLOW;
18 return -1;
19 }
20 tp->time = tb.time;
21 tp->millitm = tb.millitm;
22 tp->timezone = tb.timezone;
23 tp->dstflag = tb.dstflag;
24 return 0;
25}
lib/libc/musl/compat/time32/futimens_time32.c created+10
......@@ -0,0 +1,10 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/stat.h>
4
5int __futimens_time32(int fd, const struct timespec32 *times32)
6{
7 return futimens(fd, !times32 ? 0 : ((struct timespec[2]){
8 {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec},
9 {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}));
10}
lib/libc/musl/compat/time32/futimes_time32.c created+12
......@@ -0,0 +1,12 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/stat.h>
6
7int __futimes_time32(int fd, const struct timeval32 times32[2])
8{
9 return futimes(fd, !times32 ? 0 : ((struct timeval[2]){
10 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
11 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
12}
lib/libc/musl/compat/time32/futimesat_time32.c created+12
......@@ -0,0 +1,12 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/stat.h>
6
7int __futimesat_time32(int dirfd, const char *pathname, const struct timeval32 times32[2])
8{
9 return futimesat(dirfd, pathname, !times32 ? 0 : ((struct timeval[2]){
10 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
11 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
12}
lib/libc/musl/compat/time32/getitimer_time32.c created+15
......@@ -0,0 +1,15 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4
5int __getitimer_time32(int which, struct itimerval32 *old32)
6{
7 struct itimerval old;
8 int r = getitimer(which, &old);
9 if (r) return r;
10 old32->it_interval.tv_sec = old.it_interval.tv_sec;
11 old32->it_interval.tv_usec = old.it_interval.tv_usec;
12 old32->it_value.tv_sec = old.it_value.tv_sec;
13 old32->it_value.tv_usec = old.it_value.tv_usec;
14 return 0;
15}
lib/libc/musl/compat/time32/getrusage_time32.c created+39
......@@ -0,0 +1,39 @@
1#include "time32.h"
2#include <string.h>
3#include <stddef.h>
4#include <sys/resource.h>
5
6struct compat_rusage {
7 struct timeval32 ru_utime;
8 struct timeval32 ru_stime;
9 long ru_maxrss;
10 long ru_ixrss;
11 long ru_idrss;
12 long ru_isrss;
13 long ru_minflt;
14 long ru_majflt;
15 long ru_nswap;
16 long ru_inblock;
17 long ru_oublock;
18 long ru_msgsnd;
19 long ru_msgrcv;
20 long ru_nsignals;
21 long ru_nvcsw;
22 long ru_nivcsw;
23};
24
25int __getrusage_time32(int who, struct compat_rusage *usage)
26{
27 struct rusage ru;
28 int r = getrusage(who, &ru);
29 if (!r) {
30 usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
31 usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
32 usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
33 usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
34 memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
35 sizeof(struct compat_rusage) -
36 offsetof(struct compat_rusage, ru_maxrss));
37 }
38 return r;
39}
lib/libc/musl/compat/time32/gettimeofday_time32.c created+19
......@@ -0,0 +1,19 @@
1#include "time32.h"
2#include <sys/time.h>
3#include <errno.h>
4#include <stdint.h>
5
6int __gettimeofday_time32(struct timeval32 *tv32, void *tz)
7{
8 struct timeval tv;
9 if (!tv32) return 0;
10 int r = gettimeofday(&tv, 0);
11 if (r) return r;
12 if (tv.tv_sec < INT32_MIN || tv.tv_sec > INT32_MAX) {
13 errno = EOVERFLOW;
14 return -1;
15 }
16 tv32->tv_sec = tv.tv_sec;
17 tv32->tv_usec = tv.tv_usec;
18 return 0;
19}
lib/libc/musl/compat/time32/gmtime32.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__gmtime32(time32_t *t)
5{
6 return gmtime(&(time_t){*t});
7}
lib/libc/musl/compat/time32/gmtime32_r.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__gmtime32_r(time32_t *t, struct tm *tm)
5{
6 return gmtime_r(&(time_t){*t}, tm);
7}
lib/libc/musl/compat/time32/localtime32.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__localtime32(time32_t *t)
5{
6 return localtime(&(time_t){*t});
7}
lib/libc/musl/compat/time32/localtime32_r.c created+7
......@@ -0,0 +1,7 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__localtime32_r(time32_t *t, struct tm *tm)
5{
6 return localtime_r(&(time_t){*t}, tm);
7}
lib/libc/musl/compat/time32/lstat_time32.c created+17
......@@ -0,0 +1,17 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __lstat_time32(const char *restrict path, struct stat32 *restrict st32)
10{
11 struct stat st;
12 int r = lstat(path, &st);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(lstat, lstat64);
lib/libc/musl/compat/time32/lutimes_time32.c created+12
......@@ -0,0 +1,12 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/stat.h>
6
7int __lutimes_time32(const char *path, const struct timeval32 times32[2])
8{
9 return lutimes(path, !times32 ? 0 : ((struct timeval[2]){
10 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
11 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
12}
lib/libc/musl/compat/time32/mktime32.c created+16
......@@ -0,0 +1,16 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6time32_t __mktime32(struct tm *tm)
7{
8 struct tm tmp = *tm;
9 time_t t = mktime(&tmp);
10 if (t < INT32_MIN || t > INT32_MAX) {
11 errno = EOVERFLOW;
12 return -1;
13 }
14 *tm = tmp;
15 return t;
16}
lib/libc/musl/compat/time32/mq_timedreceive_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <mqueue.h>
3#include <time.h>
4
5ssize_t __mq_timedreceive_time32(mqd_t mqd, char *restrict msg, size_t len, unsigned *restrict prio, const struct timespec32 *restrict ts32)
6{
7 return mq_timedreceive(mqd, msg, len, prio, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
lib/libc/musl/compat/time32/mq_timedsend_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <mqueue.h>
3#include <time.h>
4
5int __mq_timedsend_time32(mqd_t mqd, const char *msg, size_t len, unsigned prio, const struct timespec32 *ts32)
6{
7 return mq_timedsend(mqd, msg, len, prio, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
lib/libc/musl/compat/time32/mtx_timedlock_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <threads.h>
4
5int __mtx_timedlock_time32(mtx_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return mtx_timedlock(m, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/nanosleep_time32.c created+15
......@@ -0,0 +1,15 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4
5int __nanosleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
6{
7 struct timespec rem;
8 int ret = nanosleep((&(struct timespec){
9 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
10 if (ret<0 && errno==EINTR && rem32) {
11 rem32->tv_sec = rem.tv_sec;
12 rem32->tv_nsec = rem.tv_nsec;
13 }
14 return ret;
15}
lib/libc/musl/compat/time32/ppoll_time32.c created+10
......@@ -0,0 +1,10 @@
1#include "time32.h"
2#define _GNU_SOURCE
3#include <time.h>
4#include <poll.h>
5
6int __ppoll_time32(struct pollfd *fds, nfds_t n, const struct timespec32 *ts32, const sigset_t *mask)
7{
8 return ppoll(fds, n, !ts32 ? 0 : (&(struct timespec){
9 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
10}
lib/libc/musl/compat/time32/pselect_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/select.h>
4
5int __pselect_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, const struct timespec32 *restrict ts32, const sigset_t *restrict mask)
6{
7 return pselect(n, rfds, wfds, efds, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
9}
lib/libc/musl/compat/time32/pthread_cond_timedwait_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_cond_timedwait_time32(pthread_cond_t *restrict c, pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return pthread_cond_timedwait(c, m, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/pthread_mutex_timedlock_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_mutex_timedlock_time32(pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return pthread_mutex_timedlock(m, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_rwlock_timedrdlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32)
6{
7 return pthread_rwlock_timedrdlock(rw, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_rwlock_timedwrlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32)
6{
7 return pthread_rwlock_timedwrlock(rw, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/pthread_timedjoin_np_time32.c created+10
......@@ -0,0 +1,10 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <pthread.h>
5
6int __pthread_timedjoin_np_time32(pthread_t t, void **res, const struct timespec32 *at32)
7{
8 return pthread_timedjoin_np(t, res, !at32 ? 0 : (&(struct timespec){
9 .tv_sec = at32->tv_sec, .tv_nsec = at32->tv_nsec}));
10}
lib/libc/musl/compat/time32/recvmmsg_time32.c created+10
......@@ -0,0 +1,10 @@
1#include "time32.h"
2#define _GNU_SOURCE
3#include <time.h>
4#include <sys/socket.h>
5
6int __recvmmsg_time32(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec32 *ts32)
7{
8 return recvmmsg(fd, msgvec, vlen, flags, ts32 ? (&(struct timespec){
9 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
10}
lib/libc/musl/compat/time32/sched_rr_get_interval_time32.c created+13
......@@ -0,0 +1,13 @@
1#include "time32.h"
2#include <time.h>
3#include <sched.h>
4
5int __sched_rr_get_interval_time32(pid_t pid, struct timespec32 *ts32)
6{
7 struct timespec ts;
8 int r = sched_rr_get_interval(pid, &ts);
9 if (r) return r;
10 ts32->tv_sec = ts.tv_sec;
11 ts32->tv_nsec = ts.tv_nsec;
12 return r;
13}
lib/libc/musl/compat/time32/select_time32.c created+10
......@@ -0,0 +1,10 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4#include <sys/select.h>
5
6int __select_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, struct timeval32 *restrict tv32)
7{
8 return select(n, rfds, wfds, efds, !tv32 ? 0 : (&(struct timeval){
9 .tv_sec = tv32->tv_sec, .tv_usec = tv32->tv_usec}));
10}
lib/libc/musl/compat/time32/sem_timedwait_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <semaphore.h>
4
5int __sem_timedwait_time32(sem_t *sem, const struct timespec32 *restrict ts32)
6{
7 return sem_timedwait(sem, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/semtimedop_time32.c created+10
......@@ -0,0 +1,10 @@
1#include "time32.h"
2#define _GNU_SOURCE
3#include <sys/sem.h>
4#include <time.h>
5
6int __semtimedop_time32(int id, struct sembuf *buf, size_t n, const struct timespec32 *ts32)
7{
8 return semtimedop(id, buf, n, !ts32 ? 0 : (&(struct timespec){
9 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
10}
lib/libc/musl/compat/time32/setitimer_time32.c created+25
......@@ -0,0 +1,25 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4
5int __setitimer_time32(int which, const struct itimerval32 *restrict new32, struct itimerval32 *restrict old32)
6{
7 struct itimerval old;
8 int r = setitimer(which, (&(struct itimerval){
9 .it_interval.tv_sec = new32->it_interval.tv_sec,
10 .it_interval.tv_usec = new32->it_interval.tv_usec,
11 .it_value.tv_sec = new32->it_value.tv_sec,
12 .it_value.tv_usec = new32->it_value.tv_usec}), &old);
13 if (r) return r;
14 /* The above call has already committed to success by changing the
15 * timer setting, so we can't fail on out-of-range old value.
16 * Since these are relative times, values large enough to overflow
17 * don't make sense anyway. */
18 if (old32) {
19 old32->it_interval.tv_sec = old.it_interval.tv_sec;
20 old32->it_interval.tv_usec = old.it_interval.tv_usec;
21 old32->it_value.tv_sec = old.it_value.tv_sec;
22 old32->it_value.tv_usec = old.it_value.tv_usec;
23 }
24 return 0;
25}
lib/libc/musl/compat/time32/settimeofday_time32.c created+10
......@@ -0,0 +1,10 @@
1#define _BSD_SOURCE
2#include "time32.h"
3#include <sys/time.h>
4
5int __settimeofday_time32(const struct timeval32 *tv32, const void *tz)
6{
7 return settimeofday(!tv32 ? 0 : (&(struct timeval){
8 .tv_sec = tv32->tv_sec,
9 .tv_usec = tv32->tv_usec}), 0);
10}
lib/libc/musl/compat/time32/sigtimedwait_time32.c created+9
......@@ -0,0 +1,9 @@
1#include "time32.h"
2#include <time.h>
3#include <signal.h>
4
5int __sigtimedwait_time32(const sigset_t *restrict set, siginfo_t *restrict si, const struct timespec32 *restrict ts32)
6{
7 return sigtimedwait(set, si, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/musl/compat/time32/stat_time32.c created+17
......@@ -0,0 +1,17 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __stat_time32(const char *restrict path, struct stat32 *restrict st32)
10{
11 struct stat st;
12 int r = stat(path, &st);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(stat, stat64);
lib/libc/musl/compat/time32/stime32.c created+8
......@@ -0,0 +1,8 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4
5int __stime32(const time32_t *t)
6{
7 return stime(&(time_t){*t});
8}
lib/libc/musl/compat/time32/thrd_sleep_time32.c created+16
......@@ -0,0 +1,16 @@
1#include "time32.h"
2#include <time.h>
3#include <threads.h>
4#include <errno.h>
5
6int __thrd_sleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
7{
8 struct timespec rem;
9 int ret = thrd_sleep((&(struct timespec){
10 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
11 if (ret<0 && errno==EINTR && rem32) {
12 rem32->tv_sec = rem.tv_sec;
13 rem32->tv_nsec = rem.tv_nsec;
14 }
15 return ret;
16}
lib/libc/musl/compat/time32/time32.c created+15
......@@ -0,0 +1,15 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6time32_t __time32(time32_t *p)
7{
8 time_t t = time(0);
9 if (t < INT32_MIN || t > INT32_MAX) {
10 errno = EOVERFLOW;
11 return -1;
12 }
13 if (p) *p = t;
14 return t;
15}
lib/libc/musl/compat/time32/time32.h created+91
......@@ -0,0 +1,91 @@
1#ifndef TIME32_H
2#define TIME32_H
3
4#include <sys/types.h>
5
6typedef long time32_t;
7
8struct timeval32 {
9 long tv_sec;
10 long tv_usec;
11};
12
13struct itimerval32 {
14 struct timeval32 it_interval;
15 struct timeval32 it_value;
16};
17
18struct timespec32 {
19 long tv_sec;
20 long tv_nsec;
21};
22
23struct itimerspec32 {
24 struct timespec32 it_interval;
25 struct timespec32 it_value;
26};
27
28int __adjtime32() __asm__("adjtime");
29int __adjtimex_time32() __asm__("adjtimex");
30int __aio_suspend_time32() __asm__("aio_suspend");
31int __clock_adjtime32() __asm__("clock_adjtime");
32int __clock_getres_time32() __asm__("clock_getres");
33int __clock_gettime32() __asm__("clock_gettime");
34int __clock_nanosleep_time32() __asm__("clock_nanosleep");
35int __clock_settime32() __asm__("clock_settime");
36int __cnd_timedwait_time32() __asm__("cnd_timedwait");
37char *__ctime32() __asm__("ctime");
38char *__ctime32_r() __asm__("ctime_r");
39double __difftime32() __asm__("difftime");
40int __fstat_time32() __asm__("fstat");
41int __fstatat_time32() __asm__("fstatat");
42int __ftime32() __asm__("ftime");
43int __futimens_time32() __asm__("futimens");
44int __futimes_time32() __asm__("futimes");
45int __futimesat_time32() __asm__("futimesat");
46int __getitimer_time32() __asm__("getitimer");
47int __getrusage_time32() __asm__("getrusage");
48int __gettimeofday_time32() __asm__("gettimeofday");
49struct tm *__gmtime32() __asm__("gmtime");
50struct tm *__gmtime32_r() __asm__("gmtime_r");
51struct tm *__localtime32() __asm__("localtime");
52struct tm *__localtime32_r() __asm__("localtime_r");
53int __lstat_time32() __asm__("lstat");
54int __lutimes_time32() __asm__("lutimes");
55time32_t __mktime32() __asm__("mktime");
56ssize_t __mq_timedreceive_time32() __asm__("mq_timedreceive");
57int __mq_timedsend_time32() __asm__("mq_timedsend");
58int __mtx_timedlock_time32() __asm__("mtx_timedlock");
59int __nanosleep_time32() __asm__("nanosleep");
60int __ppoll_time32() __asm__("ppoll");
61int __pselect_time32() __asm__("pselect");
62int __pthread_cond_timedwait_time32() __asm__("pthread_cond_timedwait");
63int __pthread_mutex_timedlock_time32() __asm__("pthread_mutex_timedlock");
64int __pthread_rwlock_timedrdlock_time32() __asm__("pthread_rwlock_timedrdlock");
65int __pthread_rwlock_timedwrlock_time32() __asm__("pthread_rwlock_timedwrlock");
66int __pthread_timedjoin_np_time32() __asm__("pthread_timedjoin_np");
67int __recvmmsg_time32() __asm__("recvmmsg");
68int __sched_rr_get_interval_time32() __asm__("sched_rr_get_interval");
69int __select_time32() __asm__("select");
70int __sem_timedwait_time32() __asm__("sem_timedwait");
71int __semtimedop_time32() __asm__("semtimedop");
72int __setitimer_time32() __asm__("setitimer");
73int __settimeofday_time32() __asm__("settimeofday");
74int __sigtimedwait_time32() __asm__("sigtimedwait");
75int __stat_time32() __asm__("stat");
76int __stime32() __asm__("stime");
77int __thrd_sleep_time32() __asm__("thrd_sleep");
78time32_t __time32() __asm__("time");
79time32_t __time32gm() __asm__("timegm");
80int __timer_gettime32() __asm__("timer_gettime");
81int __timer_settime32() __asm__("timer_settime");
82int __timerfd_gettime32() __asm__("timerfd_gettime");
83int __timerfd_settime32() __asm__("timerfd_settime");
84int __timespec_get_time32() __asm__("timespec_get");
85int __utime_time32() __asm__("utime");
86int __utimensat_time32() __asm__("utimensat");
87int __utimes_time32() __asm__("utimes");
88pid_t __wait3_time32() __asm__("wait3");
89pid_t __wait4_time32() __asm__("wait4");
90
91#endif
lib/libc/musl/compat/time32/time32gm.c created+15
......@@ -0,0 +1,15 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <errno.h>
5#include <stdint.h>
6
7time32_t __time32gm(struct tm *tm)
8{
9 time_t t = timegm(tm);
10 if (t < INT32_MIN || t > INT32_MAX) {
11 errno = EOVERFLOW;
12 return -1;
13 }
14 return t;
15}
lib/libc/musl/compat/time32/timer_gettime32.c created+15
......@@ -0,0 +1,15 @@
1#include "time32.h"
2#include <time.h>
3
4int __timer_gettime32(timer_t t, struct itimerspec32 *val32)
5{
6 struct itimerspec old;
7 int r = timer_gettime(t, &old);
8 if (r) return r;
9 /* No range checking for consistency with settime */
10 val32->it_interval.tv_sec = old.it_interval.tv_sec;
11 val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
12 val32->it_value.tv_sec = old.it_value.tv_sec;
13 val32->it_value.tv_nsec = old.it_value.tv_nsec;
14 return 0;
15}
lib/libc/musl/compat/time32/timer_settime32.c created+25
......@@ -0,0 +1,25 @@
1#include "time32.h"
2#include <time.h>
3
4int __timer_settime32(timer_t t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32)
5{
6 struct itimerspec old;
7 int r = timer_settime(t, flags, (&(struct itimerspec){
8 .it_interval.tv_sec = val32->it_interval.tv_sec,
9 .it_interval.tv_nsec = val32->it_interval.tv_nsec,
10 .it_value.tv_sec = val32->it_value.tv_sec,
11 .it_value.tv_nsec = val32->it_value.tv_nsec}),
12 old32 ? &old : 0);
13 if (r) return r;
14 /* The above call has already committed to success by changing the
15 * timer setting, so we can't fail on out-of-range old value.
16 * Since these are relative times, values large enough to overflow
17 * don't make sense anyway. */
18 if (old32) {
19 old32->it_interval.tv_sec = old.it_interval.tv_sec;
20 old32->it_interval.tv_nsec = old.it_interval.tv_nsec;
21 old32->it_value.tv_sec = old.it_value.tv_sec;
22 old32->it_value.tv_nsec = old.it_value.tv_nsec;
23 }
24 return 0;
25}
lib/libc/musl/compat/time32/timerfd_gettime32.c created+16
......@@ -0,0 +1,16 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/timerfd.h>
4
5int __timerfd_gettime32(int t, struct itimerspec32 *val32)
6{
7 struct itimerspec old;
8 int r = timerfd_gettime(t, &old);
9 if (r) return r;
10 /* No range checking for consistency with settime */
11 val32->it_interval.tv_sec = old.it_interval.tv_sec;
12 val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
13 val32->it_value.tv_sec = old.it_value.tv_sec;
14 val32->it_value.tv_nsec = old.it_value.tv_nsec;
15 return 0;
16}
lib/libc/musl/compat/time32/timerfd_settime32.c created+26
......@@ -0,0 +1,26 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/timerfd.h>
4
5int __timerfd_settime32(int t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32)
6{
7 struct itimerspec old;
8 int r = timerfd_settime(t, flags, (&(struct itimerspec){
9 .it_interval.tv_sec = val32->it_interval.tv_sec,
10 .it_interval.tv_nsec = val32->it_interval.tv_nsec,
11 .it_value.tv_sec = val32->it_value.tv_sec,
12 .it_value.tv_nsec = val32->it_value.tv_nsec}),
13 old32 ? &old : 0);
14 if (r) return r;
15 /* The above call has already committed to success by changing the
16 * timer setting, so we can't fail on out-of-range old value.
17 * Since these are relative times, values large enough to overflow
18 * don't make sense anyway. */
19 if (old32) {
20 old32->it_interval.tv_sec = old.it_interval.tv_sec;
21 old32->it_interval.tv_nsec = old.it_interval.tv_nsec;
22 old32->it_value.tv_sec = old.it_value.tv_sec;
23 old32->it_value.tv_nsec = old.it_value.tv_nsec;
24 }
25 return 0;
26}
lib/libc/musl/compat/time32/timespec_get_time32.c created+18
......@@ -0,0 +1,18 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6int __timespec_get_time32(struct timespec32 *ts32, int base)
7{
8 struct timespec ts;
9 int r = timespec_get(&ts, base);
10 if (!r) return r;
11 if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) {
12 errno = EOVERFLOW;
13 return 0;
14 }
15 ts32->tv_sec = ts.tv_sec;
16 ts32->tv_nsec = ts.tv_nsec;
17 return r;
18}
lib/libc/musl/compat/time32/utime_time32.c created+14
......@@ -0,0 +1,14 @@
1#include "time32.h"
2#include <time.h>
3#include <utime.h>
4
5struct utimbuf32 {
6 time32_t actime;
7 time32_t modtime;
8};
9
10int __utime_time32(const char *path, const struct utimbuf32 *times32)
11{
12 return utime(path, !times32 ? 0 : (&(struct utimbuf){
13 .actime = times32->actime, .modtime = times32->modtime}));
14}
lib/libc/musl/compat/time32/utimensat_time32.c created+11
......@@ -0,0 +1,11 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/stat.h>
4
5int __utimensat_time32(int fd, const char *path, const struct timespec32 times32[2], int flags)
6{
7 return utimensat(fd, path, !times32 ? 0 : ((struct timespec[2]){
8 {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec},
9 {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}),
10 flags);
11}
lib/libc/musl/compat/time32/utimes_time32.c created+11
......@@ -0,0 +1,11 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4#include <sys/stat.h>
5
6int __utimes_time32(const char *path, const struct timeval32 times32[2])
7{
8 return utimes(path, !times32 ? 0 : ((struct timeval[2]){
9 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
10 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
11}
lib/libc/musl/compat/time32/wait3_time32.c created+40
......@@ -0,0 +1,40 @@
1#define _BSD_SOURCE
2#include "time32.h"
3#include <string.h>
4#include <stddef.h>
5#include <sys/wait.h>
6
7struct compat_rusage {
8 struct timeval32 ru_utime;
9 struct timeval32 ru_stime;
10 long ru_maxrss;
11 long ru_ixrss;
12 long ru_idrss;
13 long ru_isrss;
14 long ru_minflt;
15 long ru_majflt;
16 long ru_nswap;
17 long ru_inblock;
18 long ru_oublock;
19 long ru_msgsnd;
20 long ru_msgrcv;
21 long ru_nsignals;
22 long ru_nvcsw;
23 long ru_nivcsw;
24};
25
26pid_t __wait3_time32(int *status, int options, struct compat_rusage *usage)
27{
28 struct rusage ru;
29 int r = wait3(status, options, usage ? &ru : 0);
30 if (!r && usage) {
31 usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
32 usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
33 usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
34 usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
35 memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
36 sizeof(struct compat_rusage) -
37 offsetof(struct compat_rusage, ru_maxrss));
38 }
39 return r;
40}
lib/libc/musl/compat/time32/wait4_time32.c created+40
......@@ -0,0 +1,40 @@
1#define _BSD_SOURCE
2#include "time32.h"
3#include <string.h>
4#include <stddef.h>
5#include <sys/wait.h>
6
7struct compat_rusage {
8 struct timeval32 ru_utime;
9 struct timeval32 ru_stime;
10 long ru_maxrss;
11 long ru_ixrss;
12 long ru_idrss;
13 long ru_isrss;
14 long ru_minflt;
15 long ru_majflt;
16 long ru_nswap;
17 long ru_inblock;
18 long ru_oublock;
19 long ru_msgsnd;
20 long ru_msgrcv;
21 long ru_nsignals;
22 long ru_nvcsw;
23 long ru_nivcsw;
24};
25
26pid_t __wait4_time32(pid_t pid, int *status, int options, struct compat_rusage *usage)
27{
28 struct rusage ru;
29 int r = wait4(pid, status, options, usage ? &ru : 0);
30 if (!r && usage) {
31 usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
32 usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
33 usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
34 usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
35 memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
36 sizeof(struct compat_rusage) -
37 offsetof(struct compat_rusage, ru_maxrss));
38 }
39 return r;
40}
lib/libc/musl/include/aio.h+4
......@@ -62,6 +62,10 @@ int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sige
6262#define off64_t off_t
6363#endif
6464
65#if _REDIR_TIME64
66__REDIR(aio_suspend, __aio_suspend_time64);
67#endif
68
6569#ifdef __cplusplus
6670}
6771#endif
lib/libc/musl/include/alloca.h-2
......@@ -10,9 +10,7 @@ extern "C" {
1010
1111void *alloca(size_t);
1212
13#ifdef __GNUC__
1413#define alloca __builtin_alloca
15#endif
1614
1715#ifdef __cplusplus
1816}
lib/libc/musl/include/alltypes.h.in+18-1
......@@ -1,3 +1,7 @@
1#define __LITTLE_ENDIAN 1234
2#define __BIG_ENDIAN 4321
3#define __USE_TIME_BITS64 1
4
15TYPEDEF unsigned _Addr size_t;
26TYPEDEF unsigned _Addr uintptr_t;
37TYPEDEF _Addr ptrdiff_t;
......@@ -5,6 +9,8 @@ TYPEDEF _Addr ssize_t;
59TYPEDEF _Addr intptr_t;
610TYPEDEF _Addr regoff_t;
711TYPEDEF _Reg register_t;
12TYPEDEF _Int64 time_t;
13TYPEDEF _Int64 suseconds_t;
814
915TYPEDEF signed char int8_t;
1016TYPEDEF signed short int16_t;
......@@ -35,7 +41,7 @@ TYPEDEF void * timer_t;
3541TYPEDEF int clockid_t;
3642TYPEDEF long clock_t;
3743STRUCT timeval { time_t tv_sec; suseconds_t tv_usec; };
38STRUCT timespec { time_t tv_sec; long tv_nsec; };
44STRUCT 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); };
3945
4046TYPEDEF int pid_t;
4147TYPEDEF unsigned id_t;
......@@ -60,6 +66,9 @@ TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
6066STRUCT _IO_FILE { char __x; };
6167TYPEDEF struct _IO_FILE FILE;
6268
69TYPEDEF __builtin_va_list va_list;
70TYPEDEF __builtin_va_list __isoc_va_list;
71
6372TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
6473
6574TYPEDEF struct __locale_struct * locale_t;
......@@ -71,6 +80,14 @@ STRUCT iovec { void *iov_base; size_t iov_len; };
7180TYPEDEF unsigned socklen_t;
7281TYPEDEF unsigned short sa_family_t;
7382
83TYPEDEF 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;
84TYPEDEF 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;
85TYPEDEF 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;
86TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
87TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
88TYPEDEF 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;
89TYPEDEF 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;
90
7491#undef _Addr
7592#undef _Int64
7693#undef _Reg
lib/libc/musl/include/arpa/nameser.h-1
......@@ -7,7 +7,6 @@ extern "C" {
77
88#include <stddef.h>
99#include <stdint.h>
10#include <endian.h>
1110
1211#define __NAMESER 19991006
1312#define NS_PACKETSZ 512
lib/libc/musl/include/dirent.h+2-12
......@@ -15,19 +15,9 @@ extern "C" {
1515
1616#include <bits/alltypes.h>
1717
18typedef struct __dirstream DIR;
19
20#define _DIRENT_HAVE_D_RECLEN
21#define _DIRENT_HAVE_D_OFF
22#define _DIRENT_HAVE_D_TYPE
18#include <bits/dirent.h>
2319
24struct dirent {
25 ino_t d_ino;
26 off_t d_off;
27 unsigned short d_reclen;
28 unsigned char d_type;
29 char d_name[256];
30};
20typedef struct __dirstream DIR;
3121
3222#define d_fileno d_ino
3323
lib/libc/musl/include/dlfcn.h+4
......@@ -35,6 +35,10 @@ int dladdr(const void *, Dl_info *);
3535int dlinfo(void *, int, void *);
3636#endif
3737
38#if _REDIR_TIME64
39__REDIR(dlsym, __dlsym_time64);
40#endif
41
3842#ifdef __cplusplus
3943}
4044#endif
lib/libc/musl/include/endian.h+21-23
......@@ -3,25 +3,19 @@
33
44#include <features.h>
55
6#define __LITTLE_ENDIAN 1234
7#define __BIG_ENDIAN 4321
8#define __PDP_ENDIAN 3412
6#define __NEED_uint16_t
7#define __NEED_uint32_t
8#define __NEED_uint64_t
99
10#if defined(__GNUC__) && defined(__BYTE_ORDER__)
11#define __BYTE_ORDER __BYTE_ORDER__
12#else
13#include <bits/endian.h>
14#endif
10#include <bits/alltypes.h>
1511
16#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
12#define __PDP_ENDIAN 3412
1713
1814#define BIG_ENDIAN __BIG_ENDIAN
1915#define LITTLE_ENDIAN __LITTLE_ENDIAN
2016#define PDP_ENDIAN __PDP_ENDIAN
2117#define BYTE_ORDER __BYTE_ORDER
2218
23#include <stdint.h>
24
2519static __inline uint16_t __bswap16(uint16_t __x)
2620{
2721 return __x<<8 | __x>>8;
......@@ -40,43 +34,47 @@ static __inline uint64_t __bswap64(uint64_t __x)
4034#if __BYTE_ORDER == __LITTLE_ENDIAN
4135#define htobe16(x) __bswap16(x)
4236#define be16toh(x) __bswap16(x)
43#define betoh16(x) __bswap16(x)
4437#define htobe32(x) __bswap32(x)
4538#define be32toh(x) __bswap32(x)
46#define betoh32(x) __bswap32(x)
4739#define htobe64(x) __bswap64(x)
4840#define be64toh(x) __bswap64(x)
49#define betoh64(x) __bswap64(x)
5041#define htole16(x) (uint16_t)(x)
5142#define le16toh(x) (uint16_t)(x)
52#define letoh16(x) (uint16_t)(x)
5343#define htole32(x) (uint32_t)(x)
5444#define le32toh(x) (uint32_t)(x)
55#define letoh32(x) (uint32_t)(x)
5645#define htole64(x) (uint64_t)(x)
5746#define le64toh(x) (uint64_t)(x)
58#define letoh64(x) (uint64_t)(x)
5947#else
6048#define htobe16(x) (uint16_t)(x)
6149#define be16toh(x) (uint16_t)(x)
62#define betoh16(x) (uint16_t)(x)
6350#define htobe32(x) (uint32_t)(x)
6451#define be32toh(x) (uint32_t)(x)
65#define betoh32(x) (uint32_t)(x)
6652#define htobe64(x) (uint64_t)(x)
6753#define be64toh(x) (uint64_t)(x)
68#define betoh64(x) (uint64_t)(x)
6954#define htole16(x) __bswap16(x)
7055#define le16toh(x) __bswap16(x)
71#define letoh16(x) __bswap16(x)
7256#define htole32(x) __bswap32(x)
7357#define le32toh(x) __bswap32(x)
74#define letoh32(x) __bswap32(x)
7558#define htole64(x) __bswap64(x)
7659#define le64toh(x) __bswap64(x)
77#define letoh64(x) __bswap64(x)
7860#endif
7961
62#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
63#if __BYTE_ORDER == __LITTLE_ENDIAN
64#define betoh16(x) __bswap16(x)
65#define betoh32(x) __bswap32(x)
66#define betoh64(x) __bswap64(x)
67#define letoh16(x) (uint16_t)(x)
68#define letoh32(x) (uint32_t)(x)
69#define letoh64(x) (uint64_t)(x)
70#else
71#define betoh16(x) (uint16_t)(x)
72#define betoh32(x) (uint32_t)(x)
73#define betoh64(x) (uint64_t)(x)
74#define letoh16(x) __bswap16(x)
75#define letoh32(x) __bswap32(x)
76#define letoh64(x) __bswap64(x)
77#endif
8078#endif
8179
8280#endif
lib/libc/musl/include/features.h+2
......@@ -35,4 +35,6 @@
3535#define _Noreturn
3636#endif
3737
38#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
39
3840#endif
lib/libc/musl/include/limits.h+13-5
......@@ -3,9 +3,7 @@
33
44#include <features.h>
55
6/* Most limits are system-specific */
7
8#include <bits/limits.h>
6#include <bits/alltypes.h> /* __LONG_MAX */
97
108/* Support signed or unsigned plain-char */
119
......@@ -17,8 +15,6 @@
1715#define CHAR_MAX 127
1816#endif
1917
20/* Some universal constants... */
21
2218#define CHAR_BIT 8
2319#define SCHAR_MIN (-128)
2420#define SCHAR_MAX 127
......@@ -30,8 +26,10 @@
3026#define INT_MAX 0x7fffffff
3127#define UINT_MAX 0xffffffffU
3228#define LONG_MIN (-LONG_MAX-1)
29#define LONG_MAX __LONG_MAX
3330#define ULONG_MAX (2UL*LONG_MAX+1)
3431#define LLONG_MIN (-LLONG_MAX-1)
32#define LLONG_MAX 0x7fffffffffffffffLL
3533#define ULLONG_MAX (2ULL*LLONG_MAX+1)
3634
3735#define MB_LEN_MAX 4
......@@ -39,9 +37,13 @@
3937#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
4038 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
4139
40#include <bits/limits.h>
41
4242#define PIPE_BUF 4096
4343#define FILESIZEBITS 64
44#ifndef NAME_MAX
4445#define NAME_MAX 255
46#endif
4547#define PATH_MAX 4096
4648#define NGROUPS_MAX 32
4749#define ARG_MAX 131072
......@@ -53,6 +55,12 @@
5355#define TTY_NAME_MAX 32
5456#define HOST_NAME_MAX 255
5557
58#if LONG_MAX == 0x7fffffffL
59#define LONG_BIT 32
60#else
61#define LONG_BIT 64
62#endif
63
5664/* Implementation choices... */
5765
5866#define PTHREAD_KEYS_MAX 128
lib/libc/musl/include/mqueue.h+5
......@@ -30,6 +30,11 @@ ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, c
3030int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *);
3131int mq_unlink(const char *);
3232
33#if _REDIR_TIME64
34__REDIR(mq_timedreceive, __mq_timedreceive_time64);
35__REDIR(mq_timedsend, __mq_timedsend_time64);
36#endif
37
3338#ifdef __cplusplus
3439}
3540#endif
lib/libc/musl/include/netinet/icmp6.h-1
......@@ -9,7 +9,6 @@ extern "C" {
99#include <string.h>
1010#include <sys/types.h>
1111#include <netinet/in.h>
12#include <endian.h>
1312
1413#define ICMP6_FILTER 1
1514
lib/libc/musl/include/netinet/if_ether.h+1
......@@ -58,6 +58,7 @@
5858#define ETH_P_ERSPAN 0x88BE
5959#define ETH_P_PREAUTH 0x88C7
6060#define ETH_P_TIPC 0x88CA
61#define ETH_P_LLDP 0x88CC
6162#define ETH_P_MACSEC 0x88E5
6263#define ETH_P_8021AH 0x88E7
6364#define ETH_P_MVRP 0x88F5
lib/libc/musl/include/netinet/ip.h+2-1
......@@ -7,7 +7,6 @@ extern "C" {
77
88#include <stdint.h>
99#include <netinet/in.h>
10#include <endian.h>
1110
1211struct timestamp {
1312 uint8_t len;
......@@ -191,6 +190,8 @@ struct ip_timestamp {
191190
192191#define IP_MSS 576
193192
193#define __UAPI_DEF_IPHDR 0
194
194195#ifdef __cplusplus
195196}
196197#endif
lib/libc/musl/include/netinet/ip6.h-1
......@@ -7,7 +7,6 @@ extern "C" {
77
88#include <stdint.h>
99#include <netinet/in.h>
10#include <endian.h>
1110
1211struct ip6_hdr {
1312 union {
lib/libc/musl/include/netinet/tcp.h+3-1
......@@ -38,6 +38,7 @@
3838#define TCP_FASTOPEN_NO_COOKIE 34
3939#define TCP_ZEROCOPY_RECEIVE 35
4040#define TCP_INQ 36
41#define TCP_TX_DELAY 37
4142
4243#define TCP_CM_INQ TCP_INQ
4344
......@@ -97,7 +98,6 @@ enum {
9798#include <sys/types.h>
9899#include <sys/socket.h>
99100#include <stdint.h>
100#include <endian.h>
101101
102102typedef uint32_t tcp_seq;
103103
......@@ -234,6 +234,8 @@ struct tcp_info {
234234 uint64_t tcpi_bytes_retrans;
235235 uint32_t tcpi_dsack_dups;
236236 uint32_t tcpi_reord_seen;
237 uint32_t tcpi_rcv_ooopack;
238 uint32_t tcpi_snd_wnd;
237239};
238240
239241#define TCP_MD5SIG_MAXKEYLEN 80
lib/libc/musl/include/poll.h+6
......@@ -44,6 +44,12 @@ int poll (struct pollfd *, nfds_t, int);
4444int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
4545#endif
4646
47#if _REDIR_TIME64
48#ifdef _GNU_SOURCE
49__REDIR(ppoll, __ppoll_time64);
50#endif
51#endif
52
4753#ifdef __cplusplus
4854}
4955#endif
lib/libc/musl/include/pthread.h+10
......@@ -224,6 +224,16 @@ int pthread_tryjoin_np(pthread_t, void **);
224224int pthread_timedjoin_np(pthread_t, void **, const struct timespec *);
225225#endif
226226
227#if _REDIR_TIME64
228__REDIR(pthread_mutex_timedlock, __pthread_mutex_timedlock_time64);
229__REDIR(pthread_cond_timedwait, __pthread_cond_timedwait_time64);
230__REDIR(pthread_rwlock_timedrdlock, __pthread_rwlock_timedrdlock_time64);
231__REDIR(pthread_rwlock_timedwrlock, __pthread_rwlock_timedwrlock_time64);
232#ifdef _GNU_SOURCE
233__REDIR(pthread_timedjoin_np, __pthread_timedjoin_np_time64);
234#endif
235#endif
236
227237#ifdef __cplusplus
228238}
229239#endif
lib/libc/musl/include/sched.h+8
......@@ -19,10 +19,14 @@ extern "C" {
1919struct sched_param {
2020 int sched_priority;
2121 int __reserved1;
22#if _REDIR_TIME64
23 long __reserved2[4];
24#else
2225 struct {
2326 time_t __reserved1;
2427 long __reserved2;
2528 } __reserved2[2];
29#endif
2630 int __reserved3;
2731};
2832
......@@ -133,6 +137,10 @@ __CPU_op_func_S(XOR, ^)
133137
134138#endif
135139
140#if _REDIR_TIME64
141__REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64);
142#endif
143
136144#ifdef __cplusplus
137145}
138146#endif
lib/libc/musl/include/semaphore.h+4
......@@ -29,6 +29,10 @@ int sem_trywait(sem_t *);
2929int sem_unlink(const char *);
3030int sem_wait(sem_t *);
3131
32#if _REDIR_TIME64
33__REDIR(sem_timedwait, __sem_timedwait_time64);
34#endif
35
3236#ifdef __cplusplus
3337}
3438#endif
lib/libc/musl/include/signal.h+8
......@@ -271,6 +271,14 @@ typedef int sig_atomic_t;
271271void (*signal(int, void (*)(int)))(int);
272272int raise(int);
273273
274#if _REDIR_TIME64
275#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
276 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
277 || defined(_BSD_SOURCE)
278__REDIR(sigtimedwait, __sigtimedwait_time64);
279#endif
280#endif
281
274282#ifdef __cplusplus
275283}
276284#endif
lib/libc/musl/include/sys/acct.h-1
......@@ -6,7 +6,6 @@ extern "C" {
66#endif
77
88#include <features.h>
9#include <endian.h>
109#include <time.h>
1110#include <stdint.h>
1211
lib/libc/musl/include/sys/ioctl.h+1
......@@ -4,6 +4,7 @@
44extern "C" {
55#endif
66
7#include <bits/alltypes.h>
78#include <bits/ioctl.h>
89
910#define N_TTY 0
lib/libc/musl/include/sys/mman.h+2
......@@ -92,6 +92,8 @@ extern "C" {
9292#define MADV_DODUMP 17
9393#define MADV_WIPEONFORK 18
9494#define MADV_KEEPONFORK 19
95#define MADV_COLD 20
96#define MADV_PAGEOUT 21
9597#define MADV_HWPOISON 100
9698#define MADV_SOFT_OFFLINE 101
9799#endif
lib/libc/musl/include/sys/prctl.h+4
......@@ -154,6 +154,10 @@ struct prctl_mm_map {
154154#define PR_PAC_APDBKEY (1UL << 3)
155155#define PR_PAC_APGAKEY (1UL << 4)
156156
157#define PR_SET_TAGGED_ADDR_CTRL 55
158#define PR_GET_TAGGED_ADDR_CTRL 56
159#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
160
157161int prctl (int, ...);
158162
159163#ifdef __cplusplus
lib/libc/musl/include/sys/procfs.h+3-4
......@@ -23,10 +23,9 @@ struct elf_prstatus {
2323 pid_t pr_ppid;
2424 pid_t pr_pgrp;
2525 pid_t pr_sid;
26 struct timeval pr_utime;
27 struct timeval pr_stime;
28 struct timeval pr_cutime;
29 struct timeval pr_cstime;
26 struct {
27 long tv_sec, tv_usec;
28 } pr_utime, pr_stime, pr_cutime, pr_cstime;
3029 elf_gregset_t pr_reg;
3130 int pr_fpvalid;
3231};
lib/libc/musl/include/sys/ptrace.h+29
......@@ -41,6 +41,7 @@ extern "C" {
4141#define PTRACE_SETSIGMASK 0x420b
4242#define PTRACE_SECCOMP_GET_FILTER 0x420c
4343#define PTRACE_SECCOMP_GET_METADATA 0x420d
44#define PTRACE_GET_SYSCALL_INFO 0x420e
4445
4546#define PT_READ_I PTRACE_PEEKTEXT
4647#define PT_READ_D PTRACE_PEEKDATA
......@@ -88,6 +89,11 @@ extern "C" {
8889
8990#define PTRACE_PEEKSIGINFO_SHARED 1
9091
92#define PTRACE_SYSCALL_INFO_NONE 0
93#define PTRACE_SYSCALL_INFO_ENTRY 1
94#define PTRACE_SYSCALL_INFO_EXIT 2
95#define PTRACE_SYSCALL_INFO_SECCOMP 3
96
9197#include <bits/ptrace.h>
9298
9399struct __ptrace_peeksiginfo_args {
......@@ -101,6 +107,29 @@ struct __ptrace_seccomp_metadata {
101107 uint64_t flags;
102108};
103109
110struct __ptrace_syscall_info {
111 uint8_t op;
112 uint8_t __pad[3];
113 uint32_t arch;
114 uint64_t instruction_pointer;
115 uint64_t stack_pointer;
116 union {
117 struct {
118 uint64_t nr;
119 uint64_t args[6];
120 } entry;
121 struct {
122 int64_t rval;
123 uint8_t is_error;
124 } exit;
125 struct {
126 uint64_t nr;
127 uint64_t args[6];
128 uint32_t ret_data;
129 } seccomp;
130 };
131};
132
104133long ptrace(int, ...);
105134
106135#ifdef __cplusplus
lib/libc/musl/include/sys/resource.h+6-1
......@@ -90,7 +90,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
9090#define RLIMIT_MSGQUEUE 12
9191#define RLIMIT_NICE 13
9292#define RLIMIT_RTPRIO 14
93#define RLIMIT_NLIMITS 15
93#define RLIMIT_RTTIME 15
94#define RLIMIT_NLIMITS 16
9495
9596#define RLIM_NLIMITS RLIMIT_NLIMITS
9697
......@@ -104,6 +105,10 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
104105#define rlim64_t rlim_t
105106#endif
106107
108#if _REDIR_TIME64
109__REDIR(getrusage, __getrusage_time64);
110#endif
111
107112#ifdef __cplusplus
108113}
109114#endif
lib/libc/musl/include/sys/select.h+5
......@@ -35,6 +35,11 @@ int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, co
3535#define NFDBITS (8*(int)sizeof(long))
3636#endif
3737
38#if _REDIR_TIME64
39__REDIR(select, __select_time64);
40__REDIR(pselect, __pselect_time64);
41#endif
42
3843#ifdef __cplusplus
3944}
4045#endif
lib/libc/musl/include/sys/sem.h+6-2
......@@ -25,8 +25,6 @@ extern "C" {
2525#define SETVAL 16
2626#define SETALL 17
2727
28#include <endian.h>
29
3028#include <bits/sem.h>
3129
3230#define _SEM_SEMUN_UNDEFINED 1
......@@ -62,6 +60,12 @@ int semop(int, struct sembuf *, size_t);
6260int semtimedop(int, struct sembuf *, size_t, const struct timespec *);
6361#endif
6462
63#if _REDIR_TIME64
64#ifdef _GNU_SOURCE
65__REDIR(semtimedop, __semtimedop_time64);
66#endif
67#endif
68
6569#ifdef __cplusplus
6670}
6771#endif
lib/libc/musl/include/sys/socket.h+63-6
......@@ -19,6 +19,40 @@ extern "C" {
1919
2020#include <bits/socket.h>
2121
22struct msghdr {
23 void *msg_name;
24 socklen_t msg_namelen;
25 struct iovec *msg_iov;
26#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
27 int __pad1;
28#endif
29 int msg_iovlen;
30#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
31 int __pad1;
32#endif
33 void *msg_control;
34#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
35 int __pad2;
36#endif
37 socklen_t msg_controllen;
38#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
39 int __pad2;
40#endif
41 int msg_flags;
42};
43
44struct cmsghdr {
45#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
46 int __pad1;
47#endif
48 socklen_t cmsg_len;
49#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
50 int __pad1;
51#endif
52 int cmsg_level;
53 int cmsg_type;
54};
55
2256#ifdef _GNU_SOURCE
2357struct ucred {
2458 pid_t pid;
......@@ -182,8 +216,6 @@ struct linger {
182216#define SO_PEERCRED 17
183217#define SO_RCVLOWAT 18
184218#define SO_SNDLOWAT 19
185#define SO_RCVTIMEO 20
186#define SO_SNDTIMEO 21
187219#define SO_ACCEPTCONN 30
188220#define SO_PEERSEC 31
189221#define SO_SNDBUFFORCE 32
......@@ -192,6 +224,28 @@ struct linger {
192224#define SO_DOMAIN 39
193225#endif
194226
227#ifndef SO_RCVTIMEO
228#if __LONG_MAX == 0x7fffffff
229#define SO_RCVTIMEO 66
230#define SO_SNDTIMEO 67
231#else
232#define SO_RCVTIMEO 20
233#define SO_SNDTIMEO 21
234#endif
235#endif
236
237#ifndef SO_TIMESTAMP
238#if __LONG_MAX == 0x7fffffff
239#define SO_TIMESTAMP 63
240#define SO_TIMESTAMPNS 64
241#define SO_TIMESTAMPING 65
242#else
243#define SO_TIMESTAMP 29
244#define SO_TIMESTAMPNS 35
245#define SO_TIMESTAMPING 37
246#endif
247#endif
248
195249#define SO_SECURITY_AUTHENTICATION 22
196250#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
197251#define SO_SECURITY_ENCRYPTION_NETWORK 24
......@@ -203,14 +257,10 @@ struct linger {
203257#define SO_GET_FILTER SO_ATTACH_FILTER
204258
205259#define SO_PEERNAME 28
206#define SO_TIMESTAMP 29
207260#define SCM_TIMESTAMP SO_TIMESTAMP
208
209261#define SO_PASSSEC 34
210#define SO_TIMESTAMPNS 35
211262#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
212263#define SO_MARK 36
213#define SO_TIMESTAMPING 37
214264#define SCM_TIMESTAMPING SO_TIMESTAMPING
215265#define SO_RXQ_OVFL 40
216266#define SO_WIFI_STATUS 41
......@@ -238,6 +288,7 @@ struct linger {
238288#define SO_TXTIME 61
239289#define SCM_TXTIME SO_TXTIME
240290#define SO_BINDTOIFINDEX 62
291#define SO_DETACH_REUSEPORT_BPF 68
241292
242293#ifndef SOL_SOCKET
243294#define SOL_SOCKET 1
......@@ -350,6 +401,12 @@ int setsockopt (int, int, int, const void *, socklen_t);
350401
351402int sockatmark (int);
352403
404#if _REDIR_TIME64
405#ifdef _GNU_SOURCE
406__REDIR(recvmmsg, __recvmmsg_time64);
407#endif
408#endif
409
353410#ifdef __cplusplus
354411}
355412#endif
lib/libc/musl/include/sys/stat.h+9
......@@ -110,6 +110,15 @@ int lchmod(const char *, mode_t);
110110#define off64_t off_t
111111#endif
112112
113#if _REDIR_TIME64
114__REDIR(stat, __stat_time64);
115__REDIR(fstat, __fstat_time64);
116__REDIR(lstat, __lstat_time64);
117__REDIR(fstatat, __fstatat_time64);
118__REDIR(futimens, __futimens_time64);
119__REDIR(utimensat, __utimensat_time64);
120#endif
121
113122#ifdef __cplusplus
114123}
115124#endif
lib/libc/musl/include/sys/statvfs.h-2
......@@ -11,8 +11,6 @@ extern "C" {
1111#define __NEED_fsfilcnt_t
1212#include <bits/alltypes.h>
1313
14#include <endian.h>
15
1614struct statvfs {
1715 unsigned long f_bsize, f_frsize;
1816 fsblkcnt_t f_blocks, f_bfree, f_bavail;
lib/libc/musl/include/sys/time.h+14
......@@ -56,6 +56,20 @@ int adjtime (const struct timeval *, struct timeval *);
5656 (void)0 )
5757#endif
5858
59#if _REDIR_TIME64
60__REDIR(gettimeofday, __gettimeofday_time64);
61__REDIR(getitimer, __getitimer_time64);
62__REDIR(setitimer, __setitimer_time64);
63__REDIR(utimes, __utimes_time64);
64#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
65__REDIR(futimes, __futimes_time64);
66__REDIR(futimesat, __futimesat_time64);
67__REDIR(lutimes, __lutimes_time64);
68__REDIR(settimeofday, __settimeofday_time64);
69__REDIR(adjtime, __adjtime64);
70#endif
71#endif
72
5973#ifdef __cplusplus
6074}
6175#endif
lib/libc/musl/include/sys/timeb.h+6
......@@ -4,6 +4,8 @@
44extern "C" {
55#endif
66
7#include <features.h>
8
79#define __NEED_time_t
810
911#include <bits/alltypes.h>
......@@ -16,6 +18,10 @@ struct timeb {
1618
1719int ftime(struct timeb *);
1820
21#if _REDIR_TIME64
22__REDIR(ftime, __ftime64);
23#endif
24
1925#ifdef __cplusplus
2026}
2127#endif
lib/libc/musl/include/sys/timerfd.h+5
......@@ -20,6 +20,11 @@ int timerfd_create(int, int);
2020int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *);
2121int timerfd_gettime(int, struct itimerspec *);
2222
23#if _REDIR_TIME64
24__REDIR(timerfd_settime, __timerfd_settime64);
25__REDIR(timerfd_gettime, __timerfd_gettime64);
26#endif
27
2328#ifdef __cplusplus
2429}
2530#endif
lib/libc/musl/include/sys/timex.h+5
......@@ -91,6 +91,11 @@ struct timex {
9191int adjtimex(struct timex *);
9292int clock_adjtime(clockid_t, struct timex *);
9393
94#if _REDIR_TIME64
95__REDIR(adjtimex, __adjtimex_time64);
96__REDIR(clock_adjtime, __clock_adjtime64);
97#endif
98
9499#ifdef __cplusplus
95100}
96101#endif
lib/libc/musl/include/sys/ttydefaults.h+1-6
......@@ -6,16 +6,11 @@
66#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
77#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
88#define TTYDEF_SPEED (B9600)
9#define CTRL(x) (x&037)
9#define CTRL(x) ((x)&037)
1010#define CEOF CTRL('d')
1111
12#ifdef _POSIX_VDISABLE
13#define CEOL _POSIX_VDISABLE
14#define CSTATUS _POSIX_VDISABLE
15#else
1612#define CEOL '\0'
1713#define CSTATUS '\0'
18#endif
1914
2015#define CERASE 0177
2116#define CINTR CTRL('c')
lib/libc/musl/include/sys/wait.h+9-1
......@@ -13,7 +13,8 @@ extern "C" {
1313typedef enum {
1414 P_ALL = 0,
1515 P_PID = 1,
16 P_PGID = 2
16 P_PGID = 2,
17 P_PIDFD = 3
1718} idtype_t;
1819
1920pid_t wait (int *);
......@@ -53,6 +54,13 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
5354#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
5455#define WIFCONTINUED(s) ((s) == 0xffff)
5556
57#if _REDIR_TIME64
58#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
59__REDIR(wait3, __wait3_time64);
60__REDIR(wait4, __wait4_time64);
61#endif
62#endif
63
5664#ifdef __cplusplus
5765}
5866#endif
lib/libc/musl/include/threads.h+6
......@@ -80,6 +80,12 @@ void tss_delete(tss_t);
8080int tss_set(tss_t, void *);
8181void *tss_get(tss_t);
8282
83#if _REDIR_TIME64
84__REDIR(thrd_sleep, __thrd_sleep_time64);
85__REDIR(mtx_timedlock, __mtx_timedlock_time64);
86__REDIR(cnd_timedwait, __cnd_timedwait_time64);
87#endif
88
8389#ifdef __cplusplus
8490}
8591#endif
lib/libc/musl/include/time.h+28
......@@ -130,6 +130,34 @@ int stime(const time_t *);
130130time_t timegm(struct tm *);
131131#endif
132132
133#if _REDIR_TIME64
134__REDIR(time, __time64);
135__REDIR(difftime, __difftime64);
136__REDIR(mktime, __mktime64);
137__REDIR(gmtime, __gmtime64);
138__REDIR(localtime, __localtime64);
139__REDIR(ctime, __ctime64);
140__REDIR(timespec_get, __timespec_get_time64);
141#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
142 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
143 || defined(_BSD_SOURCE)
144__REDIR(gmtime_r, __gmtime64_r);
145__REDIR(localtime_r, __localtime64_r);
146__REDIR(ctime_r, __ctime64_r);
147__REDIR(nanosleep, __nanosleep_time64);
148__REDIR(clock_getres, __clock_getres_time64);
149__REDIR(clock_gettime, __clock_gettime64);
150__REDIR(clock_settime, __clock_settime64);
151__REDIR(clock_nanosleep, __clock_nanosleep_time64);
152__REDIR(timer_settime, __timer_settime64);
153__REDIR(timer_gettime, __timer_gettime64);
154#endif
155#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
156__REDIR(stime, __stime64);
157__REDIR(timegm, __timegm_time64);
158#endif
159#endif
160
133161#ifdef __cplusplus
134162}
135163#endif
lib/libc/musl/include/utime.h+6
......@@ -5,6 +5,8 @@
55extern "C" {
66#endif
77
8#include <features.h>
9
810#define __NEED_time_t
911
1012#include <bits/alltypes.h>
......@@ -16,6 +18,10 @@ struct utimbuf {
1618
1719int utime (const char *, const struct utimbuf *);
1820
21#if _REDIR_TIME64
22__REDIR(utime, __utime64);
23#endif
24
1925#ifdef __cplusplus
2026}
2127#endif
lib/libc/musl/include/utmpx.h+6-1
......@@ -16,6 +16,7 @@ extern "C" {
1616
1717struct utmpx {
1818 short ut_type;
19 short __ut_pad1;
1920 pid_t ut_pid;
2021 char ut_line[32];
2122 char ut_id[4];
......@@ -25,7 +26,11 @@ struct utmpx {
2526 short __e_termination;
2627 short __e_exit;
2728 } ut_exit;
28 long ut_session;
29#if __BYTE_ORDER == 1234
30 int ut_session, __ut_pad2;
31#else
32 int __ut_pad2, ut_session;
33#endif
2934 struct timeval ut_tv;
3035 unsigned ut_addr_v6[4];
3136 char __unused[20];
lib/libc/musl/src/aio/aio_suspend.c+2
......@@ -73,4 +73,6 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
7373 }
7474}
7575
76#if !_REDIR_TIME64
7677weak_alias(aio_suspend, aio_suspend64);
78#endif
lib/libc/musl/src/complex/cacosh.c+4-1
......@@ -4,6 +4,9 @@
44
55double complex cacosh(double complex z)
66{
7 int zineg = signbit(cimag(z));
8
79 z = cacos(z);
8 return CMPLX(-cimag(z), creal(z));
10 if (zineg) return CMPLX(cimag(z), -creal(z));
11 else return CMPLX(-cimag(z), creal(z));
912}
lib/libc/musl/src/complex/cacoshf.c+4-1
......@@ -2,6 +2,9 @@
22
33float complex cacoshf(float complex z)
44{
5 int zineg = signbit(cimagf(z));
6
57 z = cacosf(z);
6 return CMPLXF(-cimagf(z), crealf(z));
8 if (zineg) return CMPLXF(cimagf(z), -crealf(z));
9 else return CMPLXF(-cimagf(z), crealf(z));
710}
lib/libc/musl/src/complex/cacoshl.c+4-1
......@@ -8,7 +8,10 @@ long double complex cacoshl(long double complex z)
88#else
99long double complex cacoshl(long double complex z)
1010{
11 int zineg = signbit(cimagl(z));
12
1113 z = cacosl(z);
12 return CMPLXL(-cimagl(z), creall(z));
14 if (zineg) return CMPLXL(cimagl(z), -creall(z));
15 else return CMPLXL(-cimagl(z), creall(z));
1316}
1417#endif
lib/libc/musl/src/complex/catanf.c+1-13
......@@ -87,29 +87,17 @@ float complex catanf(float complex z)
8787 x = crealf(z);
8888 y = cimagf(z);
8989
90 if ((x == 0.0f) && (y > 1.0f))
91 goto ovrf;
92
9390 x2 = x * x;
9491 a = 1.0f - x2 - (y * y);
95 if (a == 0.0f)
96 goto ovrf;
9792
9893 t = 0.5f * atan2f(2.0f * x, a);
9994 w = _redupif(t);
10095
10196 t = y - 1.0f;
10297 a = x2 + (t * t);
103 if (a == 0.0f)
104 goto ovrf;
10598
10699 t = y + 1.0f;
107100 a = (x2 + (t * t))/a;
108 w = w + (0.25f * logf (a)) * I;
109 return w;
110
111ovrf:
112 // FIXME
113 w = MAXNUMF + MAXNUMF * I;
101 w = CMPLXF(w, 0.25f * logf(a));
114102 return w;
115103}
lib/libc/musl/src/complex/catanl.c+1-13
......@@ -97,30 +97,18 @@ long double complex catanl(long double complex z)
9797 x = creall(z);
9898 y = cimagl(z);
9999
100 if ((x == 0.0L) && (y > 1.0L))
101 goto ovrf;
102
103100 x2 = x * x;
104101 a = 1.0L - x2 - (y * y);
105 if (a == 0.0L)
106 goto ovrf;
107102
108103 t = atan2l(2.0L * x, a) * 0.5L;
109104 w = redupil(t);
110105
111106 t = y - 1.0L;
112107 a = x2 + (t * t);
113 if (a == 0.0L)
114 goto ovrf;
115108
116109 t = y + 1.0L;
117110 a = (x2 + (t * t)) / a;
118 w = w + (0.25L * logl(a)) * I;
119 return w;
120
121ovrf:
122 // FIXME
123 w = LDBL_MAX + LDBL_MAX * I;
111 w = CMPLXF(w, 0.25L * logl(a));
124112 return w;
125113}
126114#endif
lib/libc/musl/src/ctype/alpha.h+84-75
......@@ -8,17 +8,17 @@
8817,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
9917,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
101016,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,
1168,69,70,71,72,73,74,17,75,76,77,78,79,80,16,16,16,81,82,83,84,85,86,87,88,89,
1216,90,16,91,92,16,16,17,17,17,93,94,95,16,16,16,16,16,16,16,16,16,16,17,17,17,
1317,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,97,16,16,16,16,16,16,
1168,69,70,71,72,73,74,17,75,76,77,78,79,80,81,16,82,83,84,85,86,87,88,89,90,91,
1292,93,16,94,95,96,16,17,17,17,97,98,99,16,16,16,16,16,16,16,16,16,16,17,17,17,
1317,100,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,101,16,16,16,16,16,
141416,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1516,17,17,98,99,16,16,16,100,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
1617,17,17,17,17,17,17,101,17,17,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,103,
18104,16,16,16,16,16,16,16,16,16,105,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1916,16,16,16,16,16,16,16,16,106,107,108,109,16,16,16,16,16,16,16,16,110,16,16,
2016,16,16,16,16,111,112,16,16,16,16,113,16,16,114,16,16,16,16,16,16,16,16,16,
2116,16,16,16,
1516,16,17,17,102,103,16,16,104,105,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
1617,17,17,17,17,17,17,17,17,106,17,17,107,16,16,16,16,16,16,16,16,16,16,16,16,
1716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,
18108,109,16,16,16,16,16,16,16,16,16,110,16,16,16,16,16,16,16,16,16,16,16,16,16,
1916,16,16,16,16,16,16,16,16,16,111,112,113,114,16,16,16,16,16,16,16,16,115,116,
20117,16,16,16,16,16,118,119,16,16,16,16,120,16,16,121,16,16,16,16,16,16,16,16,
2116,16,16,16,16,
222216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
2323255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2424255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,
......@@ -27,8 +27,8 @@
2727255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,188,64,215,255,255,
2828251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,
2929255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,
30255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,254,255,255,
31255,255,0,0,0,0,0,255,191,182,0,255,255,255,7,7,0,0,0,255,7,255,255,255,255,
30255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,255,255,255,
31255,255,1,0,0,0,0,255,191,182,0,255,255,255,135,7,0,0,0,255,7,255,255,255,255,
3232255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,
333331,254,225,255,
3434159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,
......@@ -42,54 +42,55 @@
4242255,0,0,239,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,239,223,253,
4343255,255,255,255,231,223,93,240,128,207,255,0,252,236,255,127,252,255,255,251,
444447,127,128,95,255,192,255,12,0,254,255,255,255,255,127,255,7,63,32,255,3,0,0,
450,0,150,37,240,254,174,236,255,59,95,32,255,243,0,0,0,
450,0,214,247,255,255,175,255,255,59,95,32,255,243,0,0,0,
46460,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,
4731,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,231,193,255,
48255,127,64,255,51,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,
4731,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,255,255,255,
48255,255,255,255,63,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,
4949255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,
5050127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,
51135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255,
517,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255,
5252255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
5353255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
5454255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,
5555255,199,255,1,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,
5656255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,
57255,255,255,255,255,0,255,255,255,255,255,7,255,255,255,255,255,255,255,255,
57255,255,255,255,255,1,255,255,255,255,255,7,255,255,255,255,255,255,255,255,
585863,
59590,255,255,255,127,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,
6060255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,
6161127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,
6262255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,
63255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,255,255,255,255,255,63,
64255,1,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,255,255,255,255,255,255,
65255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,31,0,
66255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,255,255,255,
67255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,
680,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,224,67,0,0,
69255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
63255,191,255,3,0,255,255,255,255,255,255,127,0,255,227,255,255,255,255,255,63,
64255,1,255,255,255,255,255,231,0,0,0,0,0,222,111,4,255,255,255,255,255,255,255,
65255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,
66128,255,31,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,
67255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,
680,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,
69224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
70700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,
71710,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,
7272255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,
7373255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,
7474255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
75750,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,
76255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,127,254,255,
76255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,255,254,255,
7777255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,
7878255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
7979255,255,255,63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
80255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,
80255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,
81810,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,
82820,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,
8383255,127,240,143,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,
84840,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,249,255,255,255,
85127,255,0,0,0,0,0,0,0,128,255,187,247,255,255,255,0,0,0,255,255,255,255,255,
86255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,40,255,255,255,
87255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,255,
880,128,255,3,223,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,255,
89255,127,196,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,126,
900,127,127,255,255,255,255,255,247,63,0,255,255,255,255,255,255,255,255,255,
91255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,255,
92255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,255,
85255,255,255,124,0,0,0,0,0,128,255,191,255,255,255,255,0,0,0,255,255,255,255,
86255,255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,232,255,255,
87255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,
88255,0,128,255,3,255,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,
89255,255,127,252,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,
90126,0,127,127,255,255,255,255,255,247,255,0,255,255,255,255,255,255,255,255,
91255,255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,
92255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,
93255,
939415,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,
9495255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,
9596255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,
......@@ -109,55 +110,63 @@
1091100,0,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,255,255,
110111127,0,255,255,255,127,0,0,0,0,0,0,0,0,255,255,55,0,255,255,63,0,255,255,255,3,
1111120,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,
112254,255,255,15,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255,
113254,255,255,63,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255,
113114255,31,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,255,255,3,
1141150,0,0,0,0,0,0,0,0,0,0,0,
1151160,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,255,255,255,255,255,255,7,
1160,255,255,255,255,255,255,7,0,255,255,255,255,255,255,255,255,63,0,0,0,192,
117255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255,
118255,255,199,255,0,0,255,255,255,255,71,0,255,255,255,255,255,255,255,255,30,0,
119255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,127,189,255,191,
120255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,253,237,227,159,
12125,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
122255,255,187,7,255,3,0,0,0,0,255,255,255,255,255,255,255,255,179,0,255,3,0,0,0,
1170,255,255,255,255,255,255,7,0,255,255,255,255,255,0,255,3,0,0,0,0,0,0,0,0,0,0,
1180,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,128,0,255,255,63,0,0,0,0,0,0,0,0,0,
1190,0,0,0,0,0,0,0,0,0,255,255,127,0,255,255,255,255,255,255,255,255,63,0,0,0,
120192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,
121255,255,255,199,255,112,0,255,255,255,255,71,0,255,255,255,255,255,255,255,
122255,30,0,255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,127,
123189,255,191,255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,253,
124237,227,159,25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,
125255,255,255,255,255,187,7,255,131,0,0,0,0,255,255,255,255,255,255,255,255,179,
1260,255,3,0,0,0,
1231270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,127,0,0,0,63,0,0,
1241280,0,255,255,255,255,255,255,255,127,17,0,255,3,0,0,0,0,255,255,255,255,255,
125255,63,0,255,3,0,0,0,0,0,
1260,255,255,255,227,255,7,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,3,
1280,128,255,255,255,255,255,255,231,127,0,0,255,255,255,255,255,255,207,255,255,
1290,0,0,0,0,255,255,255,255,255,255,255,1,255,253,255,255,255,255,127,127,1,0,
130255,3,0,0,252,255,255,255,252,255,255,254,127,0,0,0,0,0,0,0,0,0,127,251,255,
131255,255,255,127,180,203,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
129255,63,1,255,3,0,0,0,0,0,0,255,255,255,231,255,7,255,3,0,0,0,0,0,0,0,0,0,0,0,
1300,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,
1310,255,255,255,255,255,255,255,255,255,3,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1320,0,0,0,255,252,255,255,255,255,255,252,26,0,0,0,255,255,255,255,255,255,231,
133127,0,0,255,255,255,255,255,255,255,255,255,32,0,0,0,0,255,255,255,255,255,
134255,255,1,255,253,255,255,255,255,127,127,1,0,255,3,0,0,252,255,255,255,252,
135255,255,254,127,0,0,0,0,0,0,0,0,0,127,251,255,255,255,255,127,180,203,0,255,3,
136191,253,255,255,255,127,123,1,255,3,0,0,0,0,0,0,0,0,0,
1370,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,127,0,255,
132138255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,
1331390,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,
1341400,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
135255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1360,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
137255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1380,0,255,255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,
1390,255,255,255,63,0,0,255,255,255,255,255,255,127,0,15,0,255,3,248,255,255,224,
140255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255,
141255,255,255,255,127,0,0,248,255,0,0,0,0,0,0,0,0,3,0,0,0,255,255,255,255,255,
141255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
142255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
143255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
144255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,0,255,
145255,255,63,0,0,255,255,255,255,255,255,0,0,15,0,255,3,248,255,255,224,255,255,
1460,0,0,0,0,0,0,0,0,0,0,0,0,
1470,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1480,0,255,255,255,255,255,255,255,255,255,135,255,255,255,255,255,255,255,128,
149255,255,0,0,0,0,0,0,0,0,11,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
142150255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
143255,255,255,255,255,31,0,0,255,255,255,255,255,255,255,255,255,255,255,255,
144255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,
145255,255,255,127,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,
146255,255,255,255,255,255,255,
151255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
152255,255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,
1530,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
147154255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
148255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,255,
149255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,0,0,
150255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,
151223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,
152255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
155255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,
156255,255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,
1570,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,
158255,223,100,222,255,235,239,255,255,255,255,255,255,
159255,191,231,223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255,
153160255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
154255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,
155247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,
156255,255,255,253,255,255,247,207,255,255,255,255,255,255,127,255,255,249,219,7,
1570,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
158255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,
1590,0,0,0,0,
1600,255,255,255,255,255,255,255,255,143,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1610,0,0,0,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,
162255,15,238,251,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,255,3,
163255,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
161255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,
162253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,
163255,255,127,255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255,
164255,255,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1650,0,255,255,255,255,255,31,128,63,255,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,
16715,255,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
168255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
169143,8,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1700,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255,
17115,238,251,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,255,3,255,
172255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
lib/libc/musl/src/ctype/casemap.h created+297
......@@ -0,0 +1,297 @@
1static const unsigned char tab[] = {
2 7, 8, 9, 10, 11, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
3 13, 6, 6, 14, 6, 6, 6, 6, 6, 6, 6, 6, 15, 16, 17, 18,
4 6, 19, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 20, 21, 6, 6,
5 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
8 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
9 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
10 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
11 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
12 6, 6, 6, 6, 6, 6, 22, 23, 6, 6, 6, 24, 6, 6, 6, 6,
13 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
14 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
15 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
16 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
17 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 25,
18 6, 6, 6, 6, 26, 6, 6, 6, 6, 6, 6, 6, 27, 6, 6, 6,
19 6, 6, 6, 6, 6, 6, 6, 6, 28, 6, 6, 6, 6, 6, 6, 6,
20 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
21 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
22 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
23 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
24 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 29, 6,
25 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
26 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
27 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
28 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
29 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
30 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
31 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
32 6, 6, 6, 6, 6, 6, 6, 6, 6, 30, 6, 6, 6, 6, 6, 6,
33 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
34 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
35 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
36 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
37 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
40 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36,
41 43, 43, 43, 43, 43, 43, 43, 43, 1, 0, 84, 86, 86, 86, 86, 86,
42 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 43, 43, 43, 43, 43, 43,
44 43, 7, 43, 43, 91, 86, 86, 86, 86, 86, 86, 86, 74, 86, 86, 5,
45 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
46 36, 80, 121, 49, 80, 49, 80, 49, 56, 80, 49, 80, 49, 80, 49, 80,
47 49, 80, 49, 80, 49, 80, 49, 80, 78, 49, 2, 78, 13, 13, 78, 3,
48 78, 0, 36, 110, 0, 78, 49, 38, 110, 81, 78, 36, 80, 78, 57, 20,
49 129, 27, 29, 29, 83, 49, 80, 49, 80, 13, 49, 80, 49, 80, 49, 80,
50 27, 83, 36, 80, 49, 2, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123,
51 20, 121, 92, 123, 92, 123, 92, 45, 43, 73, 3, 72, 3, 120, 92, 123,
52 20, 0, 150, 10, 1, 43, 40, 6, 6, 0, 42, 6, 42, 42, 43, 7,
53 187, 181, 43, 30, 0, 43, 7, 43, 43, 43, 1, 43, 43, 43, 43, 43,
54 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
55 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1, 43, 43, 43, 43,
56 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
57 43, 43, 43, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
58 43, 205, 70, 205, 43, 0, 37, 43, 7, 1, 6, 1, 85, 86, 86, 86,
59 86, 86, 85, 86, 86, 2, 36, 129, 129, 129, 129, 129, 21, 129, 129, 129,
60 0, 0, 43, 0, 178, 209, 178, 209, 178, 209, 178, 209, 0, 0, 205, 204,
61 1, 0, 215, 215, 215, 215, 215, 131, 129, 129, 129, 129, 129, 129, 129, 129,
62 129, 129, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 28, 0, 0, 0,
63 0, 0, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 2, 0, 0,
64 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
65 49, 80, 78, 49, 80, 49, 80, 78, 49, 80, 49, 80, 49, 80, 49, 80,
66 49, 80, 49, 80, 49, 80, 49, 2, 135, 166, 135, 166, 135, 166, 135, 166,
67 135, 166, 135, 166, 135, 166, 135, 166, 42, 43, 43, 43, 43, 43, 43, 43,
68 43, 43, 43, 43, 43, 0, 0, 0, 84, 86, 86, 86, 86, 86, 86, 86,
69 86, 86, 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
72 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
73 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
74 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
75 0, 0, 0, 84, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
76 12, 0, 12, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
77 43, 7, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
78 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
79 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
80 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43,
81 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
82 43, 43, 43, 43, 86, 86, 108, 129, 21, 0, 43, 43, 43, 43, 43, 43,
83 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
84 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
85 43, 43, 43, 43, 7, 108, 3, 65, 43, 43, 86, 86, 86, 86, 86, 86,
86 86, 86, 86, 86, 86, 86, 86, 86, 44, 86, 43, 43, 43, 43, 43, 43,
87 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1,
88 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
90 0, 0, 0, 0, 0, 0, 0, 0, 12, 108, 0, 0, 0, 0, 0, 6,
91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
92 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
93 0, 0, 0, 0, 0, 0, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
94 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
95 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
96 6, 37, 6, 37, 6, 37, 6, 37, 86, 122, 158, 38, 6, 37, 6, 37,
97 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
98 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 1, 43, 43, 79, 86,
99 86, 44, 43, 127, 86, 86, 57, 43, 43, 85, 86, 86, 43, 43, 79, 86,
100 86, 44, 43, 127, 86, 86, 129, 55, 117, 91, 123, 92, 43, 43, 79, 86,
101 86, 2, 172, 4, 0, 0, 57, 43, 43, 85, 86, 86, 43, 43, 79, 86,
102 86, 44, 43, 43, 86, 86, 50, 19, 129, 87, 0, 111, 129, 126, 201, 215,
103 126, 45, 129, 129, 14, 126, 57, 127, 111, 87, 0, 129, 129, 126, 21, 0,
104 126, 3, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 43,
105 36, 43, 151, 43, 43, 43, 43, 43, 43, 43, 43, 43, 42, 43, 43, 43,
106 43, 43, 86, 86, 86, 86, 86, 128, 129, 129, 129, 129, 57, 187, 42, 43,
107 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
108 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
109 43, 43, 43, 43, 43, 43, 43, 1, 129, 129, 129, 129, 129, 129, 129, 129,
110 129, 129, 129, 129, 129, 129, 129, 201, 172, 172, 172, 172, 172, 172, 172, 172,
111 172, 172, 172, 172, 172, 172, 172, 208, 13, 0, 78, 49, 2, 180, 193, 193,
112 215, 215, 36, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
113 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
114 49, 80, 49, 80, 215, 215, 83, 193, 71, 212, 215, 215, 215, 5, 43, 43,
115 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 1, 0, 1, 0, 0,
116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
121 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 49, 80, 49, 80, 49, 80,
122 49, 80, 49, 80, 49, 80, 49, 80, 13, 0, 0, 0, 0, 0, 36, 80,
123 49, 80, 49, 80, 49, 80, 49, 80, 0, 0, 0, 0, 0, 0, 0, 0,
124 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43, 43, 43,
126 43, 43, 43, 43, 43, 121, 92, 123, 92, 123, 79, 123, 92, 123, 92, 123,
127 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 45,
128 43, 43, 121, 20, 92, 123, 92, 45, 121, 42, 92, 39, 92, 123, 92, 123,
129 92, 123, 164, 0, 10, 180, 92, 123, 92, 123, 79, 3, 42, 43, 43, 43,
130 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1,
131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0,
133 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
134 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
137 0, 43, 43, 43, 43, 43, 43, 43, 43, 7, 0, 72, 86, 86, 86, 86,
138 86, 86, 86, 86, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43,
142 43, 43, 43, 43, 43, 43, 43, 43, 43, 85, 86, 86, 86, 86, 86, 86,
143 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
145 0, 0, 0, 0, 0, 0, 36, 43, 43, 43, 43, 43, 43, 43, 43, 43,
146 43, 43, 7, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
148 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 43, 43, 43,
150 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 0, 0,
151 0, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
152 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
153 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
154 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 43,
156 43, 43, 43, 43, 43, 43, 43, 43, 86, 86, 86, 86, 86, 86, 86, 86,
157 86, 86, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
158 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
159 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 86, 86,
160 86, 86, 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0, 0, 0,
161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
163 0, 0, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 85,
164 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0,
165 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
166 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
169};
170static const int rules[] = {
171 0x0, 0x2001, -0x2000, 0x1dbf00, 0x2e700, 0x7900,
172 0x2402, 0x101, -0x100, 0x0, 0x201, -0x200,
173 -0xc6ff, -0xe800, -0x78ff, -0x12c00, 0xc300, 0xd201,
174 0xce01, 0xcd01, 0x4f01, 0xca01, 0xcb01, 0xcf01,
175 0x6100, 0xd301, 0xd101, 0xa300, 0xd501, 0x8200,
176 0xd601, 0xda01, 0xd901, 0xdb01, 0x3800, 0x3,
177 -0x4f00, -0x60ff, -0x37ff, 0x242802, 0x0, 0x101,
178 -0x100, -0xcd00, -0xda00, -0x81ff, 0x2a2b01, -0xa2ff,
179 0x2a2801, 0x2a3f00, -0xc2ff, 0x4501, 0x4701, 0x2a1f00,
180 0x2a1c00, 0x2a1e00, -0xd200, -0xce00, -0xca00, -0xcb00,
181 0xa54f00, 0xa54b00, -0xcf00, 0xa52800, 0xa54400, -0xd100,
182 -0xd300, 0x29f700, 0xa54100, 0x29fd00, -0xd500, -0xd600,
183 0x29e700, 0xa54300, 0xa52a00, -0x4500, -0xd900, -0x4700,
184 -0xdb00, 0xa51500, 0xa51200, 0x4c2402, 0x0, 0x2001,
185 -0x2000, 0x101, -0x100, 0x5400, 0x7401, 0x2601,
186 0x2501, 0x4001, 0x3f01, -0x2600, -0x2500, -0x1f00,
187 -0x4000, -0x3f00, 0x801, -0x3e00, -0x3900, -0x2f00,
188 -0x3600, -0x800, -0x5600, -0x5000, 0x700, -0x7400,
189 -0x3bff, -0x6000, -0x6ff, 0x701a02, 0x101, -0x100,
190 0x2001, -0x2000, 0x5001, 0xf01, -0xf00, 0x0,
191 0x3001, -0x3000, 0x101, -0x100, 0x0, 0xbc000,
192 0x1c6001, 0x0, 0x97d001, 0x801, -0x800, 0x8a0502,
193 0x0, -0xbbfff, -0x186200, 0x89c200, -0x182500, -0x186e00,
194 -0x186d00, -0x186400, -0x186300, -0x185c00, 0x0, 0x8a3800,
195 0x8a0400, 0xee600, 0x101, -0x100, 0x0, -0x3b00,
196 -0x1dbeff, 0x8f1d02, 0x800, -0x7ff, 0x0, 0x5600,
197 -0x55ff, 0x4a00, 0x6400, 0x8000, 0x7000, 0x7e00,
198 0x900, -0x49ff, -0x8ff, -0x1c2500, -0x63ff, -0x6fff,
199 -0x7fff, -0x7dff, 0xac0502, 0x0, 0x1001, -0x1000,
200 0x1c01, 0x101, -0x1d5cff, -0x20beff, -0x2045ff, -0x1c00,
201 0xb10b02, 0x101, -0x100, 0x3001, -0x3000, 0x0,
202 -0x29f6ff, -0xee5ff, -0x29e6ff, -0x2a2b00, -0x2a2800, -0x2a1bff,
203 -0x29fcff, -0x2a1eff, -0x2a1dff, -0x2a3eff, 0x0, -0x1c6000,
204 0x0, 0x101, -0x100, 0xbc0c02, 0x0, 0x101,
205 -0x100, -0xa543ff, 0x3a001, -0x8a03ff, -0xa527ff, 0x3000,
206 -0xa54eff, -0xa54aff, -0xa540ff, -0xa511ff, -0xa529ff, -0xa514ff,
207 -0x2fff, -0xa542ff, -0x8a37ff, 0x0, -0x97d000, -0x3a000,
208 0x0, 0x2001, -0x2000, 0x0, 0x2801, -0x2800,
209 0x0, 0x4001, -0x4000, 0x0, 0x2001, -0x2000,
210 0x0, 0x2001, -0x2000, 0x0, 0x2201, -0x2200,
211};
212static const unsigned char rulebases[] = {
213 0, 6, 39, 81, 111, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
214 124, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 131, 142, 146, 151,
215 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 196, 0, 0,
216 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
217 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
218 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
222 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
223 0, 0, 0, 0, 0, 0, 198, 201, 0, 0, 0, 219, 0, 0, 0, 0,
224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
225 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
226 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
227 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222,
229 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 0,
230 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0,
231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
232 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
233 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
234 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
235 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 0,
236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
237 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
238 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
240 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
245};
246static const unsigned char exceptions[][2] = {
247 { 48, 12 }, { 49, 13 }, { 120, 14 }, { 127, 15 },
248 { 128, 16 }, { 129, 17 }, { 134, 18 }, { 137, 19 },
249 { 138, 19 }, { 142, 20 }, { 143, 21 }, { 144, 22 },
250 { 147, 19 }, { 148, 23 }, { 149, 24 }, { 150, 25 },
251 { 151, 26 }, { 154, 27 }, { 156, 25 }, { 157, 28 },
252 { 158, 29 }, { 159, 30 }, { 166, 31 }, { 169, 31 },
253 { 174, 31 }, { 177, 32 }, { 178, 32 }, { 183, 33 },
254 { 191, 34 }, { 197, 35 }, { 200, 35 }, { 203, 35 },
255 { 221, 36 }, { 242, 35 }, { 246, 37 }, { 247, 38 },
256 { 32, 45 }, { 58, 46 }, { 61, 47 }, { 62, 48 },
257 { 63, 49 }, { 64, 49 }, { 67, 50 }, { 68, 51 },
258 { 69, 52 }, { 80, 53 }, { 81, 54 }, { 82, 55 },
259 { 83, 56 }, { 84, 57 }, { 89, 58 }, { 91, 59 },
260 { 92, 60 }, { 97, 61 }, { 99, 62 }, { 101, 63 },
261 { 102, 64 }, { 104, 65 }, { 105, 66 }, { 106, 64 },
262 { 107, 67 }, { 108, 68 }, { 111, 66 }, { 113, 69 },
263 { 114, 70 }, { 117, 71 }, { 125, 72 }, { 130, 73 },
264 { 135, 74 }, { 137, 75 }, { 138, 76 }, { 139, 76 },
265 { 140, 77 }, { 146, 78 }, { 157, 79 }, { 158, 80 },
266 { 69, 87 }, { 123, 29 }, { 124, 29 }, { 125, 29 },
267 { 127, 88 }, { 134, 89 }, { 136, 90 }, { 137, 90 },
268 { 138, 90 }, { 140, 91 }, { 142, 92 }, { 143, 92 },
269 { 172, 93 }, { 173, 94 }, { 174, 94 }, { 175, 94 },
270 { 194, 95 }, { 204, 96 }, { 205, 97 }, { 206, 97 },
271 { 207, 98 }, { 208, 99 }, { 209, 100 }, { 213, 101 },
272 { 214, 102 }, { 215, 103 }, { 240, 104 }, { 241, 105 },
273 { 242, 106 }, { 243, 107 }, { 244, 108 }, { 245, 109 },
274 { 249, 110 }, { 253, 45 }, { 254, 45 }, { 255, 45 },
275 { 80, 105 }, { 81, 105 }, { 82, 105 }, { 83, 105 },
276 { 84, 105 }, { 85, 105 }, { 86, 105 }, { 87, 105 },
277 { 88, 105 }, { 89, 105 }, { 90, 105 }, { 91, 105 },
278 { 92, 105 }, { 93, 105 }, { 94, 105 }, { 95, 105 },
279 { 130, 0 }, { 131, 0 }, { 132, 0 }, { 133, 0 },
280 { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 },
281 { 192, 117 }, { 207, 118 }, { 128, 137 }, { 129, 138 },
282 { 130, 139 }, { 133, 140 }, { 134, 141 }, { 112, 157 },
283 { 113, 157 }, { 118, 158 }, { 119, 158 }, { 120, 159 },
284 { 121, 159 }, { 122, 160 }, { 123, 160 }, { 124, 161 },
285 { 125, 161 }, { 179, 162 }, { 186, 163 }, { 187, 163 },
286 { 188, 164 }, { 190, 165 }, { 195, 162 }, { 204, 164 },
287 { 218, 166 }, { 219, 166 }, { 229, 106 }, { 234, 167 },
288 { 235, 167 }, { 236, 110 }, { 243, 162 }, { 248, 168 },
289 { 249, 168 }, { 250, 169 }, { 251, 169 }, { 252, 164 },
290 { 38, 176 }, { 42, 177 }, { 43, 178 }, { 78, 179 },
291 { 132, 8 }, { 98, 186 }, { 99, 187 }, { 100, 188 },
292 { 101, 189 }, { 102, 190 }, { 109, 191 }, { 110, 192 },
293 { 111, 193 }, { 112, 194 }, { 126, 195 }, { 127, 195 },
294 { 125, 207 }, { 141, 208 }, { 148, 209 }, { 171, 210 },
295 { 172, 211 }, { 173, 212 }, { 176, 213 }, { 177, 214 },
296 { 178, 215 }, { 196, 216 }, { 197, 217 }, { 198, 218 },
297};
lib/libc/musl/src/ctype/nonspacing.h+48-40
......@@ -8,16 +8,16 @@
8816,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
9916,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
101016,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50,
1151,16,52,53,54,16,16,16,16,16,16,55,16,16,16,16,16,56,57,58,59,60,61,62,63,16,
1216,64,16,65,66,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1151,16,52,53,54,16,16,16,16,16,16,55,16,16,56,16,57,58,59,60,61,62,63,64,65,66,
1267,68,16,69,70,71,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1316,72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
131416,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1516,16,16,73,74,16,16,16,75,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
141616,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1516,16,16,67,68,16,16,16,69,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
161716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1816,16,16,16,16,16,16,70,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1916,16,71,72,16,16,16,16,16,16,16,73,16,16,16,16,16,74,16,16,16,16,16,16,16,75,
2076,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1816,16,16,16,16,16,16,76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1916,16,77,78,16,16,16,16,16,16,16,79,16,16,16,16,16,80,81,82,16,16,16,16,16,83,
2084,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
212116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
2222255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2323255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
......@@ -25,16 +25,16 @@
25250,0,0,0,0,0,0,248,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
26260,0,0,254,255,255,255,255,191,182,0,0,0,0,0,0,0,63,0,255,23,0,0,0,0,0,248,255,
2727255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,192,191,159,61,0,0,0,128,2,0,0,0,255,255,255,
287,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,0,0,0,192,251,239,62,0,0,0,
290,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,255,255,255,255,
287,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,32,0,0,192,251,239,62,0,0,
290,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,
3030255,7,0,0,0,0,0,0,20,254,33,254,0,12,0,0,0,2,0,0,0,0,0,0,16,30,32,0,0,12,0,0,
310,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0,252,
322,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,1,0,0,
330,0,0,0,192,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0,0,0,
340,0,0,24,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0,242,
357,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,27,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160,2,0,
360,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0,0,
37224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0,
3164,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0,
32252,2,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,17,
330,0,0,0,0,0,192,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0,
340,0,0,0,0,24,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0,
35242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,31,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160,
362,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0,
370,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0,
38380,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,
39390,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,120,0,0,
40400,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0,
......@@ -48,9 +48,9 @@
48480,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,
49490,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
50500,0,0,128,247,63,0,0,0,192,0,0,0,0,0,0,0,0,0,0,3,0,68,8,0,0,96,0,0,0,0,0,0,0,
510,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,0,0,0,0,0,192,63,0,0,128,255,3,0,0,
520,0,0,7,0,0,0,0,0,200,19,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0,
5316,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,
510,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,128,255,3,0,
520,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,
530,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,
54540,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64,
55550,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255,255,0,
56560,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,
......@@ -58,24 +58,32 @@
58580,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
59590,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
60600,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,
610,2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,0,0,0,0,0,0,0,7,
620,0,0,128,239,31,0,0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,28,0,0,0,0,0,0,0,0,0,
630,0,128,211,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,
640,0,16,1,0,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
6592,0,0,0,0,0,0,0,0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
660,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,
670,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,0,224,188,15,0,0,0,0,0,0,0,0,0,0,0,0,
680,0,0,0,0,0,0,0,0,0,0,0,0,
690,126,6,0,0,0,0,248,121,128,0,126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,
700,0,0,0,0,0,0,0,127,191,0,0,0,0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,
710,0,0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
720,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,
730,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7596,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,
760,60,0,0,0,0,0,0,0,0,0,
770,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
78255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0,
790,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,
810,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
610,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
620,0,0,192,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255,
63127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,
640,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0,
650,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192,
6631,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0,
670,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
680,60,176,1,0,0,48,0,0,0,
690,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,
700,224,188,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
71128,255,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
720,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,
73126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0,
740,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,180,191,0,
750,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
760,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
770,0,0,0,0,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
780,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0,
790,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,
800,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,
810,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0,
820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
830,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,
84254,255,0,0,0,0,0,0,0,0,0,
850,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
860,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
880,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0,
890,0,0,0,0,0,0,0,0,0,0,0,0,0,
lib/libc/musl/src/ctype/punct.h+86-74
......@@ -8,17 +8,17 @@
8816,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
9916,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,64,16,16,16,16,16,16,16,16,16,
101016,16,16,16,16,16,16,16,16,16,16,16,16,16,65,16,16,66,16,67,68,
1169,16,70,71,72,16,73,16,16,74,75,76,77,78,16,79,16,80,81,82,83,84,85,86,87,88,
1216,89,16,90,91,16,16,16,16,16,16,92,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1169,16,70,71,72,16,73,16,16,74,75,76,77,78,16,79,80,81,82,83,84,85,86,87,88,89,
1290,91,16,92,93,94,95,16,16,16,16,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1316,97,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
131416,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1516,16,16,98,99,16,16,100,101,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
141616,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1516,16,16,93,94,16,16,16,95,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
161716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1816,16,16,16,16,16,16,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1916,97,98,99,100,16,16,101,102,17,17,103,16,16,16,16,16,16,16,16,16,16,16,16,
2016,104,105,16,16,16,16,106,16,107,108,109,17,17,17,110,111,112,113,16,16,16,
2116,16,
1816,16,16,16,16,16,16,16,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1916,16,16,103,104,105,106,16,16,107,108,17,17,109,16,16,16,16,16,16,110,111,16,
2016,16,16,16,112,113,16,16,114,115,116,16,117,118,119,17,17,17,120,121,122,123,
21124,16,16,16,16,
222216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
2323255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2424255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1,
......@@ -28,25 +28,25 @@
28280,0,0,0,0,0,0,0,0,0,0,0,0,0,252,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
29290,0,0,252,0,0,0,0,0,230,254,255,255,255,0,64,73,0,0,0,0,0,24,0,255,255,0,216,
30300,0,0,0,0,0,0,1,0,60,0,0,0,0,0,0,0,0,0,0,0,0,16,224,1,30,0,
3196,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,3,
320,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,252,0,0,0,0,0,
330,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,47,0,0,0,0,0,
340,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,224,0,0,0,0,0,0,0,16,
350,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,32,0,
360,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,160,0,127,0,
370,255,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,0,12,0,0,
380,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,
3196,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,
32227,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,7,252,0,0,0,
330,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,111,0,0,0,
340,0,0,0,16,0,32,0,0,0,0,64,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,224,0,0,0,0,0,0,
350,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,16,0,0,0,0,0,0,0,0,
3632,0,0,0,0,128,255,16,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,160,
370,127,0,0,255,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,
380,12,0,0,0,0,0,0,0,0,0,0,0,4,0,31,0,0,0,0,0,
39390,254,255,255,255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223,
40255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0,
410,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,
420,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
430,0,0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,
440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,
450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,
460,0,0,0,0,0,0,0,0,0,0,0,0,196,255,255,255,
40255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,
410,0,8,0,0,0,0,0,0,0,0,0,0,0,224,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,0,0,
420,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
430,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0,
440,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0,
450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0,
460,0,0,0,0,0,0,0,0,0,0,196,255,255,255,
4747255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,127,63,255,127,0,0,0,0,0,0,
48480,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,0,12,0,0,0,0,0,0,64,0,
4912,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,
4912,240,0,0,0,0,0,0,128,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,
5050255,33,144,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,
5151127,0,224,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,3,224,0,224,0,
5252224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,223,255,241,127,255,
......@@ -55,22 +55,23 @@
5555255,255,255,255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255,
5656255,63,0,0,0,0,0,0,252,255,
5757255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,207,255,255,255,
5863,255,255,255,255,227,255,253,7,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
590,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,128,0,0,0,
600,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,255,255,3,0,0,0,0,0,0,
61255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,
5863,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,
590,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
60128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,255,255,255,0,
610,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,
6262255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
63255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,0,0,0,0,0,0,
640,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
650,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,255,255,255,
63255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,
640,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
65255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,
6666255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
67127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
67255,255,255,
68255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
6869255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,0,0,
69700,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7071255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7168,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,23,
720,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,32,0,0,0,0,0,
730,0,0,0,0,0,0,0,0,240,0,0,128,59,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,
7264,0,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,23,
730,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,0,0,0,0,0,0,
740,0,0,0,0,0,0,0,0,240,0,0,128,3,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,
74750,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,
75760,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
76770,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,0,0,0,
......@@ -84,46 +85,57 @@
84850,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
8586128,255,0,0,128,255,0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,248,0,0,192,143,0,0,0,
8687128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,252,255,255,255,255,255,0,0,0,0,
870,0,0,135,255,0,255,1,0,0,0,224,0,0,0,224,0,0,0,0,0,1,0,0,96,248,127,0,0,0,0,
880,0,0,135,255,1,255,1,0,0,0,224,0,0,0,224,0,0,0,0,0,1,0,0,96,248,127,0,0,0,0,
88890,0,0,0,254,0,0,0,255,0,0,0,255,0,0,0,30,0,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
89900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,0,0,
90910,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
910,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,128,3,0,0,0,0,0,0,254,3,0,0,0,0,0,0,0,
920,0,0,0,0,0,24,0,15,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,225,63,0,232,254,255,31,0,
930,0,0,0,0,0,96,63,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,
940,16,0,32,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,
95248,0,40,0,0,0,0,0,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
960,0,0,0,0,0,0,0,0,128,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,128,14,0,0,0,255,31,
970,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,252,0,0,0,0,0,0,0,0,0,0,0,
920,0,0,0,224,127,0,0,0,192,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
930,0,0,0,0,0,0,192,63,252,255,63,0,0,128,3,0,0,0,0,0,0,254,3,32,0,0,0,0,0,0,0,
940,0,0,0,0,24,0,15,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,225,63,0,232,254,255,31,0,0,
950,0,0,0,0,96,63,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,
9624,0,32,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,
97248,0,104,0,0,0,0,0,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
980,0,0,0,0,0,0,0,0,0,128,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,128,14,0,0,0,255,
9931,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,
1000,0,0,0,0,0,8,0,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1010,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,7,0,0,0,0,0,0,0,0,0,0,0,
1020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,24,128,255,0,0,0,0,0,
1030,0,0,0,0,223,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,252,255,31,3,0,
1040,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,128,0,0,
1050,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1060,0,128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,
107255,3,
108128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1090,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1100,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,255,255,48,0,0,248,
1113,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
112255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1130,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,15,0,0,0,0,0,0,
1140,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
115255,255,255,255,255,255,255,255,255,255,255,255,255,63,
1160,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255,
117255,255,255,255,255,255,255,255,255,255,1,0,0,255,255,255,255,255,255,255,255,
11863,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,15,0,255,255,255,255,255,255,
119255,255,255,255,127,0,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,
1210,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
122255,255,255,255,255,255,255,255,255,15,0,248,254,255,0,0,0,0,0,0,0,0,0,0,0,0,
1230,0,0,0,127,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,
125128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,127,0,0,0,0,0,0,0,
1260,0,0,0,0,0,112,7,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1270,0,0,0,0,0,0,254,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,254,255,
128255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,
13015,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,255,254,
131255,254,255,255,255,63,0,255,31,255,255,255,255,0,0,0,252,0,0,0,28,0,0,0,252,
132255,255,255,31,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,15,255,1,3,
1330,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1340,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
135255,255,255,255,255,255,255,63,0,255,31,255,7,255,255,255,255,255,255,255,255,
136255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,1,
137255,15,0,0,255,15,255,255,255,255,255,255,255,0,255,3,255,255,255,255,255,0,
138255,255,255,63,0,0,0,0,0,0,0,0,0,0,255,239,255,255,255,255,255,255,255,255,
139255,255,255,255,123,252,255,255,255,255,231,199,255,255,255,231,255,255,255,
140255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,63,15,7,7,0,63,0,
981410,0,0,0,0,0,0,0,0,0,0,0,
990,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,7,0,0,0,0,0,0,
1000,24,128,255,0,0,0,0,0,0,0,0,0,0,223,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
101128,62,0,0,252,255,31,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,
1020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,
1030,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,
1040,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,128,255,48,0,0,248,3,0,0,0,0,0,0,0,0,0,0,0,
1050,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,
1060,
1070,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,15,0,0,0,0,0,0,0,0,0,0,0,255,255,
108255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
109255,255,255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255,
110255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
111255,1,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1120,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,3,0,0,0,0,
1130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,
1140,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,
1150,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,
116248,254,255,0,0,0,0,0,0,0,0,0,
1170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,127,0,0,0,0,0,0,0,0,
1180,0,0,0,0,112,7,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,15,255,
120255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,255,254,255,254,
121255,255,255,63,0,255,31,255,255,255,127,0,0,0,252,0,0,0,12,0,0,0,252,255,255,
122255,31,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,15,255,1,3,0,63,0,
1230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,
124255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,255,31,
125255,1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,
126255,255,255,255,255,255,255,255,31,0,0,0,0,
1270,255,15,255,255,255,255,255,255,255,0,255,3,255,255,255,255,255,0,255,255,
128255,63,0,0,0,0,0,0,0,0,0,0,255,15,255,255,255,255,255,127,255,31,255,255,255,
12915,0,0,255,255,255,0,0,0,0,0,1,0,255,255,127,0,0,0,
lib/libc/musl/src/ctype/towctrans.c+55-289
......@@ -1,307 +1,73 @@
1#include <ctype.h>
2#include <stddef.h>
31#include <wctype.h>
42
5#define CASEMAP(u1,u2,l) { (u1), (l)-(u1), (u2)-(u1)+1 }
6#define CASELACE(u1,u2) CASEMAP((u1),(u2),(u1)+1)
3static const unsigned char tab[];
74
8static const struct {
9 unsigned short upper;
10 signed char lower;
11 unsigned char len;
12} casemaps[] = {
13 CASEMAP(0xc0,0xde,0xe0),
5static const unsigned char rulebases[512];
6static const int rules[];
147
15 CASELACE(0x0100,0x012e),
16 CASELACE(0x0132,0x0136),
17 CASELACE(0x0139,0x0147),
18 CASELACE(0x014a,0x0176),
19 CASELACE(0x0179,0x017d),
8static const unsigned char exceptions[][2];
209
21 CASELACE(0x370,0x372),
22 CASEMAP(0x391,0x3a1,0x3b1),
23 CASEMAP(0x3a3,0x3ab,0x3c3),
24 CASEMAP(0x400,0x40f,0x450),
25 CASEMAP(0x410,0x42f,0x430),
10#include "casemap.h"
2611
27 CASELACE(0x460,0x480),
28 CASELACE(0x48a,0x4be),
29 CASELACE(0x4c1,0x4cd),
30 CASELACE(0x4d0,0x50e),
31
32 CASELACE(0x514,0x52e),
33 CASEMAP(0x531,0x556,0x561),
34
35 CASELACE(0x01a0,0x01a4),
36 CASELACE(0x01b3,0x01b5),
37 CASELACE(0x01cd,0x01db),
38 CASELACE(0x01de,0x01ee),
39 CASELACE(0x01f8,0x021e),
40 CASELACE(0x0222,0x0232),
41 CASELACE(0x03d8,0x03ee),
42
43 CASELACE(0x1e00,0x1e94),
44 CASELACE(0x1ea0,0x1efe),
45
46 CASEMAP(0x1f08,0x1f0f,0x1f00),
47 CASEMAP(0x1f18,0x1f1d,0x1f10),
48 CASEMAP(0x1f28,0x1f2f,0x1f20),
49 CASEMAP(0x1f38,0x1f3f,0x1f30),
50 CASEMAP(0x1f48,0x1f4d,0x1f40),
51
52 CASEMAP(0x1f68,0x1f6f,0x1f60),
53 CASEMAP(0x1f88,0x1f8f,0x1f80),
54 CASEMAP(0x1f98,0x1f9f,0x1f90),
55 CASEMAP(0x1fa8,0x1faf,0x1fa0),
56 CASEMAP(0x1fb8,0x1fb9,0x1fb0),
57 CASEMAP(0x1fba,0x1fbb,0x1f70),
58 CASEMAP(0x1fc8,0x1fcb,0x1f72),
59 CASEMAP(0x1fd8,0x1fd9,0x1fd0),
60 CASEMAP(0x1fda,0x1fdb,0x1f76),
61 CASEMAP(0x1fe8,0x1fe9,0x1fe0),
62 CASEMAP(0x1fea,0x1feb,0x1f7a),
63 CASEMAP(0x1ff8,0x1ff9,0x1f78),
64 CASEMAP(0x1ffa,0x1ffb,0x1f7c),
65
66 CASEMAP(0x13f0,0x13f5,0x13f8),
67 CASELACE(0xa698,0xa69a),
68 CASELACE(0xa796,0xa79e),
69
70 CASELACE(0x246,0x24e),
71 CASELACE(0x510,0x512),
72 CASEMAP(0x2160,0x216f,0x2170),
73 CASEMAP(0x2c00,0x2c2e,0x2c30),
74 CASELACE(0x2c67,0x2c6b),
75 CASELACE(0x2c80,0x2ce2),
76 CASELACE(0x2ceb,0x2ced),
77
78 CASELACE(0xa640,0xa66c),
79 CASELACE(0xa680,0xa696),
80
81 CASELACE(0xa722,0xa72e),
82 CASELACE(0xa732,0xa76e),
83 CASELACE(0xa779,0xa77b),
84 CASELACE(0xa77e,0xa786),
85
86 CASELACE(0xa790,0xa792),
87 CASELACE(0xa7a0,0xa7a8),
88
89 CASELACE(0xa7b4,0xa7b6),
90
91 CASEMAP(0xff21,0xff3a,0xff41),
92 { 0,0,0 }
93};
94
95static const unsigned short pairs[][2] = {
96 { 'I', 0x0131 },
97 { 'S', 0x017f },
98 { 0x0130, 'i' },
99 { 0x0178, 0x00ff },
100 { 0x0181, 0x0253 },
101 { 0x0182, 0x0183 },
102 { 0x0184, 0x0185 },
103 { 0x0186, 0x0254 },
104 { 0x0187, 0x0188 },
105 { 0x0189, 0x0256 },
106 { 0x018a, 0x0257 },
107 { 0x018b, 0x018c },
108 { 0x018e, 0x01dd },
109 { 0x018f, 0x0259 },
110 { 0x0190, 0x025b },
111 { 0x0191, 0x0192 },
112 { 0x0193, 0x0260 },
113 { 0x0194, 0x0263 },
114 { 0x0196, 0x0269 },
115 { 0x0197, 0x0268 },
116 { 0x0198, 0x0199 },
117 { 0x019c, 0x026f },
118 { 0x019d, 0x0272 },
119 { 0x019f, 0x0275 },
120 { 0x01a6, 0x0280 },
121 { 0x01a7, 0x01a8 },
122 { 0x01a9, 0x0283 },
123 { 0x01ac, 0x01ad },
124 { 0x01ae, 0x0288 },
125 { 0x01af, 0x01b0 },
126 { 0x01b1, 0x028a },
127 { 0x01b2, 0x028b },
128 { 0x01b7, 0x0292 },
129 { 0x01b8, 0x01b9 },
130 { 0x01bc, 0x01bd },
131 { 0x01c4, 0x01c6 },
132 { 0x01c4, 0x01c5 },
133 { 0x01c5, 0x01c6 },
134 { 0x01c7, 0x01c9 },
135 { 0x01c7, 0x01c8 },
136 { 0x01c8, 0x01c9 },
137 { 0x01ca, 0x01cc },
138 { 0x01ca, 0x01cb },
139 { 0x01cb, 0x01cc },
140 { 0x01f1, 0x01f3 },
141 { 0x01f1, 0x01f2 },
142 { 0x01f2, 0x01f3 },
143 { 0x01f4, 0x01f5 },
144 { 0x01f6, 0x0195 },
145 { 0x01f7, 0x01bf },
146 { 0x0220, 0x019e },
147 { 0x0386, 0x03ac },
148 { 0x0388, 0x03ad },
149 { 0x0389, 0x03ae },
150 { 0x038a, 0x03af },
151 { 0x038c, 0x03cc },
152 { 0x038e, 0x03cd },
153 { 0x038f, 0x03ce },
154 { 0x0399, 0x0345 },
155 { 0x0399, 0x1fbe },
156 { 0x03a3, 0x03c2 },
157 { 0x03f7, 0x03f8 },
158 { 0x03fa, 0x03fb },
159 { 0x1e60, 0x1e9b },
160 { 0x1e9e, 0xdf },
161
162 { 0x1f59, 0x1f51 },
163 { 0x1f5b, 0x1f53 },
164 { 0x1f5d, 0x1f55 },
165 { 0x1f5f, 0x1f57 },
166 { 0x1fbc, 0x1fb3 },
167 { 0x1fcc, 0x1fc3 },
168 { 0x1fec, 0x1fe5 },
169 { 0x1ffc, 0x1ff3 },
170
171 { 0x23a, 0x2c65 },
172 { 0x23b, 0x23c },
173 { 0x23d, 0x19a },
174 { 0x23e, 0x2c66 },
175 { 0x241, 0x242 },
176 { 0x243, 0x180 },
177 { 0x244, 0x289 },
178 { 0x245, 0x28c },
179 { 0x3f4, 0x3b8 },
180 { 0x3f9, 0x3f2 },
181 { 0x3fd, 0x37b },
182 { 0x3fe, 0x37c },
183 { 0x3ff, 0x37d },
184 { 0x4c0, 0x4cf },
185
186 { 0x2126, 0x3c9 },
187 { 0x212a, 'k' },
188 { 0x212b, 0xe5 },
189 { 0x2132, 0x214e },
190 { 0x2183, 0x2184 },
191 { 0x2c60, 0x2c61 },
192 { 0x2c62, 0x26b },
193 { 0x2c63, 0x1d7d },
194 { 0x2c64, 0x27d },
195 { 0x2c6d, 0x251 },
196 { 0x2c6e, 0x271 },
197 { 0x2c6f, 0x250 },
198 { 0x2c70, 0x252 },
199 { 0x2c72, 0x2c73 },
200 { 0x2c75, 0x2c76 },
201 { 0x2c7e, 0x23f },
202 { 0x2c7f, 0x240 },
203 { 0x2cf2, 0x2cf3 },
204
205 { 0xa77d, 0x1d79 },
206 { 0xa78b, 0xa78c },
207 { 0xa78d, 0x265 },
208 { 0xa7aa, 0x266 },
209
210 { 0x10c7, 0x2d27 },
211 { 0x10cd, 0x2d2d },
212
213 /* bogus greek 'symbol' letters */
214 { 0x376, 0x377 },
215 { 0x39c, 0xb5 },
216 { 0x392, 0x3d0 },
217 { 0x398, 0x3d1 },
218 { 0x3a6, 0x3d5 },
219 { 0x3a0, 0x3d6 },
220 { 0x39a, 0x3f0 },
221 { 0x3a1, 0x3f1 },
222 { 0x395, 0x3f5 },
223 { 0x3cf, 0x3d7 },
224
225 { 0xa7ab, 0x25c },
226 { 0xa7ac, 0x261 },
227 { 0xa7ad, 0x26c },
228 { 0xa7ae, 0x26a },
229 { 0xa7b0, 0x29e },
230 { 0xa7b1, 0x287 },
231 { 0xa7b2, 0x29d },
232 { 0xa7b3, 0xab53 },
233
234 /* special cyrillic lowercase forms */
235 { 0x412, 0x1c80 },
236 { 0x414, 0x1c81 },
237 { 0x41e, 0x1c82 },
238 { 0x421, 0x1c83 },
239 { 0x422, 0x1c84 },
240 { 0x422, 0x1c85 },
241 { 0x42a, 0x1c86 },
242 { 0x462, 0x1c87 },
243 { 0xa64a, 0x1c88 },
244
245 { 0,0 }
246};
247
248
249static wchar_t __towcase(wchar_t wc, int lower)
12static int casemap(unsigned c, int dir)
25013{
251 int i;
252 int lmul = 2*lower-1;
253 int lmask = lower-1;
254 /* no letters with case in these large ranges */
255 if (!iswalpha(wc)
256 || (unsigned)wc - 0x0600 <= 0x0fff-0x0600
257 || (unsigned)wc - 0x2e00 <= 0xa63f-0x2e00
258 || (unsigned)wc - 0xa800 <= 0xab52-0xa800
259 || (unsigned)wc - 0xabc0 <= 0xfeff-0xabc0)
260 return wc;
261 /* special case because the diff between upper/lower is too big */
262 if (lower && (unsigned)wc - 0x10a0 < 0x2e)
263 if (wc>0x10c5 && wc != 0x10c7 && wc != 0x10cd) return wc;
264 else return wc + 0x2d00 - 0x10a0;
265 if (!lower && (unsigned)wc - 0x2d00 < 0x26)
266 if (wc>0x2d25 && wc != 0x2d27 && wc != 0x2d2d) return wc;
267 else return wc + 0x10a0 - 0x2d00;
268 if (lower && (unsigned)wc - 0x13a0 < 0x50)
269 return wc + 0xab70 - 0x13a0;
270 if (!lower && (unsigned)wc - 0xab70 < 0x50)
271 return wc + 0x13a0 - 0xab70;
272 for (i=0; casemaps[i].len; i++) {
273 int base = casemaps[i].upper + (lmask & casemaps[i].lower);
274 if ((unsigned)wc-base < casemaps[i].len) {
275 if (casemaps[i].lower == 1)
276 return wc + lower - ((wc-casemaps[i].upper)&1);
277 return wc + lmul*casemaps[i].lower;
14 unsigned b, x, y, v, rt, xb, xn;
15 int r, rd, c0 = c;
16
17 if (c >= 0x20000) return c;
18
19 b = c>>8;
20 c &= 255;
21 x = c/3;
22 y = c%3;
23
24 /* lookup entry in two-level base-6 table */
25 v = tab[tab[b]*86+x];
26 static const int mt[] = { 2048, 342, 57 };
27 v = (v*mt[y]>>11)%6;
28
29 /* use the bit vector out of the tables as an index into
30 * a block-specific set of rules and decode the rule into
31 * a type and a case-mapping delta. */
32 r = rules[rulebases[b]+v];
33 rt = r & 255;
34 rd = r >> 8;
35
36 /* rules 0/1 are simple lower/upper case with a delta.
37 * apply according to desired mapping direction. */
38 if (rt < 2) return c0 + (rd & -(rt^dir));
39
40 /* binary search. endpoints of the binary search for
41 * this block are stored in the rule delta field. */
42 xn = rd & 0xff;
43 xb = (unsigned)rd >> 8;
44 while (xn) {
45 unsigned try = exceptions[xb+xn/2][0];
46 if (try == c) {
47 r = rules[exceptions[xb+xn/2][1]];
48 rt = r & 255;
49 rd = r >> 8;
50 if (rt < 2) return c0 + (rd & -(rt^dir));
51 /* Hard-coded for the four exceptional titlecase */
52 return c0 + (dir ? -1 : 1);
53 } else if (try > c) {
54 xn /= 2;
55 } else {
56 xb += xn/2;
57 xn -= xn/2;
27858 }
27959 }
280 for (i=0; pairs[i][1-lower]; i++) {
281 if (pairs[i][1-lower] == wc)
282 return pairs[i][lower];
283 }
284 if ((unsigned)wc - (0x10428 - 0x28*lower) < 0x28)
285 return wc - 0x28 + 0x50*lower;
286 if ((unsigned)wc - (0x104d8 - 0x28*lower) < 0x24)
287 return wc - 0x28 + 0x50*lower;
288 if ((unsigned)wc - (0x10cc0 - 0x40*lower) < 0x33)
289 return wc - 0x40 + 0x80*lower;
290 if ((unsigned)wc - (0x118c0 - 0x20*lower) < 0x20)
291 return wc - 0x20 + 0x40*lower;
292 if ((unsigned)wc - (0x1e922 - 0x22*lower) < 0x22)
293 return wc - 0x22 + 0x44*lower;
294 return wc;
60 return c0;
29561}
29662
297wint_t towupper(wint_t wc)
63wint_t towlower(wint_t wc)
29864{
299 return (unsigned)wc < 128 ? toupper(wc) : __towcase(wc, 0);
65 return casemap(wc, 0);
30066}
30167
302wint_t towlower(wint_t wc)
68wint_t towupper(wint_t wc)
30369{
304 return (unsigned)wc < 128 ? tolower(wc) : __towcase(wc, 1);
70 return casemap(wc, 1);
30571}
30672
30773wint_t __towupper_l(wint_t c, locale_t l)
lib/libc/musl/src/ctype/wcwidth.c+1-1
......@@ -23,7 +23,7 @@ int wcwidth(wchar_t wc)
2323 return -1;
2424 if (wc-0x20000U < 0x20000)
2525 return 2;
26 if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef)
26 if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100U < 0xef)
2727 return 0;
2828 return 1;
2929}
lib/libc/musl/src/ctype/wide.h+14-12
......@@ -17,7 +17,7 @@
171716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,38,39,16,16,
181816,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
191916,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
2016,16,16,16,16,16,16,40,41,42,43,44,45,46,16,16,47,16,16,16,16,16,
2016,16,16,16,16,16,16,40,41,42,43,44,45,46,47,16,48,49,16,16,16,16,
212116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
2222255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2323255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
......@@ -31,10 +31,10 @@
3131255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
3232255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,255,255,255,255,
3333255,255,255,127,254,255,255,255,255,255,255,255,255,255,127,254,255,255,255,
34255,255,255,255,255,255,255,255,255,224,255,255,255,255,127,254,255,255,255,
34255,255,255,255,255,255,255,255,255,224,255,255,255,255,255,254,255,255,255,
3535255,255,255,255,255,255,255,127,255,255,255,255,255,7,255,255,255,255,15,0,
3636255,255,255,255,255,127,255,255,255,255,255,0,255,255,255,255,255,255,255,255,
37255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,255,255,255,255,
37255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
3838255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,
39390,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
4040255,31,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
......@@ -43,13 +43,13 @@
4343255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,255,3,0,0,255,255,255,255,247,255,127,15,0,0,
44440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,255,255,255,
4545255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
460,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
47255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,
480,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
49255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,0,0,
500,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
460,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
47255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
48255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
49255,255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,
500,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
5151255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
52255,255,255,255,255,255,255,255,255,255,255,255,
52255,255,255,255,255,255,255,255,255,255,255,255,255,255,
535315,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,
54540,0,0,0,0,0,0,0,0,0,0,0,0,64,254,7,0,0,0,0,0,0,0,0,0,0,0,0,7,0,255,255,255,
5555255,255,15,255,1,3,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,
......@@ -58,6 +58,8 @@
5858255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
5959159,255,255,255,255,255,255,255,63,0,120,255,255,255,0,0,4,0,0,96,0,16,0,0,0,
60600,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,255,255,
61255,255,255,255,255,255,63,16,7,0,0,24,240,1,0,0,255,255,255,255,255,127,255,
6231,255,255,255,15,0,0,255,255,255,0,0,0,0,0,1,0,255,255,127,0,0,
630,
61255,255,255,255,255,255,63,16,39,0,0,24,240,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
620,0,0,0,0,0,0,0,0,0,0,0,255,15,0,
630,0,224,255,255,255,255,255,255,255,255,255,255,255,255,123,252,255,255,255,
64255,231,199,255,255,255,231,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
650,15,7,7,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
lib/libc/musl/src/fenv/riscv64/fenv.S+4-1
......@@ -45,8 +45,11 @@ fegetenv:
4545.global fesetenv
4646.type fesetenv, %function
4747fesetenv:
48 li t2, -1
49 li t1, 0
50 beq a0, t2, 1f
4851 lw t1, 0(a0)
49 fscsr t0, t1
521: fscsr t1
5053 li a0, 0
5154 ret
5255
lib/libc/musl/src/internal/dynlink.h-1
......@@ -96,7 +96,6 @@ struct fdpic_dummy_loadmap {
9696#define DYN_CNT 32
9797
9898typedef void (*stage2_func)(unsigned char *, size_t *);
99typedef void (*stage3_func)(size_t *);
10099
101100hidden void *__dlsym(void *restrict, const char *restrict, void *restrict);
102101
lib/libc/musl/src/internal/floatscan.c+1-4
......@@ -33,9 +33,6 @@
3333
3434#define MASK (KMAX-1)
3535
36#define CONCAT2(x,y) x ## y
37#define CONCAT(x,y) CONCAT2(x,y)
38
3936static long long scanexp(FILE *f, int pok)
4037{
4138 int c;
......@@ -301,7 +298,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
301298 y -= bias;
302299
303300 if ((e2+LDBL_MANT_DIG & INT_MAX) > emax-5) {
304 if (fabs(y) >= CONCAT(0x1p, LDBL_MANT_DIG)) {
301 if (fabsl(y) >= 2/LDBL_EPSILON) {
305302 if (denormal && bits==LDBL_MANT_DIG+e2-emin)
306303 denormal = 0;
307304 y *= 0.5;
lib/libc/musl/src/internal/syscall.h+46
......@@ -193,6 +193,45 @@ hidden long __syscall_ret(unsigned long),
193193#define SYS_sendfile SYS_sendfile64
194194#endif
195195
196#ifndef SYS_timer_settime
197#define SYS_timer_settime SYS_timer_settime32
198#endif
199
200#ifndef SYS_timer_gettime
201#define SYS_timer_gettime SYS_timer_gettime32
202#endif
203
204#ifndef SYS_timerfd_settime
205#define SYS_timerfd_settime SYS_timerfd_settime32
206#endif
207
208#ifndef SYS_timerfd_gettime
209#define SYS_timerfd_gettime SYS_timerfd_gettime32
210#endif
211
212#ifndef SYS_clock_settime
213#define SYS_clock_settime SYS_clock_settime32
214#endif
215
216#ifndef SYS_clock_gettime
217#define SYS_clock_gettime SYS_clock_gettime32
218#endif
219
220#ifndef SYS_clock_getres
221#define SYS_clock_getres SYS_clock_getres_time32
222#endif
223
224#ifndef SYS_clock_nanosleep
225#define SYS_clock_nanosleep SYS_clock_nanosleep_time32
226#endif
227
228#ifndef SYS_gettimeofday
229#define SYS_gettimeofday SYS_gettimeofday_time32
230#endif
231
232#ifndef SYS_settimeofday
233#define SYS_settimeofday SYS_settimeofday_time32
234#endif
196235
197236/* Ensure that the plain syscall names are defined even for "time64-only"
198237 * archs. These facilitate callers passing null time arguments, and make
......@@ -306,6 +345,13 @@ hidden long __syscall_ret(unsigned long),
306345#define SO_SNDTIMEO_OLD 21
307346#endif
308347
348#define SO_TIMESTAMP_OLD 29
349#define SO_TIMESTAMPNS_OLD 35
350#define SO_TIMESTAMPING_OLD 37
351#define SCM_TIMESTAMP_OLD SO_TIMESTAMP_OLD
352#define SCM_TIMESTAMPNS_OLD SO_TIMESTAMPNS_OLD
353#define SCM_TIMESTAMPING_OLD SO_TIMESTAMPING_OLD
354
309355#ifndef SIOCGSTAMP_OLD
310356#define SIOCGSTAMP_OLD 0x8906
311357#endif
lib/libc/musl/src/internal/version.h+1-1
......@@ -1 +1 @@
1#define VERSION "1.1.24"
1#define VERSION "1.2.0"
lib/libc/musl/src/ldso/__dlsym.c+4
......@@ -8,3 +8,7 @@ static void *stub_dlsym(void *restrict p, const char *restrict s, void *restrict
88}
99
1010weak_alias(stub_dlsym, __dlsym);
11
12#if _REDIR_TIME64
13weak_alias(stub_dlsym, __dlsym_redir_time64);
14#endif
lib/libc/musl/src/ldso/arm/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/i386/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/m68k/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/microblaze/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/mips/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/mipsn32/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/or1k/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/powerpc/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/ldso/sh/dlsym_time64.S created+3
......@@ -0,0 +1,3 @@
1#define __dlsym __dlsym_redir_time64
2#define dlsym __dlsym_time64
3#include "dlsym.s"
lib/libc/musl/src/linux/clock_adjtime.c+46-11
......@@ -94,21 +94,56 @@ int clock_adjtime (clockid_t clock_id, struct timex *utx)
9494 return __syscall_ret(-ENOTSUP);
9595#endif
9696 if (sizeof(time_t) > sizeof(long)) {
97 union {
98 struct timex utx;
99 struct ktimex ktx;
100 } u = { *utx };
101 u.ktx.time_sec = utx->time.tv_sec;
102 u.ktx.time_usec = utx->time.tv_usec;
97 struct ktimex ktx = {
98 .modes = utx->modes,
99 .offset = utx->offset,
100 .freq = utx->freq,
101 .maxerror = utx->maxerror,
102 .esterror = utx->esterror,
103 .status = utx->status,
104 .constant = utx->constant,
105 .precision = utx->precision,
106 .tolerance = utx->tolerance,
107 .time_sec = utx->time.tv_sec,
108 .time_usec = utx->time.tv_usec,
109 .tick = utx->tick,
110 .ppsfreq = utx->ppsfreq,
111 .jitter = utx->jitter,
112 .shift = utx->shift,
113 .stabil = utx->stabil,
114 .jitcnt = utx->jitcnt,
115 .calcnt = utx->calcnt,
116 .errcnt = utx->errcnt,
117 .stbcnt = utx->stbcnt,
118 .tai = utx->tai,
119 };
103120#ifdef SYS_adjtimex
104 if (clock_id==CLOCK_REALTIME) r = __syscall(SYS_adjtimex, &u);
121 if (clock_id==CLOCK_REALTIME) r = __syscall(SYS_adjtimex, &ktx);
105122 else
106123#endif
107 r = __syscall(SYS_clock_adjtime, clock_id, &u);
124 r = __syscall(SYS_clock_adjtime, clock_id, &ktx);
108125 if (r>=0) {
109 *utx = u.utx;
110 utx->time.tv_sec = u.ktx.time_sec;
111 utx->time.tv_usec = u.ktx.time_usec;
126 utx->modes = ktx.modes;
127 utx->offset = ktx.offset;
128 utx->freq = ktx.freq;
129 utx->maxerror = ktx.maxerror;
130 utx->esterror = ktx.esterror;
131 utx->status = ktx.status;
132 utx->constant = ktx.constant;
133 utx->precision = ktx.precision;
134 utx->tolerance = ktx.tolerance;
135 utx->time.tv_sec = ktx.time_sec;
136 utx->time.tv_usec = ktx.time_usec;
137 utx->tick = ktx.tick;
138 utx->ppsfreq = ktx.ppsfreq;
139 utx->jitter = ktx.jitter;
140 utx->shift = ktx.shift;
141 utx->stabil = ktx.stabil;
142 utx->jitcnt = ktx.jitcnt;
143 utx->calcnt = ktx.calcnt;
144 utx->errcnt = ktx.errcnt;
145 utx->stbcnt = ktx.stbcnt;
146 utx->tai = ktx.tai;
112147 }
113148 return __syscall_ret(r);
114149 }
lib/libc/musl/src/linux/wait4.c+32-2
......@@ -1,9 +1,39 @@
11#define _GNU_SOURCE
22#include <sys/wait.h>
33#include <sys/resource.h>
4#include <string.h>
5#include <errno.h>
46#include "syscall.h"
57
6pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)
8pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru)
79{
8 return syscall(SYS_wait4, pid, status, options, usage);
10 int r;
11#ifdef SYS_wait4_time64
12 if (ru) {
13 long long kru64[18];
14 r = __syscall(SYS_wait4_time64, pid, status, options, kru64);
15 if (!r) {
16 ru->ru_utime = (struct timeval)
17 { .tv_sec = kru64[0], .tv_usec = kru64[1] };
18 ru->ru_stime = (struct timeval)
19 { .tv_sec = kru64[2], .tv_usec = kru64[3] };
20 char *slots = (char *)&ru->ru_maxrss;
21 for (int i=0; i<14; i++)
22 *(long *)(slots + i*sizeof(long)) = kru64[4+i];
23 }
24 if (SYS_wait4_time64 == SYS_wait4 || r != -ENOSYS)
25 return __syscall_ret(r);
26 }
27#endif
28 char *dest = ru ? (char *)&ru->ru_maxrss - 4*sizeof(long) : 0;
29 r = __syscall(SYS_wait4, pid, status, options, dest);
30 if (r>0 && ru && sizeof(time_t) > sizeof(long)) {
31 long kru[4];
32 memcpy(kru, dest, 4*sizeof(long));
33 ru->ru_utime = (struct timeval)
34 { .tv_sec = kru[0], .tv_usec = kru[1] };
35 ru->ru_stime = (struct timeval)
36 { .tv_sec = kru[2], .tv_usec = kru[3] };
37 }
38 return __syscall_ret(r);
939}
lib/libc/musl/src/math/i386/acos.s+3-13
......@@ -1,22 +1,10 @@
11# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x)
22
3.global acosf
4.type acosf,@function
5acosf:
6 flds 4(%esp)
7 jmp 1f
8
9.global acosl
10.type acosl,@function
11acosl:
12 fldt 4(%esp)
13 jmp 1f
14
153.global acos
164.type acos,@function
175acos:
186 fldl 4(%esp)
191: fld %st(0)
7 fld %st(0)
208 fld1
219 fsub %st(0),%st(1)
2210 fadd %st(2)
......@@ -25,4 +13,6 @@ acos:
2513 fabs # fix sign of zero (matters in downward rounding mode)
2614 fxch %st(1)
2715 fpatan
16 fstpl 4(%esp)
17 fldl 4(%esp)
2818 ret
lib/libc/musl/src/math/i386/acosf.s+16-1
......@@ -1 +1,16 @@
1# see acos.s
1.global acosf
2.type acosf,@function
3acosf:
4 flds 4(%esp)
5 fld %st(0)
6 fld1
7 fsub %st(0),%st(1)
8 fadd %st(2)
9 fmulp
10 fsqrt
11 fabs # fix sign of zero (matters in downward rounding mode)
12 fxch %st(1)
13 fpatan
14 fstps 4(%esp)
15 flds 4(%esp)
16 ret
lib/libc/musl/src/math/i386/acosl.s+14-1
......@@ -1 +1,14 @@
1# see acos.s
1.global acosl
2.type acosl,@function
3acosl:
4 fldt 4(%esp)
5 fld %st(0)
6 fld1
7 fsub %st(0),%st(1)
8 fadd %st(2)
9 fmulp
10 fsqrt
11 fabs # fix sign of zero (matters in downward rounding mode)
12 fxch %st(1)
13 fpatan
14 ret
lib/libc/musl/src/math/i386/asin.s+7-25
......@@ -1,23 +1,3 @@
1.global asinf
2.type asinf,@function
3asinf:
4 flds 4(%esp)
5 mov 4(%esp),%eax
6 add %eax,%eax
7 cmp $0x01000000,%eax
8 jae 1f
9 # subnormal x, return x with underflow
10 fld %st(0)
11 fmul %st(1)
12 fstps 4(%esp)
13 ret
14
15.global asinl
16.type asinl,@function
17asinl:
18 fldt 4(%esp)
19 jmp 1f
20
211.global asin
222.type asin,@function
233asin:
......@@ -25,15 +5,17 @@ asin:
255 mov 8(%esp),%eax
266 add %eax,%eax
277 cmp $0x00200000,%eax
28 jae 1f
29 # subnormal x, return x with underflow
30 fsts 4(%esp)
31 ret
321: fld %st(0)
8 jb 1f
9 fld %st(0)
3310 fld1
3411 fsub %st(0),%st(1)
3512 fadd %st(2)
3613 fmulp
3714 fsqrt
3815 fpatan
16 fstpl 4(%esp)
17 fldl 4(%esp)
18 ret
19 # subnormal x, return x with underflow
201: fsts 4(%esp)
3921 ret
lib/libc/musl/src/math/i386/asinf.s+23-1
......@@ -1 +1,23 @@
1# see asin.s
1.global asinf
2.type asinf,@function
3asinf:
4 flds 4(%esp)
5 mov 4(%esp),%eax
6 add %eax,%eax
7 cmp $0x01000000,%eax
8 jb 1f
9 fld %st(0)
10 fld1
11 fsub %st(0),%st(1)
12 fadd %st(2)
13 fmulp
14 fsqrt
15 fpatan
16 fstps 4(%esp)
17 flds 4(%esp)
18 ret
19 # subnormal x, return x with underflow
201: fld %st(0)
21 fmul %st(1)
22 fstps 4(%esp)
23 ret
lib/libc/musl/src/math/i386/asinl.s+12-1
......@@ -1 +1,12 @@
1# see asin.s
1.global asinl
2.type asinl,@function
3asinl:
4 fldt 4(%esp)
5 fld %st(0)
6 fld1
7 fsub %st(0),%st(1)
8 fadd %st(2)
9 fmulp
10 fsqrt
11 fpatan
12 ret
lib/libc/musl/src/math/i386/atan.s+2
......@@ -8,6 +8,8 @@ atan:
88 jb 1f
99 fld1
1010 fpatan
11 fstpl 4(%esp)
12 fldl 4(%esp)
1113 ret
1214 # subnormal x, return x with underflow
13151: fsts 4(%esp)
lib/libc/musl/src/math/i386/atan2.s+2-1
......@@ -4,7 +4,8 @@ atan2:
44 fldl 4(%esp)
55 fldl 12(%esp)
66 fpatan
7 fstl 4(%esp)
7 fstpl 4(%esp)
8 fldl 4(%esp)
89 mov 8(%esp),%eax
910 add %eax,%eax
1011 cmp $0x00200000,%eax
lib/libc/musl/src/math/i386/atan2f.s+2-1
......@@ -4,7 +4,8 @@ atan2f:
44 flds 4(%esp)
55 flds 8(%esp)
66 fpatan
7 fsts 4(%esp)
7 fstps 4(%esp)
8 flds 4(%esp)
89 mov 4(%esp),%eax
910 add %eax,%eax
1011 cmp $0x01000000,%eax
lib/libc/musl/src/math/i386/atanf.s+2
......@@ -8,6 +8,8 @@ atanf:
88 jb 1f
99 fld1
1010 fpatan
11 fstps 4(%esp)
12 flds 4(%esp)
1113 ret
1214 # subnormal x, return x with underflow
13151: fld %st(0)
lib/libc/musl/src/math/i386/exp.s deleted-146
......@@ -1,146 +0,0 @@
1.global expm1f
2.type expm1f,@function
3expm1f:
4 flds 4(%esp)
5 mov 4(%esp),%eax
6 add %eax,%eax
7 cmp $0x01000000,%eax
8 jae 1f
9 # subnormal x, return x with underflow
10 fld %st(0)
11 fmul %st(1)
12 fstps 4(%esp)
13 ret
14
15.global expm1l
16.type expm1l,@function
17expm1l:
18 fldt 4(%esp)
19 jmp 1f
20
21.global expm1
22.type expm1,@function
23expm1:
24 fldl 4(%esp)
25 mov 8(%esp),%eax
26 add %eax,%eax
27 cmp $0x00200000,%eax
28 jae 1f
29 # subnormal x, return x with underflow
30 fsts 4(%esp)
31 ret
321: fldl2e
33 fmulp
34 mov $0xc2820000,%eax
35 push %eax
36 flds (%esp)
37 pop %eax
38 fucomp %st(1)
39 fnstsw %ax
40 sahf
41 fld1
42 jb 1f
43 # x*log2e < -65, return -1 without underflow
44 fstp %st(1)
45 fchs
46 ret
471: fld %st(1)
48 fabs
49 fucom %st(1)
50 fnstsw %ax
51 fstp %st(0)
52 fstp %st(0)
53 sahf
54 ja 1f
55 f2xm1
56 ret
571: call 1f
58 fld1
59 fsubrp
60 ret
61
62.global exp2f
63.type exp2f,@function
64exp2f:
65 flds 4(%esp)
66 jmp 1f
67
68.global exp2l
69.global __exp2l
70.hidden __exp2l
71.type exp2l,@function
72exp2l:
73__exp2l:
74 fldt 4(%esp)
75 jmp 1f
76
77.global expf
78.type expf,@function
79expf:
80 flds 4(%esp)
81 jmp 2f
82
83.global exp
84.type exp,@function
85exp:
86 fldl 4(%esp)
872: fldl2e
88 fmulp
89 jmp 1f
90
91.global exp2
92.type exp2,@function
93exp2:
94 fldl 4(%esp)
951: sub $12,%esp
96 fld %st(0)
97 fstpt (%esp)
98 mov 8(%esp),%ax
99 and $0x7fff,%ax
100 cmp $0x3fff+13,%ax
101 jb 4f # |x| < 8192
102 cmp $0x3fff+15,%ax
103 jae 3f # |x| >= 32768
104 fsts (%esp)
105 cmpl $0xc67ff800,(%esp)
106 jb 2f # x > -16382
107 movl $0x5f000000,(%esp)
108 flds (%esp) # 0x1p63
109 fld %st(1)
110 fsub %st(1)
111 faddp
112 fucomp %st(1)
113 fnstsw
114 sahf
115 je 2f # x - 0x1p63 + 0x1p63 == x
116 movl $1,(%esp)
117 flds (%esp) # 0x1p-149
118 fdiv %st(1)
119 fstps (%esp) # raise underflow
1202: fld1
121 fld %st(1)
122 frndint
123 fxch %st(2)
124 fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
125 f2xm1
126 faddp # 2^(x-rint(x))
1271: fscale
128 fstp %st(1)
129 add $12,%esp
130 ret
1313: xor %eax,%eax
1324: cmp $0x3fff-64,%ax
133 fld1
134 jb 1b # |x| < 0x1p-64
135 fstpt (%esp)
136 fistl 8(%esp)
137 fildl 8(%esp)
138 fsubrp %st(1)
139 addl $0x3fff,8(%esp)
140 f2xm1
141 fld1
142 faddp # 2^(x-rint(x))
143 fldt (%esp) # 2^rint(x)
144 fmulp
145 add $12,%esp
146 ret
lib/libc/musl/src/math/i386/exp2.s deleted-1
......@@ -1 +0,0 @@
1# see exp.s
lib/libc/musl/src/math/i386/exp2f.s deleted-1
......@@ -1 +0,0 @@
1# see exp.s
lib/libc/musl/src/math/i386/exp2l.s+1-1
......@@ -1 +1 @@
1# see exp.s
1# see exp_ld.s
lib/libc/musl/src/math/i386/exp_ld.s created+93
......@@ -0,0 +1,93 @@
1.global expm1l
2.type expm1l,@function
3expm1l:
4 fldt 4(%esp)
5 fldl2e
6 fmulp
7 mov $0xc2820000,%eax
8 push %eax
9 flds (%esp)
10 pop %eax
11 fucomp %st(1)
12 fnstsw %ax
13 sahf
14 fld1
15 jb 1f
16 # x*log2e < -65, return -1 without underflow
17 fstp %st(1)
18 fchs
19 ret
201: fld %st(1)
21 fabs
22 fucom %st(1)
23 fnstsw %ax
24 fstp %st(0)
25 fstp %st(0)
26 sahf
27 ja 1f
28 f2xm1
29 ret
301: call 1f
31 fld1
32 fsubrp
33 ret
34
35.global exp2l
36.global __exp2l
37.hidden __exp2l
38.type exp2l,@function
39exp2l:
40__exp2l:
41 fldt 4(%esp)
421: sub $12,%esp
43 fld %st(0)
44 fstpt (%esp)
45 mov 8(%esp),%ax
46 and $0x7fff,%ax
47 cmp $0x3fff+13,%ax
48 jb 4f # |x| < 8192
49 cmp $0x3fff+15,%ax
50 jae 3f # |x| >= 32768
51 fsts (%esp)
52 cmpl $0xc67ff800,(%esp)
53 jb 2f # x > -16382
54 movl $0x5f000000,(%esp)
55 flds (%esp) # 0x1p63
56 fld %st(1)
57 fsub %st(1)
58 faddp
59 fucomp %st(1)
60 fnstsw
61 sahf
62 je 2f # x - 0x1p63 + 0x1p63 == x
63 movl $1,(%esp)
64 flds (%esp) # 0x1p-149
65 fdiv %st(1)
66 fstps (%esp) # raise underflow
672: fld1
68 fld %st(1)
69 frndint
70 fxch %st(2)
71 fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
72 f2xm1
73 faddp # 2^(x-rint(x))
741: fscale
75 fstp %st(1)
76 add $12,%esp
77 ret
783: xor %eax,%eax
794: cmp $0x3fff-64,%ax
80 fld1
81 jb 1b # |x| < 0x1p-64
82 fstpt (%esp)
83 fistl 8(%esp)
84 fildl 8(%esp)
85 fsubrp %st(1)
86 addl $0x3fff,8(%esp)
87 f2xm1
88 fld1
89 faddp # 2^(x-rint(x))
90 fldt (%esp) # 2^rint(x)
91 fmulp
92 add $12,%esp
93 ret
lib/libc/musl/src/math/i386/expf.s deleted-1
......@@ -1 +0,0 @@
1# see exp.s
lib/libc/musl/src/math/i386/expm1.s deleted-1
......@@ -1 +0,0 @@
1# see exp.s
lib/libc/musl/src/math/i386/expm1f.s deleted-1
......@@ -1 +0,0 @@
1# see exp.s
lib/libc/musl/src/math/i386/expm1l.s+1-1
......@@ -1 +1 @@
1# see exp.s
1# see exp_ld.s
lib/libc/musl/src/math/i386/log.s+2
......@@ -4,4 +4,6 @@ log:
44 fldln2
55 fldl 4(%esp)
66 fyl2x
7 fstpl 4(%esp)
8 fldl 4(%esp)
79 ret
lib/libc/musl/src/math/i386/log10.s+2
......@@ -4,4 +4,6 @@ log10:
44 fldlg2
55 fldl 4(%esp)
66 fyl2x
7 fstpl 4(%esp)
8 fldl 4(%esp)
79 ret
lib/libc/musl/src/math/i386/log10f.s+2
......@@ -4,4 +4,6 @@ log10f:
44 fldlg2
55 flds 4(%esp)
66 fyl2x
7 fstps 4(%esp)
8 flds 4(%esp)
79 ret
lib/libc/musl/src/math/i386/log1p.s+4
......@@ -10,10 +10,14 @@ log1p:
1010 cmp $0x00100000,%eax
1111 jb 2f
1212 fyl2xp1
13 fstpl 4(%esp)
14 fldl 4(%esp)
1315 ret
14161: fld1
1517 faddp
1618 fyl2x
19 fstpl 4(%esp)
20 fldl 4(%esp)
1721 ret
1822 # subnormal x, return x with underflow
19232: fsts 4(%esp)
lib/libc/musl/src/math/i386/log1pf.s+4
......@@ -10,10 +10,14 @@ log1pf:
1010 cmp $0x00800000,%eax
1111 jb 2f
1212 fyl2xp1
13 fstps 4(%esp)
14 flds 4(%esp)
1315 ret
14161: fld1
1517 faddp
1618 fyl2x
19 fstps 4(%esp)
20 flds 4(%esp)
1721 ret
1822 # subnormal x, return x with underflow
19232: fxch
lib/libc/musl/src/math/i386/log2.s+2
......@@ -4,4 +4,6 @@ log2:
44 fld1
55 fldl 4(%esp)
66 fyl2x
7 fstpl 4(%esp)
8 fldl 4(%esp)
79 ret
lib/libc/musl/src/math/i386/log2f.s+2
......@@ -4,4 +4,6 @@ log2f:
44 fld1
55 flds 4(%esp)
66 fyl2x
7 fstps 4(%esp)
8 flds 4(%esp)
79 ret
lib/libc/musl/src/math/i386/logf.s+2
......@@ -4,4 +4,6 @@ logf:
44 fldln2
55 flds 4(%esp)
66 fyl2x
7 fstps 4(%esp)
8 flds 4(%esp)
79 ret
lib/libc/musl/src/math/mips/fabs.c created+16
......@@ -0,0 +1,16 @@
1#if !defined(__mips_soft_float) && defined(__mips_abs2008)
2
3#include <math.h>
4
5double fabs(double x)
6{
7 double r;
8 __asm__("abs.d %0,%1" : "=f"(r) : "f"(x));
9 return r;
10}
11
12#else
13
14#include "../fabs.c"
15
16#endif
lib/libc/musl/src/math/mips/fabsf.c created+16
......@@ -0,0 +1,16 @@
1#if !defined(__mips_soft_float) && defined(__mips_abs2008)
2
3#include <math.h>
4
5float fabsf(float x)
6{
7 float r;
8 __asm__("abs.s %0,%1" : "=f"(r) : "f"(x));
9 return r;
10}
11
12#else
13
14#include "../fabsf.c"
15
16#endif
lib/libc/musl/src/math/mips/sqrt.c created+16
......@@ -0,0 +1,16 @@
1#if !defined(__mips_soft_float) && __mips >= 3
2
3#include <math.h>
4
5double sqrt(double x)
6{
7 double r;
8 __asm__("sqrt.d %0,%1" : "=f"(r) : "f"(x));
9 return r;
10}
11
12#else
13
14#include "../sqrt.c"
15
16#endif
lib/libc/musl/src/math/mips/sqrtf.c created+16
......@@ -0,0 +1,16 @@
1#if !defined(__mips_soft_float) && __mips >= 2
2
3#include <math.h>
4
5float sqrtf(float x)
6{
7 float r;
8 __asm__("sqrt.s %0,%1" : "=f"(r) : "f"(x));
9 return r;
10}
11
12#else
13
14#include "../sqrtf.c"
15
16#endif
lib/libc/musl/src/math/powerpc/fabs.c+1-1
......@@ -1,6 +1,6 @@
11#include <math.h>
22
3#ifdef _SOFT_FLOAT
3#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM)
44
55#include "../fabs.c"
66
lib/libc/musl/src/math/powerpc/fma.c+1-1
......@@ -1,6 +1,6 @@
11#include <math.h>
22
3#ifdef _SOFT_FLOAT
3#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM)
44
55#include "../fma.c"
66
lib/libc/musl/src/math/x32/lrintl.s+2-2
......@@ -2,6 +2,6 @@
22.type lrintl,@function
33lrintl:
44 fldt 8(%esp)
5 fistpll 8(%esp)
6 mov 8(%esp),%rax
5 fistpl 8(%esp)
6 movl 8(%esp),%eax
77 ret
lib/libc/musl/src/misc/getrusage.c+29-1
......@@ -1,7 +1,35 @@
11#include <sys/resource.h>
2#include <string.h>
3#include <errno.h>
24#include "syscall.h"
35
46int getrusage(int who, struct rusage *ru)
57{
6 return syscall(SYS_getrusage, who, ru);
8 int r;
9#ifdef SYS_getrusage_time64
10 long long kru64[18];
11 r = __syscall(SYS_getrusage_time64, who, kru64);
12 if (!r) {
13 ru->ru_utime = (struct timeval)
14 { .tv_sec = kru64[0], .tv_usec = kru64[1] };
15 ru->ru_stime = (struct timeval)
16 { .tv_sec = kru64[2], .tv_usec = kru64[3] };
17 char *slots = (char *)&ru->ru_maxrss;
18 for (int i=0; i<14; i++)
19 *(long *)(slots + i*sizeof(long)) = kru64[4+i];
20 }
21 if (SYS_getrusage_time64 == SYS_getrusage || r != -ENOSYS)
22 return __syscall_ret(r);
23#endif
24 char *dest = (char *)&ru->ru_maxrss - 4*sizeof(long);
25 r = __syscall(SYS_getrusage, who, dest);
26 if (!r && sizeof(time_t) > sizeof(long)) {
27 long kru[4];
28 memcpy(kru, dest, 4*sizeof(long));
29 ru->ru_utime = (struct timeval)
30 { .tv_sec = kru[0], .tv_usec = kru[1] };
31 ru->ru_stime = (struct timeval)
32 { .tv_sec = kru[2], .tv_usec = kru[3] };
33 }
34 return __syscall_ret(r);
735}
lib/libc/musl/src/misc/ioctl.c+119-17
......@@ -3,8 +3,115 @@
33#include <errno.h>
44#include <time.h>
55#include <sys/time.h>
6#include <stddef.h>
7#include <string.h>
68#include "syscall.h"
79
10#define alignof(t) offsetof(struct { char c; t x; }, x)
11
12#define W 1
13#define R 2
14#define WR 3
15
16struct ioctl_compat_map {
17 int new_req, old_req;
18 unsigned char old_size, dir, force_align, noffs;
19 unsigned char offsets[8];
20};
21
22#define NINTH(a,b,c,d,e,f,g,h,i,...) i
23#define COUNT(...) NINTH(__VA_ARGS__,8,7,6,5,4,3,2,1,0)
24#define OFFS(...) COUNT(__VA_ARGS__), { __VA_ARGS__ }
25
26/* yields a type for a struct with original size n, with a misaligned
27 * timeval/timespec expanded from 32- to 64-bit. for use with ioctl
28 * number producing macros; only size of result is meaningful. */
29#define new_misaligned(n) struct { int i; time_t t; char c[(n)-4]; }
30
31static const struct ioctl_compat_map compat_map[] = {
32 { SIOCGSTAMP, SIOCGSTAMP_OLD, 8, R, 0, OFFS(0, 4) },
33 { SIOCGSTAMPNS, SIOCGSTAMPNS_OLD, 8, R, 0, OFFS(0, 4) },
34
35 /* SNDRV_TIMER_IOCTL_STATUS */
36 { _IOR('T', 0x14, char[96]), _IOR('T', 0x14, 88), 88, R, 0, OFFS(0,4) },
37
38 /* SNDRV_PCM_IOCTL_STATUS[_EXT] */
39 { _IOR('A', 0x20, char[128]), _IOR('A', 0x20, char[108]), 108, R, 1, OFFS(4,8,12,16,52,56,60,64) },
40 { _IOWR('A', 0x24, char[128]), _IOWR('A', 0x24, char[108]), 108, WR, 1, OFFS(4,8,12,16,52,56,60,64) },
41
42 /* SNDRV_RAWMIDI_IOCTL_STATUS */
43 { _IOWR('W', 0x20, char[48]), _IOWR('W', 0x20, char[36]), 36, WR, 1, OFFS(4,8) },
44
45 /* SNDRV_PCM_IOCTL_SYNC_PTR - with 3 subtables */
46 { _IOWR('A', 0x23, char[136]), _IOWR('A', 0x23, char[132]), 0, WR, 1, 0 },
47 { 0, 0, 4, WR, 1, 0 }, /* snd_pcm_sync_ptr (flags only) */
48 { 0, 0, 32, WR, 1, OFFS(8,12,16,24,28) }, /* snd_pcm_mmap_status */
49 { 0, 0, 8, WR, 1, OFFS(0,4) }, /* snd_pcm_mmap_control */
50
51 /* VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF */
52 { _IOWR('V', 9, new_misaligned(72)), _IOWR('V', 9, char[72]), 72, WR, 0, OFFS(20) },
53 { _IOWR('V', 15, new_misaligned(72)), _IOWR('V', 15, char[72]), 72, WR, 0, OFFS(20) },
54 { _IOWR('V', 17, new_misaligned(72)), _IOWR('V', 17, char[72]), 72, WR, 0, OFFS(20) },
55 { _IOWR('V', 93, new_misaligned(72)), _IOWR('V', 93, char[72]), 72, WR, 0, OFFS(20) },
56
57 /* VIDIOC_DQEVENT */
58 { _IOR('V', 89, new_misaligned(96)), _IOR('V', 89, char[96]), 96, R, 0, OFFS(76,80) },
59
60 /* VIDIOC_OMAP3ISP_STAT_REQ */
61 { _IOWR('V', 192+6, char[32]), _IOWR('V', 192+6, char[24]), 22, WR, 0, OFFS(0,4) },
62
63 /* PPPIOCGIDLE */
64 { _IOR('t', 63, char[16]), _IOR('t', 63, char[8]), 8, R, 0, OFFS(0,4) },
65
66 /* PPGETTIME, PPSETTIME */
67 { _IOR('p', 0x95, char[16]), _IOR('p', 0x95, char[8]), 8, R, 0, OFFS(0,4) },
68 { _IOW('p', 0x96, char[16]), _IOW('p', 0x96, char[8]), 8, W, 0, OFFS(0,4) },
69
70 /* LPSETTIMEOUT */
71 { _IOW(0x6, 0xf, char[16]), 0x060f, 8, W, 0, OFFS(0,4) },
72};
73
74static void convert_ioctl_struct(const struct ioctl_compat_map *map, char *old, char *new, int dir)
75{
76 int new_offset = 0;
77 int old_offset = 0;
78 int old_size = map->old_size;
79 if (!(dir & map->dir)) return;
80 if (!map->old_size) {
81 /* offsets hard-coded for SNDRV_PCM_IOCTL_SYNC_PTR;
82 * if another exception appears this needs changing. */
83 convert_ioctl_struct(map+1, old, new, dir);
84 convert_ioctl_struct(map+2, old+4, new+8, dir);
85 convert_ioctl_struct(map+3, old+68, new+72, dir);
86 return;
87 }
88 for (int i=0; i < map->noffs; i++) {
89 int ts_offset = map->offsets[i];
90 int len = ts_offset-old_offset;
91 if (dir==W) memcpy(old+old_offset, new+new_offset, len);
92 else memcpy(new+new_offset, old+old_offset, len);
93 new_offset += len;
94 old_offset += len;
95 long long new_ts;
96 long old_ts;
97 int align = map->force_align ? sizeof(time_t) : alignof(time_t);
98 new_offset += (align-1) & -new_offset;
99 if (dir==W) {
100 memcpy(&new_ts, new+new_offset, sizeof new_ts);
101 old_ts = new_ts;
102 memcpy(old+old_offset, &old_ts, sizeof old_ts);
103 } else {
104 memcpy(&old_ts, old+old_offset, sizeof old_ts);
105 new_ts = old_ts;
106 memcpy(new+new_offset, &new_ts, sizeof new_ts);
107 }
108 new_offset += sizeof new_ts;
109 old_offset += sizeof old_ts;
110 }
111 if (dir==W) memcpy(old+old_offset, new+new_offset, old_size-old_offset);
112 else memcpy(new+new_offset, old+old_offset, old_size-old_offset);
113}
114
8115int ioctl(int fd, int req, ...)
9116{
10117 void *arg;
......@@ -13,23 +120,18 @@ int ioctl(int fd, int req, ...)
13120 arg = va_arg(ap, void *);
14121 va_end(ap);
15122 int r = __syscall(SYS_ioctl, fd, req, arg);
16 if (r==-ENOTTY) switch (req) {
17 case SIOCGSTAMP:
18 case SIOCGSTAMPNS:
19 if (SIOCGSTAMP==SIOCGSTAMP_OLD) break;
20 if (req==SIOCGSTAMP) req=SIOCGSTAMP_OLD;
21 if (req==SIOCGSTAMPNS) req=SIOCGSTAMPNS_OLD;
22 long t32[2];
23 r = __syscall(SYS_ioctl, fd, req, t32);
24 if (r<0) break;
25 if (req==SIOCGSTAMP_OLD) {
26 struct timeval *tv = arg;
27 tv->tv_sec = t32[0];
28 tv->tv_usec = t32[1];
29 } else {
30 struct timespec *ts = arg;
31 ts->tv_sec = t32[0];
32 ts->tv_nsec = t32[1];
123 if (SIOCGSTAMP != SIOCGSTAMP_OLD && req && r==-ENOTTY) {
124 for (int i=0; i<sizeof compat_map/sizeof *compat_map; i++) {
125 if (compat_map[i].new_req != req) continue;
126 union {
127 long long align;
128 char buf[256];
129 } u;
130 convert_ioctl_struct(&compat_map[i], u.buf, arg, W);
131 r = __syscall(SYS_ioctl, fd, compat_map[i].old_req, u.buf);
132 if (r<0) break;
133 convert_ioctl_struct(&compat_map[i], u.buf, arg, R);
134 break;
33135 }
34136 }
35137 return __syscall_ret(r);
lib/libc/musl/src/misc/pty.c+3-1
......@@ -7,7 +7,9 @@
77
88int posix_openpt(int flags)
99{
10 return open("/dev/ptmx", flags);
10 int r = open("/dev/ptmx", flags);
11 if (r < 0 && errno == ENOSPC) errno = EAGAIN;
12 return r;
1113}
1214
1315int grantpt(int fd)
lib/libc/musl/src/network/getsockopt.c+9
......@@ -26,6 +26,15 @@ int getsockopt(int fd, int level, int optname, void *restrict optval, socklen_t
2626 tv->tv_sec = tv32[0];
2727 tv->tv_usec = tv32[1];
2828 *optlen = sizeof *tv;
29 break;
30 case SO_TIMESTAMP:
31 case SO_TIMESTAMPNS:
32 if (SO_TIMESTAMP == SO_TIMESTAMP_OLD) break;
33 if (optname==SO_TIMESTAMP) optname=SO_TIMESTAMP_OLD;
34 if (optname==SO_TIMESTAMPNS) optname=SO_TIMESTAMPNS_OLD;
35 r = __socketcall(getsockopt, fd, level,
36 optname, optval, optlen, 0);
37 break;
2938 }
3039 }
3140 return __syscall_ret(r);
lib/libc/musl/src/network/recvmmsg.c+10-4
......@@ -8,6 +8,8 @@
88#define IS32BIT(x) !((x)+0x80000000ULL>>32)
99#define CLAMP(x) (int)(IS32BIT(x) ? (x) : 0x7fffffffU+((0ULL+(x))>>63))
1010
11hidden void __convert_scm_timestamps(struct msghdr *, socklen_t);
12
1113int recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec *timeout)
1214{
1315#if LONG_MAX > INT_MAX
......@@ -19,14 +21,18 @@ int recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int fla
1921#ifdef SYS_recvmmsg_time64
2022 time_t s = timeout ? timeout->tv_sec : 0;
2123 long ns = timeout ? timeout->tv_nsec : 0;
22 int r = -ENOSYS;
23 if (SYS_recvmmsg == SYS_recvmmsg_time64 || !IS32BIT(s))
24 r = __syscall_cp(SYS_recvmmsg_time64, fd, msgvec, vlen, flags,
24 int r = __syscall_cp(SYS_recvmmsg_time64, fd, msgvec, vlen, flags,
2525 timeout ? ((long long[]){s, ns}) : 0);
2626 if (SYS_recvmmsg == SYS_recvmmsg_time64 || r!=-ENOSYS)
2727 return __syscall_ret(r);
28 return syscall_cp(SYS_recvmmsg, fd, msgvec, vlen, flags,
28 if (vlen > IOV_MAX) vlen = IOV_MAX;
29 socklen_t csize[vlen];
30 for (int i=0; i<vlen; i++) csize[i] = msgvec[i].msg_hdr.msg_controllen;
31 r = __syscall_cp(SYS_recvmmsg, fd, msgvec, vlen, flags,
2932 timeout ? ((long[]){CLAMP(s), ns}) : 0);
33 for (int i=0; i<r; i++)
34 __convert_scm_timestamps(&msgvec[i].msg_hdr, csize[i]);
35 return __syscall_ret(r);
3036#else
3137 return syscall_cp(SYS_recvmmsg, fd, msgvec, vlen, flags, timeout);
3238#endif
lib/libc/musl/src/network/recvmsg.c+47
......@@ -1,10 +1,56 @@
11#include <sys/socket.h>
22#include <limits.h>
3#include <time.h>
4#include <sys/time.h>
5#include <string.h>
36#include "syscall.h"
47
8hidden void __convert_scm_timestamps(struct msghdr *, socklen_t);
9
10void __convert_scm_timestamps(struct msghdr *msg, socklen_t csize)
11{
12 if (SCM_TIMESTAMP == SCM_TIMESTAMP_OLD) return;
13 if (!msg->msg_control || !msg->msg_controllen) return;
14
15 struct cmsghdr *cmsg, *last=0;
16 long tmp;
17 long long tvts[2];
18 int type = 0;
19
20 for (cmsg=CMSG_FIRSTHDR(msg); cmsg; cmsg=CMSG_NXTHDR(msg, cmsg)) {
21 if (cmsg->cmsg_level==SOL_SOCKET) switch (cmsg->cmsg_type) {
22 case SCM_TIMESTAMP_OLD:
23 if (type) break;
24 type = SCM_TIMESTAMP;
25 goto common;
26 case SCM_TIMESTAMPNS_OLD:
27 type = SCM_TIMESTAMPNS;
28 common:
29 memcpy(&tmp, CMSG_DATA(cmsg), sizeof tmp);
30 tvts[0] = tmp;
31 memcpy(&tmp, CMSG_DATA(cmsg) + sizeof tmp, sizeof tmp);
32 tvts[1] = tmp;
33 break;
34 }
35 last = cmsg;
36 }
37 if (!last || !type) return;
38 if (CMSG_SPACE(sizeof tvts) > csize-msg->msg_controllen) {
39 msg->msg_flags |= MSG_CTRUNC;
40 return;
41 }
42 msg->msg_controllen += CMSG_SPACE(sizeof tvts);
43 cmsg = CMSG_NXTHDR(msg, last);
44 cmsg->cmsg_level = SOL_SOCKET;
45 cmsg->cmsg_type = type;
46 cmsg->cmsg_len = CMSG_LEN(sizeof tvts);
47 memcpy(CMSG_DATA(cmsg), &tvts, sizeof tvts);
48}
49
550ssize_t recvmsg(int fd, struct msghdr *msg, int flags)
651{
752 ssize_t r;
53 socklen_t orig_controllen = msg->msg_controllen;
854#if LONG_MAX > INT_MAX
955 struct msghdr h, *orig = msg;
1056 if (msg) {
......@@ -14,6 +60,7 @@ ssize_t recvmsg(int fd, struct msghdr *msg, int flags)
1460 }
1561#endif
1662 r = socketcall_cp(recvmsg, fd, msg, flags, 0, 0, 0);
63 if (r >= 0) __convert_scm_timestamps(msg, orig_controllen);
1764#if LONG_MAX > INT_MAX
1865 if (orig) *orig = h;
1966#endif
lib/libc/musl/src/network/setsockopt.c+9
......@@ -31,6 +31,15 @@ int setsockopt(int fd, int level, int optname, const void *optval, socklen_t opt
3131
3232 r = __socketcall(setsockopt, fd, level, optname,
3333 ((long[]){s, CLAMP(us)}), 2*sizeof(long), 0);
34 break;
35 case SO_TIMESTAMP:
36 case SO_TIMESTAMPNS:
37 if (SO_TIMESTAMP == SO_TIMESTAMP_OLD) break;
38 if (optname==SO_TIMESTAMP) optname=SO_TIMESTAMP_OLD;
39 if (optname==SO_TIMESTAMPNS) optname=SO_TIMESTAMPNS_OLD;
40 r = __socketcall(setsockopt, fd, level,
41 optname, optval, optlen, 0);
42 break;
3443 }
3544 }
3645 return __syscall_ret(r);
lib/libc/musl/src/signal/arm/sigsetjmp.s+3-2
......@@ -6,9 +6,10 @@
66sigsetjmp:
77__sigsetjmp:
88 tst r1,r1
9 beq setjmp
9 bne 1f
10 b setjmp
1011
11 str lr,[r0,#256]
121: str lr,[r0,#256]
1213 str r4,[r0,#260+8]
1314 mov r4,r0
1415
lib/libc/musl/src/stat/__xstat.c+4
......@@ -1,5 +1,7 @@
11#include <sys/stat.h>
22
3#if !_REDIR_TIME64
4
35int __fxstat(int ver, int fd, struct stat *buf)
46{
57 return fstat(fd, buf);
......@@ -25,6 +27,8 @@ weak_alias(__fxstatat, __fxstatat64);
2527weak_alias(__lxstat, __lxstat64);
2628weak_alias(__xstat, __xstat64);
2729
30#endif
31
2832int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev)
2933{
3034 return mknod(path, mode, *dev);
lib/libc/musl/src/stat/fchmodat.c+2-1
......@@ -2,6 +2,7 @@
22#include <fcntl.h>
33#include <errno.h>
44#include "syscall.h"
5#include "kstat.h"
56
67int fchmodat(int fd, const char *path, mode_t mode, int flag)
78{
......@@ -10,7 +11,7 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag)
1011 if (flag != AT_SYMLINK_NOFOLLOW)
1112 return __syscall_ret(-EINVAL);
1213
13 struct stat st;
14 struct kstat st;
1415 int ret, fd2;
1516 char proc[15+3*sizeof(int)];
1617
lib/libc/musl/src/stat/fstat.c+2
......@@ -10,4 +10,6 @@ int fstat(int fd, struct stat *st)
1010 return fstatat(fd, "", st, AT_EMPTY_PATH);
1111}
1212
13#if !_REDIR_TIME64
1314weak_alias(fstat, fstat64);
15#endif
lib/libc/musl/src/stat/fstatat.c+18
......@@ -57,6 +57,14 @@ static int fstatat_statx(int fd, const char *restrict path, struct stat *restric
5757 .st_mtim.tv_nsec = stx.stx_mtime.tv_nsec,
5858 .st_ctim.tv_sec = stx.stx_ctime.tv_sec,
5959 .st_ctim.tv_nsec = stx.stx_ctime.tv_nsec,
60#if _REDIR_TIME64
61 .__st_atim32.tv_sec = stx.stx_atime.tv_sec,
62 .__st_atim32.tv_nsec = stx.stx_atime.tv_nsec,
63 .__st_mtim32.tv_sec = stx.stx_mtime.tv_sec,
64 .__st_mtim32.tv_nsec = stx.stx_mtime.tv_nsec,
65 .__st_ctim32.tv_sec = stx.stx_ctime.tv_sec,
66 .__st_ctim32.tv_nsec = stx.stx_ctime.tv_nsec,
67#endif
6068 };
6169 return 0;
6270}
......@@ -110,6 +118,14 @@ static int fstatat_kstat(int fd, const char *restrict path, struct stat *restric
110118 .st_mtim.tv_nsec = kst.st_mtime_nsec,
111119 .st_ctim.tv_sec = kst.st_ctime_sec,
112120 .st_ctim.tv_nsec = kst.st_ctime_nsec,
121#if _REDIR_TIME64
122 .__st_atim32.tv_sec = kst.st_atime_sec,
123 .__st_atim32.tv_nsec = kst.st_atime_nsec,
124 .__st_mtim32.tv_sec = kst.st_mtime_sec,
125 .__st_mtim32.tv_nsec = kst.st_mtime_nsec,
126 .__st_ctim32.tv_sec = kst.st_ctime_sec,
127 .__st_ctim32.tv_nsec = kst.st_ctime_nsec,
128#endif
113129 };
114130
115131 return 0;
......@@ -126,4 +142,6 @@ int fstatat(int fd, const char *restrict path, struct stat *restrict st, int fla
126142 return __syscall_ret(ret);
127143}
128144
145#if !_REDIR_TIME64
129146weak_alias(fstatat, fstatat64);
147#endif
lib/libc/musl/src/stat/lstat.c+2
......@@ -6,4 +6,6 @@ int lstat(const char *restrict path, struct stat *restrict buf)
66 return fstatat(AT_FDCWD, path, buf, AT_SYMLINK_NOFOLLOW);
77}
88
9#if !_REDIR_TIME64
910weak_alias(lstat, lstat64);
11#endif
lib/libc/musl/src/stat/stat.c+2
......@@ -6,4 +6,6 @@ int stat(const char *restrict path, struct stat *restrict buf)
66 return fstatat(AT_FDCWD, path, buf, 0);
77}
88
9#if !_REDIR_TIME64
910weak_alias(stat, stat64);
11#endif
lib/libc/musl/src/stdio/tempnam.c+3-2
......@@ -6,6 +6,7 @@
66#include <string.h>
77#include <stdlib.h>
88#include "syscall.h"
9#include "kstat.h"
910
1011#define MAXTRIES 100
1112
......@@ -37,10 +38,10 @@ char *tempnam(const char *dir, const char *pfx)
3738 for (try=0; try<MAXTRIES; try++) {
3839 __randname(s+l-6);
3940#ifdef SYS_lstat
40 r = __syscall(SYS_lstat, s, &(struct stat){0});
41 r = __syscall(SYS_lstat, s, &(struct kstat){0});
4142#else
4243 r = __syscall(SYS_fstatat, AT_FDCWD, s,
43 &(struct stat){0}, AT_SYMLINK_NOFOLLOW);
44 &(struct kstat){0}, AT_SYMLINK_NOFOLLOW);
4445#endif
4546 if (r == -ENOENT) return strdup(s);
4647 }
lib/libc/musl/src/stdio/tmpnam.c+3-2
......@@ -5,6 +5,7 @@
55#include <string.h>
66#include <stdlib.h>
77#include "syscall.h"
8#include "kstat.h"
89
910#define MAXTRIES 100
1011
......@@ -17,10 +18,10 @@ char *tmpnam(char *buf)
1718 for (try=0; try<MAXTRIES; try++) {
1819 __randname(s+12);
1920#ifdef SYS_lstat
20 r = __syscall(SYS_lstat, s, &(struct stat){0});
21 r = __syscall(SYS_lstat, s, &(struct kstat){0});
2122#else
2223 r = __syscall(SYS_fstatat, AT_FDCWD, s,
23 &(struct stat){0}, AT_SYMLINK_NOFOLLOW);
24 &(struct kstat){0}, AT_SYMLINK_NOFOLLOW);
2425#endif
2526 if (r == -ENOENT) return strcpy(buf ? buf : internal, s);
2627 }
lib/libc/musl/src/stdio/ungetc.c+1-1
......@@ -16,5 +16,5 @@ int ungetc(int c, FILE *f)
1616 f->flags &= ~F_EOF;
1717
1818 FUNLOCK(f);
19 return c;
19 return (unsigned char)c;
2020}
lib/libc/musl/src/string/arm/memcpy.c+1-1
......@@ -1,3 +1,3 @@
1#if __ARMEB__ || __thumb__
1#if __ARMEB__
22#include "../memcpy.c"
33#endif
lib/libc/musl/src/string/arm/memcpy_le.S+8-5
......@@ -1,4 +1,4 @@
1#if !__ARMEB__ && !__thumb__
1#if !__ARMEB__
22
33/*
44 * Copyright (C) 2008 The Android Open Source Project
......@@ -40,8 +40,9 @@
4040 * This file has been modified from the original for use in musl libc.
4141 * The main changes are: addition of .type memcpy,%function to make the
4242 * code safely callable from thumb mode, adjusting the return
43 * instructions to be compatible with pre-thumb ARM cpus, and removal
44 * of prefetch code that is not compatible with older cpus.
43 * instructions to be compatible with pre-thumb ARM cpus, removal of
44 * prefetch code that is not compatible with older cpus and support for
45 * building as thumb 2.
4546 */
4647
4748.syntax unified
......@@ -241,7 +242,8 @@ non_congruent:
241242 beq 2f
242243 ldr r5, [r1], #4
243244 sub r2, r2, #4
244 orr r4, r3, r5, lsl lr
245 mov r4, r5, lsl lr
246 orr r4, r4, r3
245247 mov r3, r5, lsr r12
246248 str r4, [r0], #4
247249 cmp r2, #4
......@@ -348,7 +350,8 @@ less_than_thirtytwo:
348350
3493511: ldr r5, [r1], #4
350352 sub r2, r2, #4
351 orr r4, r3, r5, lsl lr
353 mov r4, r5, lsl lr
354 orr r4, r4, r3
352355 mov r3, r5, lsr r12
353356 str r4, [r0], #4
354357 cmp r2, #4
lib/libc/musl/src/time/__map_file.c+2-1
......@@ -2,10 +2,11 @@
22#include <fcntl.h>
33#include <sys/stat.h>
44#include "syscall.h"
5#include "kstat.h"
56
67const char unsigned *__map_file(const char *pathname, size_t *size)
78{
8 struct stat st;
9 struct kstat st;
910 const unsigned char *map = MAP_FAILED;
1011 int fd = sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
1112 if (fd < 0) return 0;
src/install_files.h+79-81
......@@ -80,7 +80,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
8080"musl/src/crypt/crypt.c",
8181"musl/src/crypt/crypt_blowfish.c",
8282"musl/src/crypt/crypt_des.c",
83"musl/src/crypt/crypt_des.h",
8483"musl/src/crypt/crypt_md5.c",
8584"musl/src/crypt/crypt_r.c",
8685"musl/src/crypt/crypt_sha256.c",
......@@ -90,7 +89,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
9089"musl/src/ctype/__ctype_get_mb_cur_max.c",
9190"musl/src/ctype/__ctype_tolower_loc.c",
9291"musl/src/ctype/__ctype_toupper_loc.c",
93"musl/src/ctype/alpha.h",
9492"musl/src/ctype/isalnum.c",
9593"musl/src/ctype/isalpha.c",
9694"musl/src/ctype/isascii.c",
......@@ -117,8 +115,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
117115"musl/src/ctype/iswupper.c",
118116"musl/src/ctype/iswxdigit.c",
119117"musl/src/ctype/isxdigit.c",
120"musl/src/ctype/nonspacing.h",
121"musl/src/ctype/punct.h",
122118"musl/src/ctype/toascii.c",
123119"musl/src/ctype/tolower.c",
124120"musl/src/ctype/toupper.c",
......@@ -126,8 +122,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
126122"musl/src/ctype/wcswidth.c",
127123"musl/src/ctype/wctrans.c",
128124"musl/src/ctype/wcwidth.c",
129"musl/src/ctype/wide.h",
130"musl/src/dirent/__dirent.h",
131125"musl/src/dirent/alphasort.c",
132126"musl/src/dirent/closedir.c",
133127"musl/src/dirent/dirfd.c",
......@@ -152,7 +146,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
152146"musl/src/env/setenv.c",
153147"musl/src/env/unsetenv.c",
154148"musl/src/errno/__errno_location.c",
155"musl/src/errno/__strerror.h",
156149"musl/src/errno/strerror.c",
157150"musl/src/exit/_Exit.c",
158151"musl/src/exit/abort.c",
......@@ -196,55 +189,18 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
196189"musl/src/fenv/sh/fenv.S",
197190"musl/src/fenv/x32/fenv.s",
198191"musl/src/fenv/x86_64/fenv.s",
199"musl/src/include/arpa/inet.h",
200"musl/src/include/crypt.h",
201"musl/src/include/errno.h",
202"musl/src/include/features.h",
203"musl/src/include/langinfo.h",
204"musl/src/include/pthread.h",
205"musl/src/include/resolv.h",
206"musl/src/include/signal.h",
207"musl/src/include/stdio.h",
208"musl/src/include/stdlib.h",
209"musl/src/include/string.h",
210"musl/src/include/sys/auxv.h",
211"musl/src/include/sys/membarrier.h",
212"musl/src/include/sys/mman.h",
213"musl/src/include/sys/sysinfo.h",
214"musl/src/include/sys/time.h",
215"musl/src/include/time.h",
216"musl/src/include/unistd.h",
217"musl/src/include/wchar.h",
218"musl/src/internal/atomic.h",
219"musl/src/internal/complex_impl.h",
220192"musl/src/internal/defsysinfo.c",
221"musl/src/internal/dynlink.h",
222"musl/src/internal/fdpic_crt.h",
223193"musl/src/internal/floatscan.c",
224"musl/src/internal/floatscan.h",
225"musl/src/internal/futex.h",
226194"musl/src/internal/i386/defsysinfo.s",
227195"musl/src/internal/intscan.c",
228"musl/src/internal/intscan.h",
229"musl/src/internal/ksigaction.h",
230196"musl/src/internal/libc.c",
231"musl/src/internal/libc.h",
232"musl/src/internal/libm.h",
233"musl/src/internal/locale_impl.h",
234"musl/src/internal/lock.h",
235"musl/src/internal/malloc_impl.h",
236197"musl/src/internal/procfdname.c",
237"musl/src/internal/pthread_impl.h",
238198"musl/src/internal/sh/__shcall.c",
239199"musl/src/internal/shgetc.c",
240"musl/src/internal/shgetc.h",
241"musl/src/internal/stdio_impl.h",
242"musl/src/internal/syscall.h",
243200"musl/src/internal/syscall_ret.c",
244201"musl/src/internal/vdso.c",
245202"musl/src/internal/version.c",
246203"musl/src/ipc/ftok.c",
247"musl/src/ipc/ipc.h",
248204"musl/src/ipc/msgctl.c",
249205"musl/src/ipc/msgget.c",
250206"musl/src/ipc/msgrcv.c",
......@@ -261,6 +217,7 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
261217"musl/src/ldso/aarch64/dlsym.s",
262218"musl/src/ldso/aarch64/tlsdesc.s",
263219"musl/src/ldso/arm/dlsym.s",
220"musl/src/ldso/arm/dlsym_time64.S",
264221"musl/src/ldso/arm/find_exidx.c",
265222"musl/src/ldso/arm/tlsdesc.S",
266223"musl/src/ldso/dl_iterate_phdr.c",
......@@ -271,18 +228,26 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
271228"musl/src/ldso/dlopen.c",
272229"musl/src/ldso/dlsym.c",
273230"musl/src/ldso/i386/dlsym.s",
231"musl/src/ldso/i386/dlsym_time64.S",
274232"musl/src/ldso/i386/tlsdesc.s",
275233"musl/src/ldso/m68k/dlsym.s",
234"musl/src/ldso/m68k/dlsym_time64.S",
276235"musl/src/ldso/microblaze/dlsym.s",
236"musl/src/ldso/microblaze/dlsym_time64.S",
277237"musl/src/ldso/mips/dlsym.s",
238"musl/src/ldso/mips/dlsym_time64.S",
278239"musl/src/ldso/mips64/dlsym.s",
279240"musl/src/ldso/mipsn32/dlsym.s",
241"musl/src/ldso/mipsn32/dlsym_time64.S",
280242"musl/src/ldso/or1k/dlsym.s",
243"musl/src/ldso/or1k/dlsym_time64.S",
281244"musl/src/ldso/powerpc/dlsym.s",
245"musl/src/ldso/powerpc/dlsym_time64.S",
282246"musl/src/ldso/powerpc64/dlsym.s",
283247"musl/src/ldso/riscv64/dlsym.s",
284248"musl/src/ldso/s390x/dlsym.s",
285249"musl/src/ldso/sh/dlsym.s",
250"musl/src/ldso/sh/dlsym_time64.S",
286251"musl/src/ldso/tlsdesc.c",
287252"musl/src/ldso/x32/dlsym.s",
288253"musl/src/ldso/x86_64/dlsym.s",
......@@ -369,30 +334,21 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
369334"musl/src/linux/xattr.c",
370335"musl/src/locale/__lctrans.c",
371336"musl/src/locale/__mo_lookup.c",
372"musl/src/locale/big5.h",
373337"musl/src/locale/bind_textdomain_codeset.c",
374338"musl/src/locale/c_locale.c",
375339"musl/src/locale/catclose.c",
376340"musl/src/locale/catgets.c",
377341"musl/src/locale/catopen.c",
378"musl/src/locale/codepages.h",
379342"musl/src/locale/dcngettext.c",
380343"musl/src/locale/duplocale.c",
381344"musl/src/locale/freelocale.c",
382"musl/src/locale/gb18030.h",
383"musl/src/locale/hkscs.h",
384345"musl/src/locale/iconv.c",
385346"musl/src/locale/iconv_close.c",
386"musl/src/locale/jis0208.h",
387"musl/src/locale/ksc.h",
388347"musl/src/locale/langinfo.c",
389"musl/src/locale/legacychars.h",
390348"musl/src/locale/locale_map.c",
391349"musl/src/locale/localeconv.c",
392350"musl/src/locale/newlocale.c",
393351"musl/src/locale/pleval.c",
394"musl/src/locale/pleval.h",
395"musl/src/locale/revjis.h",
396352"musl/src/locale/setlocale.c",
397353"musl/src/locale/strcoll.c",
398354"musl/src/locale/strfmon.c",
......@@ -401,7 +357,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
401357"musl/src/locale/uselocale.c",
402358"musl/src/locale/wcscoll.c",
403359"musl/src/locale/wcsxfrm.c",
404"musl/src/malloc/DESIGN",
405360"musl/src/malloc/aligned_alloc.c",
406361"musl/src/malloc/expand_heap.c",
407362"musl/src/malloc/lite_malloc.c",
......@@ -418,7 +373,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
418373"musl/src/math/__fpclassifyf.c",
419374"musl/src/math/__fpclassifyl.c",
420375"musl/src/math/__invtrigl.c",
421"musl/src/math/__invtrigl.h",
422376"musl/src/math/__math_divzero.c",
423377"musl/src/math/__math_divzerof.c",
424378"musl/src/math/__math_invalid.c",
......@@ -525,10 +479,8 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
525479"musl/src/math/exp2.c",
526480"musl/src/math/exp2f.c",
527481"musl/src/math/exp2f_data.c",
528"musl/src/math/exp2f_data.h",
529482"musl/src/math/exp2l.c",
530483"musl/src/math/exp_data.c",
531"musl/src/math/exp_data.h",
532484"musl/src/math/expf.c",
533485"musl/src/math/expl.c",
534486"musl/src/math/expm1.c",
......@@ -579,14 +531,9 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
579531"musl/src/math/i386/ceil.s",
580532"musl/src/math/i386/ceilf.s",
581533"musl/src/math/i386/ceill.s",
582"musl/src/math/i386/exp.s",
583"musl/src/math/i386/exp2.s",
584"musl/src/math/i386/exp2f.s",
585534"musl/src/math/i386/exp2l.s",
586"musl/src/math/i386/expf.s",
535"musl/src/math/i386/exp_ld.s",
587536"musl/src/math/i386/expl.s",
588"musl/src/math/i386/expm1.s",
589"musl/src/math/i386/expm1f.s",
590537"musl/src/math/i386/expm1l.s",
591538"musl/src/math/i386/fabs.s",
592539"musl/src/math/i386/fabsf.s",
......@@ -673,19 +620,15 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
673620"musl/src/math/log1pl.c",
674621"musl/src/math/log2.c",
675622"musl/src/math/log2_data.c",
676"musl/src/math/log2_data.h",
677623"musl/src/math/log2f.c",
678624"musl/src/math/log2f_data.c",
679"musl/src/math/log2f_data.h",
680625"musl/src/math/log2l.c",
681626"musl/src/math/log_data.c",
682"musl/src/math/log_data.h",
683627"musl/src/math/logb.c",
684628"musl/src/math/logbf.c",
685629"musl/src/math/logbl.c",
686630"musl/src/math/logf.c",
687631"musl/src/math/logf_data.c",
688"musl/src/math/logf_data.h",
689632"musl/src/math/logl.c",
690633"musl/src/math/lrint.c",
691634"musl/src/math/lrintf.c",
......@@ -693,6 +636,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
693636"musl/src/math/lround.c",
694637"musl/src/math/lroundf.c",
695638"musl/src/math/lroundl.c",
639"musl/src/math/mips/fabs.c",
640"musl/src/math/mips/fabsf.c",
641"musl/src/math/mips/sqrt.c",
642"musl/src/math/mips/sqrtf.c",
696643"musl/src/math/modf.c",
697644"musl/src/math/modff.c",
698645"musl/src/math/modfl.c",
......@@ -710,7 +657,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
710657"musl/src/math/nexttowardl.c",
711658"musl/src/math/pow.c",
712659"musl/src/math/pow_data.c",
713"musl/src/math/pow_data.h",
714660"musl/src/math/powerpc/fabs.c",
715661"musl/src/math/powerpc/fabsf.c",
716662"musl/src/math/powerpc/fma.c",
......@@ -741,7 +687,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
741687"musl/src/math/powerpc64/truncf.c",
742688"musl/src/math/powf.c",
743689"musl/src/math/powf_data.c",
744"musl/src/math/powf_data.h",
745690"musl/src/math/powl.c",
746691"musl/src/math/remainder.c",
747692"musl/src/math/remainderf.c",
......@@ -958,7 +903,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
958903"musl/src/multibyte/c16rtomb.c",
959904"musl/src/multibyte/c32rtomb.c",
960905"musl/src/multibyte/internal.c",
961"musl/src/multibyte/internal.h",
962906"musl/src/multibyte/mblen.c",
963907"musl/src/multibyte/mbrlen.c",
964908"musl/src/multibyte/mbrtoc16.c",
......@@ -1021,12 +965,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1021965"musl/src/network/inet_ntop.c",
1022966"musl/src/network/inet_pton.c",
1023967"musl/src/network/listen.c",
1024"musl/src/network/lookup.h",
1025968"musl/src/network/lookup_ipliteral.c",
1026969"musl/src/network/lookup_name.c",
1027970"musl/src/network/lookup_serv.c",
1028971"musl/src/network/netlink.c",
1029"musl/src/network/netlink.h",
1030972"musl/src/network/netname.c",
1031973"musl/src/network/ns_parse.c",
1032974"musl/src/network/ntohl.c",
......@@ -1070,12 +1012,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
10701012"musl/src/passwd/getspnam.c",
10711013"musl/src/passwd/getspnam_r.c",
10721014"musl/src/passwd/lckpwdf.c",
1073"musl/src/passwd/nscd.h",
10741015"musl/src/passwd/nscd_query.c",
10751016"musl/src/passwd/putgrent.c",
10761017"musl/src/passwd/putpwent.c",
10771018"musl/src/passwd/putspent.c",
1078"musl/src/passwd/pwf.h",
10791019"musl/src/prng/__rand48_step.c",
10801020"musl/src/prng/__seed48.c",
10811021"musl/src/prng/drand48.c",
......@@ -1083,7 +1023,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
10831023"musl/src/prng/lrand48.c",
10841024"musl/src/prng/mrand48.c",
10851025"musl/src/prng/rand.c",
1086"musl/src/prng/rand48.h",
10871026"musl/src/prng/rand_r.c",
10881027"musl/src/prng/random.c",
10891028"musl/src/prng/seed48.c",
......@@ -1095,7 +1034,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
10951034"musl/src/process/execv.c",
10961035"musl/src/process/execve.c",
10971036"musl/src/process/execvp.c",
1098"musl/src/process/fdop.h",
10991037"musl/src/process/fexecve.c",
11001038"musl/src/process/fork.c",
11011039"musl/src/process/i386/vfork.s",
......@@ -1134,7 +1072,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
11341072"musl/src/regex/regerror.c",
11351073"musl/src/regex/regexec.c",
11361074"musl/src/regex/tre-mem.c",
1137"musl/src/regex/tre.h",
11381075"musl/src/sched/affinity.c",
11391076"musl/src/sched/sched_cpucount.c",
11401077"musl/src/sched/sched_get_priority_max.c",
......@@ -1152,7 +1089,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
11521089"musl/src/search/tdestroy.c",
11531090"musl/src/search/tfind.c",
11541091"musl/src/search/tsearch.c",
1155"musl/src/search/tsearch.h",
11561092"musl/src/search/twalk.c",
11571093"musl/src/select/poll.c",
11581094"musl/src/select/pselect.c",
......@@ -1335,7 +1271,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
13351271"musl/src/stdio/fwrite.c",
13361272"musl/src/stdio/fwscanf.c",
13371273"musl/src/stdio/getc.c",
1338"musl/src/stdio/getc.h",
13391274"musl/src/stdio/getc_unlocked.c",
13401275"musl/src/stdio/getchar.c",
13411276"musl/src/stdio/getchar_unlocked.c",
......@@ -1354,7 +1289,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
13541289"musl/src/stdio/popen.c",
13551290"musl/src/stdio/printf.c",
13561291"musl/src/stdio/putc.c",
1357"musl/src/stdio/putc.h",
13581292"musl/src/stdio/putc_unlocked.c",
13591293"musl/src/stdio/putchar.c",
13601294"musl/src/stdio/putchar_unlocked.c",
......@@ -1746,7 +1680,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
17461680"musl/src/time/strftime.c",
17471681"musl/src/time/strptime.c",
17481682"musl/src/time/time.c",
1749"musl/src/time/time_impl.h",
17501683"musl/src/time/timegm.c",
17511684"musl/src/time/timer_create.c",
17521685"musl/src/time/timer_delete.c",
......@@ -1843,4 +1776,69 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
18431776"musl/src/unistd/writev.c",
18441777"musl/src/unistd/x32/lseek.c",
18451778};
1779static const char *ZIG_MUSL_COMPAT_TIME32_FILES[] = {
1780"musl/compat/time32/__xstat.c",
1781"musl/compat/time32/adjtime32.c",
1782"musl/compat/time32/adjtimex_time32.c",
1783"musl/compat/time32/aio_suspend_time32.c",
1784"musl/compat/time32/clock_adjtime32.c",
1785"musl/compat/time32/clock_getres_time32.c",
1786"musl/compat/time32/clock_gettime32.c",
1787"musl/compat/time32/clock_nanosleep_time32.c",
1788"musl/compat/time32/clock_settime32.c",
1789"musl/compat/time32/cnd_timedwait_time32.c",
1790"musl/compat/time32/ctime32.c",
1791"musl/compat/time32/ctime32_r.c",
1792"musl/compat/time32/difftime32.c",
1793"musl/compat/time32/fstat_time32.c",
1794"musl/compat/time32/fstatat_time32.c",
1795"musl/compat/time32/ftime32.c",
1796"musl/compat/time32/futimens_time32.c",
1797"musl/compat/time32/futimes_time32.c",
1798"musl/compat/time32/futimesat_time32.c",
1799"musl/compat/time32/getitimer_time32.c",
1800"musl/compat/time32/getrusage_time32.c",
1801"musl/compat/time32/gettimeofday_time32.c",
1802"musl/compat/time32/gmtime32.c",
1803"musl/compat/time32/gmtime32_r.c",
1804"musl/compat/time32/localtime32.c",
1805"musl/compat/time32/localtime32_r.c",
1806"musl/compat/time32/lstat_time32.c",
1807"musl/compat/time32/lutimes_time32.c",
1808"musl/compat/time32/mktime32.c",
1809"musl/compat/time32/mq_timedreceive_time32.c",
1810"musl/compat/time32/mq_timedsend_time32.c",
1811"musl/compat/time32/mtx_timedlock_time32.c",
1812"musl/compat/time32/nanosleep_time32.c",
1813"musl/compat/time32/ppoll_time32.c",
1814"musl/compat/time32/pselect_time32.c",
1815"musl/compat/time32/pthread_cond_timedwait_time32.c",
1816"musl/compat/time32/pthread_mutex_timedlock_time32.c",
1817"musl/compat/time32/pthread_rwlock_timedrdlock_time32.c",
1818"musl/compat/time32/pthread_rwlock_timedwrlock_time32.c",
1819"musl/compat/time32/pthread_timedjoin_np_time32.c",
1820"musl/compat/time32/recvmmsg_time32.c",
1821"musl/compat/time32/sched_rr_get_interval_time32.c",
1822"musl/compat/time32/select_time32.c",
1823"musl/compat/time32/sem_timedwait_time32.c",
1824"musl/compat/time32/semtimedop_time32.c",
1825"musl/compat/time32/setitimer_time32.c",
1826"musl/compat/time32/settimeofday_time32.c",
1827"musl/compat/time32/sigtimedwait_time32.c",
1828"musl/compat/time32/stat_time32.c",
1829"musl/compat/time32/stime32.c",
1830"musl/compat/time32/thrd_sleep_time32.c",
1831"musl/compat/time32/time32.c",
1832"musl/compat/time32/time32gm.c",
1833"musl/compat/time32/timer_gettime32.c",
1834"musl/compat/time32/timer_settime32.c",
1835"musl/compat/time32/timerfd_gettime32.c",
1836"musl/compat/time32/timerfd_settime32.c",
1837"musl/compat/time32/timespec_get_time32.c",
1838"musl/compat/time32/utime_time32.c",
1839"musl/compat/time32/utimensat_time32.c",
1840"musl/compat/time32/utimes_time32.c",
1841"musl/compat/time32/wait3_time32.c",
1842"musl/compat/time32/wait4_time32.c",
1843};
18461844#endif
src/link.cpp+39-24
......@@ -983,44 +983,59 @@ static bool is_musl_arch_name(const char *name) {
983983 return false;
984984}
985985
986enum MuslSrc {
987 MuslSrcAsm,
988 MuslSrcNormal,
989 MuslSrcO3,
990};
991
992static void add_musl_src_file(HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> &source_table,
993 const char *file_path)
994{
995 Buf *src_file = buf_create_from_str(file_path);
996
997 MuslSrc src_kind;
998 if (buf_ends_with_str(src_file, ".c")) {
999 bool want_O3 = buf_starts_with_str(src_file, "musl/src/malloc/") ||
1000 buf_starts_with_str(src_file, "musl/src/string/") ||
1001 buf_starts_with_str(src_file, "musl/src/internal/");
1002 src_kind = want_O3 ? MuslSrcO3 : MuslSrcNormal;
1003 } else if (buf_ends_with_str(src_file, ".s") || buf_ends_with_str(src_file, ".S")) {
1004 src_kind = MuslSrcAsm;
1005 } else {
1006 zig_unreachable();
1007 }
1008 if (ZIG_OS_SEP_CHAR != '/') {
1009 buf_replace(src_file, '/', ZIG_OS_SEP_CHAR);
1010 }
1011 source_table.put_unique(src_file, src_kind);
1012}
1013
9861014static const char *build_musl(CodeGen *parent, Stage2ProgressNode *progress_node) {
9871015 CodeGen *child_gen = create_child_codegen(parent, nullptr, OutTypeLib, nullptr, "c", progress_node);
9881016
9891017 // When there is a src/<arch>/foo.* then it should substitute for src/foo.*
9901018 // Even a .s file can substitute for a .c file.
9911019
992 enum MuslSrc {
993 MuslSrcAsm,
994 MuslSrcNormal,
995 MuslSrcO3,
996 };
997
9981020 const char *target_musl_arch_name = target_arch_musl_name(parent->zig_target->arch);
9991021
10001022 HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> source_table = {};
1001 source_table.init(1800);
1023 source_table.init(2000);
10021024
10031025 for (size_t i = 0; i < array_length(ZIG_MUSL_SRC_FILES); i += 1) {
1004 Buf *src_file = buf_create_from_str(ZIG_MUSL_SRC_FILES[i]);
1005
1006 MuslSrc src_kind;
1007 if (buf_ends_with_str(src_file, ".c")) {
1008 assert(buf_starts_with_str(src_file, "musl/src/"));
1009 bool want_O3 = buf_starts_with_str(src_file, "musl/src/malloc/") ||
1010 buf_starts_with_str(src_file, "musl/src/string/") ||
1011 buf_starts_with_str(src_file, "musl/src/internal/");
1012 src_kind = want_O3 ? MuslSrcO3 : MuslSrcNormal;
1013 } else if (buf_ends_with_str(src_file, ".s") || buf_ends_with_str(src_file, ".S")) {
1014 src_kind = MuslSrcAsm;
1015 } else {
1016 continue;
1017 }
1018 if (ZIG_OS_SEP_CHAR != '/') {
1019 buf_replace(src_file, '/', ZIG_OS_SEP_CHAR);
1026 add_musl_src_file(source_table, ZIG_MUSL_SRC_FILES[i]);
1027 }
1028
1029 static const char *time32_compat_arch_list[] = {"arm", "i386", "mips", "powerpc"};
1030 for (size_t arch_i = 0; arch_i < array_length(time32_compat_arch_list); arch_i += 1) {
1031 if (strcmp(target_musl_arch_name, time32_compat_arch_list[arch_i]) == 0) {
1032 for (size_t i = 0; i < array_length(ZIG_MUSL_COMPAT_TIME32_FILES); i += 1) {
1033 add_musl_src_file(source_table, ZIG_MUSL_COMPAT_TIME32_FILES[i]);
1034 }
10201035 }
1021 source_table.put_unique(src_file, src_kind);
10221036 }
10231037
1038
10241039 ZigList<CFile *> c_source_files = {0};
10251040
10261041 Buf dirname = BUF_INIT;