From a5e133bf29d42101ba90012b3b03b670bbb949b2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 25 Jan 2016 00:52:58 +0000 Subject: [PATCH 001/412] change the internal socketcall selection logic only use SYS_socketcall if SYSCALL_USE_SOCKETCALL is defined internally, otherwise use direct syscalls. this commit does not change the current behaviour, it is preparation for adding direct syscall numbers for i386. --- arch/i386/syscall_arch.h | 2 ++ src/internal/syscall.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/i386/syscall_arch.h b/arch/i386/syscall_arch.h index ca0ea7fb..4c9d874a 100644 --- a/arch/i386/syscall_arch.h +++ b/arch/i386/syscall_arch.h @@ -55,3 +55,5 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a #define VDSO_USEFUL #define VDSO_CGT_SYM "__vdso_clock_gettime" #define VDSO_CGT_VER "LINUX_2.6" + +#define SYSCALL_USE_SOCKETCALL diff --git a/src/internal/syscall.h b/src/internal/syscall.h index 36c772df..ff3cf53a 100644 --- a/src/internal/syscall.h +++ b/src/internal/syscall.h @@ -63,7 +63,7 @@ long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...), #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__) #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__)) -#ifdef SYS_socket +#ifndef SYSCALL_USE_SOCKETCALL #define __socketcall(nm,a,b,c,d,e,f) syscall(SYS_##nm, a, b, c, d, e, f) #define __socketcall_cp(nm,a,b,c,d,e,f) syscall_cp(SYS_##nm, a, b, c, d, e, f) #else From 37bfb68f688772e7ce339ab72b9ddcf86ac1e8a8 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 18 Nov 2015 23:27:07 +0000 Subject: [PATCH 002/412] add new i386 socket syscall numbers new in linux v4.3 commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb direct calls instead of socketcall allow better seccomp filtering. musl continues to use socketcalls internally on i386. (older kernels would need a fallback mechanism if the direct calls were used.) --- arch/i386/bits/syscall.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/i386/bits/syscall.h b/arch/i386/bits/syscall.h index 2902f808..64004d8e 100644 --- a/arch/i386/bits/syscall.h +++ b/arch/i386/bits/syscall.h @@ -357,6 +357,21 @@ #define __NR_memfd_create 356 #define __NR_bpf 357 #define __NR_execveat 358 +#define __NR_socket 359 +#define __NR_socketpair 360 +#define __NR_bind 361 +#define __NR_connect 362 +#define __NR_listen 363 +#define __NR_accept4 364 +#define __NR_getsockopt 365 +#define __NR_setsockopt 366 +#define __NR_getsockname 367 +#define __NR_getpeername 368 +#define __NR_sendto 369 +#define __NR_sendmsg 370 +#define __NR_recvfrom 371 +#define __NR_recvmsg 372 +#define __NR_shutdown 373 /* Repeated with SYS_ prefix */ @@ -720,3 +735,18 @@ #define SYS_memfd_create 356 #define SYS_bpf 357 #define SYS_execveat 358 +#define SYS_socket 359 +#define SYS_socketpair 360 +#define SYS_bind 361 +#define SYS_connect 362 +#define SYS_listen 363 +#define SYS_accept4 364 +#define SYS_getsockopt 365 +#define SYS_setsockopt 366 +#define SYS_getsockname 367 +#define SYS_getpeername 368 +#define SYS_sendto 369 +#define SYS_sendmsg 370 +#define SYS_recvfrom 371 +#define SYS_recvmsg 372 +#define SYS_shutdown 373 From 09001a8f97ac779573976b5838e3d293f1713c5c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 18 Nov 2015 23:31:37 +0000 Subject: [PATCH 003/412] add new membarrier, userfaultfd and switch_endian syscalls new in linux v4.3 added for aarch64, arm, i386, mips, or1k, powerpc, x32 and x86_64. membarrier is a system wide memory barrier, moves most of the synchronization cost to one side, new in kernel commit 5b25b13ab08f616efd566347d809b4ece54570d1 userfaultfd is useful for qemu and is new in kernel commit 8d2afd96c20316d112e04d935d9e09150e988397 switch_endian is powerpc only for switching endianness, new in commit 529d235a0e190ded1d21ccc80a73e625ebcad09b --- arch/aarch64/bits/syscall.h | 4 ++++ arch/arm/bits/syscall.h | 4 ++++ arch/i386/bits/syscall.h | 4 ++++ arch/mips/bits/syscall.h | 4 ++++ arch/or1k/bits/syscall.h | 4 ++++ arch/powerpc/bits/syscall.h | 6 ++++++ arch/x32/bits/syscall.h | 4 ++++ arch/x86_64/bits/syscall.h | 4 ++++ 8 files changed, 34 insertions(+) diff --git a/arch/aarch64/bits/syscall.h b/arch/aarch64/bits/syscall.h index d7a1420a..d64b4371 100644 --- a/arch/aarch64/bits/syscall.h +++ b/arch/aarch64/bits/syscall.h @@ -265,6 +265,8 @@ #define __NR_memfd_create 279 #define __NR_bpf 280 #define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 #define SYS_io_setup __NR_io_setup #define SYS_io_destroy __NR_io_destroy @@ -533,3 +535,5 @@ #define SYS_memfd_create __NR_memfd_create #define SYS_bpf __NR_bpf #define SYS_execveat __NR_execveat +#define SYS_userfaultfd __NR_userfaultfd +#define SYS_membarrier __NR_membarrier diff --git a/arch/arm/bits/syscall.h b/arch/arm/bits/syscall.h index df6cda01..0ddb2ccf 100644 --- a/arch/arm/bits/syscall.h +++ b/arch/arm/bits/syscall.h @@ -341,6 +341,8 @@ #define __NR_memfd_create 385 #define __NR_bpf 386 #define __NR_execveat 387 +#define __NR_userfaultfd 388 +#define __NR_membarrier 389 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 @@ -693,3 +695,5 @@ #define SYS_memfd_create 385 #define SYS_bpf 386 #define SYS_execveat 387 +#define SYS_userfaultfd 388 +#define SYS_membarrier 389 diff --git a/arch/i386/bits/syscall.h b/arch/i386/bits/syscall.h index 64004d8e..27c5325c 100644 --- a/arch/i386/bits/syscall.h +++ b/arch/i386/bits/syscall.h @@ -372,6 +372,8 @@ #define __NR_recvfrom 371 #define __NR_recvmsg 372 #define __NR_shutdown 373 +#define __NR_userfaultfd 374 +#define __NR_membarrier 375 /* Repeated with SYS_ prefix */ @@ -750,3 +752,5 @@ #define SYS_recvfrom 371 #define SYS_recvmsg 372 #define SYS_shutdown 373 +#define SYS_userfaultfd 374 +#define SYS_membarrier 375 diff --git a/arch/mips/bits/syscall.h b/arch/mips/bits/syscall.h index 06761ed4..08bac39d 100644 --- a/arch/mips/bits/syscall.h +++ b/arch/mips/bits/syscall.h @@ -354,6 +354,8 @@ #define __NR_memfd_create 4354 #define __NR_bpf 4355 #define __NR_execveat 4356 +#define __NR_userfaultfd 4357 +#define __NR_membarrier 4358 /* Repeated with SYS_ prefix */ @@ -713,3 +715,5 @@ #define SYS_memfd_create 4354 #define SYS_bpf 4355 #define SYS_execveat 4356 +#define SYS_userfaultfd 4357 +#define SYS_membarrier 4358 diff --git a/arch/or1k/bits/syscall.h b/arch/or1k/bits/syscall.h index 967db728..203e243b 100644 --- a/arch/or1k/bits/syscall.h +++ b/arch/or1k/bits/syscall.h @@ -265,6 +265,8 @@ #define __NR_memfd_create 279 #define __NR_bpf 280 #define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 #define SYS_io_setup __NR_io_setup #define SYS_io_destroy __NR_io_destroy @@ -533,3 +535,5 @@ #define SYS_memfd_create __NR_memfd_create #define SYS_bpf __NR_bpf #define SYS_execveat __NR_execveat +#define SYS_userfaultfd __NR_userfaultfd +#define SYS_membarrier __NR_membarrier diff --git a/arch/powerpc/bits/syscall.h b/arch/powerpc/bits/syscall.h index 36fb6148..2dfec2fa 100644 --- a/arch/powerpc/bits/syscall.h +++ b/arch/powerpc/bits/syscall.h @@ -364,6 +364,9 @@ #define __NR_memfd_create 360 #define __NR_bpf 361 #define __NR_execveat 362 +#define __NR_switch_endian 363 +#define __NR_userfaultfd 364 +#define __NR_membarrier 365 /* * repeated with SYS prefix @@ -734,3 +737,6 @@ #define SYS_memfd_create 360 #define SYS_bpf 361 #define SYS_execveat 362 +#define SYS_switch_endian 363 +#define SYS_userfaultfd 364 +#define SYS_membarrier 365 diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h index 5a6d4d10..6240c356 100644 --- a/arch/x32/bits/syscall.h +++ b/arch/x32/bits/syscall.h @@ -277,6 +277,8 @@ #define __NR_memfd_create (__X32_SYSCALL_BIT + 319) #define __NR_kexec_file_load (__X32_SYSCALL_BIT + 320) #define __NR_bpf (__X32_SYSCALL_BIT + 321) +#define __NR_userfaultfd (__X32_SYSCALL_BIT + 323) +#define __NR_membarrier (__X32_SYSCALL_BIT + 324) #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) @@ -607,6 +609,8 @@ #define SYS_memfd_create __NR_memfd_create #define SYS_kexec_file_load __NR_kexec_file_load #define SYS_bpf __NR_bpf +#define SYS_userfaultfd __NR_userfaultfd +#define SYS_membarrier __NR_membarrier #define SYS_rt_sigaction __NR_rt_sigaction diff --git a/arch/x86_64/bits/syscall.h b/arch/x86_64/bits/syscall.h index 96ec51fa..0ff50268 100644 --- a/arch/x86_64/bits/syscall.h +++ b/arch/x86_64/bits/syscall.h @@ -321,6 +321,8 @@ #define __NR_kexec_file_load 320 #define __NR_bpf 321 #define __NR_execveat 322 +#define __NR_userfaultfd 323 +#define __NR_membarrier 324 @@ -649,3 +651,5 @@ #define SYS_kexec_file_load 320 #define SYS_bpf 321 #define SYS_execveat 322 +#define SYS_userfaultfd 323 +#define SYS_membarrier 324 From 3934f49c01d35565a9b74b3f9b29a913efa7c973 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 18 Nov 2015 23:54:22 +0000 Subject: [PATCH 004/412] update netpacket/packet.h to linux v4.3 --- include/netpacket/packet.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/netpacket/packet.h b/include/netpacket/packet.h index fa53712f..f2210ce8 100644 --- a/include/netpacket/packet.h +++ b/include/netpacket/packet.h @@ -32,10 +32,27 @@ struct packet_mreq { #define PACKET_RECV_OUTPUT 3 #define PACKET_RX_RING 5 #define PACKET_STATISTICS 6 +#define PACKET_COPY_THRESH 7 +#define PACKET_AUXDATA 8 +#define PACKET_ORIGDEV 9 +#define PACKET_VERSION 10 +#define PACKET_HDRLEN 11 +#define PACKET_RESERVE 12 +#define PACKET_TX_RING 13 +#define PACKET_LOSS 14 +#define PACKET_VNET_HDR 15 +#define PACKET_TX_TIMESTAMP 16 +#define PACKET_TIMESTAMP 17 +#define PACKET_FANOUT 18 +#define PACKET_TX_HAS_OFF 19 +#define PACKET_QDISC_BYPASS 20 +#define PACKET_ROLLOVER_STATS 21 +#define PACKET_FANOUT_DATA 22 #define PACKET_MR_MULTICAST 0 #define PACKET_MR_PROMISC 1 #define PACKET_MR_ALLMULTI 2 +#define PACKET_MR_UNICAST 3 #ifdef __cplusplus } From 8afd2a1d03de74f9e801bfbd2f15c6aab0fa1278 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 18 Nov 2015 23:56:08 +0000 Subject: [PATCH 005/412] add new PR_CAP_AMBIENT and related defines to sys/prctl.h ambient capability mask is new in linux v4.3, commit 58319057b7847667f0c9585b9de0e8932b0fdb08 --- include/sys/prctl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/sys/prctl.h b/include/sys/prctl.h index ec92053d..24f4f8bd 100644 --- a/include/sys/prctl.h +++ b/include/sys/prctl.h @@ -124,6 +124,12 @@ struct prctl_mm_map { #define PR_FP_MODE_FR (1 << 0) #define PR_FP_MODE_FRE (1 << 1) +#define PR_CAP_AMBIENT 47 +#define PR_CAP_AMBIENT_IS_SET 1 +#define PR_CAP_AMBIENT_RAISE 2 +#define PR_CAP_AMBIENT_LOWER 3 +#define PR_CAP_AMBIENT_CLEAR_ALL 4 + int prctl (int, ...); #ifdef __cplusplus From aaa604052dce98cfb4cc39f561bbb739c69bd802 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 19 Nov 2015 00:01:17 +0000 Subject: [PATCH 006/412] add new PTRACE_O_SUSPEND_SECCOMP ptrace option allows a ptracer process to disable/enable seccomp filters of the traced process, useful for checkpoint/restore, new in v4.3 commit 13c4a90119d28cfcb6b5bdd820c233b86c2b0237 --- include/sys/ptrace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sys/ptrace.h b/include/sys/ptrace.h index a133e66a..bc385f8c 100644 --- a/include/sys/ptrace.h +++ b/include/sys/ptrace.h @@ -72,7 +72,8 @@ extern "C" { #define PTRACE_O_TRACEEXIT 0x00000040 #define PTRACE_O_TRACESECCOMP 0x00000080 #define PTRACE_O_EXITKILL 0x00100000 -#define PTRACE_O_MASK 0x001000ff +#define PTRACE_O_SUSPEND_SECCOMP 0x00200000 +#define PTRACE_O_MASK 0x003000ff #define PTRACE_EVENT_FORK 1 #define PTRACE_EVENT_VFORK 2 From 51d5f139ca9e79d621a396542dde5b8cd76c5c3f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 23 Jan 2016 23:16:14 +0000 Subject: [PATCH 007/412] add mlock2 syscall number from linux v4.4 this is mlock with a flags argument, new in linux commit a8ca5d0ecbdde5cc3d7accacbd69968b0c98764e as usual microblaze and sh don't have allocated syscall number yet. --- arch/aarch64/bits/syscall.h | 2 ++ arch/arm/bits/syscall.h | 2 ++ arch/i386/bits/syscall.h | 2 ++ arch/mips/bits/syscall.h | 2 ++ arch/or1k/bits/syscall.h | 2 ++ arch/powerpc/bits/syscall.h | 2 ++ arch/x32/bits/syscall.h | 2 ++ arch/x86_64/bits/syscall.h | 2 ++ 8 files changed, 16 insertions(+) diff --git a/arch/aarch64/bits/syscall.h b/arch/aarch64/bits/syscall.h index d64b4371..31bed730 100644 --- a/arch/aarch64/bits/syscall.h +++ b/arch/aarch64/bits/syscall.h @@ -267,6 +267,7 @@ #define __NR_execveat 281 #define __NR_userfaultfd 282 #define __NR_membarrier 283 +#define __NR_mlock2 284 #define SYS_io_setup __NR_io_setup #define SYS_io_destroy __NR_io_destroy @@ -537,3 +538,4 @@ #define SYS_execveat __NR_execveat #define SYS_userfaultfd __NR_userfaultfd #define SYS_membarrier __NR_membarrier +#define SYS_mlock2 __NR_mlock2 diff --git a/arch/arm/bits/syscall.h b/arch/arm/bits/syscall.h index 0ddb2ccf..036c562f 100644 --- a/arch/arm/bits/syscall.h +++ b/arch/arm/bits/syscall.h @@ -343,6 +343,7 @@ #define __NR_execveat 387 #define __NR_userfaultfd 388 #define __NR_membarrier 389 +#define __NR_mlock2 390 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 @@ -697,3 +698,4 @@ #define SYS_execveat 387 #define SYS_userfaultfd 388 #define SYS_membarrier 389 +#define SYS_mlock2 390 diff --git a/arch/i386/bits/syscall.h b/arch/i386/bits/syscall.h index 27c5325c..b1a389b4 100644 --- a/arch/i386/bits/syscall.h +++ b/arch/i386/bits/syscall.h @@ -374,6 +374,7 @@ #define __NR_shutdown 373 #define __NR_userfaultfd 374 #define __NR_membarrier 375 +#define __NR_mlock2 376 /* Repeated with SYS_ prefix */ @@ -754,3 +755,4 @@ #define SYS_shutdown 373 #define SYS_userfaultfd 374 #define SYS_membarrier 375 +#define SYS_mlock2 376 diff --git a/arch/mips/bits/syscall.h b/arch/mips/bits/syscall.h index 08bac39d..340c5873 100644 --- a/arch/mips/bits/syscall.h +++ b/arch/mips/bits/syscall.h @@ -356,6 +356,7 @@ #define __NR_execveat 4356 #define __NR_userfaultfd 4357 #define __NR_membarrier 4358 +#define __NR_mlock2 4359 /* Repeated with SYS_ prefix */ @@ -717,3 +718,4 @@ #define SYS_execveat 4356 #define SYS_userfaultfd 4357 #define SYS_membarrier 4358 +#define SYS_mlock2 4359 diff --git a/arch/or1k/bits/syscall.h b/arch/or1k/bits/syscall.h index 203e243b..a73b2324 100644 --- a/arch/or1k/bits/syscall.h +++ b/arch/or1k/bits/syscall.h @@ -267,6 +267,7 @@ #define __NR_execveat 281 #define __NR_userfaultfd 282 #define __NR_membarrier 283 +#define __NR_mlock2 284 #define SYS_io_setup __NR_io_setup #define SYS_io_destroy __NR_io_destroy @@ -537,3 +538,4 @@ #define SYS_execveat __NR_execveat #define SYS_userfaultfd __NR_userfaultfd #define SYS_membarrier __NR_membarrier +#define SYS_mlock2 __NR_mlock2 diff --git a/arch/powerpc/bits/syscall.h b/arch/powerpc/bits/syscall.h index 2dfec2fa..e02f56f1 100644 --- a/arch/powerpc/bits/syscall.h +++ b/arch/powerpc/bits/syscall.h @@ -367,6 +367,7 @@ #define __NR_switch_endian 363 #define __NR_userfaultfd 364 #define __NR_membarrier 365 +#define __NR_mlock2 378 /* * repeated with SYS prefix @@ -740,3 +741,4 @@ #define SYS_switch_endian 363 #define SYS_userfaultfd 364 #define SYS_membarrier 365 +#define SYS_mlock2 378 diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h index 6240c356..4a1099d3 100644 --- a/arch/x32/bits/syscall.h +++ b/arch/x32/bits/syscall.h @@ -279,6 +279,7 @@ #define __NR_bpf (__X32_SYSCALL_BIT + 321) #define __NR_userfaultfd (__X32_SYSCALL_BIT + 323) #define __NR_membarrier (__X32_SYSCALL_BIT + 324) +#define __NR_mlock2 (__X32_SYSCALL_BIT + 325) #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) @@ -611,6 +612,7 @@ #define SYS_bpf __NR_bpf #define SYS_userfaultfd __NR_userfaultfd #define SYS_membarrier __NR_membarrier +#define SYS_mlock2 __NR_mlock2 #define SYS_rt_sigaction __NR_rt_sigaction diff --git a/arch/x86_64/bits/syscall.h b/arch/x86_64/bits/syscall.h index 0ff50268..22aa716c 100644 --- a/arch/x86_64/bits/syscall.h +++ b/arch/x86_64/bits/syscall.h @@ -323,6 +323,7 @@ #define __NR_execveat 322 #define __NR_userfaultfd 323 #define __NR_membarrier 324 +#define __NR_mlock2 325 @@ -653,3 +654,4 @@ #define SYS_execveat 322 #define SYS_userfaultfd 323 #define SYS_membarrier 324 +#define SYS_mlock2 325 From 789ff6a9f8ec91729cde7fdcb0568d5d928eeba5 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 24 Jan 2016 01:19:38 +0000 Subject: [PATCH 008/412] add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flags they lock faulted pages into memory (useful when a small part of a large mapped file needs efficient access), new in linux v4.4, commit b0f205c2a3082dd9081f9a94e50658c5fa906ff1 MLOCK_* is not in the POSIX reserved namespace for sys/mman.h --- arch/aarch64/bits/mman.h | 1 + arch/arm/bits/mman.h | 1 + arch/i386/bits/mman.h | 1 + arch/microblaze/bits/mman.h | 1 + arch/mips/bits/mman.h | 1 + arch/or1k/bits/mman.h | 1 + arch/powerpc/bits/mman.h | 1 + arch/sh/bits/mman.h | 1 + arch/x32/bits/mman.h | 1 + arch/x86_64/bits/mman.h | 1 + include/sys/mman.h | 1 + 11 files changed, 11 insertions(+) diff --git a/arch/aarch64/bits/mman.h b/arch/aarch64/bits/mman.h index ce5519f2..31ece5bf 100644 --- a/arch/aarch64/bits/mman.h +++ b/arch/aarch64/bits/mman.h @@ -36,6 +36,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/arm/bits/mman.h b/arch/arm/bits/mman.h index cc854aae..ea6f6a78 100644 --- a/arch/arm/bits/mman.h +++ b/arch/arm/bits/mman.h @@ -37,6 +37,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/i386/bits/mman.h b/arch/i386/bits/mman.h index 0f53acb7..0c9022fd 100644 --- a/arch/i386/bits/mman.h +++ b/arch/i386/bits/mman.h @@ -38,6 +38,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/microblaze/bits/mman.h b/arch/microblaze/bits/mman.h index cc854aae..ea6f6a78 100644 --- a/arch/microblaze/bits/mman.h +++ b/arch/microblaze/bits/mman.h @@ -37,6 +37,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/mips/bits/mman.h b/arch/mips/bits/mman.h index 3125fc2b..cb9ac539 100644 --- a/arch/mips/bits/mman.h +++ b/arch/mips/bits/mman.h @@ -37,6 +37,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/or1k/bits/mman.h b/arch/or1k/bits/mman.h index cc854aae..ea6f6a78 100644 --- a/arch/or1k/bits/mman.h +++ b/arch/or1k/bits/mman.h @@ -37,6 +37,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h index 779fddec..6581edc5 100644 --- a/arch/powerpc/bits/mman.h +++ b/arch/powerpc/bits/mman.h @@ -38,6 +38,7 @@ #define MCL_CURRENT 0x2000 #define MCL_FUTURE 0x4000 +#define MCL_ONFAULT 0x8000 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/sh/bits/mman.h b/arch/sh/bits/mman.h index f6fc98f0..3a25df1e 100644 --- a/arch/sh/bits/mman.h +++ b/arch/sh/bits/mman.h @@ -38,6 +38,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/x32/bits/mman.h b/arch/x32/bits/mman.h index 846b7eae..f3235f4e 100644 --- a/arch/x32/bits/mman.h +++ b/arch/x32/bits/mman.h @@ -38,6 +38,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/arch/x86_64/bits/mman.h b/arch/x86_64/bits/mman.h index 846b7eae..f3235f4e 100644 --- a/arch/x86_64/bits/mman.h +++ b/arch/x86_64/bits/mman.h @@ -38,6 +38,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 +#define MCL_ONFAULT 4 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 diff --git a/include/sys/mman.h b/include/sys/mman.h index 9fc2db51..a1864ec8 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -39,6 +39,7 @@ int remap_file_pages (void *, size_t, int, size_t, int); #endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MLOCK_ONFAULT 0x01 int madvise (void *, size_t, int); int mincore (void *, size_t, unsigned char *); #endif From c243d6f09570010a448789dd296b14b7a61cb2ea Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 24 Jan 2016 04:48:20 +0000 Subject: [PATCH 009/412] add new PTRACE_SECCOMP_GET_FILTER ptrace command allows the tracer to dump the bpf seccomp filters of the tracee, new in linux v4.4, commit f8e529ed941ba2bbcbf310b575d968159ce7e895 --- include/sys/ptrace.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/ptrace.h b/include/sys/ptrace.h index bc385f8c..d9d45408 100644 --- a/include/sys/ptrace.h +++ b/include/sys/ptrace.h @@ -39,6 +39,7 @@ extern "C" { #define PTRACE_PEEKSIGINFO 0x4209 #define PTRACE_GETSIGMASK 0x420a #define PTRACE_SETSIGMASK 0x420b +#define PTRACE_SECCOMP_GET_FILTER 0x420c #define PT_READ_I PTRACE_PEEKTEXT #define PT_READ_D PTRACE_PEEKDATA From 22f84829afa06bba9d220bd0f7b1bce912987297 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 27 Jan 2016 00:40:32 +0000 Subject: [PATCH 010/412] move bits/signal.h include close to the top of signal.h only have code above the bits/signal.h include that is necessary. (some types are used for the ucontext struct and mips has to override a few macro definitions) this way mips bits/signal.h will be able to affect siginfo_t. --- include/signal.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/signal.h b/include/signal.h index 559362f2..8df725d9 100644 --- a/include/signal.h +++ b/include/signal.h @@ -27,8 +27,6 @@ extern "C" { #include -#define SIG_HOLD ((void (*)(int)) 2) - #define SIG_BLOCK 0 #define SIG_UNBLOCK 1 #define SIG_SETMASK 2 @@ -43,6 +41,18 @@ extern "C" { #define SI_USER 0 #define SI_KERNEL 128 +typedef struct sigaltstack stack_t; + +#endif + +#include + +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ + || defined(_BSD_SOURCE) + +#define SIG_HOLD ((void (*)(int)) 2) + #define FPE_INTDIV 1 #define FPE_INTOVF 2 #define FPE_FLTDIV 3 @@ -78,8 +88,6 @@ extern "C" { #define CLD_STOPPED 5 #define CLD_CONTINUED 6 -typedef struct sigaltstack stack_t; - union sigval { int sival_int; void *sival_ptr; @@ -240,8 +248,6 @@ int sigandset(sigset_t *, const sigset_t *, const sigset_t *); #define SA_ONESHOT SA_RESETHAND #endif -#include - #define SIG_ERR ((void (*)(int))-1) #define SIG_DFL ((void (*)(int)) 0) #define SIG_IGN ((void (*)(int)) 1) From 9a3b8f97a160ce292dcf0ef2a9358fa0e11e9ee3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 27 Jan 2016 00:54:25 +0000 Subject: [PATCH 011/412] fix siginfo_t for mips si_errno and si_code are swapped in mips siginfo_t compared to other archs and some si_code values are different. This fix is required for POSIX timers to work. based on patch by Dmitry Ivanov. --- arch/mips/bits/signal.h | 9 +++++++++ include/signal.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/arch/mips/bits/signal.h b/arch/mips/bits/signal.h index 818e0a7b..889f77e8 100644 --- a/arch/mips/bits/signal.h +++ b/arch/mips/bits/signal.h @@ -73,6 +73,15 @@ typedef struct __ucontext { #define SIG_UNBLOCK 2 #define SIG_SETMASK 3 +#undef SI_ASYNCIO +#undef SI_MESGQ +#undef SI_TIMER +#define SI_ASYNCIO (-2) +#define SI_MESGQ (-4) +#define SI_TIMER (-3) + +#define __SI_SWAP_ERRNO_CODE + #endif #define SIGHUP 1 diff --git a/include/signal.h b/include/signal.h index 8df725d9..c6323c61 100644 --- a/include/signal.h +++ b/include/signal.h @@ -94,7 +94,11 @@ union sigval { }; typedef struct { +#ifdef __SI_SWAP_ERRNO_CODE + int si_signo, si_code, si_errno; +#else int si_signo, si_errno, si_code; +#endif union { char __pad[128 - 2*sizeof(int) - sizeof(long)]; struct { From a5ba2d7507eb6b4388c47f7893e025185496ff90 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 27 Jan 2016 12:23:47 -0500 Subject: [PATCH 012/412] improve clock_gettime and adapt it to support slightly-broken vdso these changes are motivated by a functionally similar patch by Hauke Mehrtens to address the needs of the new mips vdso clock_gettime, which wrongly fails with ENOSYS rather than falling back to making a syscall for clock ids it cannot handle from userspace. in the process of preparing to handle that case, it was noticed that the old clock_gettime use of the vdso was actually wrong with respect to error handling -- the tail call to the vdso function failed to set errno and instead returned an error code. since tail calls to vdso are no longer possible and since the plain syscall code is now needed as a fallback path anyway, it does not make sense to use a function pointer to call the plain syscall code path. instead, it's inlined at the end of the main clock_gettime function. the new code also avoids the need to test for initialization of the vdso function pointer by statically initializing it to a self-init function, and eliminates redundant loads from the volatile pointer object. finally, the use of a_cas_p on an object of type other than void *, which is not permitted aliasing, is replaced by using an object with the correct type and casting the value. --- src/time/clock_gettime.c | 61 +++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/src/time/clock_gettime.c b/src/time/clock_gettime.c index 1572de0e..24128804 100644 --- a/src/time/clock_gettime.c +++ b/src/time/clock_gettime.c @@ -5,10 +5,45 @@ #include "libc.h" #include "atomic.h" -static int sc_clock_gettime(clockid_t clk, struct timespec *ts) +#ifdef VDSO_CGT_SYM + +void *__vdsosym(const char *, const char *); + +static void *volatile vdso_func; + +static int cgt_init(clockid_t clk, struct timespec *ts) { - int r = __syscall(SYS_clock_gettime, clk, ts); - if (!r) return r; + void *p = __vdsosym(VDSO_CGT_VER, VDSO_CGT_SYM); + int (*f)(clockid_t, struct timespec *) = + (int (*)(clockid_t, struct timespec *))p; + a_cas_p(&vdso_func, (void *)cgt_init, p); + return f ? f(clk, ts) : -ENOSYS; +} + +static void *volatile vdso_func = (void *)cgt_init; + +#endif + +int __clock_gettime(clockid_t clk, struct timespec *ts) +{ + int r; + +#ifdef VDSO_CGT_SYM + int (*f)(clockid_t, struct timespec *) = + (int (*)(clockid_t, struct timespec *))vdso_func; + if (f) { + r = f(clk, ts); + if (!r) return r; + if (r == -EINVAL) return __syscall_ret(r); + /* Fall through on errors other than EINVAL. Some buggy + * vdso implementations return ENOSYS for clocks they + * can't handle, rather than making the syscall. This + * also handles the case where cgt_init fails to find + * a vdso function to use. */ + } +#endif + + r = __syscall(SYS_clock_gettime, clk, ts); if (r == -ENOSYS) { if (clk == CLOCK_REALTIME) { __syscall(SYS_gettimeofday, ts, 0); @@ -17,25 +52,7 @@ static int sc_clock_gettime(clockid_t clk, struct timespec *ts) } r = -EINVAL; } - errno = -r; - return -1; -} - -void *__vdsosym(const char *, const char *); - -int __clock_gettime(clockid_t clk, struct timespec *ts) -{ -#ifdef VDSO_CGT_SYM - static int (*volatile cgt)(clockid_t, struct timespec *); - if (!cgt) { - void *f = __vdsosym(VDSO_CGT_VER, VDSO_CGT_SYM); - if (!f) f = (void *)sc_clock_gettime; - a_cas_p(&cgt, 0, f); - } - return cgt(clk, ts); -#else - return sc_clock_gettime(clk, ts); -#endif + return __syscall_ret(r); } weak_alias(__clock_gettime, clock_gettime); From b0bf52f3e9fd246762958821fdc2851add05d423 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 26 Jan 2016 21:26:34 +0100 Subject: [PATCH 013/412] mips: add vdso support vdso support is available on mips starting with kernel 4.4, see kernel commit a7f4df4e21 "MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()" for details. In Linux kernel 4.4.0 the mips code returns -ENOSYS in case it can not handle the vdso call and assumes the libc will call the original syscall in this case. Handle this case in musl. Currently Linux kernel 4.4.0 handles the following types: CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME and CLOCK_MONOTONIC. --- arch/mips/syscall_arch.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h index e74e0ad0..39c0ea32 100644 --- a/arch/mips/syscall_arch.h +++ b/arch/mips/syscall_arch.h @@ -161,3 +161,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo if (n == SYS_fstatat) __stat_fix(c); return r2; } + +#define VDSO_USEFUL +#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT_VER "LINUX_2.6" From e1d99894b6ce23055a2e29f72763e7fd9585a87f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 27 Jan 2016 19:01:21 -0500 Subject: [PATCH 014/412] remove unneeded -I options from configure test for may_alias attribute this test does not include anything, so the -I options are not useful and are just a maintenance burden if paths change. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 2d7ea30e..41ef9df7 100755 --- a/configure +++ b/configure @@ -338,7 +338,7 @@ __attribute__((__may_alias__)) #endif x; EOF -if $CC $CFLAGS_C99FSE -I$srcdir/arch/$ARCH -I$srcdir/include $CPPFLAGS $CFLAGS \ +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \ -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "no\n" else From efdf04cf877574b4e3905802e0039f844077f58f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 27 Jan 2016 19:31:15 -0500 Subject: [PATCH 015/412] add arch/generic include fallback to build rules this sets the stage for the first phase of the bits deduplication. bits headers which are identical for "most" archs will be moved to arch/generic/bits. --- Makefile | 8 ++++++-- configure | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index de30a607..7c3dda4b 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ CFLAGS_AUTO = -Os -pipe CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc CFLAGS_ALL = $(CFLAGS_C99FSE) -CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -Iobj/src/internal -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include +CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) @@ -50,8 +50,9 @@ RANLIB = $(CROSS_COMPILE)ranlib INSTALL = $(srcdir)/tools/install.sh ARCH_INCLUDES = $(wildcard $(srcdir)/arch/$(ARCH)/bits/*.h) +GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h) INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h) -ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%)) +ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%)) EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a) @@ -202,6 +203,9 @@ $(DESTDIR)$(libdir)/%: lib/% $(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/$(ARCH)/bits/% $(INSTALL) -D -m 644 $< $@ +$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/generic/bits/% + $(INSTALL) -D -m 644 $< $@ + $(DESTDIR)$(includedir)/bits/%: obj/include/bits/% $(INSTALL) -D -m 644 $< $@ diff --git a/configure b/configure index 41ef9df7..a296f8ab 100755 --- a/configure +++ b/configure @@ -651,8 +651,9 @@ echo '#include ' > "$tmpc" echo '#if LDBL_MANT_DIG == 53' >> "$tmpc" echo 'typedef char ldcheck[9-(int)sizeof(long double)];' >> "$tmpc" echo '#endif' >> "$tmpc" -if $CC $CFLAGS_C99FSE -I$srcdir/arch/$ARCH -I$srcdir/include $CPPFLAGS $CFLAGS \ - -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +if $CC $CFLAGS_C99FSE \ + -I$srcdir/arch/$ARCH -I$srcdir/arch/generic -I$srcdir/include \ + $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "yes\n" else printf "no\n" From 4dfac11538cb20c848c30d754863800061ee8c81 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 27 Jan 2016 21:40:47 -0500 Subject: [PATCH 016/412] deduplicate the bulk of the arch bits headers all bits headers that were identical for a number of 'clean' archs are moved to the new arch/generic tree. in addition, a few headers that differed only cosmetically from the new generic version are removed. additional deduplication may be possible in mman.h and in several headers (limits.h, posix.h, stdint.h) that mostly depend on whether the arch is 32- or 64-bit, but they are left alone for now because greater gains are likely possible with more invasive changes to header logic, which is beyond the scope of this commit. --- arch/arm/bits/errno.h | 134 --------------- arch/arm/bits/io.h | 0 arch/arm/bits/poll.h | 0 arch/arm/bits/resource.h | 0 arch/arm/bits/statfs.h | 7 - arch/arm/bits/stdarg.h | 4 - arch/arm/bits/termios.h | 160 ------------------ arch/{aarch64 => generic}/bits/errno.h | 0 arch/{i386 => generic}/bits/fcntl.h | 0 arch/{microblaze => generic}/bits/fenv.h | 0 arch/{aarch64 => generic}/bits/io.h | 0 arch/{arm => generic}/bits/ioctl.h | 0 arch/{arm => generic}/bits/ipc.h | 0 arch/{arm => generic}/bits/msg.h | 0 arch/{aarch64 => generic}/bits/poll.h | 0 arch/{aarch64 => generic}/bits/resource.h | 0 arch/{arm => generic}/bits/sem.h | 0 arch/{arm => generic}/bits/shm.h | 0 arch/{arm => generic}/bits/socket.h | 0 arch/{aarch64 => generic}/bits/statfs.h | 0 arch/{aarch64 => generic}/bits/stdarg.h | 0 arch/{aarch64 => generic}/bits/termios.h | 0 arch/i386/bits/errno.h | 134 --------------- arch/i386/bits/ioctl.h | 197 ---------------------- arch/i386/bits/ipc.h | 14 -- arch/i386/bits/msg.h | 16 -- arch/i386/bits/poll.h | 0 arch/i386/bits/resource.h | 0 arch/i386/bits/sem.h | 16 -- arch/i386/bits/shm.h | 29 ---- arch/i386/bits/socket.h | 17 -- arch/i386/bits/statfs.h | 7 - arch/i386/bits/termios.h | 160 ------------------ arch/microblaze/bits/errno.h | 134 --------------- arch/microblaze/bits/fcntl.h | 40 ----- arch/microblaze/bits/io.h | 0 arch/microblaze/bits/ioctl.h | 197 ---------------------- arch/microblaze/bits/ipc.h | 14 -- arch/microblaze/bits/msg.h | 16 -- arch/microblaze/bits/poll.h | 0 arch/microblaze/bits/resource.h | 0 arch/microblaze/bits/sem.h | 16 -- arch/microblaze/bits/shm.h | 29 ---- arch/microblaze/bits/socket.h | 17 -- arch/microblaze/bits/statfs.h | 7 - arch/microblaze/bits/stdarg.h | 4 - arch/microblaze/bits/termios.h | 160 ------------------ arch/mips/bits/io.h | 0 arch/mips/bits/ipc.h | 14 -- arch/mips/bits/stdarg.h | 4 - arch/or1k/bits/errno.h | 134 --------------- arch/or1k/bits/fcntl.h | 40 ----- arch/or1k/bits/fenv.h | 10 -- arch/or1k/bits/io.h | 0 arch/or1k/bits/ioctl.h | 197 ---------------------- arch/or1k/bits/poll.h | 0 arch/or1k/bits/resource.h | 0 arch/or1k/bits/shm.h | 27 --- arch/or1k/bits/socket.h | 15 -- arch/or1k/bits/statfs.h | 7 - arch/or1k/bits/stdarg.h | 4 - arch/or1k/bits/termios.h | 159 ----------------- arch/powerpc/bits/io.h | 0 arch/powerpc/bits/poll.h | 0 arch/powerpc/bits/resource.h | 0 arch/powerpc/bits/statfs.h | 7 - arch/powerpc/bits/stdarg.h | 4 - arch/sh/bits/errno.h | 134 --------------- arch/sh/bits/fcntl.h | 40 ----- arch/sh/bits/io.h | 0 arch/sh/bits/ipc.h | 14 -- arch/sh/bits/msg.h | 16 -- arch/sh/bits/poll.h | 0 arch/sh/bits/resource.h | 0 arch/sh/bits/sem.h | 16 -- arch/sh/bits/socket.h | 17 -- arch/sh/bits/statfs.h | 7 - arch/sh/bits/stdarg.h | 4 - arch/sh/bits/termios.h | 160 ------------------ arch/x32/bits/errno.h | 134 --------------- arch/x32/bits/poll.h | 0 arch/x32/bits/resource.h | 0 arch/x32/bits/sem.h | 16 -- arch/x32/bits/stdarg.h | 4 - arch/x32/bits/termios.h | 160 ------------------ arch/x86_64/bits/errno.h | 134 --------------- arch/x86_64/bits/poll.h | 0 arch/x86_64/bits/resource.h | 0 arch/x86_64/bits/sem.h | 16 -- arch/x86_64/bits/statfs.h | 7 - arch/x86_64/bits/stdarg.h | 4 - arch/x86_64/bits/termios.h | 160 ------------------ 92 files changed, 3194 deletions(-) delete mode 100644 arch/arm/bits/errno.h delete mode 100644 arch/arm/bits/io.h delete mode 100644 arch/arm/bits/poll.h delete mode 100644 arch/arm/bits/resource.h delete mode 100644 arch/arm/bits/statfs.h delete mode 100644 arch/arm/bits/stdarg.h delete mode 100644 arch/arm/bits/termios.h rename arch/{aarch64 => generic}/bits/errno.h (100%) rename arch/{i386 => generic}/bits/fcntl.h (100%) rename arch/{microblaze => generic}/bits/fenv.h (100%) rename arch/{aarch64 => generic}/bits/io.h (100%) rename arch/{arm => generic}/bits/ioctl.h (100%) rename arch/{arm => generic}/bits/ipc.h (100%) rename arch/{arm => generic}/bits/msg.h (100%) rename arch/{aarch64 => generic}/bits/poll.h (100%) rename arch/{aarch64 => generic}/bits/resource.h (100%) rename arch/{arm => generic}/bits/sem.h (100%) rename arch/{arm => generic}/bits/shm.h (100%) rename arch/{arm => generic}/bits/socket.h (100%) rename arch/{aarch64 => generic}/bits/statfs.h (100%) rename arch/{aarch64 => generic}/bits/stdarg.h (100%) rename arch/{aarch64 => generic}/bits/termios.h (100%) delete mode 100644 arch/i386/bits/errno.h delete mode 100644 arch/i386/bits/ioctl.h delete mode 100644 arch/i386/bits/ipc.h delete mode 100644 arch/i386/bits/msg.h delete mode 100644 arch/i386/bits/poll.h delete mode 100644 arch/i386/bits/resource.h delete mode 100644 arch/i386/bits/sem.h delete mode 100644 arch/i386/bits/shm.h delete mode 100644 arch/i386/bits/socket.h delete mode 100644 arch/i386/bits/statfs.h delete mode 100644 arch/i386/bits/termios.h delete mode 100644 arch/microblaze/bits/errno.h delete mode 100644 arch/microblaze/bits/fcntl.h delete mode 100644 arch/microblaze/bits/io.h delete mode 100644 arch/microblaze/bits/ioctl.h delete mode 100644 arch/microblaze/bits/ipc.h delete mode 100644 arch/microblaze/bits/msg.h delete mode 100644 arch/microblaze/bits/poll.h delete mode 100644 arch/microblaze/bits/resource.h delete mode 100644 arch/microblaze/bits/sem.h delete mode 100644 arch/microblaze/bits/shm.h delete mode 100644 arch/microblaze/bits/socket.h delete mode 100644 arch/microblaze/bits/statfs.h delete mode 100644 arch/microblaze/bits/stdarg.h delete mode 100644 arch/microblaze/bits/termios.h delete mode 100644 arch/mips/bits/io.h delete mode 100644 arch/mips/bits/ipc.h delete mode 100644 arch/mips/bits/stdarg.h delete mode 100644 arch/or1k/bits/errno.h delete mode 100644 arch/or1k/bits/fcntl.h delete mode 100644 arch/or1k/bits/fenv.h delete mode 100644 arch/or1k/bits/io.h delete mode 100644 arch/or1k/bits/ioctl.h delete mode 100644 arch/or1k/bits/poll.h delete mode 100644 arch/or1k/bits/resource.h delete mode 100644 arch/or1k/bits/shm.h delete mode 100644 arch/or1k/bits/socket.h delete mode 100644 arch/or1k/bits/statfs.h delete mode 100644 arch/or1k/bits/stdarg.h delete mode 100644 arch/or1k/bits/termios.h delete mode 100644 arch/powerpc/bits/io.h delete mode 100644 arch/powerpc/bits/poll.h delete mode 100644 arch/powerpc/bits/resource.h delete mode 100644 arch/powerpc/bits/statfs.h delete mode 100644 arch/powerpc/bits/stdarg.h delete mode 100644 arch/sh/bits/errno.h delete mode 100644 arch/sh/bits/fcntl.h delete mode 100644 arch/sh/bits/io.h delete mode 100644 arch/sh/bits/ipc.h delete mode 100644 arch/sh/bits/msg.h delete mode 100644 arch/sh/bits/poll.h delete mode 100644 arch/sh/bits/resource.h delete mode 100644 arch/sh/bits/sem.h delete mode 100644 arch/sh/bits/socket.h delete mode 100644 arch/sh/bits/statfs.h delete mode 100644 arch/sh/bits/stdarg.h delete mode 100644 arch/sh/bits/termios.h delete mode 100644 arch/x32/bits/errno.h delete mode 100644 arch/x32/bits/poll.h delete mode 100644 arch/x32/bits/resource.h delete mode 100644 arch/x32/bits/sem.h delete mode 100644 arch/x32/bits/stdarg.h delete mode 100644 arch/x32/bits/termios.h delete mode 100644 arch/x86_64/bits/errno.h delete mode 100644 arch/x86_64/bits/poll.h delete mode 100644 arch/x86_64/bits/resource.h delete mode 100644 arch/x86_64/bits/sem.h delete mode 100644 arch/x86_64/bits/statfs.h delete mode 100644 arch/x86_64/bits/stdarg.h delete mode 100644 arch/x86_64/bits/termios.h diff --git a/arch/arm/bits/errno.h b/arch/arm/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/arm/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/arm/bits/io.h b/arch/arm/bits/io.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/arm/bits/poll.h b/arch/arm/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/arm/bits/resource.h b/arch/arm/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/arm/bits/statfs.h b/arch/arm/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/arm/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/arm/bits/stdarg.h b/arch/arm/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/arm/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/arm/bits/termios.h b/arch/arm/bits/termios.h deleted file mode 100644 index f0d81b13..00000000 --- a/arch/arm/bits/termios.h +++ /dev/null @@ -1,160 +0,0 @@ -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif diff --git a/arch/aarch64/bits/errno.h b/arch/generic/bits/errno.h similarity index 100% rename from arch/aarch64/bits/errno.h rename to arch/generic/bits/errno.h diff --git a/arch/i386/bits/fcntl.h b/arch/generic/bits/fcntl.h similarity index 100% rename from arch/i386/bits/fcntl.h rename to arch/generic/bits/fcntl.h diff --git a/arch/microblaze/bits/fenv.h b/arch/generic/bits/fenv.h similarity index 100% rename from arch/microblaze/bits/fenv.h rename to arch/generic/bits/fenv.h diff --git a/arch/aarch64/bits/io.h b/arch/generic/bits/io.h similarity index 100% rename from arch/aarch64/bits/io.h rename to arch/generic/bits/io.h diff --git a/arch/arm/bits/ioctl.h b/arch/generic/bits/ioctl.h similarity index 100% rename from arch/arm/bits/ioctl.h rename to arch/generic/bits/ioctl.h diff --git a/arch/arm/bits/ipc.h b/arch/generic/bits/ipc.h similarity index 100% rename from arch/arm/bits/ipc.h rename to arch/generic/bits/ipc.h diff --git a/arch/arm/bits/msg.h b/arch/generic/bits/msg.h similarity index 100% rename from arch/arm/bits/msg.h rename to arch/generic/bits/msg.h diff --git a/arch/aarch64/bits/poll.h b/arch/generic/bits/poll.h similarity index 100% rename from arch/aarch64/bits/poll.h rename to arch/generic/bits/poll.h diff --git a/arch/aarch64/bits/resource.h b/arch/generic/bits/resource.h similarity index 100% rename from arch/aarch64/bits/resource.h rename to arch/generic/bits/resource.h diff --git a/arch/arm/bits/sem.h b/arch/generic/bits/sem.h similarity index 100% rename from arch/arm/bits/sem.h rename to arch/generic/bits/sem.h diff --git a/arch/arm/bits/shm.h b/arch/generic/bits/shm.h similarity index 100% rename from arch/arm/bits/shm.h rename to arch/generic/bits/shm.h diff --git a/arch/arm/bits/socket.h b/arch/generic/bits/socket.h similarity index 100% rename from arch/arm/bits/socket.h rename to arch/generic/bits/socket.h diff --git a/arch/aarch64/bits/statfs.h b/arch/generic/bits/statfs.h similarity index 100% rename from arch/aarch64/bits/statfs.h rename to arch/generic/bits/statfs.h diff --git a/arch/aarch64/bits/stdarg.h b/arch/generic/bits/stdarg.h similarity index 100% rename from arch/aarch64/bits/stdarg.h rename to arch/generic/bits/stdarg.h diff --git a/arch/aarch64/bits/termios.h b/arch/generic/bits/termios.h similarity index 100% rename from arch/aarch64/bits/termios.h rename to arch/generic/bits/termios.h diff --git a/arch/i386/bits/errno.h b/arch/i386/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/i386/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/i386/bits/ioctl.h b/arch/i386/bits/ioctl.h deleted file mode 100644 index 9d75118e..00000000 --- a/arch/i386/bits/ioctl.h +++ /dev/null @@ -1,197 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGPTN 0x80045430 -#define TIOCSPTLCK 0x40045431 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F -#define FIOQSIZE 0x5460 - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/i386/bits/ipc.h b/arch/i386/bits/ipc.h deleted file mode 100644 index b748d3b7..00000000 --- a/arch/i386/bits/ipc.h +++ /dev/null @@ -1,14 +0,0 @@ -struct ipc_perm -{ - key_t __ipc_perm_key; - uid_t uid; - gid_t gid; - uid_t cuid; - gid_t cgid; - mode_t mode; - int __ipc_perm_seq; - long __pad1; - long __pad2; -}; - -#define IPC_64 0x100 diff --git a/arch/i386/bits/msg.h b/arch/i386/bits/msg.h deleted file mode 100644 index 3db8576b..00000000 --- a/arch/i386/bits/msg.h +++ /dev/null @@ -1,16 +0,0 @@ -struct msqid_ds -{ - struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; - unsigned long msg_cbytes; - msgqnum_t msg_qnum; - msglen_t msg_qbytes; - pid_t msg_lspid; - pid_t msg_lrpid; - unsigned long __unused[2]; -}; diff --git a/arch/i386/bits/poll.h b/arch/i386/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/i386/bits/resource.h b/arch/i386/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/i386/bits/sem.h b/arch/i386/bits/sem.h deleted file mode 100644 index c629b81e..00000000 --- a/arch/i386/bits/sem.h +++ /dev/null @@ -1,16 +0,0 @@ -struct semid_ds { - struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned short sem_nsems; - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; -#else - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; - unsigned short sem_nsems; -#endif - time_t __unused3; - time_t __unused4; -}; diff --git a/arch/i386/bits/shm.h b/arch/i386/bits/shm.h deleted file mode 100644 index 547581f1..00000000 --- a/arch/i386/bits/shm.h +++ /dev/null @@ -1,29 +0,0 @@ -#define SHMLBA 4096 - -struct shmid_ds -{ - struct ipc_perm shm_perm; - size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; - pid_t shm_cpid; - pid_t shm_lpid; - unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; -}; - -struct shminfo { - unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; -}; - -struct shm_info { - int __used_ids; - unsigned long shm_tot, shm_rss, shm_swp; - unsigned long __swap_attempts, __swap_successes; -}; - diff --git a/arch/i386/bits/socket.h b/arch/i386/bits/socket.h deleted file mode 100644 index 36febbc2..00000000 --- a/arch/i386/bits/socket.h +++ /dev/null @@ -1,17 +0,0 @@ -struct msghdr -{ - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr -{ - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/arch/i386/bits/statfs.h b/arch/i386/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/i386/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/i386/bits/termios.h b/arch/i386/bits/termios.h deleted file mode 100644 index f0d81b13..00000000 --- a/arch/i386/bits/termios.h +++ /dev/null @@ -1,160 +0,0 @@ -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif diff --git a/arch/microblaze/bits/errno.h b/arch/microblaze/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/microblaze/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/microblaze/bits/fcntl.h b/arch/microblaze/bits/fcntl.h deleted file mode 100644 index ae233cc0..00000000 --- a/arch/microblaze/bits/fcntl.h +++ /dev/null @@ -1,40 +0,0 @@ -#define O_CREAT 0100 -#define O_EXCL 0200 -#define O_NOCTTY 0400 -#define O_TRUNC 01000 -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_DSYNC 010000 -#define O_SYNC 04010000 -#define O_RSYNC 04010000 -#define O_DIRECTORY 0200000 -#define O_NOFOLLOW 0400000 -#define O_CLOEXEC 02000000 - -#define O_ASYNC 020000 -#define O_DIRECT 040000 -#define O_LARGEFILE 0100000 -#define O_NOATIME 01000000 -#define O_PATH 010000000 -#define O_TMPFILE 020200000 -#define O_NDELAY O_NONBLOCK - -#define F_DUPFD 0 -#define F_GETFD 1 -#define F_SETFD 2 -#define F_GETFL 3 -#define F_SETFL 4 - -#define F_SETOWN 8 -#define F_GETOWN 9 -#define F_SETSIG 10 -#define F_GETSIG 11 - -#define F_GETLK 12 -#define F_SETLK 13 -#define F_SETLKW 14 - -#define F_SETOWN_EX 15 -#define F_GETOWN_EX 16 - -#define F_GETOWNER_UIDS 17 diff --git a/arch/microblaze/bits/io.h b/arch/microblaze/bits/io.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/microblaze/bits/ioctl.h b/arch/microblaze/bits/ioctl.h deleted file mode 100644 index 9d75118e..00000000 --- a/arch/microblaze/bits/ioctl.h +++ /dev/null @@ -1,197 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGPTN 0x80045430 -#define TIOCSPTLCK 0x40045431 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F -#define FIOQSIZE 0x5460 - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/microblaze/bits/ipc.h b/arch/microblaze/bits/ipc.h deleted file mode 100644 index b748d3b7..00000000 --- a/arch/microblaze/bits/ipc.h +++ /dev/null @@ -1,14 +0,0 @@ -struct ipc_perm -{ - key_t __ipc_perm_key; - uid_t uid; - gid_t gid; - uid_t cuid; - gid_t cgid; - mode_t mode; - int __ipc_perm_seq; - long __pad1; - long __pad2; -}; - -#define IPC_64 0x100 diff --git a/arch/microblaze/bits/msg.h b/arch/microblaze/bits/msg.h deleted file mode 100644 index 3db8576b..00000000 --- a/arch/microblaze/bits/msg.h +++ /dev/null @@ -1,16 +0,0 @@ -struct msqid_ds -{ - struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; - unsigned long msg_cbytes; - msgqnum_t msg_qnum; - msglen_t msg_qbytes; - pid_t msg_lspid; - pid_t msg_lrpid; - unsigned long __unused[2]; -}; diff --git a/arch/microblaze/bits/poll.h b/arch/microblaze/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/microblaze/bits/resource.h b/arch/microblaze/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/microblaze/bits/sem.h b/arch/microblaze/bits/sem.h deleted file mode 100644 index c629b81e..00000000 --- a/arch/microblaze/bits/sem.h +++ /dev/null @@ -1,16 +0,0 @@ -struct semid_ds { - struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned short sem_nsems; - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; -#else - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; - unsigned short sem_nsems; -#endif - time_t __unused3; - time_t __unused4; -}; diff --git a/arch/microblaze/bits/shm.h b/arch/microblaze/bits/shm.h deleted file mode 100644 index 547581f1..00000000 --- a/arch/microblaze/bits/shm.h +++ /dev/null @@ -1,29 +0,0 @@ -#define SHMLBA 4096 - -struct shmid_ds -{ - struct ipc_perm shm_perm; - size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; - pid_t shm_cpid; - pid_t shm_lpid; - unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; -}; - -struct shminfo { - unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; -}; - -struct shm_info { - int __used_ids; - unsigned long shm_tot, shm_rss, shm_swp; - unsigned long __swap_attempts, __swap_successes; -}; - diff --git a/arch/microblaze/bits/socket.h b/arch/microblaze/bits/socket.h deleted file mode 100644 index 36febbc2..00000000 --- a/arch/microblaze/bits/socket.h +++ /dev/null @@ -1,17 +0,0 @@ -struct msghdr -{ - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr -{ - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/arch/microblaze/bits/statfs.h b/arch/microblaze/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/microblaze/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/microblaze/bits/stdarg.h b/arch/microblaze/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/microblaze/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/microblaze/bits/termios.h b/arch/microblaze/bits/termios.h deleted file mode 100644 index f0d81b13..00000000 --- a/arch/microblaze/bits/termios.h +++ /dev/null @@ -1,160 +0,0 @@ -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif diff --git a/arch/mips/bits/io.h b/arch/mips/bits/io.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/mips/bits/ipc.h b/arch/mips/bits/ipc.h deleted file mode 100644 index b748d3b7..00000000 --- a/arch/mips/bits/ipc.h +++ /dev/null @@ -1,14 +0,0 @@ -struct ipc_perm -{ - key_t __ipc_perm_key; - uid_t uid; - gid_t gid; - uid_t cuid; - gid_t cgid; - mode_t mode; - int __ipc_perm_seq; - long __pad1; - long __pad2; -}; - -#define IPC_64 0x100 diff --git a/arch/mips/bits/stdarg.h b/arch/mips/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/mips/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/or1k/bits/errno.h b/arch/or1k/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/or1k/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/or1k/bits/fcntl.h b/arch/or1k/bits/fcntl.h deleted file mode 100644 index ae233cc0..00000000 --- a/arch/or1k/bits/fcntl.h +++ /dev/null @@ -1,40 +0,0 @@ -#define O_CREAT 0100 -#define O_EXCL 0200 -#define O_NOCTTY 0400 -#define O_TRUNC 01000 -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_DSYNC 010000 -#define O_SYNC 04010000 -#define O_RSYNC 04010000 -#define O_DIRECTORY 0200000 -#define O_NOFOLLOW 0400000 -#define O_CLOEXEC 02000000 - -#define O_ASYNC 020000 -#define O_DIRECT 040000 -#define O_LARGEFILE 0100000 -#define O_NOATIME 01000000 -#define O_PATH 010000000 -#define O_TMPFILE 020200000 -#define O_NDELAY O_NONBLOCK - -#define F_DUPFD 0 -#define F_GETFD 1 -#define F_SETFD 2 -#define F_GETFL 3 -#define F_SETFL 4 - -#define F_SETOWN 8 -#define F_GETOWN 9 -#define F_SETSIG 10 -#define F_GETSIG 11 - -#define F_GETLK 12 -#define F_SETLK 13 -#define F_SETLKW 14 - -#define F_SETOWN_EX 15 -#define F_GETOWN_EX 16 - -#define F_GETOWNER_UIDS 17 diff --git a/arch/or1k/bits/fenv.h b/arch/or1k/bits/fenv.h deleted file mode 100644 index edbdea2a..00000000 --- a/arch/or1k/bits/fenv.h +++ /dev/null @@ -1,10 +0,0 @@ -#define FE_ALL_EXCEPT 0 -#define FE_TONEAREST 0 - -typedef unsigned long fexcept_t; - -typedef struct { - unsigned long __cw; -} fenv_t; - -#define FE_DFL_ENV ((const fenv_t *) -1) diff --git a/arch/or1k/bits/io.h b/arch/or1k/bits/io.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/or1k/bits/ioctl.h b/arch/or1k/bits/ioctl.h deleted file mode 100644 index 9d75118e..00000000 --- a/arch/or1k/bits/ioctl.h +++ /dev/null @@ -1,197 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGPTN 0x80045430 -#define TIOCSPTLCK 0x40045431 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F -#define FIOQSIZE 0x5460 - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/or1k/bits/poll.h b/arch/or1k/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/or1k/bits/resource.h b/arch/or1k/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/or1k/bits/shm.h b/arch/or1k/bits/shm.h deleted file mode 100644 index 81b2a29a..00000000 --- a/arch/or1k/bits/shm.h +++ /dev/null @@ -1,27 +0,0 @@ -#define SHMLBA 4096 - -struct shmid_ds { - struct ipc_perm shm_perm; - size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; - pid_t shm_cpid; - pid_t shm_lpid; - unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; -}; - -struct shminfo { - unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; -}; - -struct shm_info { - int __used_ids; - unsigned long shm_tot, shm_rss, shm_swp; - unsigned long __swap_attempts, __swap_successes; -}; diff --git a/arch/or1k/bits/socket.h b/arch/or1k/bits/socket.h deleted file mode 100644 index 1f73b995..00000000 --- a/arch/or1k/bits/socket.h +++ /dev/null @@ -1,15 +0,0 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/arch/or1k/bits/statfs.h b/arch/or1k/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/or1k/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/or1k/bits/stdarg.h b/arch/or1k/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/or1k/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/or1k/bits/termios.h b/arch/or1k/bits/termios.h deleted file mode 100644 index da266449..00000000 --- a/arch/or1k/bits/termios.h +++ /dev/null @@ -1,159 +0,0 @@ -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif diff --git a/arch/powerpc/bits/io.h b/arch/powerpc/bits/io.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/powerpc/bits/poll.h b/arch/powerpc/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/powerpc/bits/resource.h b/arch/powerpc/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/powerpc/bits/statfs.h b/arch/powerpc/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/powerpc/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/powerpc/bits/stdarg.h b/arch/powerpc/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/powerpc/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/sh/bits/errno.h b/arch/sh/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/sh/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/sh/bits/fcntl.h b/arch/sh/bits/fcntl.h deleted file mode 100644 index ae233cc0..00000000 --- a/arch/sh/bits/fcntl.h +++ /dev/null @@ -1,40 +0,0 @@ -#define O_CREAT 0100 -#define O_EXCL 0200 -#define O_NOCTTY 0400 -#define O_TRUNC 01000 -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_DSYNC 010000 -#define O_SYNC 04010000 -#define O_RSYNC 04010000 -#define O_DIRECTORY 0200000 -#define O_NOFOLLOW 0400000 -#define O_CLOEXEC 02000000 - -#define O_ASYNC 020000 -#define O_DIRECT 040000 -#define O_LARGEFILE 0100000 -#define O_NOATIME 01000000 -#define O_PATH 010000000 -#define O_TMPFILE 020200000 -#define O_NDELAY O_NONBLOCK - -#define F_DUPFD 0 -#define F_GETFD 1 -#define F_SETFD 2 -#define F_GETFL 3 -#define F_SETFL 4 - -#define F_SETOWN 8 -#define F_GETOWN 9 -#define F_SETSIG 10 -#define F_GETSIG 11 - -#define F_GETLK 12 -#define F_SETLK 13 -#define F_SETLKW 14 - -#define F_SETOWN_EX 15 -#define F_GETOWN_EX 16 - -#define F_GETOWNER_UIDS 17 diff --git a/arch/sh/bits/io.h b/arch/sh/bits/io.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/sh/bits/ipc.h b/arch/sh/bits/ipc.h deleted file mode 100644 index b748d3b7..00000000 --- a/arch/sh/bits/ipc.h +++ /dev/null @@ -1,14 +0,0 @@ -struct ipc_perm -{ - key_t __ipc_perm_key; - uid_t uid; - gid_t gid; - uid_t cuid; - gid_t cgid; - mode_t mode; - int __ipc_perm_seq; - long __pad1; - long __pad2; -}; - -#define IPC_64 0x100 diff --git a/arch/sh/bits/msg.h b/arch/sh/bits/msg.h deleted file mode 100644 index 3db8576b..00000000 --- a/arch/sh/bits/msg.h +++ /dev/null @@ -1,16 +0,0 @@ -struct msqid_ds -{ - struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; - unsigned long msg_cbytes; - msgqnum_t msg_qnum; - msglen_t msg_qbytes; - pid_t msg_lspid; - pid_t msg_lrpid; - unsigned long __unused[2]; -}; diff --git a/arch/sh/bits/poll.h b/arch/sh/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/sh/bits/resource.h b/arch/sh/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/sh/bits/sem.h b/arch/sh/bits/sem.h deleted file mode 100644 index c629b81e..00000000 --- a/arch/sh/bits/sem.h +++ /dev/null @@ -1,16 +0,0 @@ -struct semid_ds { - struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned short sem_nsems; - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; -#else - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; - unsigned short sem_nsems; -#endif - time_t __unused3; - time_t __unused4; -}; diff --git a/arch/sh/bits/socket.h b/arch/sh/bits/socket.h deleted file mode 100644 index 36febbc2..00000000 --- a/arch/sh/bits/socket.h +++ /dev/null @@ -1,17 +0,0 @@ -struct msghdr -{ - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr -{ - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/arch/sh/bits/statfs.h b/arch/sh/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/sh/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/sh/bits/stdarg.h b/arch/sh/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/sh/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/sh/bits/termios.h b/arch/sh/bits/termios.h deleted file mode 100644 index f0d81b13..00000000 --- a/arch/sh/bits/termios.h +++ /dev/null @@ -1,160 +0,0 @@ -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif diff --git a/arch/x32/bits/errno.h b/arch/x32/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/x32/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/x32/bits/poll.h b/arch/x32/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/x32/bits/resource.h b/arch/x32/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/x32/bits/sem.h b/arch/x32/bits/sem.h deleted file mode 100644 index c629b81e..00000000 --- a/arch/x32/bits/sem.h +++ /dev/null @@ -1,16 +0,0 @@ -struct semid_ds { - struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned short sem_nsems; - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; -#else - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; - unsigned short sem_nsems; -#endif - time_t __unused3; - time_t __unused4; -}; diff --git a/arch/x32/bits/stdarg.h b/arch/x32/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/x32/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/x32/bits/termios.h b/arch/x32/bits/termios.h deleted file mode 100644 index f0d81b13..00000000 --- a/arch/x32/bits/termios.h +++ /dev/null @@ -1,160 +0,0 @@ -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif diff --git a/arch/x86_64/bits/errno.h b/arch/x86_64/bits/errno.h deleted file mode 100644 index d2e1eeee..00000000 --- a/arch/x86_64/bits/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 -#define ELOOP 40 -#define EWOULDBLOCK EAGAIN -#define ENOMSG 42 -#define EIDRM 43 -#define ECHRNG 44 -#define EL2NSYNC 45 -#define EL3HLT 46 -#define EL3RST 47 -#define ELNRNG 48 -#define EUNATCH 49 -#define ENOCSI 50 -#define EL2HLT 51 -#define EBADE 52 -#define EBADR 53 -#define EXFULL 54 -#define ENOANO 55 -#define EBADRQC 56 -#define EBADSLT 57 -#define EDEADLOCK EDEADLK -#define EBFONT 59 -#define ENOSTR 60 -#define ENODATA 61 -#define ETIME 62 -#define ENOSR 63 -#define ENONET 64 -#define ENOPKG 65 -#define EREMOTE 66 -#define ENOLINK 67 -#define EADV 68 -#define ESRMNT 69 -#define ECOMM 70 -#define EPROTO 71 -#define EMULTIHOP 72 -#define EDOTDOT 73 -#define EBADMSG 74 -#define EOVERFLOW 75 -#define ENOTUNIQ 76 -#define EBADFD 77 -#define EREMCHG 78 -#define ELIBACC 79 -#define ELIBBAD 80 -#define ELIBSCN 81 -#define ELIBMAX 82 -#define ELIBEXEC 83 -#define EILSEQ 84 -#define ERESTART 85 -#define ESTRPIPE 86 -#define EUSERS 87 -#define ENOTSOCK 88 -#define EDESTADDRREQ 89 -#define EMSGSIZE 90 -#define EPROTOTYPE 91 -#define ENOPROTOOPT 92 -#define EPROTONOSUPPORT 93 -#define ESOCKTNOSUPPORT 94 -#define EOPNOTSUPP 95 -#define ENOTSUP EOPNOTSUPP -#define EPFNOSUPPORT 96 -#define EAFNOSUPPORT 97 -#define EADDRINUSE 98 -#define EADDRNOTAVAIL 99 -#define ENETDOWN 100 -#define ENETUNREACH 101 -#define ENETRESET 102 -#define ECONNABORTED 103 -#define ECONNRESET 104 -#define ENOBUFS 105 -#define EISCONN 106 -#define ENOTCONN 107 -#define ESHUTDOWN 108 -#define ETOOMANYREFS 109 -#define ETIMEDOUT 110 -#define ECONNREFUSED 111 -#define EHOSTDOWN 112 -#define EHOSTUNREACH 113 -#define EALREADY 114 -#define EINPROGRESS 115 -#define ESTALE 116 -#define EUCLEAN 117 -#define ENOTNAM 118 -#define ENAVAIL 119 -#define EISNAM 120 -#define EREMOTEIO 121 -#define EDQUOT 122 -#define ENOMEDIUM 123 -#define EMEDIUMTYPE 124 -#define ECANCELED 125 -#define ENOKEY 126 -#define EKEYEXPIRED 127 -#define EKEYREVOKED 128 -#define EKEYREJECTED 129 -#define EOWNERDEAD 130 -#define ENOTRECOVERABLE 131 -#define ERFKILL 132 -#define EHWPOISON 133 diff --git a/arch/x86_64/bits/poll.h b/arch/x86_64/bits/poll.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/x86_64/bits/resource.h b/arch/x86_64/bits/resource.h deleted file mode 100644 index e69de29b..00000000 diff --git a/arch/x86_64/bits/sem.h b/arch/x86_64/bits/sem.h deleted file mode 100644 index c629b81e..00000000 --- a/arch/x86_64/bits/sem.h +++ /dev/null @@ -1,16 +0,0 @@ -struct semid_ds { - struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned short sem_nsems; - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; -#else - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; - unsigned short sem_nsems; -#endif - time_t __unused3; - time_t __unused4; -}; diff --git a/arch/x86_64/bits/statfs.h b/arch/x86_64/bits/statfs.h deleted file mode 100644 index f103f4e4..00000000 --- a/arch/x86_64/bits/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -struct statfs { - unsigned long f_type, f_bsize; - fsblkcnt_t f_blocks, f_bfree, f_bavail; - fsfilcnt_t f_files, f_ffree; - fsid_t f_fsid; - unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; -}; diff --git a/arch/x86_64/bits/stdarg.h b/arch/x86_64/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/x86_64/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/x86_64/bits/termios.h b/arch/x86_64/bits/termios.h deleted file mode 100644 index f0d81b13..00000000 --- a/arch/x86_64/bits/termios.h +++ /dev/null @@ -1,160 +0,0 @@ -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[NCCS]; - speed_t __c_ispeed; - speed_t __c_ospeed; -}; - -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#define B0 0000000 -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 - -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 - -#define CBAUD 0010017 - -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 - -#define ISIG 0000001 -#define ICANON 0000002 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define IEXTEN 0100000 - -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define CBAUDEX 0010000 -#define CRTSCTS 020000000000 -#define EXTPROC 0200000 -#define XTABS 0014000 -#endif From 378f8cb5222b63e4f8532c757ce54e4074567e1f Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Fri, 22 Jan 2016 15:17:15 -0500 Subject: [PATCH 017/412] legacy/utmpx: Add utmp{,x}name stubs --- src/legacy/utmpx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/legacy/utmpx.c b/src/legacy/utmpx.c index c483e4ed..46ca4b8b 100644 --- a/src/legacy/utmpx.c +++ b/src/legacy/utmpx.c @@ -34,6 +34,11 @@ void updwtmpx(const char *f, const struct utmpx *u) { } +int __utmpxname(const char *f) +{ + return -1; +} + weak_alias(endutxent, endutent); weak_alias(setutxent, setutent); weak_alias(getutxent, getutent); @@ -41,3 +46,5 @@ weak_alias(getutxid, getutid); weak_alias(getutxline, getutline); weak_alias(pututxline, pututline); weak_alias(updwtmpx, updwtmp); +weak_alias(__utmpxname, utmpname); +weak_alias(__utmpxname, utmpxname); From 19df86cbb39f2429f7c7e20c99c606c38a5fd4e9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 00:38:23 -0500 Subject: [PATCH 018/412] add errno setting to stub utmpxname function --- src/legacy/utmpx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/legacy/utmpx.c b/src/legacy/utmpx.c index 46ca4b8b..e2843c94 100644 --- a/src/legacy/utmpx.c +++ b/src/legacy/utmpx.c @@ -1,5 +1,6 @@ #include #include +#include #include "libc.h" void endutxent(void) @@ -36,6 +37,7 @@ void updwtmpx(const char *f, const struct utmpx *u) int __utmpxname(const char *f) { + errno = ENOTSUP; return -1; } From d6cb08bcaca4ff1f921375510ca72bccea969c75 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 18:24:34 -0500 Subject: [PATCH 019/412] factor resolv.conf parsing out of res_msend to its own file this change is made in preparation for adding search domains, for which higher-level code will need to parse resolv.conf. simply parsing it twice for each lookup would be one reasonable option, but the existing parser code was buggy anyway, which suggested to me that it's a bad idea to have two variants of this code in two different places. the old code in res_msend potentially misinterpreted overly long lines in resolv.conf, and stopped parsing after it found 3 nameservers, even if there were relevant options left to be parsed later in the file. --- src/network/lookup.h | 11 +++++ src/network/res_msend.c | 80 +++++++++------------------------- src/network/resolvconf.c | 93 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 59 deletions(-) create mode 100644 src/network/resolvconf.c diff --git a/src/network/lookup.h b/src/network/lookup.h index 69419115..0468edbc 100644 --- a/src/network/lookup.h +++ b/src/network/lookup.h @@ -2,6 +2,7 @@ #define LOOKUP_H #include +#include struct address { int family; @@ -15,6 +16,14 @@ struct service { unsigned char proto, socktype; }; +#define MAXNS 3 + +struct resolvconf { + struct address ns[MAXNS]; + unsigned nns, attempts, ndots; + unsigned timeout; +}; + /* The limit of 48 results is a non-sharp bound on the number of addresses * that can fit in one 512-byte DNS packet full of v4 results and a second * packet full of v6 results. Due to headers, the actual limit is lower. */ @@ -25,4 +34,6 @@ int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int pro int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags); int __lookup_ipliteral(struct address buf[static 1], const char *name, int family); +int __get_resolv_conf(struct resolvconf *, char *, size_t); + #endif diff --git a/src/network/res_msend.c b/src/network/res_msend.c index d0e8e481..0ee914d4 100644 --- a/src/network/res_msend.c +++ b/src/network/res_msend.c @@ -31,14 +31,11 @@ int __res_msend(int nqueries, const unsigned char *const *queries, const int *qlens, unsigned char *const *answers, int *alens, int asize) { int fd; - FILE *f, _f; - unsigned char _buf[256]; - char line[64], *s, *z; - int timeout = 5000, attempts = 2, retry_interval, servfail_retry; + int timeout, attempts, retry_interval, servfail_retry; union { struct sockaddr_in sin; struct sockaddr_in6 sin6; - } sa = {0}, ns[3] = {{0}}; + } sa = {0}, ns[MAXNS] = {{0}}; socklen_t sl = sizeof sa.sin; int nns = 0; int family = AF_INET; @@ -48,66 +45,31 @@ int __res_msend(int nqueries, const unsigned char *const *queries, int cs; struct pollfd pfd; unsigned long t0, t1, t2; - struct address iplit; + struct resolvconf conf; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); - /* Get nameservers from resolv.conf, fallback to localhost */ - f = __fopen_rb_ca("/etc/resolv.conf", &_f, _buf, sizeof _buf); - if (!f) switch (errno) { - case ENOENT: - case ENOTDIR: - case EACCES: - goto no_resolv_conf; - default: - return -1; - } - for (nns=0; nns<3 && fgets(line, sizeof line, f); ) { - if (!strncmp(line, "options", 7) && isspace(line[7])) { - unsigned long x; - char *p, *z; - p = strstr(line, "timeout:"); - if (p && isdigit(p[8])) { - p += 8; - x = strtoul(p, &z, 10); - if (z != p) timeout = x < 30 ? x*1000 : 30000; - } - p = strstr(line, "attempts:"); - if (p && isdigit(p[9])) { - p += 9; - x = strtoul(p, &z, 10); - if (z != p) attempts = x < 10 ? x : 10; - if (!attempts) attempts = 1; - } - } - if (strncmp(line, "nameserver", 10) || !isspace(line[10])) - continue; - for (s=line+11; isspace(*s); s++); - for (z=s; *z && !isspace(*z); z++); - *z=0; + /* Get nameservers & timeout/retry settings from resolv.conf */ + if (__get_resolv_conf(&conf, 0, 0) < 0) return -1; - if (__lookup_ipliteral(&iplit, s, AF_UNSPEC)>0) { - if (iplit.family == AF_INET) { - memcpy(&ns[nns].sin.sin_addr, iplit.addr, 4); - ns[nns].sin.sin_port = htons(53); - ns[nns++].sin.sin_family = AF_INET; - } else { - sl = sizeof sa.sin6; - memcpy(&ns[nns].sin6.sin6_addr, iplit.addr, 16); - ns[nns].sin6.sin6_port = htons(53); - ns[nns].sin6.sin6_scope_id = iplit.scopeid; - ns[nns++].sin6.sin6_family = family = AF_INET6; - } + timeout = 1000*conf.timeout; + attempts = conf.attempts; + + nns = conf.nns; + for (nns=0; nnsfamily == AF_INET) { + memcpy(&ns[nns].sin.sin_addr, iplit->addr, 4); + ns[nns].sin.sin_port = htons(53); + ns[nns].sin.sin_family = AF_INET; + } else { + sl = sizeof sa.sin6; + memcpy(&ns[nns].sin6.sin6_addr, iplit->addr, 16); + ns[nns].sin6.sin6_port = htons(53); + ns[nns].sin6.sin6_scope_id = iplit->scopeid; + ns[nns].sin6.sin6_family = family = AF_INET6; } } - __fclose_ca(f); -no_resolv_conf: - if (!nns) { - ns[0].sin.sin_family = AF_INET; - ns[0].sin.sin_port = htons(53); - ns[0].sin.sin_addr.s_addr = htonl(0x7f000001); - nns=1; - } /* Get local address and open/bind a socket */ sa.sin.sin_family = family; diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c new file mode 100644 index 00000000..0743a88f --- /dev/null +++ b/src/network/resolvconf.c @@ -0,0 +1,93 @@ +#include "lookup.h" +#include "stdio_impl.h" +#include +#include +#include +#include + +int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) +{ + char line[256]; + unsigned char _buf[256]; + FILE *f, _f; + int nns; + + conf->ndots = 1; + conf->timeout = 5; + conf->attempts = 2; + if (search) *search = 0; + + f = __fopen_rb_ca("/etc/resolv.conf", &_f, _buf, sizeof _buf); + if (!f) switch (errno) { + case ENOENT: + case ENOTDIR: + case EACCES: + goto no_resolv_conf; + default: + return -1; + } + + while (fgets(line, sizeof line, f)) { + char *p, *z; + if (!strchr(line, '\n') && !feof(f)) { + /* Ignore lines that get truncated rather than + * potentially misinterpreting them. */ + int c; + do c = getc(f); + while (c != '\n' && c != EOF); + continue; + } + if (!strncmp(line, "options", 7) && isspace(line[7])) { + p = strstr(line, "ndots:"); + if (p && isdigit(p[6])) { + p += 6; + unsigned long x = strtoul(p, &z, 10); + if (z != p) conf->ndots = x > 15 ? 15 : x; + } + p = strstr(line, "attempts:"); + if (p && isdigit(p[6])) { + p += 6; + unsigned long x = strtoul(p, &z, 10); + if (z != p) conf->attempts = x > 10 ? 10 : x; + } + p = strstr(line, "timeout:"); + if (p && (isdigit(p[8]) || p[8]=='.')) { + p += 8; + unsigned long x = strtoul(p, &z, 10); + if (z != p) conf->timeout = x > 60 ? 60 : x; + } + continue; + } + if (!strncmp(line, "nameserver", 10) && isspace(line[10])) { + if (nns >= MAXNS) continue; + for (p=line+11; isspace(*p); p++); + for (z=p; *z && !isspace(*z); z++); + *z=0; + if (__lookup_ipliteral(conf->ns+nns, p, AF_UNSPEC) > 0) + nns++; + continue; + } + + if (!search) continue; + if (strncmp(line, "domain", 6) || strncmp(line, "search", 6) + || !isspace(line[6])) + continue; + for (p=line+7; isspace(*p); p++); + size_t l = strlen(p); + /* This can never happen anyway with chosen buffer sizes. */ + if (l >= search_sz) continue; + memcpy(search, p, l+1); + } + + __fclose_ca(f); + +no_resolv_conf: + if (!nns) { + __lookup_ipliteral(conf->ns, "127.0.0.1", AF_UNSPEC); + nns = 1; + } + + conf->nns = nns; + + return 0; +} From fe8453d2ee128cfcf8777a19659f1c1f19e052ac Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 19:20:13 -0500 Subject: [PATCH 020/412] fix logic for matching search/domain keywords in resolv.conf --- src/network/resolvconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c index 0743a88f..7e4dbe21 100644 --- a/src/network/resolvconf.c +++ b/src/network/resolvconf.c @@ -69,7 +69,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) } if (!search) continue; - if (strncmp(line, "domain", 6) || strncmp(line, "search", 6) + if ((strncmp(line, "domain", 6) && strncmp(line, "search", 6)) || !isspace(line[6])) continue; for (p=line+7; isspace(*p); p++); From 0fef7ffac114befc94ab5fa794a1754442dcd531 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 19:23:06 -0500 Subject: [PATCH 021/412] fix handling of dns response codes rcode of 3 (NxDomain) was treated as a hard EAI_NONAME failure, but it should instead return 0 (no results) so the caller can continue searching. this will be important for adding search domain support. the top-level caller will automatically return EAI_NONAME if there are zero results at the end. also, the case where rcode is 0 (success) but there are no results was not handled. this happens when the domain exists but there are no A or AAAA records for it. in this case a hard EAI_NONAME should be imposed to inhibit further search, since the name was defined and just does not have any address associated with it. previously a misleading hard failure of EAI_FAIL was reported. --- src/network/lookup_name.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index df9e623e..fb7b5c12 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -152,7 +152,8 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static if (ctx.cnt) return ctx.cnt; if (alens[0] < 4 || (abuf[0][3] & 15) == 2) return EAI_AGAIN; - if ((abuf[0][3] & 15) == 3) return EAI_NONAME; + if ((abuf[0][3] & 15) == 0) return EAI_NONAME; + if ((abuf[0][3] & 15) == 3) return 0; return EAI_FAIL; } From 3d6e2e477ced37fd328870f018950b283cb7293c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 19:50:48 -0500 Subject: [PATCH 022/412] add support for search domains to dns resolver search is only performed if the search or domain keyword is used in resolv.conf and the queried name has fewer than ndots dots. there is no default domain and names with >=ndots dots are never subjected to search; failure in the root scope is final. the (non-POSIX) res_search API presently does not honor search. this may be added at some point in the future if needed. resolv.conf is now parsed twice, at two different layers of the code involved. this will be fixed in a subsequent patch. --- src/network/lookup_name.c | 42 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index fb7b5c12..09734b50 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -157,6 +157,46 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static return EAI_FAIL; } +static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family) +{ + char search[256]; + struct resolvconf conf; + size_t l, dots; + char *p, *z; + + if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1; + + /* Count dots, suppress search when >=ndots or name ends in + * a dot, which is an explicit request for global scope. */ + for (dots=l=0; name[l]; l++) if (name[l]=='.') dots++; + if (dots >= conf.ndots || name[l-1]=='.') *search = 0; + + /* This can never happen; the caller already checked length. */ + if (l >= 256) return EAI_NONAME; + + /* Name with search domain appended is setup in canon[]. This both + * provides the desired default canonical name (if the requested + * name is not a CNAME record) and serves as a buffer for passing + * the full requested name to name_from_dns. */ + memcpy(canon, name, l); + canon[l] = '.'; + + for (p=search; *p; p=z) { + for (; isspace(*p); p++); + for (z=p; *z && !isspace(*z); z++); + if (z==p) break; + if (z-p < 256 - l - 1) { + memcpy(canon+l+1, p, z-p); + canon[z-p+1+l] = 0; + int cnt = name_from_dns(buf, canon, canon, family); + if (cnt) return cnt; + } + } + + canon[l] = 0; + return name_from_dns(buf, canon, name, family); +} + static const struct policy { unsigned char addr[16]; unsigned char len, mask; @@ -257,7 +297,7 @@ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], c if (!cnt) cnt = name_from_numeric(buf, name, family); if (!cnt && !(flags & AI_NUMERICHOST)) { cnt = name_from_hosts(buf, canon, name, family); - if (!cnt) cnt = name_from_dns(buf, canon, name, family); + if (!cnt) cnt = name_from_dns_search(buf, canon, name, family); } if (cnt<=0) return cnt ? cnt : EAI_NONAME; From dcad020c9cb450c61ece604d11941ef6e7945330 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 20:50:30 -0500 Subject: [PATCH 023/412] fix uninitialized variable in new resolv.conf parser --- src/network/resolvconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c index 7e4dbe21..2cf1f475 100644 --- a/src/network/resolvconf.c +++ b/src/network/resolvconf.c @@ -10,7 +10,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) char line[256]; unsigned char _buf[256]; FILE *f, _f; - int nns; + int nns = 0; conf->ndots = 1; conf->timeout = 5; From 1563587b45a39512df9b5810dcc5961d4d21a910 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Jan 2016 20:51:31 -0500 Subject: [PATCH 024/412] reuse parsed resolv.conf in dns core to avoid re-reading/re-parsing --- src/network/lookup_name.c | 11 ++++++----- src/network/res_msend.c | 27 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index 09734b50..a26ad535 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -93,7 +93,7 @@ struct dpc_ctx { int __dns_parse(const unsigned char *, int, int (*)(void *, int, const void *, int, const void *), void *); int __dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int); int __res_mkquery(int, const char *, int, int, const unsigned char *, int, const unsigned char*, unsigned char *, int); -int __res_msend(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int); +int __res_msend_rc(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int, const struct resolvconf *); #define RR_A 1 #define RR_CNAME 5 @@ -125,7 +125,7 @@ static int dns_parse_callback(void *c, int rr, const void *data, int len, const return 0; } -static int name_from_dns(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family) +static int name_from_dns(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, const struct resolvconf *conf) { unsigned char qbuf[2][280], abuf[2][512]; const unsigned char *qp[2] = { qbuf[0], qbuf[1] }; @@ -145,7 +145,8 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static nq++; } - if (__res_msend(nq, qp, qlens, ap, alens, sizeof *abuf) < 0) return EAI_SYSTEM; + if (__res_msend_rc(nq, qp, qlens, ap, alens, sizeof *abuf, conf) < 0) + return EAI_SYSTEM; for (i=0; itimeout; + attempts = conf->attempts; - timeout = 1000*conf.timeout; - attempts = conf.attempts; - - nns = conf.nns; - for (nns=0; nnsnns; + for (nns=0; nnsnns; nns++) { + const struct address *iplit = &conf->ns[nns]; if (iplit->family == AF_INET) { memcpy(&ns[nns].sin.sin_addr, iplit->addr, 4); ns[nns].sin.sin_port = htons(53); @@ -178,3 +175,11 @@ out: return 0; } + +int __res_msend(int nqueries, const unsigned char *const *queries, + const int *qlens, unsigned char *const *answers, int *alens, int asize) +{ + struct resolvconf conf; + if (__get_resolv_conf(&conf, 0, 0) < 0) return -1; + return __res_msend_rc(nqueries, queries, qlens, answers, alens, asize, &conf); +} From 140ad50cbf9244eecc21a0126c743396a34e8106 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 30 Jan 2016 14:34:45 -0500 Subject: [PATCH 025/412] fix regression in dynamic-linked tls when both main app & libs have tls commit d56460c939c94a6c547abe8238f442b8de10bfbd introduced this bug by setting up the tls module chain incorrectly when the main app has tls. the singly-linked list head pointer was setup correctly, but the tail pointer was not, so the first attempt to append to the list (for a shared library with tls) would treat the list as empty and effectively removed the main app from the list. this left all tls module id numbers off-by-one. this bug did not appear in any released versions. --- ldso/dynlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 26a60b4c..f497542e 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1519,7 +1519,7 @@ _Noreturn void __dls3(size_t *sp) } } if (app.tls.size) { - libc.tls_head = &app.tls; + libc.tls_head = tls_tail = &app.tls; app.tls_id = tls_cnt = 1; #ifdef TLS_ABOVE_TP app.tls.offset = 0; From 9ee57db8834ee0d9adb1e6a84a75b0818dbfca69 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 30 Jan 2016 19:42:08 -0500 Subject: [PATCH 026/412] fix misaligned pointer-like objects in arm atomics asm source file this file's .data section was not aligned, and just happened to get the correct alignment with past builds. it's likely that the move of atomic.s from arch/arm/src to src/thread/arm caused the change in alignment, which broke the atomic and thread-pointer access fragments on actual armv5 hardware. --- src/thread/arm/atomics.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/thread/arm/atomics.s b/src/thread/arm/atomics.s index 5c5b0e3e..673fc03b 100644 --- a/src/thread/arm/atomics.s +++ b/src/thread/arm/atomics.s @@ -95,6 +95,8 @@ __a_gettp_dummy: bx lr .data +.align 2 + .global __a_barrier_ptr .hidden __a_barrier_ptr __a_barrier_ptr: From a8cc2253843e30dfbdf0bb2954439d9f2b2e8704 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Apr 2015 14:31:07 +0000 Subject: [PATCH 027/412] regex: clean up position accounting for literal nodes This should not change the meaning of the code, just make the intent clearer: advancing position is tied to adding a new literal. --- src/regex/regcomp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 330de467..ac207c89 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -834,22 +834,20 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) return REG_EBRACE; s++; } - node = tre_ast_new_literal(ctx->mem, v, v, ctx->position); - ctx->position++; + node = tre_ast_new_literal(ctx->mem, v, v, ctx->position++); s--; break; default: if (!ere && (unsigned)*s-'1' < 9) { /* back reference */ int val = *s - '0'; - node = tre_ast_new_literal(ctx->mem, BACKREF, val, ctx->position); + node = tre_ast_new_literal(ctx->mem, BACKREF, val, ctx->position++); ctx->max_backref = MAX(val, ctx->max_backref); } else { /* extension: accept unknown escaped char as a literal */ goto parse_literal; } - ctx->position++; } s++; break; From 7eaa76fc2e7993582989d3838b1ac32dd8abac09 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Apr 2015 15:51:16 +0000 Subject: [PATCH 028/412] regex: reject repetitions in some cases with REG_BADRPT Previously repetitions were accepted after empty expressions like in (*|?)|{2}, but in BRE the handling of * and \{\} were not consistent: they were accepted as literals in some cases and repetitions in others. It is better to treat repetitions after an empty expression as an error (this is allowed by the standard, and glibc mostly does the same). This is hard to do consistently with the current logic so the new rule is: Reject repetitions after empty expressions, except after assertions ^*, $? and empty groups ()+ and never treat them as literals. Empty alternation (|a) is undefined by the standard, but it can be useful so that should be accepted. --- src/regex/regcomp.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index ac207c89..078f657c 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -837,6 +837,10 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) node = tre_ast_new_literal(ctx->mem, v, v, ctx->position++); s--; break; + case '{': + /* reject repetitions after empty expression in BRE */ + if (!ere) + return REG_BADRPT; default: if (!ere && (unsigned)*s-'1' < 9) { /* back reference */ @@ -880,10 +884,14 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) s++; break; case '*': - case '|': + return REG_BADPAT; case '{': case '+': case '?': + /* reject repetitions after empty expression in ERE */ + if (ere) + return REG_BADRPT; + case '|': if (!ere) goto parse_literal; case 0: @@ -964,8 +972,9 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) } parse_iter: - /* extension: repetitions are accepted after an empty node - eg. (+), ^*, a$?, a|{2} */ + /* extension: repetitions are rejected after an empty node + eg. (+), |*, {2}, but assertions are not treated as empty + so ^* or $? are accepted currently. */ switch (*s) { case '+': case '?': From da4cc13b9705e7d3a02216959b9711b3b30828c1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Apr 2015 16:47:17 +0000 Subject: [PATCH 029/412] regex: treat \| in BRE as alternation The standard does not define semantics for \| in BRE, but some code depends on it meaning alternation. Empty alternative expression is allowed to be consistent with ERE. Based on a patch by Rob Landley. --- src/regex/regcomp.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 078f657c..f1f06afe 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -841,6 +841,14 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) /* reject repetitions after empty expression in BRE */ if (!ere) return REG_BADRPT; + case '|': + /* extension: treat \| as alternation in BRE */ + if (!ere) { + node = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + s--; + goto end; + } + /* fallthrough */ default: if (!ere && (unsigned)*s-'1' < 9) { /* back reference */ @@ -918,6 +926,7 @@ parse_literal: s += len; break; } +end: if (!node) return REG_ESPACE; ctx->n = node; @@ -1016,13 +1025,20 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) if ((ere && *s == '|') || (ere && *s == ')' && depth) || (!ere && *s == '\\' && s[1] == ')') || + /* extension: treat \| as alternation in BRE */ + (!ere && *s == '\\' && s[1] == '|') || !*s) { /* extension: empty branch is unspecified (), (|a), (a|) here they are not rejected but match on empty string */ int c = *s; nunion = tre_ast_new_union(ctx->mem, nunion, nbranch); nbranch = 0; - if (c != '|') { + + if (c == '\\' && s[1] == '|') { + s+=2; + } else if (c == '|') { + s++; + } else { if (c == '\\') { if (!depth) return REG_EPAREN; s+=2; @@ -1042,7 +1058,6 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) nunion = tre_stack_pop_voidptr(stack); goto parse_iter; } - s++; } } } From 03498ec22a4804ddbd8203d9ac94b6f7b6574b3c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Apr 2015 17:25:31 +0000 Subject: [PATCH 030/412] regex: rewrite the repetition parsing code The goto logic was hard to follow and modify. This is in preparation for the BRE \+ and \? support. --- src/regex/regcomp.c | 59 ++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index f1f06afe..ccd3755b 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -984,41 +984,40 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) /* extension: repetitions are rejected after an empty node eg. (+), |*, {2}, but assertions are not treated as empty so ^* or $? are accepted currently. */ - switch (*s) { - case '+': - case '?': - if (!ere) + for (;;) { + if (*s!='\\' && *s!='*') { + if (!ere) + break; + if (*s!='+' && *s!='?' && *s!='{') + break; + } + if (*s=='\\' && ere) break; - /* fallthrough */ - case '*':; - int min=0, max=-1; - if (*s == '+') - min = 1; - if (*s == '?') - max = 1; - s++; - ctx->n = tre_ast_new_iter(ctx->mem, ctx->n, min, max, 0); - if (!ctx->n) - return REG_ESPACE; + if (*s=='\\' && s[1]!='{') + break; + if (*s=='\\') + s++; + /* extension: multiple consecutive *+?{,} is unspecified, but (a+)+ has to be supported so accepting a++ makes sense, note however that the RE_DUP_MAX limit can be circumvented: (a{255}){255} uses a lot of memory.. */ - goto parse_iter; - case '\\': - if (ere || s[1] != '{') - break; - s++; - goto parse_brace; - case '{': - if (!ere) - break; - parse_brace: - err = parse_dup(ctx, s+1); - if (err != REG_OK) - return err; - s = ctx->s; - goto parse_iter; + if (*s=='{') { + err = parse_dup(ctx, s+1); + if (err != REG_OK) + return err; + s = ctx->s; + } else { + int min=0, max=-1; + if (*s == '+') + min = 1; + if (*s == '?') + max = 1; + s++; + ctx->n = tre_ast_new_iter(ctx->mem, ctx->n, min, max, 0); + if (!ctx->n) + return REG_ESPACE; + } } nbranch = tre_ast_new_catenation(ctx->mem, nbranch, ctx->n); From 25160f1c08235cf5b6a9617c5640380618a0f6ff Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Apr 2015 17:28:49 +0000 Subject: [PATCH 031/412] regex: treat \+, \? as repetitions in BRE These are undefined escape sequences by the standard, but often used in sed scripts. --- src/regex/regcomp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index ccd3755b..b3dbb252 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -838,6 +838,9 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) s--; break; case '{': + case '+': + case '?': + /* extension: treat \+, \? as repetitions in BRE */ /* reject repetitions after empty expression in BRE */ if (!ere) return REG_BADRPT; @@ -993,7 +996,8 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) } if (*s=='\\' && ere) break; - if (*s=='\\' && s[1]!='{') + /* extension: treat \+, \? as repetitions in BRE */ + if (*s=='\\' && s[1]!='+' && s[1]!='?' && s[1]!='{') break; if (*s=='\\') s++; From 831e9d9efa61566a25c1dcdbd28f55daeea4dd32 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Apr 2015 17:53:38 +0000 Subject: [PATCH 032/412] regex: simplify the {,} repetition parsing logic --- src/regex/regcomp.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index b3dbb252..7ce29889 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -708,7 +708,7 @@ static const char *parse_dup_count(const char *s, int *n) return s; } -static reg_errcode_t parse_dup(tre_parse_ctx_t *ctx, const char *s) +static const char *parse_dup(const char *s, int ere, int *pmin, int *pmax) { int min, max; @@ -723,19 +723,13 @@ static reg_errcode_t parse_dup(tre_parse_ctx_t *ctx, const char *s) max > RE_DUP_MAX || min > RE_DUP_MAX || min < 0 || - (!(ctx->cflags & REG_EXTENDED) && *s++ != '\\') || + (!ere && *s++ != '\\') || *s++ != '}' ) - return REG_BADBR; - - if (min == 0 && max == 0) - ctx->n = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); - else - ctx->n = tre_ast_new_iter(ctx->mem, ctx->n, min, max, 0); - if (!ctx->n) - return REG_ESPACE; - ctx->s = s; - return REG_OK; + return 0; + *pmin = min; + *pmax = max; + return s; } static int hexval(unsigned c) @@ -988,6 +982,8 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) eg. (+), |*, {2}, but assertions are not treated as empty so ^* or $? are accepted currently. */ for (;;) { + int min, max; + if (*s!='\\' && *s!='*') { if (!ere) break; @@ -1007,21 +1003,24 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) sense, note however that the RE_DUP_MAX limit can be circumvented: (a{255}){255} uses a lot of memory.. */ if (*s=='{') { - err = parse_dup(ctx, s+1); - if (err != REG_OK) - return err; - s = ctx->s; + s = parse_dup(s+1, ere, &min, &max); + if (!s) + return REG_BADBR; } else { - int min=0, max=-1; + min=0; + max=-1; if (*s == '+') min = 1; if (*s == '?') max = 1; s++; - ctx->n = tre_ast_new_iter(ctx->mem, ctx->n, min, max, 0); - if (!ctx->n) - return REG_ESPACE; } + if (max == 0) + ctx->n = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + else + ctx->n = tre_ast_new_iter(ctx->mem, ctx->n, min, max, 0); + if (!ctx->n) + return REG_ESPACE; } nbranch = tre_ast_new_catenation(ctx->mem, nbranch, ctx->n); From c18d05f0e8909ec54252b251c441b5dd903268f8 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 30 Jan 2016 21:14:05 +0100 Subject: [PATCH 033/412] ldso: fix GDB dynamic linker info on MIPS GDB is looking for a pointer to the ldso debug info in the data of the ..rld_map section. Signed-off-by: Felix Fietkau --- arch/mips/reloc.h | 2 +- ldso/dynlink.c | 11 +++++++---- src/internal/dynlink.h | 4 ++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/mips/reloc.h b/arch/mips/reloc.h index 9b40e3da..8c52df09 100644 --- a/arch/mips/reloc.h +++ b/arch/mips/reloc.h @@ -24,7 +24,7 @@ #define REL_TPOFF R_MIPS_TLS_TPREL32 #define NEED_MIPS_GOT_RELOCS 1 -#define DYNAMIC_IS_RO 1 +#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) #define CRTJMP(pc,sp) __asm__ __volatile__( \ diff --git a/ldso/dynlink.c b/ldso/dynlink.c index f497542e..87f3b7f8 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1582,11 +1582,14 @@ _Noreturn void __dls3(size_t *sp) load_deps(&app); make_global(&app); -#ifndef DYNAMIC_IS_RO - for (i=0; app.dynv[i]; i+=2) - if (app.dynv[i]==DT_DEBUG) + for (i=0; app.dynv[i]; i+=2) { + if (!DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG) app.dynv[i+1] = (size_t)&debug; -#endif + if (DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG_INDIRECT) { + size_t *ptr = (size_t *) app.dynv[i+1]; + *ptr = (size_t)&debug; + } + } /* The main program must be relocated LAST since it may contin * copy relocations which depend on libraries' relocations. */ diff --git a/src/internal/dynlink.h b/src/internal/dynlink.h index 9c494e43..48890b2d 100644 --- a/src/internal/dynlink.h +++ b/src/internal/dynlink.h @@ -83,6 +83,10 @@ struct fdpic_dummy_loadmap { #define NEED_MIPS_GOT_RELOCS 0 #endif +#ifndef DT_DEBUG_INDIRECT +#define DT_DEBUG_INDIRECT 0 +#endif + #define AUX_CNT 32 #define DYN_CNT 32 From 65498f289bded83afb809b24d850647e7c91cd58 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 31 Jan 2016 00:40:33 -0500 Subject: [PATCH 034/412] don't suppress shared libc when linker lacks -Bsymbolic-functions previous work overhauling the dynamic linker made it so that linking libc with -Bsymbolic-functions was no longer mandatory, but the configure logic that forced --disable-shared when ld failed to accept the option was left in place. this commit removes the hard-coded -Bsymbolic-functions from the Makefile and changes the configure test to one that simply adds it to the auto-detected LDFLAGS on success. --- Makefile | 3 +-- configure | 13 ++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 7c3dda4b..b2a719db 100644 --- a/Makefile +++ b/Makefile @@ -159,8 +159,7 @@ obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH) lib/libc.so: $(LOBJS) $(LDSO_OBJS) $(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \ - -Wl,-e,_dlstart -Wl,-Bsymbolic-functions \ - -o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC) + -Wl,-e,_dlstart -o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC) lib/libc.a: $(AOBJS) rm -f $@ diff --git a/configure b/configure index a296f8ab..58f496e0 100755 --- a/configure +++ b/configure @@ -565,15 +565,10 @@ tryldflag LDFLAGS_AUTO -Wl,--no-undefined # versions built without shared library support and pcc are broken. tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL -test "$shared" = "no" || { -# Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions -LDFLAGS_DUMMY= -tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || { -test "$shared" = "yes" && fail "$0: error: linker cannot build shared library" -printf "warning: disabling dynamic linking support\n" -shared=no -} -} +# Linking with -Bsymbolic-functions is no longer mandatory for +# the dynamic linker to work, but enable it if it works as +# a linking optimization. +tryldflag LDFLAGS_AUTO -Wl,-Bsymbolic-functions # Find compiler runtime library test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh From 3b27725385614d44add9351191765181edc3f4c1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 31 Jan 2016 16:33:44 +0100 Subject: [PATCH 035/412] better a_sc inline asm constraint on aarch64 and arm "Q" input constraint was used for the written object, instead of "=Q" output constraint. this should not cause problems because "memory" is on the clobber list, but "=Q" better documents the intent and more consistent with the actual asm code. this changes the generated code, because different registers are used, but other than the register names nothing should change. --- arch/aarch64/atomic_arch.h | 4 ++-- arch/arm/atomic_arch.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/aarch64/atomic_arch.h b/arch/aarch64/atomic_arch.h index 6b4f1a4d..af93d879 100644 --- a/arch/aarch64/atomic_arch.h +++ b/arch/aarch64/atomic_arch.h @@ -10,7 +10,7 @@ static inline int a_ll(volatile int *p) static inline int a_sc(volatile int *p, int v) { int r; - __asm__ __volatile__ ("stlxr %w0,%w1,%2" : "=&r"(r) : "r"(v), "Q"(*p) : "memory"); + __asm__ __volatile__ ("stlxr %w0,%w2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory"); return !r; } @@ -44,7 +44,7 @@ static inline void *a_ll_p(volatile void *p) static inline int a_sc_p(volatile int *p, void *v) { int r; - __asm__ __volatile__ ("stlxr %w0,%1,%2" : "=&r"(r) : "r"(v), "Q"(*(void *volatile *)p) : "memory"); + __asm__ __volatile__ ("stlxr %w0,%2,%1" : "=&r"(r), "=Q"(*(void *volatile *)p) : "r"(v) : "memory"); return !r; } diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index 21db6b22..706fa1f2 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -16,7 +16,7 @@ static inline int a_ll(volatile int *p) static inline int a_sc(volatile int *p, int v) { int r; - __asm__ __volatile__ ("strex %0,%1,%2" : "=&r"(r) : "r"(v), "Q"(*p) : "memory"); + __asm__ __volatile__ ("strex %0,%2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory"); return !r; } From 2810b30fc3c515e38d6acabe87de7b48bb8bfc7b Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 31 Jan 2016 16:46:46 +0100 Subject: [PATCH 036/412] regex: increase the stack tre uses for tnfa creation 10k elements stack is increased to 1000k, otherwise tnfa creation fails for reasonable sized patterns: a single literal char can add 7 elements to this stack, so regcomp of an 1500 char long pattern (with only litral chars) fails with REG_ESPACE. (the new limit allows about < 150k chars, this arbitrary limit allows most command line regex usage.) ideally there would be no upper bound: regcomp dynamically reallocates this buffer, every reallocation checks for allocation failure and at the end this stack is freed so there is no reason for special bound. however that may have unwanted effect on regcomp and regexec runtime so this is a conservative change. --- src/regex/regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 7ce29889..da6abd18 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -2688,7 +2688,7 @@ regcomp(regex_t *restrict preg, const char *restrict regex, int cflags) /* Allocate a stack used throughout the compilation process for various purposes. */ - stack = tre_stack_new(512, 10240, 128); + stack = tre_stack_new(512, 1024000, 128); if (!stack) return REG_ESPACE; /* Allocate a fast memory allocator. */ From d1507646975cbf6c3e511ba07b193f27f032d108 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 31 Jan 2016 17:31:03 +0100 Subject: [PATCH 037/412] fix malloc_usable_size for NULL input the linux man page specifies malloc_usable_size(0) to return 0 and this is the semantics other implementations follow (jemalloc). reported by Alexander Monakov. --- src/malloc/malloc_usable_size.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/malloc/malloc_usable_size.c b/src/malloc/malloc_usable_size.c index 8cccd9d8..6743ea77 100644 --- a/src/malloc/malloc_usable_size.c +++ b/src/malloc/malloc_usable_size.c @@ -13,5 +13,5 @@ struct chunk { size_t malloc_usable_size(void *p) { - return CHUNK_SIZE(MEM_TO_CHUNK(p)) - OVERHEAD; + return p ? CHUNK_SIZE(MEM_TO_CHUNK(p)) - OVERHEAD : 0; } From 40891ae6dbc1c6113c4a826656a28143648df159 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 2 Feb 2016 17:35:06 -0500 Subject: [PATCH 038/412] update INSTALL file with new archs, compiler info add aarch64 and or1k archs, upgrade sh from experimental, and note that sh now supports the FDPIC ABI. the old advice on compiler versions was outdated and more specific than made sense. presence of compiler bugs varies a lot by arch, so it's hard to make any good recommendations beyond "recent". if we want to document specific known-good/bad compiler versions, a much larger section in the documentation than what's appropriate for the INSTALL file would be needed. --- INSTALL | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/INSTALL b/INSTALL index 5713cd49..9f33910b 100644 --- a/INSTALL +++ b/INSTALL @@ -18,28 +18,18 @@ Build Prerequisites The only build-time prerequisites for musl are GNU Make and a freestanding C99 compiler toolchain targeting the desired instruction -set architecture and ABI, with support for gcc-style inline assembly, -weak aliases, and stand-alone assembly source files. +set architecture and ABI, with support for a minimal subset of "GNU C" +extensions consisting mainly of gcc-style inline assembly, weak +aliases, hidden visibility, and stand-alone assembly source files. + +GCC, LLVM/clang, Firm/cparser, and PCC have all successfully built +musl, but GCC is the most widely used/tested. Recent compiler (and +binutils) versions should be used if possible since some older +versions have bugs which affect musl. The system used to build musl does not need to be Linux-based, nor do the Linux kernel headers need to be available. -If support for dynamic linking is desired, some further requirements -are placed on the compiler and linker. In particular, the linker must -support the -Bsymbolic-functions option. - -At present, GCC 4.6 or later is the recommended compiler for building -musl. Any earlier version of GCC with full C99 support should also -work, but may be subject to minor floating point conformance issues on -i386 targets. Sufficiently recent versions of PCC and LLVM/clang are -also believed to work, but have not been tested as heavily; prior to -Fall 2012, both had known bugs that affected musl. Firm/cparser is -also believed to work but lacks support for producing shared -libraries. GCC 4.9.0 and 4.9.1 are known to have a serious bug -(#61144) which affects musl. Beginning with version 1.1.4 musl -attempts to work around the bug, but these compiler versions are still -considered unstable and unsupported. - Supported Targets @@ -53,12 +43,17 @@ and ABI combinations: the `cmpxchg` instruction is added * x86_64 + * ILP32 ABI (x32) is available as a separate arch but is still + experimental * ARM * EABI, standard or hard-float VFP variant * Little-endian default; big-endian variants also supported * Compiler toolchains only support armv4t and later +* AArch64 + * Little-endian default; big-endian variants also supported + * MIPS * ABI is o32 * Big-endian default; little-endian variants also supported @@ -74,21 +69,18 @@ and ABI combinations: * For dynamic linking, compiler toolchain must be configured for "secure PLT" variant +* SuperH (SH) + * Standard ELF ABI or FDPIC ABI (shared-text without MMU) + * Little-endian by default; big-engian variant also supported + * Full FPU ABI or soft-float ABI is supported, but the + single-precision-only FPU ABI is not + * Microblaze * Big-endian default; little-endian variants also supported * Soft-float * Requires support for lwx/swx instructions -The following additional targets are available for build, but may not -work correctly and may not yet have ABI stability: - -* SuperH (SH) - * Little-endian by default; big-engian variant also supported - * Full FPU ABI or soft-float ABI is supported, but the - single-precision-only FPU ABI is not supported (musl always - requires IEEE single and double to be supported) - -* x32 (x86_64 ILP32 ABI) +* OpenRISC 1000 (or1k) From 47314f1e6780bd561151c3241d4bcf7b861ed3ee Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 2 Feb 2016 21:14:09 -0500 Subject: [PATCH 039/412] make configure accept -h as an alias for --help --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 58f496e0..248c4500 100755 --- a/configure +++ b/configure @@ -142,7 +142,7 @@ clang_wrapper=no for arg ; do case "$arg" in ---help) usage ;; +--help|-h) usage ;; --srcdir=*) srcdir=${arg#*=} ;; --prefix=*) prefix=${arg#*=} ;; --exec-prefix=*) exec_prefix=${arg#*=} ;; From aecda35373511c5bf02c0f708bd262adb1a09287 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 4 Feb 2016 22:59:13 +0000 Subject: [PATCH 040/412] avoid using signals when a thread attempts to cancel itself not only is pthread_kill expensive in this case; it also breaks testing under qemu app-level emulation. --- src/thread/pthread_cancel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c index a21c3866..3d229223 100644 --- a/src/thread/pthread_cancel.c +++ b/src/thread/pthread_cancel.c @@ -92,5 +92,6 @@ int pthread_cancel(pthread_t t) init = 1; } a_store(&t->cancel, 1); + if (t == pthread_self() && !t->cancelasync) return 0; return pthread_kill(t, SIGCANCEL); } From 756c8af8589265e99e454fe3adcda1d0bc5e1963 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 4 Feb 2016 23:01:03 +0000 Subject: [PATCH 041/412] in mips cancellable syscall asm, don't assume gp register is valid the old __cp_cancel code path loaded the address of __cancel from the GOT using the $gp register, which happened to be set to point to the correct GOT by the calling C function, but there is no ABI requirement that this happen. instead, go the roundabout way and compute the address of __cancel via pc-relative and gp-relative addressing starting with a fake return address generated by a bal instruction, which is the same trick crt1 uses to bootstrap. --- src/thread/mips/syscall_cp.s | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/thread/mips/syscall_cp.s b/src/thread/mips/syscall_cp.s index 8f76d40e..b01a5704 100644 --- a/src/thread/mips/syscall_cp.s +++ b/src/thread/mips/syscall_cp.s @@ -9,6 +9,9 @@ .global __cp_cancel .hidden __cp_cancel .type __cp_cancel,@function +.global __cp_cancel_data +.hidden __cp_cancel_data +.type __cp_cancel_data,@function .hidden __cancel .global __syscall_cp_asm .hidden __syscall_cp_asm @@ -40,7 +43,15 @@ __cp_end: nop __cp_cancel: + move $2, $ra + bal 1f addu $sp, $sp, 32 - lw $25, %call16(__cancel)($gp) +__cp_cancel_data: + .gpword __cp_cancel_data + .gpword __cancel +1: lw $3, ($ra) + subu $3, $ra, $3 + lw $25, 4($ra) + addu $25, $25, $3 jr $25 - nop + move $ra, $2 From 869a9df5b5f7da57ebd86d146e25f78450678eeb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 8 Feb 2016 21:07:09 +0000 Subject: [PATCH 042/412] remove workaround for broken mips assemblers the workaround was for a bug that botched .gpword references to local labels, applying a nonsensical random offset of -0x4000 to them. this reverses commit 5e396fb996a80b035d0f6ecf7fed50f68aa3ebb7 and a removes a similar hack that was added to syscall_cp.s in the later commit 756c8af8589265e99e454fe3adcda1d0bc5e1963. it turns out one additional instance of the same idiom, the GETFUNCSYM macro in arch/mips/reloc.h, was still affected by the assembler bug and does not admit an easy workaround without making assumptions about how the macro is used. the previous workarounds made static linking work but left the early-stage dynamic linker broken and thus had limited usefulness. instead, affected users (using binutils versions older than 2.20) will need to fix the bug on the binutils side; the trivial patch is commit 453f5985b13e35161984bf1bf657bbab11515aa4 in the binutils-gdb repository. --- arch/mips/crt_arch.h | 5 +---- src/thread/mips/syscall_cp.s | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/mips/crt_arch.h b/arch/mips/crt_arch.h index f4ba02ae..9fc50d7c 100644 --- a/arch/mips/crt_arch.h +++ b/arch/mips/crt_arch.h @@ -4,16 +4,13 @@ __asm__( ".text \n" ".global _" START "\n" ".global " START "\n" -".global " START "_data\n" ".type _" START ", @function\n" ".type " START ", @function\n" -".type " START "_data, @function\n" "_" START ":\n" "" START ":\n" " bal 1f \n" " move $fp, $0 \n" -"" START "_data: \n" -" .gpword " START "_data \n" +" .gpword . \n" " .gpword " START "_c \n" ".weak _DYNAMIC \n" ".hidden _DYNAMIC \n" diff --git a/src/thread/mips/syscall_cp.s b/src/thread/mips/syscall_cp.s index b01a5704..d2846264 100644 --- a/src/thread/mips/syscall_cp.s +++ b/src/thread/mips/syscall_cp.s @@ -9,9 +9,6 @@ .global __cp_cancel .hidden __cp_cancel .type __cp_cancel,@function -.global __cp_cancel_data -.hidden __cp_cancel_data -.type __cp_cancel_data,@function .hidden __cancel .global __syscall_cp_asm .hidden __syscall_cp_asm @@ -46,8 +43,7 @@ __cp_cancel: move $2, $ra bal 1f addu $sp, $sp, 32 -__cp_cancel_data: - .gpword __cp_cancel_data + .gpword . .gpword __cancel 1: lw $3, ($ra) subu $3, $ra, $3 From 5a6e8d098abfef67028e6c3edbac39e0bbaf8bd8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 10 Feb 2016 13:51:05 -0500 Subject: [PATCH 043/412] fix failed write reporting by fwrite in line-buffered mode when a write error occurred while flushing output due to a newline, fwrite falsely reported all bytes up to and including the newline as successfully written. in general, due to buffering such "spurious success" returns are acceptable for stdio; however for line-buffered mode it was subtly wrong. errors were still visible via ferror() or as a short-write return if there was more data past the newline that should have been written, but since the contract for line-buffered mode is that everything up through the newline be written out immediately, a discrepency was observable in the actual file contents. --- src/stdio/fwrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stdio/fwrite.c b/src/stdio/fwrite.c index 81ec271e..fa30c0d3 100644 --- a/src/stdio/fwrite.c +++ b/src/stdio/fwrite.c @@ -13,8 +13,8 @@ size_t __fwritex(const unsigned char *restrict s, size_t l, FILE *restrict f) /* Match /^(.*\n|)/ */ for (i=l; i && s[i-1] != '\n'; i--); if (i) { - if (f->write(f, s, i) < i) - return i; + size_t n = f->write(f, s, i); + if (n < i) return n; s += i; l -= i; } From 416d1c7a711807384cc21a18163475cf757bbcb5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 10 Feb 2016 19:10:34 -0500 Subject: [PATCH 044/412] fix line-buffered flush omission for odd usage of putc-family functions as specified, the int argument providing the character to write is converted to type unsigned char. for the actual write to buffer, conversion happened implicitly via the assignment operator; however, the logic to check whether the argument was a newline used the original int value. thus usage such as putchar('\n'+0x100) failed to produce a flush. --- src/internal/stdio_impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal/stdio_impl.h b/src/internal/stdio_impl.h index 0dd7fb5e..7cdf729d 100644 --- a/src/internal/stdio_impl.h +++ b/src/internal/stdio_impl.h @@ -86,7 +86,8 @@ void __ofl_unlock(void); #define getc_unlocked(f) \ ( ((f)->rpos < (f)->rend) ? *(f)->rpos++ : __uflow((f)) ) -#define putc_unlocked(c, f) ( ((c)!=(f)->lbf && (f)->wpos<(f)->wend) \ +#define putc_unlocked(c, f) \ + ( ((unsigned char)(c)!=(f)->lbf && (f)->wpos<(f)->wend) \ ? *(f)->wpos++ = (c) : __overflow((f),(c)) ) /* Caller-allocated FILE * operations */ From 500c6886c654fd45e4926990fee2c61d816be197 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 10 Feb 2016 19:44:19 -0500 Subject: [PATCH 045/412] fix return value for fread/fwrite when size argument is 0 when the size argument was zero but nmemb was nonzero, these functions were returning nmemb, despite no data having been written. conceptually this is not wrong, but the standard requires a return value of zero in this case. --- src/stdio/fread.c | 1 + src/stdio/fwrite.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/stdio/fread.c b/src/stdio/fread.c index 33a65f58..aef75f73 100644 --- a/src/stdio/fread.c +++ b/src/stdio/fread.c @@ -7,6 +7,7 @@ size_t fread(void *restrict destv, size_t size, size_t nmemb, FILE *restrict f) { unsigned char *dest = destv; size_t len = size*nmemb, l = len, k; + if (!size) nmemb = 0; FLOCK(f); diff --git a/src/stdio/fwrite.c b/src/stdio/fwrite.c index fa30c0d3..7a567b2c 100644 --- a/src/stdio/fwrite.c +++ b/src/stdio/fwrite.c @@ -28,6 +28,7 @@ size_t __fwritex(const unsigned char *restrict s, size_t l, FILE *restrict f) size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f) { size_t k, l = size*nmemb; + if (!size) nmemb = 0; FLOCK(f); k = __fwritex(src, l, f); FUNLOCK(f); From 692b16d14b913676567be82a56211adc250793c7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 12 Feb 2016 09:58:50 -0500 Subject: [PATCH 046/412] add declarations for utmpname/utmpxname to appropriate headers commit 378f8cb5222b63e4f8532c757ce54e4074567e1f added these functions (as stubs) but left them without declarations. this broke some autoconf based software that detected linkability of the symbols but didn't check for a declaration. --- include/utmp.h | 2 +- include/utmpx.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/utmp.h b/include/utmp.h index 24e2da7b..48a400d8 100644 --- a/include/utmp.h +++ b/include/utmp.h @@ -22,7 +22,6 @@ struct lastlog { #define ut_name ut_user #define ut_addr ut_addr_v6[0] #define utmp utmpx -#define utmpname(x) (-1) #define e_exit __e_exit #define e_termination __e_termination @@ -34,6 +33,7 @@ struct utmp *pututline(const struct utmp *); void setutent(void); void updwtmp(const char *, const struct utmp *); +int utmpname(const char *); int login_tty(int); diff --git a/include/utmpx.h b/include/utmpx.h index f0c3b013..44b501d3 100644 --- a/include/utmpx.h +++ b/include/utmpx.h @@ -43,6 +43,7 @@ void setutxent(void); #define e_exit __e_exit #define e_termination __e_termination void updwtmpx(const char *, const struct utmpx *); +int utmpxname(const char *); #endif #define EMPTY 0 From 0ed932f34f11663e6b3ddfa866b1798a5938a3dc Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 12 Feb 2016 10:11:40 -0500 Subject: [PATCH 047/412] do not define static_assert macro for pre-C11 compilers some software simply uses static_assert if the macro is defined, and this breaks if the compiler does not recognize the _Static_assert keyword used to define it. --- include/assert.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/assert.h b/include/assert.h index 1ee02a4a..e679adbf 100644 --- a/include/assert.h +++ b/include/assert.h @@ -8,7 +8,7 @@ #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))) #endif -#ifndef __cplusplus +#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus) #define static_assert _Static_assert #endif From 9c102700a7b9e743da692d3cb6bfa580fcdd4379 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 15 Feb 2016 23:12:42 -0500 Subject: [PATCH 048/412] release 1.1.13 --- VERSION | 2 +- WHATSNEW | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ccad953a..9ea63dbc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.12 +1.1.13 diff --git a/WHATSNEW b/WHATSNEW index 911a16d9..935c0bb3 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1618,3 +1618,63 @@ arch-specific bugs fixed: - arm crt1 entry point failed to align stack pointer in some cases - mips fesetround failed to actually set rounding mode - i386 asm source CFI generation had multiple bugs + + + +1.1.13 release notes + +new features: +- out-of-tree builds +- search domains in resolv.conf +- sh arch supports j-core (j2) cas.l atomics +- dynamic linker includes arch/abi in output when run as a command +- header support for new kernel features through linux 4.4 +- mips vdso clock_gettime support +- regex BRE extensions: \|, \+, \? + +performance: +- improved atomics performance on all archs with ll/sc model +- atomic instructions are now inlined on armv6 +- use fpu sqrt for arm softfp abi on targets with vfp + +compatibility: +- getnameinfo now accepts sockaddr sizes larger than needed +- new default CFLAGS/LDFLAGS avoid entire classes of toolchain bugs +- explicit use of float_t/double_t avoids compiler float spill bugs +- i386 max_align_t definition now works with g++ 4.7's pseudo-c++11 +- all known protocols are added to protoent functions +- stub utmpname, utmpxname functions +- linker support for -Bsymbolic-functions is no longer mandatory +- regex parsing size limits increased +- malloc_usable_size now accepts null pointer input + +bugs fixed: +- potential single-byte heap overflow in getdelim +- mishandling of transient failure opening hosts, services, resolv.conf +- mremap was sometimes able to allocate objects larger than PTRDIFF_MAX +- nl_langinfo wrongly returned NULL instead of "" for invalid items +- out-of-bounds dynamic tls allocation due to pointer/index scaling error +- getifaddrs misreported point-to-point interface addresses +- tdelete left tsearch trees misbalanced +- tsearch crashed on allocation failure +- tsearch, tfind, and tdelete failed to handle null pointer input +- passing signal number 0 to sigaction resulted in a crash +- getdelim updated caller's size wrongly when realloc failed +- getdelim realloc strategy was wasteful +- if_nametoindex returned wrong value on failure +- missing ssp-suppression for some source files called from early-init +- various minor resolv.conf parsing bugs +- fwrite wrongly reported success on write errors in line-buffered flush +- fwrite and fread wrongly returned nmemb (not 0) when size was 0 + +nommu-specific bugs fix: +- failure to zero bss in FDPIC shared library loader +- unsafe writes to read-only file mapping in non-FDPIC library loader + +arch-specific bugs fixed: +- sh[eb]-nofpu-fdpic was using fpu-dependent setjmp/longjmp variants +- dynamic linker path file name was wrong for arm "softfp" targets +- mips siginfo_t and related macros were defined incorrectly +- possibly misaligned pointer globals on arm (from an asm source file) +- mips dynamic linker failed to provide info needed by debugger +- mips cancellation asm wrongly assumed validity of $gp register value From 10a17dfbad2c267d885817abc9c7589fc7ff630b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 16 Feb 2016 13:26:16 -0500 Subject: [PATCH 049/412] fix assumption in fputs that fwrite returning 0 implies an error internally, the idiom of passing nmemb=1 to fwrite and interpreting the return value of fwrite (which is necessarily 0 or 1) as failure/success is fairly widely used. this is not correct, however, when the size argument is unknown and may be zero, since C requires fwrite to return 0 in that special case. previously fwrite always returned nmemb on success, but this was changed for conformance with ISO C by commit 500c6886c654fd45e4926990fee2c61d816be197. --- src/stdio/fputs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stdio/fputs.c b/src/stdio/fputs.c index 4737f448..1cf344f2 100644 --- a/src/stdio/fputs.c +++ b/src/stdio/fputs.c @@ -3,7 +3,8 @@ int fputs(const char *restrict s, FILE *restrict f) { - return (int)fwrite(s, strlen(s), 1, f) - 1; + size_t l = strlen(s); + return (fwrite(s, 1, l, f)==l) - 1; } weak_alias(fputs, fputs_unlocked); From ef2b5e9f13a7f216d6d64aeccc6b33c1262faece Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 16 Feb 2016 13:27:24 -0500 Subject: [PATCH 050/412] fix unlikely corner cases in getopt's message printing like fputs (see commit 10a17dfbad2c267d885817abc9c7589fc7ff630b), the message printing code for getopt assumed that fwrite only returns 0 on failure, but it can also happen on success if the total length to be written is zero. programs with zero-length argv[0] were affected. commit 500c6886c654fd45e4926990fee2c61d816be197 introduced this problem in getopt by fixing the fwrite behavior to conform to the requirements of ISO C. previously the wrong expectations of the getopt code were met by the fwrite implementation. --- src/misc/getopt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/getopt.c b/src/misc/getopt.c index 92179830..8290aef7 100644 --- a/src/misc/getopt.c +++ b/src/misc/getopt.c @@ -17,9 +17,9 @@ void __getopt_msg(const char *a, const char *b, const char *c, size_t l) FILE *f = stderr; b = __lctrans_cur(b); flockfile(f); - fwrite(a, strlen(a), 1, f) + fputs(a, f)>=0 && fwrite(b, strlen(b), 1, f) - && fwrite(c, l, 1, f) + && fwrite(c, 1, l, f)==l && putc('\n', f); funlockfile(f); } From cf115059ba0ecd611008c89c78c37b62f8e6d6af Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 16 Feb 2016 17:38:07 -0500 Subject: [PATCH 051/412] in crypt-sha*, reject excessive rounds as error rather than clamping the reference implementation clamps rounds to [1000,999999999]. we further limited rounds to at most 9999999 as a defense against extreme run times, but wrongly clamped instead of treating out-of-bounds values as an error, thereby producing implementation-specific hash results. fixing this should not break anything since values of rounds this high are not useful anyway. --- src/crypt/crypt_sha256.c | 2 +- src/crypt/crypt_sha512.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypt/crypt_sha256.c b/src/crypt/crypt_sha256.c index d5f0b786..e885dc68 100644 --- a/src/crypt/crypt_sha256.c +++ b/src/crypt/crypt_sha256.c @@ -230,7 +230,7 @@ static char *sha256crypt(const char *key, const char *setting, char *output) if (u < ROUNDS_MIN) r = ROUNDS_MIN; else if (u > ROUNDS_MAX) - r = ROUNDS_MAX; + return 0; else r = u; /* needed when rounds is zero prefixed or out of bounds */ diff --git a/src/crypt/crypt_sha512.c b/src/crypt/crypt_sha512.c index 1294e98b..39970caf 100644 --- a/src/crypt/crypt_sha512.c +++ b/src/crypt/crypt_sha512.c @@ -252,7 +252,7 @@ static char *sha512crypt(const char *key, const char *setting, char *output) if (u < ROUNDS_MIN) r = ROUNDS_MIN; else if (u > ROUNDS_MAX) - r = ROUNDS_MAX; + return 0; else r = u; /* needed when rounds is zero prefixed or out of bounds */ From 80fbaac4cd1930e9545a5d36bf46ae49011d2ce8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 17 Feb 2016 13:53:54 -0500 Subject: [PATCH 052/412] make configure attempt to catch broken floating point CFLAGS/defaults --- configure | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure b/configure index 248c4500..779a3ef0 100755 --- a/configure +++ b/configure @@ -655,6 +655,16 @@ printf "no\n" fail "$0: error: unsupported long double type" fi +# +# Some build systems globally pass in broken CFLAGS like -ffast-math +# for all packages. On recent GCC we can detect this and error out +# early rather than producing a seriously-broken math library. +# +if trycppif "__FAST_MATH__ || (defined(__GCC_IEC_559) && __GCC_IEC_559==0)" \ + "$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" ; then +fail "$0: error: compiler has broken floating point; check CFLAGS" +fi + printf "creating config.mak... " cmdline=$(quote "$0") From 63bcda4d8f4074e9d92ae156afd0dced6e64eb65 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 17 Feb 2016 13:56:27 -0500 Subject: [PATCH 053/412] adjust makefile to make crt/ and ldso/ sources arch-replaceable prior to commit 2f853dd6b9a95d5b13ee8f9df762125e0588df5d which overhauled the makefile for out-of-tree builds, crt/*.c files were replaceable by crt/$(ARCH)/*.s, and top-level ldso/ did not exist (its files were under src/ldso). since then, crti.o and crtn.o have been hard-coded as arch-specific, but none of the other files in crt/ or ldso/ were replaceable at all. in preparation for easy integration with midipix, which has a port of musl to windows, it needs to be possible to override the ELF-specific code in these files. making the same arch-replacements system work throughout the whole source tree also improves consistency and removes the need for some file-specific rules (crti.o and crtn.o) in the makefile. --- Makefile | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index b2a719db..6daf2c45 100644 --- a/Makefile +++ b/Makefile @@ -17,16 +17,22 @@ includedir = $(prefix)/include libdir = $(prefix)/lib syslibdir = /lib -BASE_SRCS = $(sort $(wildcard $(srcdir)/src/*/*.c)) +SRC_DIRS = $(addprefix $(srcdir)/,src/* crt ldso) +BASE_GLOBS = $(addsuffix /*.c,$(SRC_DIRS)) +ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS)) +BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS))) +ARCH_SRCS = $(sort $(wildcard $(ARCH_GLOBS))) BASE_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(BASE_SRCS))) -ARCH_SRCS = $(wildcard $(srcdir)/src/*/$(ARCH)/*.[csS]) ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS))) REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS))) -LDSO_SRCS = $(sort $(wildcard $(srcdir)/ldso/*.c)) -LDSO_OBJS = $(patsubst $(srcdir)/%,obj/%.lo,$(basename $(LDSO_SRCS))) -OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS)))) -AOBJS = $(OBJS) -LOBJS = $(OBJS:.o=.lo) +ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS)))) + +LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) +LDSO_OBJS = $(filter obj/ldso/%,$(ALL_OBJS:%.o=%.lo)) +CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS)) + +AOBJS = $(LIBC_OBJS) +LOBJS = $(LIBC_OBJS:.o=.lo) GENH = obj/include/bits/alltypes.h GENH_INT = obj/src/internal/version.h IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h) @@ -76,9 +82,9 @@ endif all: $(ALL_LIBS) $(ALL_TOOLS) -OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(OBJS) $(LDSO_OBJS) $(GENH) $(GENH_INT))) $(addprefix obj/, crt crt/$(ARCH) include)) +OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(GENH) $(GENH_INT))) obj/include) -$(ALL_LIBS) $(ALL_TOOLS) $(CRT_LIBS:lib/%=obj/crt/%) $(OBJS) $(LOBJS) $(GENH) $(GENH_INT): | $(OBJ_DIRS) +$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS) $(OBJ_DIRS): mkdir -p $@ @@ -126,7 +132,7 @@ NOSSP_SRCS = $(wildcard crt/*.c) \ ldso/dlstart.c ldso/dynlink.c $(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) -$(CRT_LIBS:lib/%=obj/crt/%): CFLAGS_ALL += -DCRT +$(CRT_OBJS): CFLAGS_ALL += -DCRT $(LOBJS) $(LDSO_OBJS): CFLAGS_ALL += -fPIC @@ -170,15 +176,12 @@ $(EMPTY_LIBS): rm -f $@ $(AR) rc $@ +lib/%.o: obj/crt/$(ARCH)/%.o + cp $< $@ + lib/%.o: obj/crt/%.o cp $< $@ -lib/crti.o: obj/crt/$(ARCH)/crti.o - cp $< $@ - -lib/crtn.o: obj/crt/$(ARCH)/crtn.o - cp $< $@ - lib/musl-gcc.specs: $(srcdir)/tools/musl-gcc.specs.sh config.mak sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@ From 157e28492a287907fb6f3d39894c2c1b84122b51 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 17 Feb 2016 16:11:45 -0500 Subject: [PATCH 054/412] support clean/distclean make targets in unconfigured tree commit 2f853dd6b9a95d5b13ee8f9df762125e0588df5d moved the error handling for $(ARCH) not being set such that it applied to all targets, including clean and distclean. previously these targets worked even in an unconfigured tree. to restore the old behavior, make most of the makefile body conditional on $(ARCH) being set/non-empty and produce the error via a fake "all" target in the conditional branch for the case where $(ARCH) is empty. --- Makefile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 6daf2c45..3e656d26 100644 --- a/Makefile +++ b/Makefile @@ -77,8 +77,12 @@ LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1 -include config.mak ifeq ($(ARCH),) -$(error Please set ARCH in config.mak before running make.) -endif + +all: + @echo "Please set ARCH in config.mak before running make." + @exit 1 + +else all: $(ALL_LIBS) $(ALL_TOOLS) @@ -89,14 +93,6 @@ $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS): mkdir -p $@ -install: install-libs install-headers install-tools - -clean: - rm -rf obj lib - -distclean: clean - rm -f config.mak - obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@ @@ -223,10 +219,20 @@ install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%) install-tools: $(ALL_TOOLS:obj/%=$(DESTDIR)$(bindir)/%) +install: install-libs install-headers install-tools + musl-git-%.tar.gz: .git git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ $(patsubst musl-git-%.tar.gz,%,$@) musl-%.tar.gz: .git git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ v$(patsubst musl-%.tar.gz,%,$@) +endif + +clean: + rm -rf obj lib + +distclean: clean + rm -f config.mak + .PHONY: all clean install install-libs install-headers install-tools From 5030e4a0605707c3f84c04c70ac689ca6ee54ffd Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 18 Feb 2016 04:09:33 +0000 Subject: [PATCH 055/412] partly revert detection of broken float in configure commit 80fbaac4cd1930e9545a5d36bf46ae49011d2ce8 broke all soft-float archs, where gcc defines __GCC_IEC_559==0 because rounding modes and exception flags are not supported. for now, just check for __FAST_MATH__ as an indication of broken float. this won't detect all possible misconfigurations but it probably catches the most common one. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 779a3ef0..0e365856 100755 --- a/configure +++ b/configure @@ -660,7 +660,7 @@ fi # for all packages. On recent GCC we can detect this and error out # early rather than producing a seriously-broken math library. # -if trycppif "__FAST_MATH__ || (defined(__GCC_IEC_559) && __GCC_IEC_559==0)" \ +if trycppif "__FAST_MATH__" \ "$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" ; then fail "$0: error: compiler has broken floating point; check CFLAGS" fi From 2d0290debf28d9fddd3f1807fe12b1c64f96ab23 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 18 Feb 2016 04:13:05 +0000 Subject: [PATCH 056/412] fix regression in SH/FDPIC dynamic linker the dynamic linker was found to hang when used as the PT_INTERP, but not when invoked as a command. the mechanism of this failure was not determined, but the cause is clear: commit 5552ce52000855906a5cb4f08f2e456573cca51f removed the SHARED macro, but arch/sh/crt_arch.h is still using it to choose the right form of the crt/ldso entry point code. moving the forced definition from rcrt1.c to dlstart.c restores the old behavior. eventually the logic should be changed to fully remove the SHARED macro or at least rename it to something more reasonable. --- crt/rcrt1.c | 1 - ldso/dlstart.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crt/rcrt1.c b/crt/rcrt1.c index e763d0ab..be017153 100644 --- a/crt/rcrt1.c +++ b/crt/rcrt1.c @@ -1,4 +1,3 @@ -#define SHARED #define START "_start" #define _dlstart_c _start_c #include "../ldso/dlstart.c" diff --git a/ldso/dlstart.c b/ldso/dlstart.c index 4482d525..4dbe1784 100644 --- a/ldso/dlstart.c +++ b/ldso/dlstart.c @@ -5,6 +5,8 @@ #define START "_dlstart" #endif +#define SHARED + #include "crt_arch.h" #ifndef GETFUNCSYM From 790580b2fc47bc20e613336cb937a120422a770c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 18 Feb 2016 15:14:15 -0500 Subject: [PATCH 057/412] update authors/contributors list these additions were made based on scanning commit authors since the last update, at the time of the 1.1.7 release, and adding everyone with either substantial code contributions or a pattern of ongoing simple patch submission. --- COPYRIGHT | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/COPYRIGHT b/COPYRIGHT index b1e62172..f7f1a1f2 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -25,6 +25,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Authors/contributors include: +Alex Dowad Alexander Monakov Anthony G. Basile Arvid Picciani @@ -33,29 +34,37 @@ Boris Brezillon Brent Cook Chris Spiegel Clément Vasseur +Daniel Micay Denys Vlasenko Emil Renner Berthing Felix Fietkau Felix Janda Gianluca Anzolin +Hauke Mehrtens Hiltjo Posthuma Isaac Dunham Jens Gustedt Jeremy Huntwork +Jo-Philipp Wich Joakim Sindholt John Spencer Josiah Worcester Justin Cormack +Khem Raj +Kylie McClain Luca Barbato Luka Perkov M Farkas-Dyck (Strake) Michael Forney +Natanael Copa Nicholas J. Kain orc Pascal Cuoq +Petr Hosek Pierre Carrier Rich Felker Richard Pennington +Shiz sin Solar Designer Stefan Kristiansson From ed97dfd979c054b8c598875410529077dad84c02 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 18 Feb 2016 23:53:03 +0000 Subject: [PATCH 058/412] improve macro logic for enabling arm math asm in order to take advantage of the fpu in -mfloat-abi=softfp mode, the __VFP_FP__ (presence of vfp fpu) was checked instead of checking for __ARM_PCS_VFP (hardfloat EABI variant). however, the latter macro is the one that's actually specified by the ABI documents rather than being compiler-specific, and should also be checked in case __VFP_FP__ is not defined on some compilers or some configurations. --- src/math/arm/sqrt.c | 2 +- src/math/arm/sqrtf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/arm/sqrt.c b/src/math/arm/sqrt.c index c9c00083..874af960 100644 --- a/src/math/arm/sqrt.c +++ b/src/math/arm/sqrt.c @@ -1,6 +1,6 @@ #include -#if __VFP_FP__ && !__SOFTFP__ +#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__) double sqrt(double x) { diff --git a/src/math/arm/sqrtf.c b/src/math/arm/sqrtf.c index e6576655..98858ecd 100644 --- a/src/math/arm/sqrtf.c +++ b/src/math/arm/sqrtf.c @@ -1,6 +1,6 @@ #include -#if __VFP_FP__ && !__SOFTFP__ +#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__) float sqrtf(float x) { From 71c334f951d9ffa4d8bdc71bdd49628e5ae4512b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 19 Feb 2016 01:20:07 +0000 Subject: [PATCH 059/412] work around regression building for armhf with clang (compiler bug) commit e4355bd6bec89688e8c739cd7b4c76e675643dca moved the math asm from external source files to inline asm, but unfortunately, all current releases of clang use the wrong inline asm constraint codes for float and double ("w" and "P" instead of "t" and "w", respectively). this patch adds detection for the bug in configure, and, for now, just disables the affected asm on broken clang versions. --- configure | 14 ++++++++++++++ src/math/arm/fabsf.c | 2 +- src/math/arm/sqrtf.c | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0e365856..5a92ea01 100755 --- a/configure +++ b/configure @@ -588,6 +588,20 @@ fi if test "$ARCH" = "arm" ; then trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf +# Versions of clang up until at least 3.8 have the wrong constraint codes +# for floating point operands to inline asm. Detect this so the affected +# source files can just disable the asm. +if test "$cc_family" = clang ; then +printf "checking whether clang's vfp asm constraints work... " +echo 'float f(float x) { __asm__("":"+t"(x)); return x; }' > "$tmpc" +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_VFP_ASM" +CFLAGS_AUTO="${CFLAGS_AUTO# }" +fi +fi fi if test "$ARCH" = "aarch64" ; then diff --git a/src/math/arm/fabsf.c b/src/math/arm/fabsf.c index 28153a61..4a217c98 100644 --- a/src/math/arm/fabsf.c +++ b/src/math/arm/fabsf.c @@ -1,6 +1,6 @@ #include -#if __ARM_PCS_VFP +#if __ARM_PCS_VFP && !BROKEN_VFP_ASM float fabsf(float x) { diff --git a/src/math/arm/sqrtf.c b/src/math/arm/sqrtf.c index 98858ecd..32693293 100644 --- a/src/math/arm/sqrtf.c +++ b/src/math/arm/sqrtf.c @@ -1,6 +1,6 @@ #include -#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__) +#if (__ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)) && !BROKEN_VFP_ASM float sqrtf(float x) { From 4c101e158a59eafb8adbfeabab13a8747e4a97cb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 19 Feb 2016 00:10:23 -0500 Subject: [PATCH 060/412] add arch tuple matching for nt32 and nt64 in configure the nt32 and nt64 archs will be provided by the midipix project for building musl on top of its posix-like syscall layer for windows. at present the needed arch files are in a separate repository, but having the tuple matching in the upstream configure script should make it possible to overlay the arch files without needing any further patching. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 5a92ea01..0955ce68 100755 --- a/configure +++ b/configure @@ -302,8 +302,10 @@ case "$target" in mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;; arm*) ARCH=arm ;; aarch64*) ARCH=aarch64 ;; +i?86-nt32*) ARCH=nt32 ;; i?86*) ARCH=i386 ;; x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; +x86_64-nt64*) ARCH=nt64 ;; x86_64*) ARCH=x86_64 ;; mips*) ARCH=mips ;; microblaze*) ARCH=microblaze ;; From 8b084f06d0e17a8814147c386042f19829aff961 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 19 Feb 2016 14:16:33 -0500 Subject: [PATCH 061/412] generate list of crt files to install instead of hard-coding in makefile this follows the principle of having the source tree layout define build semantics. it also makes it possible for crt/$(ARCH) to define additional installable files, which may be needed for midipix and other future targets. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3e656d26..ec54880d 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES: EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a) -CRT_LIBS = lib/crt1.o lib/Scrt1.o lib/rcrt1.o lib/crti.o lib/crtn.o +CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS))) STATIC_LIBS = lib/libc.a SHARED_LIBS = lib/libc.so TOOL_LIBS = lib/musl-gcc.specs From 074e6b3fe3f2ad89b991f3d8ab0932035b312a62 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 22 Feb 2016 00:07:05 -0500 Subject: [PATCH 062/412] release 1.1.14 --- VERSION | 2 +- WHATSNEW | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9ea63dbc..e9bc1499 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.13 +1.1.14 diff --git a/WHATSNEW b/WHATSNEW index 935c0bb3..62daa1c9 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1678,3 +1678,16 @@ arch-specific bugs fixed: - possibly misaligned pointer globals on arm (from an asm source file) - mips dynamic linker failed to provide info needed by debugger - mips cancellation asm wrongly assumed validity of $gp register value + + + +1.1.14 release notes + +regressions fixed: +- treatment of empty string argument as error by puts and fputs +- make clean and distclean failure in unconfigured trees +- sh/fdpic dynamic linker entry point hang due to wrong code +- armhf (and arm softfp model) build failure with clang + +other bugs fixed: +- wrongly clamping (rather than failing) excessive rounds in crypt-sha* From 225f6a6b5b7173b6655e4f5d49b5b9fea70bf3bb Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Mon, 22 Feb 2016 21:14:23 -0600 Subject: [PATCH 063/412] allow implementing a_cas_p with pointer-sized ll/sc No current ports do this, but it will be useful for porting to 64-bit ll/sc architectures, such as mips64 and powerpc64. --- src/internal/atomic.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/internal/atomic.h b/src/internal/atomic.h index 2097247e..6f37d252 100644 --- a/src/internal/atomic.h +++ b/src/internal/atomic.h @@ -82,6 +82,23 @@ static inline int a_fetch_or(volatile int *p, int v) #endif +#ifdef a_ll_p + +#ifndef a_cas_p +#define a_cas_p a_cas_p +static inline void *a_cas_p(volatile void *p, void *t, void *s) +{ + void *old; + a_pre_llsc(); + do old = a_ll_p(p); + while (old==t && !a_sc_p(p, s)); + a_post_llsc(); + return old; +} +#endif + +#endif + #ifndef a_cas #error missing definition of a_cas #endif @@ -209,6 +226,7 @@ static inline void a_or_64(volatile uint64_t *p, uint64_t v) #endif #ifndef a_cas_p +typedef char a_cas_p_undefined_but_pointer_not_32bit[-sizeof(char) == 0xffffffff ? 1 : -1]; #define a_cas_p a_cas_p static inline void *a_cas_p(volatile void *p, void *t, void *s) { From fd224a800b68843c4d8d1002b07dd91041a7fa32 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 23 Feb 2016 13:04:56 -0500 Subject: [PATCH 064/412] make aarch64 atomic_arch.h report that it defines pointer-sized ll/sc at present this is done only for consistency, since this file defines its own a_cas_p rather than using the new generic one from atomic.h added in commit 225f6a6b5b7173b6655e4f5d49b5b9fea70bf3bb. these definitions may however be useful if we ever need to add other pointer-sized atomic operations. --- arch/aarch64/atomic_arch.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/aarch64/atomic_arch.h b/arch/aarch64/atomic_arch.h index af93d879..8ab68c1c 100644 --- a/arch/aarch64/atomic_arch.h +++ b/arch/aarch64/atomic_arch.h @@ -34,6 +34,7 @@ static inline int a_cas(volatile int *p, int t, int s) return old; } +#define a_ll_p a_ll_p static inline void *a_ll_p(volatile void *p) { void *v; @@ -41,6 +42,7 @@ static inline void *a_ll_p(volatile void *p) return v; } +#define a_sc_p a_sc_p static inline int a_sc_p(volatile int *p, void *v) { int r; From 6d70c08a2c37745df637b231711f6dec79dbc6e1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 2 Mar 2016 00:34:51 -0500 Subject: [PATCH 065/412] handle non-matching address family entries in hosts file name_from_hosts failed to account for the possibility of an address family error from name_from_numeric, wrongly counting such a return as success and using the uninitialized address data as part of the results passed up to the caller. non-matching address family entries cannot simply be ignored or results would be inconsistent with respect to whether AF_UNSPEC or a specific address family is queried. instead, record that a non-matching entry was seen, and fail the lookup with EAI_NONAME of no matching-family entries are found. --- src/network/lookup_name.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index a26ad535..86f90ac1 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -49,7 +49,7 @@ static int name_from_hosts(struct address buf[static MAXADDRS], char canon[stati { char line[512]; size_t l = strlen(name); - int cnt = 0; + int cnt = 0, badfam = 0; unsigned char _buf[1032]; FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); if (!f) switch (errno) { @@ -71,8 +71,16 @@ static int name_from_hosts(struct address buf[static MAXADDRS], char canon[stati /* Isolate IP address to parse */ for (p=line; *p && !isspace(*p); p++); *p++ = 0; - if (name_from_numeric(buf+cnt, line, family)) + switch (name_from_numeric(buf+cnt, line, family)) { + case 1: cnt++; + break; + case 0: + continue; + default: + badfam = EAI_NONAME; + continue; + } /* Extract first name as canonical name */ for (; *p && isspace(*p); p++); @@ -81,7 +89,7 @@ static int name_from_hosts(struct address buf[static MAXADDRS], char canon[stati if (is_valid_hostname(p)) memcpy(canon, p, z-p+1); } __fclose_ca(f); - return cnt; + return cnt ? cnt : badfam; } struct dpc_ctx { From 6e694d6960d9d50a119e8660c95bf9308e609053 Mon Sep 17 00:00:00 2001 From: Michael Meeuwisse Date: Tue, 23 Feb 2016 23:49:57 +0100 Subject: [PATCH 066/412] explicitly include stdio.h to get EOF definition needed by wctob --- src/multibyte/wctob.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/multibyte/wctob.c b/src/multibyte/wctob.c index 4aeda6a1..b484a3fd 100644 --- a/src/multibyte/wctob.c +++ b/src/multibyte/wctob.c @@ -1,4 +1,5 @@ #include +#include #include #include "internal.h" From 39ea71fb8afddda879a1999f2a203dfdaf57a639 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 29 Feb 2016 15:04:46 +0000 Subject: [PATCH 067/412] fix * at the start of a BRE subexpression commit 7eaa76fc2e7993582989d3838b1ac32dd8abac09 made * invalid at the start of a BRE subexpression, but it should be accepted as literal * there according to the standard. This patch does not fix subexpressions starting with ^*. --- src/regex/regcomp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index da6abd18..7a2864cd 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -889,7 +889,6 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) s++; break; case '*': - return REG_BADPAT; case '{': case '+': case '?': @@ -978,9 +977,6 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) } parse_iter: - /* extension: repetitions are rejected after an empty node - eg. (+), |*, {2}, but assertions are not treated as empty - so ^* or $? are accepted currently. */ for (;;) { int min, max; From 29b13575376509bb21539711f30c1deaf0823033 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 29 Feb 2016 16:36:25 +0000 Subject: [PATCH 068/412] fix ^* at the start of a complete BRE This is a workaround to treat * as literal * at the start of a BRE. Ideally ^ would be treated as an anchor at the start of any BRE subexpression and similarly $ would be an anchor at the end of any subexpression. This is not required by the standard and hard to do with the current code, but it's the existing practice. If it is changed, * should be treated as literal after such anchor as well. --- src/regex/regcomp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 7a2864cd..5fad98b3 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -994,6 +994,10 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) if (*s=='\\') s++; + /* handle ^* at the start of a complete BRE. */ + if (!ere && s==ctx->re+1 && s[-1]=='^') + break; + /* extension: multiple consecutive *+?{,} is unspecified, but (a+)+ has to be supported so accepting a++ makes sense, note however that the RE_DUP_MAX limit can be From 98d335735d64ee34a34cb9c08ea2cb51a076d2a1 Mon Sep 17 00:00:00 2001 From: Nathan Zadoks Date: Wed, 2 Mar 2016 17:26:26 +0100 Subject: [PATCH 069/412] add sched_getcpu This is a GNU extension, but a fairly minor one, for a system call that otherwise has no libc wrapper. --- include/sched.h | 1 + src/sched/sched_getcpu.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/sched/sched_getcpu.c diff --git a/include/sched.h b/include/sched.h index 3e34a72c..7e88f097 100644 --- a/include/sched.h +++ b/include/sched.h @@ -76,6 +76,7 @@ void free(void *); typedef struct cpu_set_t { unsigned long __bits[128/sizeof(long)]; } cpu_set_t; int __sched_cpucount(size_t, const cpu_set_t *); +int sched_getcpu(void); int sched_getaffinity(pid_t, size_t, cpu_set_t *); int sched_setaffinity(pid_t, size_t, const cpu_set_t *); diff --git a/src/sched/sched_getcpu.c b/src/sched/sched_getcpu.c new file mode 100644 index 00000000..760e4d5b --- /dev/null +++ b/src/sched/sched_getcpu.c @@ -0,0 +1,13 @@ +#define _GNU_SOURCE +#include +#include "syscall.h" + +int sched_getcpu(void) +{ + int r; + unsigned cpu; + + r = __syscall(SYS_getcpu, &cpu, 0, 0); + if (!r) return cpu; + return __syscall_ret(r); +} From db66ef1f7db7c5b672591a97a97bc789c9efe2f3 Mon Sep 17 00:00:00 2001 From: Nathan Zadoks Date: Wed, 2 Mar 2016 17:26:27 +0100 Subject: [PATCH 070/412] add sched_getcpu vDSO support This brings the call to an actually usable speed. Quick unscientific benchmark: 14ns : 102ns :: vDSO : syscall --- arch/x86_64/syscall_arch.h | 2 ++ src/sched/sched_getcpu.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/arch/x86_64/syscall_arch.h b/arch/x86_64/syscall_arch.h index a7a7b5a6..54e05ff6 100644 --- a/arch/x86_64/syscall_arch.h +++ b/arch/x86_64/syscall_arch.h @@ -64,3 +64,5 @@ static __inline long __syscall6(long n, long a1, long a2, long a3, long a4, long #define VDSO_USEFUL #define VDSO_CGT_SYM "__vdso_clock_gettime" #define VDSO_CGT_VER "LINUX_2.6" +#define VDSO_GETCPU_SYM "__vdso_getcpu" +#define VDSO_GETCPU_VER "LINUX_2.6" diff --git a/src/sched/sched_getcpu.c b/src/sched/sched_getcpu.c index 760e4d5b..e08cfdf1 100644 --- a/src/sched/sched_getcpu.c +++ b/src/sched/sched_getcpu.c @@ -1,12 +1,43 @@ #define _GNU_SOURCE +#include #include #include "syscall.h" +#include "atomic.h" + +#ifdef VDSO_GETCPU_SYM + +void *__vdsosym(const char *, const char *); + +static void *volatile vdso_func; + +typedef long (*getcpu_f)(unsigned *, unsigned *, void *); + +static long getcpu_init(unsigned *cpu, unsigned *node, void *unused) +{ + void *p = __vdsosym(VDSO_GETCPU_VER, VDSO_GETCPU_SYM); + getcpu_f f = (getcpu_f)p; + a_cas_p(&vdso_func, (void *)getcpu_init, p); + return f ? f(cpu, node, unused) : -ENOSYS; +} + +static void *volatile vdso_func = (void *)getcpu_init; + +#endif int sched_getcpu(void) { int r; unsigned cpu; +#ifdef VDSO_GETCPU_SYM + getcpu_f f = (getcpu_f)vdso_func; + if (f) { + r = f(&cpu, 0, 0); + if (!r) return cpu; + if (r != -ENOSYS) return __syscall_ret(r); + } +#endif + r = __syscall(SYS_getcpu, &cpu, 0, 0); if (!r) return cpu; return __syscall_ret(r); From b023c03b574acdfd73418314a5dcaa83e5cea5a0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 4 Mar 2016 21:23:33 +0000 Subject: [PATCH 071/412] math: fix expf(-NAN) and exp2f(-NAN) to return -NAN instead of 0 expf(-NAN) was treated as expf(-large) which unconditionally returns +0, so special case +-NAN. reported by Petr Hosek. --- src/math/exp2f.c | 2 ++ src/math/expf.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/math/exp2f.c b/src/math/exp2f.c index cf6126ee..296b6343 100644 --- a/src/math/exp2f.c +++ b/src/math/exp2f.c @@ -91,6 +91,8 @@ float exp2f(float x) /* Filter out exceptional cases. */ ix = u.i & 0x7fffffff; if (ix > 0x42fc0000) { /* |x| > 126 */ + if (ix > 0x7f800000) /* NaN */ + return x; if (u.i >= 0x43000000 && u.i < 0x80000000) { /* x >= 128 */ x *= 0x1p127f; return x; diff --git a/src/math/expf.c b/src/math/expf.c index 16e9afe6..feee2b0e 100644 --- a/src/math/expf.c +++ b/src/math/expf.c @@ -39,6 +39,8 @@ float expf(float x) /* special cases */ if (hx >= 0x42aeac50) { /* if |x| >= -87.33655f or NaN */ + if (hx > 0x7f800000) /* NaN */ + return x; if (hx >= 0x42b17218 && !sign) { /* x >= 88.722839f */ /* overflow */ x *= 0x1p127f; From 71392a91c333d47b6b3c8f99c897e3b5a7eb6d58 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 6 Mar 2016 17:25:52 +0000 Subject: [PATCH 072/412] generalize mips-specific reloc code not to hard-code sym/type encoding this change is made in preparation for adding the mips64 port, which needs a 64-bit (and mips64-specific) form of the R_INFO macro, but it's a better abstraction anyway. based on part of the mips64 port patch by Mahesh Bodapati and Jaydeep Patil of Imagination Technologies. --- ldso/dynlink.c | 2 +- src/internal/dynlink.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 87f3b7f8..e458f386 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1134,7 +1134,7 @@ static void do_mips_relocs(struct dso *p, size_t *got) Sym *sym = p->syms + j; rel[0] = (unsigned char *)got - base; for (i-=j; i; i--, sym++, rel[0]+=sizeof(size_t)) { - rel[1] = sym-p->syms << 8 | R_MIPS_JUMP_SLOT; + rel[1] = R_INFO(sym-p->syms, R_MIPS_JUMP_SLOT); do_relocs(p, rel, sizeof rel, 2); } } diff --git a/src/internal/dynlink.h b/src/internal/dynlink.h index 48890b2d..5717627a 100644 --- a/src/internal/dynlink.h +++ b/src/internal/dynlink.h @@ -11,12 +11,14 @@ typedef Elf32_Phdr Phdr; typedef Elf32_Sym Sym; #define R_TYPE(x) ((x)&255) #define R_SYM(x) ((x)>>8) +#define R_INFO ELF32_R_INFO #else typedef Elf64_Ehdr Ehdr; typedef Elf64_Phdr Phdr; typedef Elf64_Sym Sym; #define R_TYPE(x) ((x)&0x7fffffff) #define R_SYM(x) ((x)>>32) +#define R_INFO ELF64_R_INFO #endif /* These enum constants provide unmatchable default values for From 83933573aff71a5d178ab71912f177d2d844e63e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 6 Mar 2016 17:41:56 +0000 Subject: [PATCH 073/412] add mips64 port patch by Mahesh Bodapati and Jaydeep Patil of Imagination Technologies. --- arch/mips64/atomic_arch.h | 50 +++ arch/mips64/bits/alltypes.h.in | 28 ++ arch/mips64/bits/endian.h | 5 + arch/mips64/bits/errno.h | 134 +++++++ arch/mips64/bits/fcntl.h | 40 ++ arch/mips64/bits/fenv.h | 25 ++ arch/mips64/bits/float.h | 16 + arch/mips64/bits/ioctl.h | 210 +++++++++++ arch/mips64/bits/ipc.h | 14 + arch/mips64/bits/limits.h | 7 + arch/mips64/bits/mman.h | 58 +++ arch/mips64/bits/msg.h | 13 + arch/mips64/bits/poll.h | 2 + arch/mips64/bits/posix.h | 2 + arch/mips64/bits/reg.h | 47 +++ arch/mips64/bits/resource.h | 5 + arch/mips64/bits/sem.h | 14 + arch/mips64/bits/setjmp.h | 1 + arch/mips64/bits/shm.h | 24 ++ arch/mips64/bits/signal.h | 143 ++++++++ arch/mips64/bits/socket.h | 68 ++++ arch/mips64/bits/stat.h | 23 ++ arch/mips64/bits/statfs.h | 8 + arch/mips64/bits/stdint.h | 20 + arch/mips64/bits/syscall.h | 633 ++++++++++++++++++++++++++++++++ arch/mips64/bits/termios.h | 166 +++++++++ arch/mips64/bits/user.h | 15 + arch/mips64/crt_arch.h | 33 ++ arch/mips64/ksigaction.h | 8 + arch/mips64/pthread_arch.h | 18 + arch/mips64/reloc.h | 60 +++ arch/mips64/syscall_arch.h | 281 ++++++++++++++ configure | 8 +- crt/mips64/crti.s | 17 + crt/mips64/crtn.s | 13 + src/fenv/mips64/fenv-sf.c | 3 + src/fenv/mips64/fenv.S | 71 ++++ src/internal/mips64/syscall.s | 19 + src/ldso/mips64/dlsym.s | 17 + src/setjmp/mips64/longjmp.S | 37 ++ src/setjmp/mips64/setjmp.S | 34 ++ src/signal/mips64/restore.s | 9 + src/signal/mips64/sigsetjmp.s | 38 ++ src/thread/mips64/__unmapself.s | 9 + src/thread/mips64/clone.s | 30 ++ src/thread/mips64/syscall_cp.s | 52 +++ src/unistd/mips64/pipe.s | 19 + 47 files changed, 2546 insertions(+), 1 deletion(-) create mode 100644 arch/mips64/atomic_arch.h create mode 100644 arch/mips64/bits/alltypes.h.in create mode 100644 arch/mips64/bits/endian.h create mode 100644 arch/mips64/bits/errno.h create mode 100644 arch/mips64/bits/fcntl.h create mode 100644 arch/mips64/bits/fenv.h create mode 100644 arch/mips64/bits/float.h create mode 100644 arch/mips64/bits/ioctl.h create mode 100644 arch/mips64/bits/ipc.h create mode 100644 arch/mips64/bits/limits.h create mode 100644 arch/mips64/bits/mman.h create mode 100644 arch/mips64/bits/msg.h create mode 100644 arch/mips64/bits/poll.h create mode 100644 arch/mips64/bits/posix.h create mode 100644 arch/mips64/bits/reg.h create mode 100644 arch/mips64/bits/resource.h create mode 100644 arch/mips64/bits/sem.h create mode 100644 arch/mips64/bits/setjmp.h create mode 100644 arch/mips64/bits/shm.h create mode 100644 arch/mips64/bits/signal.h create mode 100644 arch/mips64/bits/socket.h create mode 100644 arch/mips64/bits/stat.h create mode 100644 arch/mips64/bits/statfs.h create mode 100644 arch/mips64/bits/stdint.h create mode 100644 arch/mips64/bits/syscall.h create mode 100644 arch/mips64/bits/termios.h create mode 100644 arch/mips64/bits/user.h create mode 100644 arch/mips64/crt_arch.h create mode 100644 arch/mips64/ksigaction.h create mode 100644 arch/mips64/pthread_arch.h create mode 100644 arch/mips64/reloc.h create mode 100644 arch/mips64/syscall_arch.h create mode 100644 crt/mips64/crti.s create mode 100644 crt/mips64/crtn.s create mode 100644 src/fenv/mips64/fenv-sf.c create mode 100644 src/fenv/mips64/fenv.S create mode 100644 src/internal/mips64/syscall.s create mode 100644 src/ldso/mips64/dlsym.s create mode 100644 src/setjmp/mips64/longjmp.S create mode 100644 src/setjmp/mips64/setjmp.S create mode 100644 src/signal/mips64/restore.s create mode 100644 src/signal/mips64/sigsetjmp.s create mode 100644 src/thread/mips64/__unmapself.s create mode 100644 src/thread/mips64/clone.s create mode 100644 src/thread/mips64/syscall_cp.s create mode 100644 src/unistd/mips64/pipe.s diff --git a/arch/mips64/atomic_arch.h b/arch/mips64/atomic_arch.h new file mode 100644 index 00000000..49d9884a --- /dev/null +++ b/arch/mips64/atomic_arch.h @@ -0,0 +1,50 @@ +#define a_ll a_ll +static inline int a_ll(volatile int *p) +{ + int v; + __asm__ __volatile__ ( + "ll %0, %1" + : "=r"(v) : "m"(*p)); + return v; +} + +#define a_sc a_sc +static inline int a_sc(volatile int *p, int v) +{ + int r; + __asm__ __volatile__ ( + "sc %0, %1" + : "=r"(r), "=m"(*p) : "0"(v) : "memory"); + return r; +} + +#define a_ll_p a_ll_p +static inline void *a_ll_p(volatile long *p) +{ + void *v; + __asm__ __volatile__ ( + "lld %0, %1" + : "=r"(v) : "m"(*p)); + return v; +} + +#define a_sc_p a_sc_p +static inline int a_sc_p(volatile long *p, void *v) +{ + int r; + __asm__ __volatile__ ( + "scd %0, %1" + : "=r"(r), "=m"(*p) : "0"(v) : "memory"); + return r; +} + +#define a_barrier a_barrier +static inline void a_barrier() +{ + /* mips2 sync, but using too many directives causes + * gcc not to inline it, so encode with .long instead. */ + __asm__ __volatile__ (".long 0xf" : : : "memory"); +} + +#define a_pre_llsc a_barrier +#define a_post_llsc a_barrier diff --git a/arch/mips64/bits/alltypes.h.in b/arch/mips64/bits/alltypes.h.in new file mode 100644 index 00000000..2b2e34a8 --- /dev/null +++ b/arch/mips64/bits/alltypes.h.in @@ -0,0 +1,28 @@ +#define _Addr long +#define _Int64 long +#define _Reg long + +TYPEDEF __builtin_va_list va_list; +TYPEDEF __builtin_va_list __isoc_va_list; + +#ifndef __cplusplus +TYPEDEF int wchar_t; +#endif + +TYPEDEF float float_t; +TYPEDEF double double_t; + +TYPEDEF struct { long long __ll; long double __ld; } max_align_t; + +TYPEDEF long time_t; +TYPEDEF long suseconds_t; + +TYPEDEF unsigned nlink_t; + +TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; +TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; +TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; +TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/arch/mips64/bits/endian.h b/arch/mips64/bits/endian.h new file mode 100644 index 00000000..5399dcb5 --- /dev/null +++ b/arch/mips64/bits/endian.h @@ -0,0 +1,5 @@ +#if _MIPSEL || __MIPSEL || __MIPSEL__ +#define __BYTE_ORDER __LITTLE_ENDIAN +#else +#define __BYTE_ORDER __BIG_ENDIAN +#endif diff --git a/arch/mips64/bits/errno.h b/arch/mips64/bits/errno.h new file mode 100644 index 00000000..1bb91e3d --- /dev/null +++ b/arch/mips64/bits/errno.h @@ -0,0 +1,134 @@ +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define ENOTBLK 15 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define EINVAL 22 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define ETXTBSY 26 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 +#define EDOM 33 +#define ERANGE 34 +#define ENOMSG 35 +#define EIDRM 36 +#define ECHRNG 37 +#define EL2NSYNC 38 +#define EL3HLT 39 +#define EL3RST 40 +#define ELNRNG 41 +#define EUNATCH 42 +#define ENOCSI 43 +#define EL2HLT 44 +#define EDEADLK 45 +#define ENOLCK 46 +#define EBADE 50 +#define EBADR 51 +#define EXFULL 52 +#define ENOANO 53 +#define EBADRQC 54 +#define EBADSLT 55 +#define EDEADLOCK 56 +#define EBFONT 59 +#define ENOSTR 60 +#define ENODATA 61 +#define ETIME 62 +#define ENOSR 63 +#define ENONET 64 +#define ENOPKG 65 +#define EREMOTE 66 +#define ENOLINK 67 +#define EADV 68 +#define ESRMNT 69 +#define ECOMM 70 +#define EPROTO 71 +#define EDOTDOT 73 +#define EMULTIHOP 74 +#define EBADMSG 77 +#define ENAMETOOLONG 78 +#define EOVERFLOW 79 +#define ENOTUNIQ 80 +#define EBADFD 81 +#define EREMCHG 82 +#define ELIBACC 83 +#define ELIBBAD 84 +#define ELIBSCN 85 +#define ELIBMAX 86 +#define ELIBEXEC 87 +#define EILSEQ 88 +#define ENOSYS 89 +#define ELOOP 90 +#define ERESTART 91 +#define ESTRPIPE 92 +#define ENOTEMPTY 93 +#define EUSERS 94 +#define ENOTSOCK 95 +#define EDESTADDRREQ 96 +#define EMSGSIZE 97 +#define EPROTOTYPE 98 +#define ENOPROTOOPT 99 +#define EPROTONOSUPPORT 120 +#define ESOCKTNOSUPPORT 121 +#define EOPNOTSUPP 122 +#define ENOTSUP EOPNOTSUPP +#define EPFNOSUPPORT 123 +#define EAFNOSUPPORT 124 +#define EADDRINUSE 125 +#define EADDRNOTAVAIL 126 +#define ENETDOWN 127 +#define ENETUNREACH 128 +#define ENETRESET 129 +#define ECONNABORTED 130 +#define ECONNRESET 131 +#define ENOBUFS 132 +#define EISCONN 133 +#define ENOTCONN 134 +#define EUCLEAN 135 +#define ENOTNAM 137 +#define ENAVAIL 138 +#define EISNAM 139 +#define EREMOTEIO 140 +#define ESHUTDOWN 143 +#define ETOOMANYREFS 144 +#define ETIMEDOUT 145 +#define ECONNREFUSED 146 +#define EHOSTDOWN 147 +#define EHOSTUNREACH 148 +#define EWOULDBLOCK EAGAIN +#define EALREADY 149 +#define EINPROGRESS 150 +#define ESTALE 151 +#define ECANCELED 158 +#define ENOMEDIUM 159 +#define EMEDIUMTYPE 160 +#define ENOKEY 161 +#define EKEYEXPIRED 162 +#define EKEYREVOKED 163 +#define EKEYREJECTED 164 +#define EOWNERDEAD 165 +#define ENOTRECOVERABLE 166 +#define ERFKILL 167 +#define EHWPOISON 168 +#define EDQUOT 1133 diff --git a/arch/mips64/bits/fcntl.h b/arch/mips64/bits/fcntl.h new file mode 100644 index 00000000..3bcec15e --- /dev/null +++ b/arch/mips64/bits/fcntl.h @@ -0,0 +1,40 @@ +#define O_CREAT 0400 +#define O_EXCL 02000 +#define O_NOCTTY 04000 +#define O_TRUNC 01000 +#define O_APPEND 0010 +#define O_NONBLOCK 0200 +#define O_DSYNC 0020 +#define O_SYNC 040020 +#define O_RSYNC 040020 +#define O_DIRECTORY 0200000 +#define O_NOFOLLOW 0400000 +#define O_CLOEXEC 02000000 + +#define O_ASYNC 010000 +#define O_DIRECT 0100000 +#define O_LARGEFILE 0 +#define O_NOATIME 01000000 +#define O_PATH 010000000 +#define O_TMPFILE 020200000 +#define O_NDELAY O_NONBLOCK + +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_SETFD 2 +#define F_GETFL 3 +#define F_SETFL 4 + +#define F_SETOWN 24 +#define F_GETOWN 23 +#define F_SETSIG 10 +#define F_GETSIG 11 + +#define F_GETLK 14 +#define F_SETLK 6 +#define F_SETLKW 7 + +#define F_SETOWN_EX 15 +#define F_GETOWN_EX 16 + +#define F_GETOWNER_UIDS 17 diff --git a/arch/mips64/bits/fenv.h b/arch/mips64/bits/fenv.h new file mode 100644 index 00000000..27620896 --- /dev/null +++ b/arch/mips64/bits/fenv.h @@ -0,0 +1,25 @@ +#ifdef __mips_soft_float +#define FE_ALL_EXCEPT 0 +#define FE_TONEAREST 0 +#else +#define FE_INEXACT 4 +#define FE_UNDERFLOW 8 +#define FE_OVERFLOW 16 +#define FE_DIVBYZERO 32 +#define FE_INVALID 64 + +#define FE_ALL_EXCEPT 124 + +#define FE_TONEAREST 0 +#define FE_TOWARDZERO 1 +#define FE_UPWARD 2 +#define FE_DOWNWARD 3 +#endif + +typedef unsigned short fexcept_t; + +typedef struct { + unsigned __cw; +} fenv_t; + +#define FE_DFL_ENV ((const fenv_t *) -1) diff --git a/arch/mips64/bits/float.h b/arch/mips64/bits/float.h new file mode 100644 index 00000000..719c7908 --- /dev/null +++ b/arch/mips64/bits/float.h @@ -0,0 +1,16 @@ +#define FLT_EVAL_METHOD 0 + +#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L +#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L +#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L +#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L + +#define LDBL_MANT_DIG 113 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MAX_EXP 16384 + +#define LDBL_DIG 33 +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_10_EXP 4932 + +#define DECIMAL_DIG 36 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h new file mode 100644 index 00000000..041be560 --- /dev/null +++ b/arch/mips64/bits/ioctl.h @@ -0,0 +1,210 @@ +#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) ) +#define _IOC_NONE 1U +#define _IOC_READ 2U +#define _IOC_WRITE 4U + +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) + +#define TCGETA 0x5401 +#define TCSETA 0x5402 +#define TCSETAW 0x5403 +#define TCSETAF 0x5404 +#define TCSBRK 0x5405 +#define TCXONC 0x5406 +#define TCFLSH 0x5407 +#define TCGETS 0x540D +#define TCSETS 0x540E +#define TCSETSW 0x540F +#define TCSETSF 0x5410 + +#define TIOCEXCL 0x740D +#define TIOCNXCL 0x740E +#define TIOCOUTQ 0x7472 +#define TIOCSTI 0x5472 +#define TIOCMGET 0x741D +#define TIOCMBIS 0x741B +#define TIOCMBIC 0x741C +#define TIOCMSET 0x741D + +#define TIOCPKT 0x5470 +#define TIOCSWINSZ _IOW('t', 103, struct winsize) +#define TIOCGWINSZ _IOR('t', 104, struct winsize) +#define TIOCNOTTY 0x5471 +#define TIOCSETD 0x7401 +#define TIOCGETD 0x7400 + +#define FIOCLEX 0x6601 +#define FIONCLEX 0x6602 +#define FIOASYNC 0x667D +#define FIONBIO 0x667E +#define FIOQSIZE 0x667F + +#define TIOCGLTC 0x7474 +#define TIOCSLTC 0x7475 +#define TIOCSPGRP _IOW('t', 118, int) +#define TIOCGPGRP _IOR('t', 119, int) +#define TIOCCONS _IOW('t', 120, int) + +#define FIONREAD 0x467F +#define TIOCINQ FIONREAD + +#define TIOCGETP 0x7408 +#define TIOCSETP 0x7409 +#define TIOCSETN 0x740A + +#define TIOCSBRK 0x5427 +#define TIOCCBRK 0x5428 +#define TIOCGSID 0x7416 +#define TIOCGPTN _IOR('T', 0x30, unsigned int) +#define TIOCSPTLCK _IOW('T', 0x31, int) + +#define TIOCSCTTY 0x5480 +#define TIOCGSOFTCAR 0x5481 +#define TIOCSSOFTCAR 0x5482 +#define TIOCLINUX 0x5483 +#define TIOCGSERIAL 0x5484 +#define TIOCSSERIAL 0x5485 +#define TCSBRKP 0x5486 + +#define TIOCSERCONFIG 0x5488 +#define TIOCSERGWILD 0x5489 +#define TIOCSERSWILD 0x548A +#define TIOCGLCKTRMIOS 0x548B +#define TIOCSLCKTRMIOS 0x548C +#define TIOCSERGSTRUCT 0x548D +#define TIOCSERGETLSR 0x548E +#define TIOCSERGETMULTI 0x548F +#define TIOCSERSETMULTI 0x5490 +#define TIOCMIWAIT 0x5491 +#define TIOCGICOUNT 0x5492 +#define TIOCGHAYESESP 0x5493 +#define TIOCSHAYESESP 0x5494 + +#define TIOCTTYGSTRUCT 0x5426 +#define TCGETX 0x5432 +#define TCSETX 0x5433 +#define TCSETXF 0x5434 +#define TCSETXW 0x5435 + +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 +#define TIOCPKT_IOCTL 64 + +#define TIOCSER_TEMT 0x01 + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 +#define TIOCM_MODEM_BITS TIOCM_OUT2 + +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 +#define N_6PACK 7 +#define N_MASC 8 +#define N_R3964 9 +#define N_PROFIBUS_FDL 10 +#define N_IRDA 11 +#define N_SMSBLOCK 12 +#define N_HDLC 13 +#define N_SYNC_PPP 14 +#define N_HCI 15 + +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 + +#define SIOCADDRT 0x890B +#define SIOCDELRT 0x890C +#define SIOCRTMSG 0x890D + +#define SIOCGIFNAME 0x8910 +#define SIOCSIFLINK 0x8911 +#define SIOCGIFCONF 0x8912 +#define SIOCGIFFLAGS 0x8913 +#define SIOCSIFFLAGS 0x8914 +#define SIOCGIFADDR 0x8915 +#define SIOCSIFADDR 0x8916 +#define SIOCGIFDSTADDR 0x8917 +#define SIOCSIFDSTADDR 0x8918 +#define SIOCGIFBRDADDR 0x8919 +#define SIOCSIFBRDADDR 0x891a +#define SIOCGIFNETMASK 0x891b +#define SIOCSIFNETMASK 0x891c +#define SIOCGIFMETRIC 0x891d +#define SIOCSIFMETRIC 0x891e +#define SIOCGIFMEM 0x891f +#define SIOCSIFMEM 0x8920 +#define SIOCGIFMTU 0x8921 +#define SIOCSIFMTU 0x8922 +#define SIOCSIFHWADDR 0x8924 +#define SIOCGIFENCAP 0x8925 +#define SIOCSIFENCAP 0x8926 +#define SIOCGIFHWADDR 0x8927 +#define SIOCGIFSLAVE 0x8929 +#define SIOCSIFSLAVE 0x8930 +#define SIOCADDMULTI 0x8931 +#define SIOCDELMULTI 0x8932 +#define SIOCGIFINDEX 0x8933 +#define SIOGIFINDEX SIOCGIFINDEX +#define SIOCSIFPFLAGS 0x8934 +#define SIOCGIFPFLAGS 0x8935 +#define SIOCDIFADDR 0x8936 +#define SIOCSIFHWBROADCAST 0x8937 +#define SIOCGIFCOUNT 0x8938 + +#define SIOCGIFBR 0x8940 +#define SIOCSIFBR 0x8941 + +#define SIOCGIFTXQLEN 0x8942 +#define SIOCSIFTXQLEN 0x8943 + +#define SIOCDARP 0x8953 +#define SIOCGARP 0x8954 +#define SIOCSARP 0x8955 + +#define SIOCDRARP 0x8960 +#define SIOCGRARP 0x8961 +#define SIOCSRARP 0x8962 + +#define SIOCGIFMAP 0x8970 +#define SIOCSIFMAP 0x8971 + +#define SIOCADDDLCI 0x8980 +#define SIOCDELDLCI 0x8981 + +#define SIOCDEVPRIVATE 0x89F0 +#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/mips64/bits/ipc.h b/arch/mips64/bits/ipc.h new file mode 100644 index 00000000..43a8314e --- /dev/null +++ b/arch/mips64/bits/ipc.h @@ -0,0 +1,14 @@ +struct ipc_perm { + key_t __ipc_perm_key; + uid_t uid; + gid_t gid; + uid_t cuid; + gid_t cgid; + mode_t mode; + int __ipc_perm_seq; + int __pad1; + unsigned long __unused1; + unsigned long __unused2; +}; + +#define IPC_64 0x100 diff --git a/arch/mips64/bits/limits.h b/arch/mips64/bits/limits.h new file mode 100644 index 00000000..58698c62 --- /dev/null +++ b/arch/mips64/bits/limits.h @@ -0,0 +1,7 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define LONG_BIT 64 +#endif + +#define LONG_MAX 0x7fffffffffffffffL +#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/arch/mips64/bits/mman.h b/arch/mips64/bits/mman.h new file mode 100644 index 00000000..cb9ac539 --- /dev/null +++ b/arch/mips64/bits/mman.h @@ -0,0 +1,58 @@ +#define MAP_FAILED ((void *) -1) + +#define PROT_NONE 0 +#define PROT_READ 1 +#define PROT_WRITE 2 +#define PROT_EXEC 4 +#define PROT_GROWSDOWN 0x01000000 +#define PROT_GROWSUP 0x02000000 + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_FIXED 0x10 + +#define MAP_TYPE 0x0f +#define MAP_FILE 0x00 +#define MAP_ANON 0x800 +#define MAP_ANONYMOUS MAP_ANON +#define MAP_NORESERVE 0x0400 +#define MAP_GROWSDOWN 0x1000 +#define MAP_DENYWRITE 0x2000 +#define MAP_EXECUTABLE 0x4000 +#define MAP_LOCKED 0x8000 +#define MAP_POPULATE 0x10000 +#define MAP_NONBLOCK 0x20000 +#define MAP_STACK 0x40000 +#define MAP_HUGETLB 0x80000 + +#define POSIX_MADV_NORMAL 0 +#define POSIX_MADV_RANDOM 1 +#define POSIX_MADV_SEQUENTIAL 2 +#define POSIX_MADV_WILLNEED 3 +#define POSIX_MADV_DONTNEED 0 + +#define MS_ASYNC 1 +#define MS_INVALIDATE 2 +#define MS_SYNC 4 + +#define MCL_CURRENT 1 +#define MCL_FUTURE 2 +#define MCL_ONFAULT 4 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MADV_NORMAL 0 +#define MADV_RANDOM 1 +#define MADV_SEQUENTIAL 2 +#define MADV_WILLNEED 3 +#define MADV_DONTNEED 4 +#define MADV_REMOVE 9 +#define MADV_DONTFORK 10 +#define MADV_DOFORK 11 +#define MADV_MERGEABLE 12 +#define MADV_UNMERGEABLE 13 +#define MADV_HUGEPAGE 14 +#define MADV_NOHUGEPAGE 15 +#define MADV_DONTDUMP 16 +#define MADV_DODUMP 17 +#define MADV_HWPOISON 100 +#endif diff --git a/arch/mips64/bits/msg.h b/arch/mips64/bits/msg.h new file mode 100644 index 00000000..641e1703 --- /dev/null +++ b/arch/mips64/bits/msg.h @@ -0,0 +1,13 @@ +struct msqid_ds { + struct ipc_perm msg_perm; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; + unsigned long msg_cbytes; + msgqnum_t msg_qnum; + msglen_t msg_qbytes; + pid_t msg_lspid; + pid_t msg_lrpid; + unsigned long __pad1; + unsigned long __pad2; +}; diff --git a/arch/mips64/bits/poll.h b/arch/mips64/bits/poll.h new file mode 100644 index 00000000..b0b1ed62 --- /dev/null +++ b/arch/mips64/bits/poll.h @@ -0,0 +1,2 @@ +#define POLLWRNORM POLLOUT +#define POLLWRBAND 0x100 diff --git a/arch/mips64/bits/posix.h b/arch/mips64/bits/posix.h new file mode 100644 index 00000000..acf42944 --- /dev/null +++ b/arch/mips64/bits/posix.h @@ -0,0 +1,2 @@ +#define _POSIX_V6_LP64_OFFBIG 1 +#define _POSIX_V7_LP64_OFFBIG 1 diff --git a/arch/mips64/bits/reg.h b/arch/mips64/bits/reg.h new file mode 100644 index 00000000..a3f63acc --- /dev/null +++ b/arch/mips64/bits/reg.h @@ -0,0 +1,47 @@ +#undef __WORDSIZE +#define __WORDSIZE 64 + +#define EF_R0 0 +#define EF_R1 1 +#define EF_R2 2 +#define EF_R3 3 +#define EF_R4 4 +#define EF_R5 5 +#define EF_R6 6 +#define EF_R7 7 +#define EF_R8 8 +#define EF_R9 9 +#define EF_R10 10 +#define EF_R11 11 +#define EF_R12 12 +#define EF_R13 13 +#define EF_R14 14 +#define EF_R15 15 +#define EF_R16 16 +#define EF_R17 17 +#define EF_R18 18 +#define EF_R19 19 +#define EF_R20 20 +#define EF_R21 21 +#define EF_R22 22 +#define EF_R23 23 +#define EF_R24 24 +#define EF_R25 25 + +#define EF_R26 26 +#define EF_R27 27 +#define EF_R28 28 +#define EF_R29 29 +#define EF_R30 30 +#define EF_R31 31 + +#define EF_LO 32 +#define EF_HI 33 + +#define EF_CP0_EPC 34 +#define EF_CP0_BADVADDR 35 +#define EF_CP0_STATUS 36 +#define EF_CP0_CAUSE 37 +#define EF_UNUSED0 38 + +#define EF_SIZE 304 diff --git a/arch/mips64/bits/resource.h b/arch/mips64/bits/resource.h new file mode 100644 index 00000000..414a4054 --- /dev/null +++ b/arch/mips64/bits/resource.h @@ -0,0 +1,5 @@ +#define RLIMIT_NOFILE 5 +#define RLIMIT_AS 6 +#define RLIMIT_RSS 7 +#define RLIMIT_NPROC 8 +#define RLIMIT_MEMLOCK 9 diff --git a/arch/mips64/bits/sem.h b/arch/mips64/bits/sem.h new file mode 100644 index 00000000..e46ced95 --- /dev/null +++ b/arch/mips64/bits/sem.h @@ -0,0 +1,14 @@ +struct semid_ds { + struct ipc_perm sem_perm; + time_t sem_otime; + time_t sem_ctime; +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned short sem_nsems; + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; +#else + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; + unsigned short sem_nsems; +#endif + time_t __unused3; + time_t __unused4; +}; diff --git a/arch/mips64/bits/setjmp.h b/arch/mips64/bits/setjmp.h new file mode 100644 index 00000000..4d93267e --- /dev/null +++ b/arch/mips64/bits/setjmp.h @@ -0,0 +1 @@ +typedef unsigned long long __jmp_buf[23]; diff --git a/arch/mips64/bits/shm.h b/arch/mips64/bits/shm.h new file mode 100644 index 00000000..8d193781 --- /dev/null +++ b/arch/mips64/bits/shm.h @@ -0,0 +1,24 @@ +#define SHMLBA 4096 + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; + pid_t shm_cpid; + pid_t shm_lpid; + unsigned long shm_nattch; + unsigned long __pad1; + unsigned long __pad2; +}; + +struct shminfo { + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; +}; + +struct shm_info { + int __used_ids; + unsigned long shm_tot, shm_rss, shm_swp; + unsigned long __swap_attempts, __swap_successes; +}; diff --git a/arch/mips64/bits/signal.h b/arch/mips64/bits/signal.h new file mode 100644 index 00000000..c31ad07e --- /dev/null +++ b/arch/mips64/bits/signal.h @@ -0,0 +1,143 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +typedef unsigned long long greg_t, gregset_t[32]; + +typedef struct { + union { + double fp_dregs[32]; + struct { + float _fp_fregs; + unsigned _fp_pad; + } fp_fregs[32]; + } fp_r; +} fpregset_t; + +struct sigcontext { + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned long long sc_mdhi; + unsigned long long sc_hi1; + unsigned long long sc_hi2; + unsigned long long sc_hi3; + unsigned long long sc_mdlo; + unsigned long long sc_lo1; + unsigned long long sc_lo2; + unsigned long long sc_lo3; + unsigned long long sc_pc; + unsigned int sc_fpc_csr; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned int sc_reserved; +}; + +typedef struct { + gregset_t gregs; + fpregset_t fpregs; + greg_t mdhi; + greg_t hi1; + greg_t hi2; + greg_t hi3; + greg_t mdlo; + greg_t lo1; + greg_t lo2; + greg_t lo3; + greg_t pc; + unsigned int fpc_csr; + unsigned int used_math; + unsigned int dsp; + unsigned int reserved; +} mcontext_t; + +#else +typedef struct { + unsigned long long __mc1[32]; + double __mc2[32]; + unsigned long long __mc3[9]; + unsigned __mc4[4]; +} mcontext_t; +#endif + +struct sigaltstack { + void *ss_sp; + size_t ss_size; + int ss_flags; +}; + +typedef struct __ucontext { + unsigned long uc_flags; + struct __ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; +} ucontext_t; + +#define SA_NOCLDSTOP 1 +#define SA_NOCLDWAIT 0x10000 +#define SA_SIGINFO 8 +#define SA_ONSTACK 0x08000000 +#define SA_RESTART 0x10000000 +#define SA_NODEFER 0x40000000 +#define SA_RESETHAND 0x80000000 +#define SA_RESTORER 0x04000000 + +#undef SIG_BLOCK +#undef SIG_UNBLOCK +#undef SIG_SETMASK +#define SIG_BLOCK 1 +#define SIG_UNBLOCK 2 +#define SIG_SETMASK 3 + +#undef SI_ASYNCIO +#undef SI_MESGQ +#undef SI_TIMER +#define SI_ASYNCIO (-2) +#define SI_MESGQ (-4) +#define SI_TIMER (-3) + +#define __SI_SWAP_ERRNO_CODE + +#endif + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT SIGABRT +#define SIGSTKFLT 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGBUS 10 +#define SIGSEGV 11 +#define SIGSYS 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGUSR1 16 +#define SIGUSR2 17 +#define SIGCHLD 18 +#define SIGPWR 19 +#define SIGWINCH 20 +#define SIGURG 21 +#define SIGIO 22 +#define SIGPOLL SIGIO +#define SIGSTOP 23 +#define SIGTSTP 24 +#define SIGCONT 25 +#define SIGTTIN 26 +#define SIGTTOU 27 +#define SIGVTALRM 28 +#define SIGPROF 29 +#define SIGXCPU 30 +#define SIGXFSZ 31 +#define SIGUNUSED SIGSYS + +#define _NSIG 128 diff --git a/arch/mips64/bits/socket.h b/arch/mips64/bits/socket.h new file mode 100644 index 00000000..cf801797 --- /dev/null +++ b/arch/mips64/bits/socket.h @@ -0,0 +1,68 @@ +#include + +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; +#if __BYTE_ORDER == __BIG_ENDIAN + int __pad1, msg_iovlen; +#else + int msg_iovlen, __pad1; +#endif + void *msg_control; +#if __BYTE_ORDER == __BIG_ENDIAN + int __pad2; + socklen_t msg_controllen; +#else + socklen_t msg_controllen; + int __pad2; +#endif + int msg_flags; +}; + +struct cmsghdr { +#if __BYTE_ORDER == __BIG_ENDIAN + int __pad1; + socklen_t cmsg_len; +#else + socklen_t cmsg_len; + int __pad1; +#endif + int cmsg_level; + int cmsg_type; +}; + +#define SOCK_STREAM 2 +#define SOCK_DGRAM 1 +#define SOL_SOCKET 65535 +#define SO_DEBUG 1 + +#define SO_REUSEADDR 0x0004 +#define SO_KEEPALIVE 0x0008 +#define SO_DONTROUTE 0x0010 +#define SO_BROADCAST 0x0020 +#define SO_LINGER 0x0080 +#define SO_OOBINLINE 0x0100 +#define SO_REUSEPORT 0x0200 +#define SO_SNDBUF 0x1001 +#define SO_RCVBUF 0x1002 +#define SO_SNDLOWAT 0x1003 +#define SO_RCVLOWAT 0x1004 +#define SO_RCVTIMEO 0x1006 +#define SO_SNDTIMEO 0x1005 +#define SO_ERROR 0x1007 +#define SO_TYPE 0x1008 +#define SO_ACCEPTCONN 0x1009 +#define SO_PROTOCOL 0x1028 +#define SO_DOMAIN 0x1029 + +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_BSDCOMPAT 14 +#define SO_PASSCRED 17 +#define SO_PEERCRED 18 +#define SO_SNDBUFFORCE 31 +#define SO_RCVBUFFORCE 33 + +#define SOCK_NONBLOCK 0200 +#define SOCK_CLOEXEC 02000000 diff --git a/arch/mips64/bits/stat.h b/arch/mips64/bits/stat.h new file mode 100644 index 00000000..b46617f1 --- /dev/null +++ b/arch/mips64/bits/stat.h @@ -0,0 +1,23 @@ +#include +#include + +struct stat { + dev_t st_dev; + int __pad1[3]; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + unsigned int __pad2[2]; + off_t st_size; + int __pad3; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + blksize_t st_blksize; + unsigned int __pad4; + blkcnt_t st_blocks; + int __pad5[14]; +}; diff --git a/arch/mips64/bits/statfs.h b/arch/mips64/bits/statfs.h new file mode 100644 index 00000000..a73bd547 --- /dev/null +++ b/arch/mips64/bits/statfs.h @@ -0,0 +1,8 @@ +struct statfs { + unsigned long f_type, f_bsize, f_frsize; + fsblkcnt_t f_blocks, f_bfree; + fsfilcnt_t f_files, f_ffree; + fsblkcnt_t f_bavail; + fsid_t f_fsid; + unsigned long f_namelen, f_flags, f_spare[5]; +}; diff --git a/arch/mips64/bits/stdint.h b/arch/mips64/bits/stdint.h new file mode 100644 index 00000000..1bb147f2 --- /dev/null +++ b/arch/mips64/bits/stdint.h @@ -0,0 +1,20 @@ +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; + +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN + +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX + +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX + +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#define SIZE_MAX UINT64_MAX diff --git a/arch/mips64/bits/syscall.h b/arch/mips64/bits/syscall.h new file mode 100644 index 00000000..d9b4f42f --- /dev/null +++ b/arch/mips64/bits/syscall.h @@ -0,0 +1,633 @@ +#define __NR_read 5000 +#define __NR_write 5001 +#define __NR_open 5002 +#define __NR_close 5003 +#define __NR_stat 5004 +#define __NR_fstat 5005 +#define __NR_lstat 5006 +#define __NR_poll 5007 +#define __NR_lseek 5008 +#define __NR_mmap 5009 +#define __NR_mprotect 5010 +#define __NR_munmap 5011 +#define __NR_brk 5012 +#define __NR_rt_sigaction 5013 +#define __NR_rt_sigprocmask 5014 +#define __NR_ioctl 5015 +#define __NR_pread64 5016 +#define __NR_pwrite64 5017 +#define __NR_readv 5018 +#define __NR_writev 5019 +#define __NR_access 5020 +#define __NR_pipe 5021 +#define __NR__newselect 5022 +#define __NR_sched_yield 5023 +#define __NR_mremap 5024 +#define __NR_msync 5025 +#define __NR_mincore 5026 +#define __NR_madvise 5027 +#define __NR_shmget 5028 +#define __NR_shmat 5029 +#define __NR_shmctl 5030 +#define __NR_dup 5031 +#define __NR_dup2 5032 +#define __NR_pause 5033 +#define __NR_nanosleep 5034 +#define __NR_getitimer 5035 +#define __NR_setitimer 5036 +#define __NR_alarm 5037 +#define __NR_getpid 5038 +#define __NR_sendfile 5039 +#define __NR_socket 5040 +#define __NR_connect 5041 +#define __NR_accept 5042 +#define __NR_sendto 5043 +#define __NR_recvfrom 5044 +#define __NR_sendmsg 5045 +#define __NR_recvmsg 5046 +#define __NR_shutdown 5047 +#define __NR_bind 5048 +#define __NR_listen 5049 +#define __NR_getsockname 5050 +#define __NR_getpeername 5051 +#define __NR_socketpair 5052 +#define __NR_setsockopt 5053 +#define __NR_getsockopt 5054 +#define __NR_clone 5055 +#define __NR_fork 5056 +#define __NR_execve 5057 +#define __NR_exit 5058 +#define __NR_wait4 5059 +#define __NR_kill 5060 +#define __NR_uname 5061 +#define __NR_semget 5062 +#define __NR_semop 5063 +#define __NR_semctl 5064 +#define __NR_shmdt 5065 +#define __NR_msgget 5066 +#define __NR_msgsnd 5067 +#define __NR_msgrcv 5068 +#define __NR_msgctl 5069 +#define __NR_fcntl 5070 +#define __NR_flock 5071 +#define __NR_fsync 5072 +#define __NR_fdatasync 5073 +#define __NR_truncate 5074 +#define __NR_ftruncate 5075 +#define __NR_getdents 5076 +#define __NR_getcwd 5077 +#define __NR_chdir 5078 +#define __NR_fchdir 5079 +#define __NR_rename 5080 +#define __NR_mkdir 5081 +#define __NR_rmdir 5082 +#define __NR_creat 5083 +#define __NR_link 5084 +#define __NR_unlink 5085 +#define __NR_symlink 5086 +#define __NR_readlink 5087 +#define __NR_chmod 5088 +#define __NR_fchmod 5089 +#define __NR_chown 5090 +#define __NR_fchown 5091 +#define __NR_lchown 5092 +#define __NR_umask 5093 +#define __NR_gettimeofday 5094 +#define __NR_getrlimit 5095 +#define __NR_getrusage 5096 +#define __NR_sysinfo 5097 +#define __NR_times 5098 +#define __NR_ptrace 5099 +#define __NR_getuid 5100 +#define __NR_syslog 5101 +#define __NR_getgid 5102 +#define __NR_setuid 5103 +#define __NR_setgid 5104 +#define __NR_geteuid 5105 +#define __NR_getegid 5106 +#define __NR_setpgid 5107 +#define __NR_getppid 5108 +#define __NR_getpgrp 5109 +#define __NR_setsid 5110 +#define __NR_setreuid 5111 +#define __NR_setregid 5112 +#define __NR_getgroups 5113 +#define __NR_setgroups 5114 +#define __NR_setresuid 5115 +#define __NR_getresuid 5116 +#define __NR_setresgid 5117 +#define __NR_getresgid 5118 +#define __NR_getpgid 5119 +#define __NR_setfsuid 5120 +#define __NR_setfsgid 5121 +#define __NR_getsid 5122 +#define __NR_capget 5123 +#define __NR_capset 5124 +#define __NR_rt_sigpending 5125 +#define __NR_rt_sigtimedwait 5126 +#define __NR_rt_sigqueueinfo 5127 +#define __NR_rt_sigsuspend 5128 +#define __NR_sigaltstack 5129 +#define __NR_utime 5130 +#define __NR_mknod 5131 +#define __NR_personality 5132 +#define __NR_ustat 5133 +#define __NR_statfs 5134 +#define __NR_fstatfs 5135 +#define __NR_sysfs 5136 +#define __NR_getpriority 5137 +#define __NR_setpriority 5138 +#define __NR_sched_setparam 5139 +#define __NR_sched_getparam 5140 +#define __NR_sched_setscheduler 5141 +#define __NR_sched_getscheduler 5142 +#define __NR_sched_get_priority_max 5143 +#define __NR_sched_get_priority_min 5144 +#define __NR_sched_rr_get_interval 5145 +#define __NR_mlock 5146 +#define __NR_munlock 5147 +#define __NR_mlockall 5148 +#define __NR_munlockall 5149 +#define __NR_vhangup 5150 +#define __NR_pivot_root 5151 +#define __NR__sysctl 5152 +#define __NR_prctl 5153 +#define __NR_adjtimex 5154 +#define __NR_setrlimit 5155 +#define __NR_chroot 5156 +#define __NR_sync 5157 +#define __NR_acct 5158 +#define __NR_settimeofday 5159 +#define __NR_mount 5160 +#define __NR_umount2 5161 +#define __NR_swapon 5162 +#define __NR_swapoff 5163 +#define __NR_reboot 5164 +#define __NR_sethostname 5165 +#define __NR_setdomainname 5166 +#define __NR_create_module 5167 +#define __NR_init_module 5168 +#define __NR_delete_module 5169 +#define __NR_get_kernel_syms 5170 +#define __NR_query_module 5171 +#define __NR_quotactl 5172 +#define __NR_nfsservctl 5173 +#define __NR_getpmsg 5174 +#define __NR_putpmsg 5175 +#define __NR_afs_syscall 5176 +#define __NR_reserved177 5177 +#define __NR_gettid 5178 +#define __NR_readahead 5179 +#define __NR_setxattr 5180 +#define __NR_lsetxattr 5181 +#define __NR_fsetxattr 5182 +#define __NR_getxattr 5183 +#define __NR_lgetxattr 5184 +#define __NR_fgetxattr 5185 +#define __NR_listxattr 5186 +#define __NR_llistxattr 5187 +#define __NR_flistxattr 5188 +#define __NR_removexattr 5189 +#define __NR_lremovexattr 5190 +#define __NR_fremovexattr 5191 +#define __NR_tkill 5192 +#define __NR_reserved193 5193 +#define __NR_futex 5194 +#define __NR_sched_setaffinity 5195 +#define __NR_sched_getaffinity 5196 +#define __NR_cacheflush 5197 +#define __NR_cachectl 5198 +#define __NR_sysmips 5199 +#define __NR_io_setup 5200 +#define __NR_io_destroy 5201 +#define __NR_io_getevents 5202 +#define __NR_io_submit 5203 +#define __NR_io_cancel 5204 +#define __NR_exit_group 5205 +#define __NR_lookup_dcookie 5206 +#define __NR_epoll_create 5207 +#define __NR_epoll_ctl 5208 +#define __NR_epoll_wait 5209 +#define __NR_remap_file_pages 5210 +#define __NR_rt_sigreturn 5211 +#define __NR_set_tid_address 5212 +#define __NR_restart_syscall 5213 +#define __NR_semtimedop 5214 +#define __NR_fadvise64 5215 +#define __NR_timer_create 5216 +#define __NR_timer_settime 5217 +#define __NR_timer_gettime 5218 +#define __NR_timer_getoverrun 5219 +#define __NR_timer_delete 5220 +#define __NR_clock_settime 5221 +#define __NR_clock_gettime 5222 +#define __NR_clock_getres 5223 +#define __NR_clock_nanosleep 5224 +#define __NR_tgkill 5225 +#define __NR_utimes 5226 +#define __NR_mbind 5227 +#define __NR_get_mempolicy 5228 +#define __NR_set_mempolicy 5229 +#define __NR_mq_open 5230 +#define __NR_mq_unlink 5231 +#define __NR_mq_timedsend 5232 +#define __NR_mq_timedreceive 5233 +#define __NR_mq_notify 5234 +#define __NR_mq_getsetattr 5235 +#define __NR_vserver 5236 +#define __NR_waitid 5237 +#define __NR_add_key 5239 +#define __NR_request_key 5240 +#define __NR_keyctl 5241 +#define __NR_set_thread_area 5242 +#define __NR_inotify_init 5243 +#define __NR_inotify_add_watch 5244 +#define __NR_inotify_rm_watch 5245 +#define __NR_migrate_pages 5246 +#define __NR_openat 5247 +#define __NR_mkdirat 5248 +#define __NR_mknodat 5249 +#define __NR_fchownat 5250 +#define __NR_futimesat 5251 +#define __NR_newfstatat 5252 +#define __NR_unlinkat 5253 +#define __NR_renameat 5254 +#define __NR_linkat 5255 +#define __NR_symlinkat 5256 +#define __NR_readlinkat 5257 +#define __NR_fchmodat 5258 +#define __NR_faccessat 5259 +#define __NR_pselect6 5260 +#define __NR_ppoll 5261 +#define __NR_unshare 5262 +#define __NR_splice 5263 +#define __NR_sync_file_range 5264 +#define __NR_tee 5265 +#define __NR_vmsplice 5266 +#define __NR_move_pages 5267 +#define __NR_set_robust_list 5268 +#define __NR_get_robust_list 5269 +#define __NR_kexec_load 5270 +#define __NR_getcpu 5271 +#define __NR_epoll_pwait 5272 +#define __NR_ioprio_set 5273 +#define __NR_ioprio_get 5274 +#define __NR_utimensat 5275 +#define __NR_signalfd 5276 +#define __NR_timerfd 5277 +#define __NR_eventfd 5278 +#define __NR_fallocate 5279 +#define __NR_timerfd_create 5280 +#define __NR_timerfd_gettime 5281 +#define __NR_timerfd_settime 5282 +#define __NR_signalfd4 5283 +#define __NR_eventfd2 5284 +#define __NR_epoll_create1 5285 +#define __NR_dup3 5286 +#define __NR_pipe2 5287 +#define __NR_inotify_init1 5288 +#define __NR_preadv 5289 +#define __NR_pwritev 5290 +#define __NR_rt_tgsigqueueinfo 5291 +#define __NR_perf_event_open 5292 +#define __NR_accept4 5293 +#define __NR_recvmmsg 5294 +#define __NR_fanotify_init 5295 +#define __NR_fanotify_mark 5296 +#define __NR_prlimit64 5297 +#define __NR_name_to_handle_at 5298 +#define __NR_open_by_handle_at 5299 +#define __NR_clock_adjtime 5300 +#define __NR_syncfs 5301 +#define __NR_sendmmsg 5302 +#define __NR_setns 5303 +#define __NR_process_vm_readv 5304 +#define __NR_process_vm_writev 5305 +#define __NR_kcmp 5306 +#define __NR_finit_module 5307 +#define __NR_getdents64 5308 +#define __NR_sched_setattr 5309 +#define __NR_sched_getattr 5310 +#define __NR_renameat2 5311 +#define __NR_seccomp 5312 +#define __NR_getrandom 5313 +#define __NR_memfd_create 5314 +#define __NR_bpf 5315 +#define __NR_execveat 5316 + +#define SYS_read 5000 +#define SYS_write 5001 +#define SYS_open 5002 +#define SYS_close 5003 +#define SYS_stat 5004 +#define SYS_fstat 5005 +#define SYS_lstat 5006 +#define SYS_poll 5007 +#define SYS_lseek 5008 +#define SYS_mmap 5009 +#define SYS_mprotect 5010 +#define SYS_munmap 5011 +#define SYS_brk 5012 +#define SYS_rt_sigaction 5013 +#define SYS_rt_sigprocmask 5014 +#define SYS_ioctl 5015 +#define SYS_pread64 5016 +#define SYS_pwrite64 5017 +#define SYS_readv 5018 +#define SYS_writev 5019 +#define SYS_access 5020 +#define SYS_pipe 5021 +#define SYS__newselect 5022 +#define SYS_sched_yield 5023 +#define SYS_mremap 5024 +#define SYS_msync 5025 +#define SYS_mincore 5026 +#define SYS_madvise 5027 +#define SYS_shmget 5028 +#define SYS_shmat 5029 +#define SYS_shmctl 5030 +#define SYS_dup 5031 +#define SYS_dup2 5032 +#define SYS_pause 5033 +#define SYS_nanosleep 5034 +#define SYS_getitimer 5035 +#define SYS_setitimer 5036 +#define SYS_alarm 5037 +#define SYS_getpid 5038 +#define SYS_sendfile 5039 +#define SYS_socket 5040 +#define SYS_connect 5041 +#define SYS_accept 5042 +#define SYS_sendto 5043 +#define SYS_recvfrom 5044 +#define SYS_sendmsg 5045 +#define SYS_recvmsg 5046 +#define SYS_shutdown 5047 +#define SYS_bind 5048 +#define SYS_listen 5049 +#define SYS_getsockname 5050 +#define SYS_getpeername 5051 +#define SYS_socketpair 5052 +#define SYS_setsockopt 5053 +#define SYS_getsockopt 5054 +#define SYS_clone 5055 +#define SYS_fork 5056 +#define SYS_execve 5057 +#define SYS_exit 5058 +#define SYS_wait4 5059 +#define SYS_kill 5060 +#define SYS_uname 5061 +#define SYS_semget 5062 +#define SYS_semop 5063 +#define SYS_semctl 5064 +#define SYS_shmdt 5065 +#define SYS_msgget 5066 +#define SYS_msgsnd 5067 +#define SYS_msgrcv 5068 +#define SYS_msgctl 5069 +#define SYS_fcntl 5070 +#define SYS_flock 5071 +#define SYS_fsync 5072 +#define SYS_fdatasync 5073 +#define SYS_truncate 5074 +#define SYS_ftruncate 5075 +#define SYS_getdents 5076 +#define SYS_getcwd 5077 +#define SYS_chdir 5078 +#define SYS_fchdir 5079 +#define SYS_rename 5080 +#define SYS_mkdir 5081 +#define SYS_rmdir 5082 +#define SYS_creat 5083 +#define SYS_link 5084 +#define SYS_unlink 5085 +#define SYS_symlink 5086 +#define SYS_readlink 5087 +#define SYS_chmod 5088 +#define SYS_fchmod 5089 +#define SYS_chown 5090 +#define SYS_fchown 5091 +#define SYS_lchown 5092 +#define SYS_umask 5093 +#define SYS_gettimeofday 5094 +#define SYS_getrlimit 5095 +#define SYS_getrusage 5096 +#define SYS_sysinfo 5097 +#define SYS_times 5098 +#define SYS_ptrace 5099 +#define SYS_getuid 5100 +#define SYS_syslog 5101 +#define SYS_getgid 5102 +#define SYS_setuid 5103 +#define SYS_setgid 5104 +#define SYS_geteuid 5105 +#define SYS_getegid 5106 +#define SYS_setpgid 5107 +#define SYS_getppid 5108 +#define SYS_getpgrp 5109 +#define SYS_setsid 5110 +#define SYS_setreuid 5111 +#define SYS_setregid 5112 +#define SYS_getgroups 5113 +#define SYS_setgroups 5114 +#define SYS_setresuid 5115 +#define SYS_getresuid 5116 +#define SYS_setresgid 5117 +#define SYS_getresgid 5118 +#define SYS_getpgid 5119 +#define SYS_setfsuid 5120 +#define SYS_setfsgid 5121 +#define SYS_getsid 5122 +#define SYS_capget 5123 +#define SYS_capset 5124 +#define SYS_rt_sigpending 5125 +#define SYS_rt_sigtimedwait 5126 +#define SYS_rt_sigqueueinfo 5127 +#define SYS_rt_sigsuspend 5128 +#define SYS_sigaltstack 5129 +#define SYS_utime 5130 +#define SYS_mknod 5131 +#define SYS_personality 5132 +#define SYS_ustat 5133 +#define SYS_statfs 5134 +#define SYS_fstatfs 5135 +#define SYS_sysfs 5136 +#define SYS_getpriority 5137 +#define SYS_setpriority 5138 +#define SYS_sched_setparam 5139 +#define SYS_sched_getparam 5140 +#define SYS_sched_setscheduler 5141 +#define SYS_sched_getscheduler 5142 +#define SYS_sched_get_priority_max 5143 +#define SYS_sched_get_priority_min 5144 +#define SYS_sched_rr_get_interval 5145 +#define SYS_mlock 5146 +#define SYS_munlock 5147 +#define SYS_mlockall 5148 +#define SYS_munlockall 5149 +#define SYS_vhangup 5150 +#define SYS_pivot_root 5151 +#define SYS__sysctl 5152 +#define SYS_prctl 5153 +#define SYS_adjtimex 5154 +#define SYS_setrlimit 5155 +#define SYS_chroot 5156 +#define SYS_sync 5157 +#define SYS_acct 5158 +#define SYS_settimeofday 5159 +#define SYS_mount 5160 +#define SYS_umount2 5161 +#define SYS_swapon 5162 +#define SYS_swapoff 5163 +#define SYS_reboot 5164 +#define SYS_sethostname 5165 +#define SYS_setdomainname 5166 +#define SYS_create_module 5167 +#define SYS_init_module 5168 +#define SYS_delete_module 5169 +#define SYS_get_kernel_syms 5170 +#define SYS_query_module 5171 +#define SYS_quotactl 5172 +#define SYS_nfsservctl 5173 +#define SYS_getpmsg 5174 +#define SYS_putpmsg 5175 +#define SYS_afs_syscall 5176 +#define SYS_reserved177 5177 +#define SYS_gettid 5178 +#define SYS_readahead 5179 +#define SYS_setxattr 5180 +#define SYS_lsetxattr 5181 +#define SYS_fsetxattr 5182 +#define SYS_getxattr 5183 +#define SYS_lgetxattr 5184 +#define SYS_fgetxattr 5185 +#define SYS_listxattr 5186 +#define SYS_llistxattr 5187 +#define SYS_flistxattr 5188 +#define SYS_removexattr 5189 +#define SYS_lremovexattr 5190 +#define SYS_fremovexattr 5191 +#define SYS_tkill 5192 +#define SYS_reserved193 5193 +#define SYS_futex 5194 +#define SYS_sched_setaffinity 5195 +#define SYS_sched_getaffinity 5196 +#define SYS_cacheflush 5197 +#define SYS_cachectl 5198 +#define SYS_sysmips 5199 +#define SYS_io_setup 5200 +#define SYS_io_destroy 5201 +#define SYS_io_getevents 5202 +#define SYS_io_submit 5203 +#define SYS_io_cancel 5204 +#define SYS_exit_group 5205 +#define SYS_lookup_dcookie 5206 +#define SYS_epoll_create 5207 +#define SYS_epoll_ctl 5208 +#define SYS_epoll_wait 5209 +#define SYS_remap_file_pages 5210 +#define SYS_rt_sigreturn 5211 +#define SYS_set_tid_address 5212 +#define SYS_restart_syscall 5213 +#define SYS_semtimedop 5214 +#define SYS_fadvise64 5215 +#define SYS_timer_create 5216 +#define SYS_timer_settime 5217 +#define SYS_timer_gettime 5218 +#define SYS_timer_getoverrun 5219 +#define SYS_timer_delete 5220 +#define SYS_clock_settime 5221 +#define SYS_clock_gettime 5222 +#define SYS_clock_getres 5223 +#define SYS_clock_nanosleep 5224 +#define SYS_tgkill 5225 +#define SYS_utimes 5226 +#define SYS_mbind 5227 +#define SYS_get_mempolicy 5228 +#define SYS_set_mempolicy 5229 +#define SYS_mq_open 5230 +#define SYS_mq_unlink 5231 +#define SYS_mq_timedsend 5232 +#define SYS_mq_timedreceive 5233 +#define SYS_mq_notify 5234 +#define SYS_mq_getsetattr 5235 +#define SYS_vserver 5236 +#define SYS_waitid 5237 +#define SYS_add_key 5239 +#define SYS_request_key 5240 +#define SYS_keyctl 5241 +#define SYS_set_thread_area 5242 +#define SYS_inotify_init 5243 +#define SYS_inotify_add_watch 5244 +#define SYS_inotify_rm_watch 5245 +#define SYS_migrate_pages 5246 +#define SYS_openat 5247 +#define SYS_mkdirat 5248 +#define SYS_mknodat 5249 +#define SYS_fchownat 5250 +#define SYS_futimesat 5251 +#define SYS_newfstatat 5252 +#define SYS_unlinkat 5253 +#define SYS_renameat 5254 +#define SYS_linkat 5255 +#define SYS_symlinkat 5256 +#define SYS_readlinkat 5257 +#define SYS_fchmodat 5258 +#define SYS_faccessat 5259 +#define SYS_pselect6 5260 +#define SYS_ppoll 5261 +#define SYS_unshare 5262 +#define SYS_splice 5263 +#define SYS_sync_file_range 5264 +#define SYS_tee 5265 +#define SYS_vmsplice 5266 +#define SYS_move_pages 5267 +#define SYS_set_robust_list 5268 +#define SYS_get_robust_list 5269 +#define SYS_kexec_load 5270 +#define SYS_getcpu 5271 +#define SYS_epoll_pwait 5272 +#define SYS_ioprio_set 5273 +#define SYS_ioprio_get 5274 +#define SYS_utimensat 5275 +#define SYS_signalfd 5276 +#define SYS_timerfd 5277 +#define SYS_eventfd 5278 +#define SYS_fallocate 5279 +#define SYS_timerfd_create 5280 +#define SYS_timerfd_gettime 5281 +#define SYS_timerfd_settime 5282 +#define SYS_signalfd4 5283 +#define SYS_eventfd2 5284 +#define SYS_epoll_create1 5285 +#define SYS_dup3 5286 +#define SYS_pipe2 5287 +#define SYS_inotify_init1 5288 +#define SYS_preadv 5289 +#define SYS_pwritev 5290 +#define SYS_rt_tgsigqueueinfo 5291 +#define SYS_perf_event_open 5292 +#define SYS_accept4 5293 +#define SYS_recvmmsg 5294 +#define SYS_fanotify_init 5295 +#define SYS_fanotify_mark 5296 +#define SYS_prlimit64 5297 +#define SYS_name_to_handle_at 5298 +#define SYS_open_by_handle_at 5299 +#define SYS_clock_adjtime 5300 +#define SYS_syncfs 5301 +#define SYS_sendmmsg 5302 +#define SYS_setns 5303 +#define SYS_process_vm_readv 5304 +#define SYS_process_vm_writev 5305 +#define SYS_kcmp 5306 +#define SYS_finit_module 5307 +#define SYS_getdents64 5308 +#define SYS_sched_setattr 5309 +#define SYS_sched_getattr 5310 +#define SYS_renameat2 5311 +#define SYS_seccomp 5312 +#define SYS_getrandom 5313 +#define SYS_memfd_create 5314 +#define SYS_bpf 5315 +#define SYS_execveat 5316 diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h new file mode 100644 index 00000000..3a7d5a13 --- /dev/null +++ b/arch/mips64/bits/termios.h @@ -0,0 +1,166 @@ +struct termios { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_line; + cc_t c_cc[NCCS]; +}; + +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VMIN 4 +#define VTIME 5 +#define VEOL2 6 +#define VSWTC 7 +#define VSWTCH 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 +#define VEOF 16 +#define VEOL 17 + +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IUCLC 0001000 +#define IXON 0002000 +#define IXANY 0004000 +#define IXOFF 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 + +#define OPOST 0000001 +#define OLCUC 0000002 +#define ONLCR 0000004 +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 +#define OFILL 0000100 +#define OFDEL 0000200 +#define NLDLY 0000400 +#define NL0 0000000 +#define NL1 0000400 +#define CRDLY 0003000 +#define CR0 0000000 +#define CR1 0001000 +#define CR2 0002000 +#define CR3 0003000 +#define TABDLY 0014000 +#define TAB0 0000000 +#define TAB1 0004000 +#define TAB2 0010000 +#define TAB3 0014000 +#define BSDLY 0020000 +#define BS0 0000000 +#define BS1 0020000 +#define FFDLY 0100000 +#define FF0 0000000 +#define FF1 0100000 + +#define VTDLY 0040000 +#define VT0 0000000 +#define VT1 0040000 + +#define B0 0000000 +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA 0000016 +#define EXTB 0000017 + +#define BOTHER 0010000 +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define B500000 0010005 +#define B576000 0010006 +#define B921600 0010007 +#define B1000000 0010010 +#define B1152000 0010011 +#define B1500000 0010012 +#define B2000000 0010013 +#define B2500000 0010014 +#define B3000000 0010015 +#define B3500000 0010016 +#define B4000000 0010017 + +#define CBAUD 0010017 + +#define CSIZE 0000060 +#define CS5 0000000 +#define CS6 0000020 +#define CS7 0000040 +#define CS8 0000060 +#define CSTOPB 0000100 +#define CREAD 0000200 +#define PARENB 0000400 +#define PARODD 0001000 +#define HUPCL 0002000 +#define CLOCAL 0004000 + +#define ISIG 0000001 +#define ICANON 0000002 +#define XCASE 0000004 +#define ECHO 0000010 +#define ECHOE 0000020 +#define ECHOK 0000040 +#define ECHONL 0000100 +#define NOFLSH 0000200 +#define IEXTEN 0000400 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0020000 +#define PENDIN 0040000 +#define TOSTOP 0100000 +#define ITOSTOP 0100000 + +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define CBAUDEX 0010000 +#define CIBAUD 002003600000 +#define IBSHIFT 16 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 +#define EXTPROC 0200000 +#define XTABS 0014000 +#define TIOCSER_TEMT 1 +#endif diff --git a/arch/mips64/bits/user.h b/arch/mips64/bits/user.h new file mode 100644 index 00000000..60fa1fda --- /dev/null +++ b/arch/mips64/bits/user.h @@ -0,0 +1,15 @@ +struct user { + unsigned long regs[102]; + unsigned long u_tsize, u_dsize, u_ssize; + unsigned long long start_code, start_data, start_stack; + long long signal; + unsigned long long *u_ar0; + unsigned long long magic; + char u_comm[32]; +}; + +#define ELF_NGREG 45 +#define ELF_NFPREG 33 + +typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; +typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG]; diff --git a/arch/mips64/crt_arch.h b/arch/mips64/crt_arch.h new file mode 100644 index 00000000..d148f977 --- /dev/null +++ b/arch/mips64/crt_arch.h @@ -0,0 +1,33 @@ +__asm__( +".set push\n" +".set noreorder\n" +".text \n" +".global _" START "\n" +".global " START "\n" +".global " START "_data\n" +".type _" START ", @function\n" +".type " START ", @function\n" +".type " START "_data, @function\n" +"_" START ":\n" +"" START ":\n" +".align 8 \n" +" bal 1f \n" +" move $fp, $0 \n" +"" START "_data: \n" +" .gpdword " START "_data \n" +" .gpdword " START "_c \n" +".weak _DYNAMIC \n" +".hidden _DYNAMIC \n" +" .gpdword _DYNAMIC \n" +"1: ld $gp, 0($ra) \n" +" dsubu $gp, $ra, $gp \n" +" move $4, $sp \n" +" ld $5, 16($ra) \n" +" daddu $5, $5, $gp \n" +" ld $25, 8($ra) \n" +" daddu $25, $25, $gp \n" +" and $sp, $sp, -16 \n" +" jalr $25 \n" +" nop \n" +".set pop \n" +); diff --git a/arch/mips64/ksigaction.h b/arch/mips64/ksigaction.h new file mode 100644 index 00000000..55ba18ea --- /dev/null +++ b/arch/mips64/ksigaction.h @@ -0,0 +1,8 @@ +struct k_sigaction { + unsigned flags; + void (*handler)(int); + unsigned long mask[2]; + void (*restorer)(); +}; + +void __restore(), __restore_rt(); diff --git a/arch/mips64/pthread_arch.h b/arch/mips64/pthread_arch.h new file mode 100644 index 00000000..b42edbe3 --- /dev/null +++ b/arch/mips64/pthread_arch.h @@ -0,0 +1,18 @@ +static inline struct pthread *__pthread_self() +{ +#ifdef __clang__ + char *tp; + __asm__ __volatile__ (".word 0x7c03e83b ; move %0, $3" : "=r" (tp) : : "$3" ); +#else + register char *tp __asm__("$3"); + __asm__ __volatile__ (".word 0x7c03e83b" : "=r" (tp) ); +#endif + return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); +} + +#define TLS_ABOVE_TP +#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000) + +#define DTP_OFFSET 0x8000 + +#define MC_PC pc diff --git a/arch/mips64/reloc.h b/arch/mips64/reloc.h new file mode 100644 index 00000000..5933147c --- /dev/null +++ b/arch/mips64/reloc.h @@ -0,0 +1,60 @@ +#ifndef __RELOC_H__ +#define __RELOC_H__ + +#define _GNU_SOURCE +#include + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define ENDIAN_SUFFIX "el" +#else +#define ENDIAN_SUFFIX "" +#endif + +#ifdef __mips_soft_float +#define FP_SUFFIX "-sf" +#else +#define FP_SUFFIX "" +#endif + +#define LDSO_ARCH "mips64" ENDIAN_SUFFIX FP_SUFFIX + +#define TPOFF_K (-0x7000) + +#define REL_SYM_OR_REL 4611 +#define REL_PLT R_MIPS_JUMP_SLOT +#define REL_COPY R_MIPS_COPY +#define REL_DTPMOD R_MIPS_TLS_DTPMOD64 +#define REL_DTPOFF R_MIPS_TLS_DTPREL64 +#define REL_TPOFF R_MIPS_TLS_TPREL64 + +#undef R_TYPE +#undef R_SYM +#undef R_INFO +#define R_TYPE(x) (be64toh(x)&0x7fffffff) +#define R_SYM(x) (be32toh(be64toh(x)>>32)) +#define R_INFO(s,t) (htobe64((uint64_t)htobe32(s)<<32 | (uint64_t)t)) + +#define NEED_MIPS_GOT_RELOCS 1 +#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP +#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) + +#define CRTJMP(pc,sp) __asm__ __volatile__( \ + "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" ) + +#define GETFUNCSYM(fp, sym, got) __asm__ ( \ + ".hidden " #sym "\n" \ + ".set push \n" \ + ".set noreorder \n" \ + ".align 8 \n" \ + " bal 1f \n" \ + " nop \n" \ + " .gpdword . \n" \ + " .gpdword " #sym " \n" \ + "1: ld %0, ($ra) \n" \ + " dsubu %0, $ra, %0 \n" \ + " ld $ra, 8($ra) \n" \ + " daddu %0, %0, $ra \n" \ + ".set pop \n" \ + : "=r"(*(fp)) : : "memory", "ra" ) + +#endif diff --git a/arch/mips64/syscall_arch.h b/arch/mips64/syscall_arch.h new file mode 100644 index 00000000..1bd6c18f --- /dev/null +++ b/arch/mips64/syscall_arch.h @@ -0,0 +1,281 @@ +#define __SYSCALL_LL_E(x) (x) +#define __SYSCALL_LL_O(x) (x) + +__attribute__((visibility("hidden"))) +long (__syscall)(long, ...); + +#define SYSCALL_RLIM_INFINITY (-1UL/2) + +#include +struct kernel_stat { + unsigned int st_dev; + unsigned int __pad1[3]; + unsigned long long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + int st_uid; + int st_gid; + unsigned int st_rdev; + unsigned int __pad2[3]; + long long st_size; + unsigned int st_atime_sec; + unsigned int st_atime_nsec; + unsigned int st_mtime_sec; + unsigned int st_mtime_nsec; + unsigned int st_ctime_sec; + unsigned int st_ctime_nsec; + unsigned int st_blksize; + unsigned int __pad3; + unsigned long long st_blocks; +}; + +static void __stat_fix(struct kernel_stat *kst, struct stat *st) +{ + st->st_dev = kst->st_dev; + st->st_ino = kst->st_ino; + st->st_mode = kst->st_mode; + st->st_nlink = kst->st_nlink; + st->st_uid = kst->st_uid; + st->st_gid = kst->st_gid; + st->st_rdev = kst->st_rdev; + st->st_size = kst->st_size; + st->st_atim.tv_sec = kst->st_atime_sec; + st->st_atim.tv_nsec = kst->st_atime_nsec; + st->st_mtim.tv_sec = kst->st_mtime_sec; + st->st_mtim.tv_nsec = kst->st_mtime_nsec; + st->st_ctim.tv_sec = kst->st_ctime_sec; + st->st_ctim.tv_nsec = kst->st_ctime_nsec; + st->st_blksize = kst->st_blksize; + st->st_blocks = kst->st_blocks; +} + +#ifndef __clang__ + +static inline long __syscall0(long n) +{ + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "daddu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + return r7 ? -r2 : r2; +} + +static inline long __syscall1(long n, long a) +{ + register long r4 __asm__("$4") = a; + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "daddu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + return r7 ? -r2 : r2; +} + +static inline long __syscall2(long n, long a, long b) +{ + struct kernel_stat kst; + long ret; + register long r4 __asm__("$4"); + register long r5 __asm__("$5"); + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + + r5 = b; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + r5 = (long) &kst; + + r4 = a; + __asm__ __volatile__ ( + "daddu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4), "r"(r5) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + + if (r7) return -r2; + ret = r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)b); + + return ret; +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + struct kernel_stat kst; + long ret; + register long r4 __asm__("$4"); + register long r5 __asm__("$5"); + register long r6 __asm__("$6"); + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + + r5 = b; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + r5 = (long) &kst; + + r4 = a; + r6 = c; + __asm__ __volatile__ ( + "daddu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4), "r"(r5), "r"(r6) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + + if (r7) return -r2; + ret = r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)b); + + return ret; +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + struct kernel_stat kst; + long ret; + register long r4 __asm__("$4"); + register long r5 __asm__("$5"); + register long r6 __asm__("$6"); + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + + r5 = b; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + r5 = (long) &kst; + + r4 = a; + r6 = c; + r7 = d; + __asm__ __volatile__ ( + "daddu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4), "r"(r5), "r"(r6) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + + if (r7) return -r2; + ret = r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)b); + + return ret; +} + +#else + +static inline long __syscall0(long n) +{ + return (__syscall)(n); +} + +static inline long __syscall1(long n, long a) +{ + return (__syscall)(n, a); +} + +static inline long __syscall2(long n, long a, long b) +{ + long r2; + long old_b = b; + struct kernel_stat kst; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + b = (long) &kst; + + r2 = (__syscall)(n, a, b); + if (r2 > -4096UL) return r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)old_b); + + return r2; +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + long r2; + long old_b = b; + struct kernel_stat kst; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + b = (long) &kst; + + r2 = (__syscall)(n, a, b, c); + if (r2 > -4096UL) return r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)old_b); + + return r2; +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + long r2; + long old_b = b; + struct kernel_stat kst; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + b = (long) &kst; + + r2 = (__syscall)(n, a, b, c, d); + if (r2 > -4096UL) return r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)old_b); + + return r2; +} + +#endif + +static inline long __syscall5(long n, long a, long b, long c, long d, long e) +{ + long r2; + long old_b = b; + struct kernel_stat kst; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + b = (long) &kst; + + r2 = (__syscall)(n, a, b, c, d, e); + if (r2 > -4096UL) return r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)old_b); + + return r2; +} + +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) +{ + long r2; + long old_b = b; + struct kernel_stat kst; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + b = (long) &kst; + + r2 = (__syscall)(n, a, b, c, d, e, f); + if (r2 > -4096UL) return r2; + + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + __stat_fix(&kst, (struct stat *)old_b); + + return r2; +} + +#define VDSO_USEFUL +#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT_VER "LINUX_2.6" diff --git a/configure b/configure index 0955ce68..89e0d177 100755 --- a/configure +++ b/configure @@ -299,7 +299,7 @@ printf "%s\n" "$target" # case "$target" in # Catch these early to simplify matching for 32-bit archs -mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;; +powerpc64*) fail "$0: unsupported target \"$target\"" ;; arm*) ARCH=arm ;; aarch64*) ARCH=aarch64 ;; i?86-nt32*) ARCH=nt32 ;; @@ -307,6 +307,7 @@ i?86*) ARCH=i386 ;; x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; x86_64-nt64*) ARCH=nt64 ;; x86_64*) ARCH=x86_64 ;; +mips64*) ARCH=mips64 ;; mips*) ARCH=mips ;; microblaze*) ARCH=microblaze ;; or1k*) ARCH=or1k ;; @@ -615,6 +616,11 @@ trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi +if test "$ARCH" = "mips64" ; then +trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el +trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf +fi + test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ && SUBARCH=${SUBARCH}el diff --git a/crt/mips64/crti.s b/crt/mips64/crti.s new file mode 100644 index 00000000..c962dd09 --- /dev/null +++ b/crt/mips64/crti.s @@ -0,0 +1,17 @@ +.set noreorder + +.section .init +.global _init +.align 3 +_init: + dsubu $sp, $sp, 32 + sd $gp, 16($sp) + sd $ra, 24($sp) + +.section .fini +.global _fini +.align 3 +_fini: + dsubu $sp, $sp, 32 + sd $gp, 16($sp) + sd $ra, 24($sp) diff --git a/crt/mips64/crtn.s b/crt/mips64/crtn.s new file mode 100644 index 00000000..f3930b24 --- /dev/null +++ b/crt/mips64/crtn.s @@ -0,0 +1,13 @@ +.set noreorder + +.section .init + ld $gp,16($sp) + ld $ra,24($sp) + j $ra + daddu $sp,$sp,32 + +.section .fini + ld $gp,16($sp) + ld $ra,24($sp) + j $ra + daddu $sp,$sp,32 diff --git a/src/fenv/mips64/fenv-sf.c b/src/fenv/mips64/fenv-sf.c new file mode 100644 index 00000000..4aa3dbf1 --- /dev/null +++ b/src/fenv/mips64/fenv-sf.c @@ -0,0 +1,3 @@ +#ifdef __mips_soft_float +#include "../fenv.c" +#endif diff --git a/src/fenv/mips64/fenv.S b/src/fenv/mips64/fenv.S new file mode 100644 index 00000000..3cba3f0f --- /dev/null +++ b/src/fenv/mips64/fenv.S @@ -0,0 +1,71 @@ +#ifndef __mips_soft_float + +.set noreorder + +.global feclearexcept +.type feclearexcept,@function +feclearexcept: + and $4, $4, 0x7c + cfc1 $5, $31 + or $5, $5, $4 + xor $5, $5, $4 + ctc1 $5, $31 + jr $ra + li $2, 0 + +.global feraiseexcept +.type feraiseexcept,@function +feraiseexcept: + and $4, $4, 0x7c + cfc1 $5, $31 + or $5, $5, $4 + ctc1 $5, $31 + jr $ra + li $2, 0 + +.global fetestexcept +.type fetestexcept,@function +fetestexcept: + and $4, $4, 0x7c + cfc1 $2, $31 + jr $ra + and $2, $2, $4 + +.global fegetround +.type fegetround,@function +fegetround: + cfc1 $2, $31 + jr $ra + andi $2, $2, 3 + +.global __fesetround +.type __fesetround,@function +__fesetround: + cfc1 $5, $31 + li $6, -4 + and $5, $5, $6 + or $5, $5, $4 + ctc1 $5, $31 + jr $ra + li $2, 0 + +.global fegetenv +.type fegetenv,@function +fegetenv: + cfc1 $5, $31 + sw $5, 0($4) + jr $ra + li $2, 0 + +.global fesetenv +.type fesetenv,@function +fesetenv: + daddiu $5, $4, 1 + beq $5, $0, 1f + nop + lw $5, 0($4) +1: ctc1 $5, $31 + jr $ra + li $2, 0 + +#endif diff --git a/src/internal/mips64/syscall.s b/src/internal/mips64/syscall.s new file mode 100644 index 00000000..98448667 --- /dev/null +++ b/src/internal/mips64/syscall.s @@ -0,0 +1,19 @@ +.set noreorder +.global __syscall +.hidden __syscall +.type __syscall,@function +__syscall: + move $2, $4 + move $4, $5 + move $5, $6 + move $6, $7 + move $7, $8 + move $8, $9 + move $9, $10 + move $10, $11 + syscall + beq $7, $0, 1f + nop + dsubu $2, $0, $2 +1: jr $ra + nop diff --git a/src/ldso/mips64/dlsym.s b/src/ldso/mips64/dlsym.s new file mode 100644 index 00000000..32e0dddc --- /dev/null +++ b/src/ldso/mips64/dlsym.s @@ -0,0 +1,17 @@ +.set noreorder +.global dlsym +.hidden __dlsym +.type dlsym,@function +dlsym: + lui $3, %hi(%neg(%gp_rel(dlsym))) + daddiu $3, $3, %lo(%neg(%gp_rel(dlsym))) + daddu $3, $3, $25 + move $6, $ra + ld $25, %got_disp(__dlsym)($3) + daddiu $sp, $sp, -32 + sd $ra, 24($sp) + jalr $25 + nop + ld $ra, 24($sp) + jr $ra + daddiu $sp, $sp, 32 diff --git a/src/setjmp/mips64/longjmp.S b/src/setjmp/mips64/longjmp.S new file mode 100644 index 00000000..3db8a883 --- /dev/null +++ b/src/setjmp/mips64/longjmp.S @@ -0,0 +1,37 @@ +.set noreorder +.global _longjmp +.global longjmp +.type _longjmp,@function +.type longjmp,@function +_longjmp: +longjmp: + move $2, $5 + + bne $2, $0, 1f + nop + daddu $2, $2, 1 +1: +#ifndef __mips_soft_float + ldc1 $24, 96($4) + ldc1 $25, 104($4) + ldc1 $26, 112($4) + ldc1 $27, 120($4) + ldc1 $28, 128($4) + ldc1 $29, 136($4) + ldc1 $30, 144($4) + ldc1 $31, 152($4) +#endif + ld $ra, 0($4) + ld $sp, 8($4) + ld $gp, 16($4) + ld $16, 24($4) + ld $17, 32($4) + ld $18, 40($4) + ld $19, 48($4) + ld $20, 56($4) + ld $21, 64($4) + ld $22, 72($4) + ld $23, 80($4) + ld $30, 88($4) + jr $ra + nop diff --git a/src/setjmp/mips64/setjmp.S b/src/setjmp/mips64/setjmp.S new file mode 100644 index 00000000..b9646c2a --- /dev/null +++ b/src/setjmp/mips64/setjmp.S @@ -0,0 +1,34 @@ +.set noreorder +.global __setjmp +.global _setjmp +.global setjmp +.type __setjmp,@function +.type _setjmp,@function +.type setjmp,@function +__setjmp: +_setjmp: +setjmp: + sd $ra, 0($4) + sd $sp, 8($4) + sd $gp, 16($4) + sd $16, 24($4) + sd $17, 32($4) + sd $18, 40($4) + sd $19, 48($4) + sd $20, 56($4) + sd $21, 64($4) + sd $22, 72($4) + sd $23, 80($4) + sd $30, 88($4) +#ifndef __mips_soft_float + sdc1 $24, 96($4) + sdc1 $25, 104($4) + sdc1 $26, 112($4) + sdc1 $27, 120($4) + sdc1 $28, 128($4) + sdc1 $29, 136($4) + sdc1 $30, 144($4) + sdc1 $31, 152($4) +#endif + jr $ra + li $2, 0 diff --git a/src/signal/mips64/restore.s b/src/signal/mips64/restore.s new file mode 100644 index 00000000..e8988369 --- /dev/null +++ b/src/signal/mips64/restore.s @@ -0,0 +1,9 @@ +.set noreorder +.global __restore_rt +.global __restore +.type __restore_rt,@function +.type __restore,@function +__restore_rt: +__restore: + li $2,5211 + syscall diff --git a/src/signal/mips64/sigsetjmp.s b/src/signal/mips64/sigsetjmp.s new file mode 100644 index 00000000..156e70bd --- /dev/null +++ b/src/signal/mips64/sigsetjmp.s @@ -0,0 +1,38 @@ +.set noreorder +.global sigsetjmp +.global __sigsetjmp +.type sigsetjmp,@function +.type __sigsetjmp,@function +sigsetjmp: +__sigsetjmp: + lui $3, %hi(%neg(%gp_rel(sigsetjmp))) + daddiu $3, $3, %lo(%neg(%gp_rel(sigsetjmp))) + + # comparing save mask with 0, if equals to 0 then + # sigsetjmp is equal to setjmp. + beq $5, $0, 1f + daddu $3, $3, $25 + sd $ra, 160($4) + sd $16, 168($4) + + # save base of got so that we can use it later + # once we return from 'longjmp' + sd $3, 176($4) + ld $25, %got_disp(setjmp)($3) + jalr $25 + move $16, $4 + + move $5, $2 # Return from 'setjmp' or 'longjmp' + move $4, $16 # Restore the pointer-to-sigjmp_buf + ld $ra, 160($4) # Restore ra of sigsetjmp + ld $16, 168($4) # Restore $16 of sigsetjmp + ld $3, 176($4) # Restore base of got + +.hidden __sigsetjmp_tail + ld $25, %got_disp(__sigsetjmp_tail)($3) + jr $25 + nop +1: + ld $25, %got_disp(setjmp)($3) + jr $25 + nop diff --git a/src/thread/mips64/__unmapself.s b/src/thread/mips64/__unmapself.s new file mode 100644 index 00000000..f6795cda --- /dev/null +++ b/src/thread/mips64/__unmapself.s @@ -0,0 +1,9 @@ +.set noreorder +.global __unmapself +.type __unmapself, @function +__unmapself: + li $2, 5011 + syscall + li $4, 0 + li $2, 5058 + syscall diff --git a/src/thread/mips64/clone.s b/src/thread/mips64/clone.s new file mode 100644 index 00000000..229d2677 --- /dev/null +++ b/src/thread/mips64/clone.s @@ -0,0 +1,30 @@ +.set noreorder +.global __clone +.type __clone,@function +__clone: + # Save function pointer and argument pointer on new thread stack + and $5, $5, -16 # aligning stack to double word + dsubu $5, $5, 16 + sd $4, 0($5) # save function pointer + sd $7, 8($5) # save argument pointer + + # Shuffle (fn,sp,fl,arg,ptid,tls,ctid) to (fl,sp,ptid,tls,ctid) + # sys_clone(u64 flags, u64 ustack_base, u64 parent_tidptr, u64 child_tidptr, u64 tls) + move $4, $6 + move $6, $8 + move $7, $9 + move $8, $10 + li $2, 5055 + syscall + beq $7, $0, 1f + nop + jr $ra + dsubu $2, $0, $2 +1: beq $2, $0, 1f + nop + jr $ra + nop +1: ld $25, 0($sp) # function pointer + ld $4, 8($sp) # argument pointer + jr $25 # call the user's function + nop diff --git a/src/thread/mips64/syscall_cp.s b/src/thread/mips64/syscall_cp.s new file mode 100644 index 00000000..0d4ede76 --- /dev/null +++ b/src/thread/mips64/syscall_cp.s @@ -0,0 +1,52 @@ +.set noreorder +.global __cp_begin +.hidden __cp_begin +.type __cp_begin,@function +.global __cp_end +.hidden __cp_end +.type __cp_end,@function +.global __cp_cancel +.hidden __cp_cancel +.type __cp_cancel,@function +.global __cp_cancel_data +.hidden __cp_cancel_data +.type __cp_cancel_data,@function +.hidden __cancel +.global __syscall_cp_asm +.hidden __syscall_cp_asm +.type __syscall_cp_asm,@function +__syscall_cp_asm: +__cp_begin: + lw $4, 0($4) + bne $4, $0, __cp_cancel + move $2, $5 + move $4, $6 + move $5, $7 + move $6, $8 + move $7, $9 + move $8, $10 + move $9, $11 + ld $10, 0($sp) + syscall +__cp_end: + beq $7, $0, 1f + nop + dsubu $2, $0, $2 +1: jr $ra + nop + + # if cancellation flag is 1 then call __cancel +__cp_cancel: + move $2, $ra +.align 8 + bal 1f + nop +__cp_cancel_data: + .gpdword __cp_cancel_data + .gpdword __cancel +1: ld $3, ($ra) + dsubu $3, $ra, $3 + ld $25, 8($ra) + daddu $25, $25, $3 + jr $25 + move $ra, $2 diff --git a/src/unistd/mips64/pipe.s b/src/unistd/mips64/pipe.s new file mode 100644 index 00000000..f8a27dcc --- /dev/null +++ b/src/unistd/mips64/pipe.s @@ -0,0 +1,19 @@ +.set noreorder +.global pipe +.type pipe,@function +pipe: + lui $3, %hi(%neg(%gp_rel(pipe))) + daddiu $3, $3, %lo(%neg(%gp_rel(pipe))) + daddu $3, $3, $25 + li $2, 5021 + syscall + beq $7, $0, 1f + nop + ld $25, %got_disp(__syscall_ret)($3) + jr $25 + dsubu $4, $0, $2 +1: sw $2, 0($4) + sw $3, 4($4) + move $2, $0 + jr $ra + nop From 589aefa5b061647e8b9ad9bca3aaa8dc6222460a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 6 Mar 2016 17:48:58 +0000 Subject: [PATCH 074/412] update documentation files for mips64 port --- COPYRIGHT | 5 +++++ INSTALL | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/COPYRIGHT b/COPYRIGHT index f7f1a1f2..1b20b230 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -43,6 +43,7 @@ Gianluca Anzolin Hauke Mehrtens Hiltjo Posthuma Isaac Dunham +Jaydeep Patil Jens Gustedt Jeremy Huntwork Jo-Philipp Wich @@ -55,6 +56,7 @@ Kylie McClain Luca Barbato Luka Perkov M Farkas-Dyck (Strake) +Mahesh Bodapati Michael Forney Natanael Copa Nicholas J. Kain @@ -123,6 +125,9 @@ Pennington for use in the ellcc project. The original code was adapted by Rich Felker for build system and code conventions during upstream integration. It is licensed under the standard MIT terms. +The mips64 port was contributed by Imagination Technologies and is +licensed under the standard MIT terms. + The powerpc port was also originally written by Richard Pennington, and later supplemented and integrated by John Spencer. It is licensed under the standard MIT terms. diff --git a/INSTALL b/INSTALL index 9f33910b..526c3f62 100644 --- a/INSTALL +++ b/INSTALL @@ -62,6 +62,12 @@ and ABI combinations: * MIPS2 or later, or kernel emulation of ll/sc (standard in Linux) is required +* MIPS64 + * ABI is n64 (LP64) + * Big-endian default; little-endian variants also supported + * Default ABI variant uses FPU registers; alternate soft-float ABI + that does not use FPU registers or instructions is available + * PowerPC * Only 32-bit is supported * Compiler toolchain must provide 64-bit long double, not IBM From 9543656cc32fda48fc463f332ee20e91eed2b768 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sun, 6 Mar 2016 20:22:38 +0300 Subject: [PATCH 075/412] env: avoid leaving dangling pointers in __env_map This is the minimal fix for __putenv leaving a pointer to freed heap storage in __env_map array, which could later on lead to errors such as double-free. --- src/env/putenv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/env/putenv.c b/src/env/putenv.c index 4042869b..71530426 100644 --- a/src/env/putenv.c +++ b/src/env/putenv.c @@ -30,6 +30,7 @@ int __putenv(char *s, int a) } } else { free(__env_map[j]); + __env_map[j] = s; } } } From 5a92dd95c77cee81755f1a441ae0b71e3ae2bcdb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 25 Jan 2016 13:20:52 +0100 Subject: [PATCH 076/412] add powerpc soft-float support Some PowerPC CPUs (e.g. Freescale MPC85xx) have a completely different instruction set for floating point operations (SPE). Executing regular PowerPC floating point instructions results in "Illegal instruction" errors. Make it possible to run these devices in soft-float mode. --- arch/powerpc/bits/fenv.h | 5 +++ arch/powerpc/reloc.h | 8 +++- configure | 4 ++ src/fenv/powerpc/fenv-sf.c | 3 ++ src/fenv/powerpc/{fenv.s => fenv.S} | 42 ++++++++++++--------- src/setjmp/powerpc/{longjmp.s => longjmp.S} | 24 +++++++----- src/setjmp/powerpc/{setjmp.s => setjmp.S} | 14 ++++--- 7 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 src/fenv/powerpc/fenv-sf.c rename src/fenv/powerpc/{fenv.s => fenv.S} (68%) rename src/setjmp/powerpc/{longjmp.s => longjmp.S} (63%) rename src/setjmp/powerpc/{setjmp.s => setjmp.S} (79%) diff --git a/arch/powerpc/bits/fenv.h b/arch/powerpc/bits/fenv.h index 2f722e6b..c5a3e5c5 100644 --- a/arch/powerpc/bits/fenv.h +++ b/arch/powerpc/bits/fenv.h @@ -1,3 +1,7 @@ +#ifdef _SOFT_FLOAT +#define FE_ALL_EXCEPT 0 +#define FE_TONEAREST 0 +#else #define FE_TONEAREST 0 #define FE_TOWARDZERO 1 #define FE_UPWARD 2 @@ -24,6 +28,7 @@ #define FE_ALL_INVALID 0x01f80700 #endif +#endif typedef unsigned fexcept_t; typedef double fenv_t; diff --git a/arch/powerpc/reloc.h b/arch/powerpc/reloc.h index b8b6589f..1b4cab36 100644 --- a/arch/powerpc/reloc.h +++ b/arch/powerpc/reloc.h @@ -1,4 +1,10 @@ -#define LDSO_ARCH "powerpc" +#ifdef _SOFT_FLOAT +#define FP_SUFFIX "-sf" +#else +#define FP_SUFFIX "" +#endif + +#define LDSO_ARCH "powerpc" FP_SUFFIX #define TPOFF_K (-0x7000) diff --git a/configure b/configure index 89e0d177..9c0762c9 100755 --- a/configure +++ b/configure @@ -621,6 +621,10 @@ trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi +if test "$ARCH" = "powerpc" ; then +trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf +fi + test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ && SUBARCH=${SUBARCH}el diff --git a/src/fenv/powerpc/fenv-sf.c b/src/fenv/powerpc/fenv-sf.c new file mode 100644 index 00000000..85bef40f --- /dev/null +++ b/src/fenv/powerpc/fenv-sf.c @@ -0,0 +1,3 @@ +#ifdef _SOFT_FLOAT +#include "../fenv.c" +#endif diff --git a/src/fenv/powerpc/fenv.s b/src/fenv/powerpc/fenv.S similarity index 68% rename from src/fenv/powerpc/fenv.s rename to src/fenv/powerpc/fenv.S index e34a9990..1516eb5c 100644 --- a/src/fenv/powerpc/fenv.s +++ b/src/fenv/powerpc/fenv.S @@ -1,18 +1,21 @@ +#ifndef _SOFT_FLOAT .global feclearexcept .type feclearexcept,@function feclearexcept: andis. 3,3,0x3e00 - # if (r3 & FE_INVALID) r3 |= all_invalid_flags + /* if (r3 & FE_INVALID) r3 |= all_invalid_flags */ andis. 0,3,0x2000 stwu 1,-16(1) beq- 0,1f oris 3,3,0x01f8 ori 3,3,0x0700 1: - # note: fpscr contains various fpu status and control - # flags and we dont check if r3 may alter other flags - # than the exception related ones - # fpscr &= ~r3 + /* + * note: fpscr contains various fpu status and control + * flags and we dont check if r3 may alter other flags + * than the exception related ones + * ufpscr &= ~r3 + */ mffs 0 stfd 0,8(1) lwz 9,12(1) @@ -21,7 +24,7 @@ feclearexcept: lfd 0,8(1) mtfsf 255,0 - # return 0 + /* return 0 */ li 3,0 addi 1,1,16 blr @@ -30,13 +33,13 @@ feclearexcept: .type feraiseexcept,@function feraiseexcept: andis. 3,3,0x3e00 - # if (r3 & FE_INVALID) r3 |= software_invalid_flag + /* if (r3 & FE_INVALID) r3 |= software_invalid_flag */ andis. 0,3,0x2000 stwu 1,-16(1) beq- 0,1f ori 3,3,0x0400 1: - # fpscr |= r3 + /* fpscr |= r3 */ mffs 0 stfd 0,8(1) lwz 9,12(1) @@ -45,7 +48,7 @@ feraiseexcept: lfd 0,8(1) mtfsf 255,0 - # return 0 + /* return 0 */ li 3,0 addi 1,1,16 blr @@ -54,7 +57,7 @@ feraiseexcept: .type fetestexcept,@function fetestexcept: andis. 3,3,0x3e00 - # return r3 & fpscr + /* return r3 & fpscr */ stwu 1,-16(1) mffs 0 stfd 0,8(1) @@ -66,7 +69,7 @@ fetestexcept: .global fegetround .type fegetround,@function fegetround: - # return fpscr & 3 + /* return fpscr & 3 */ stwu 1,-16(1) mffs 0 stfd 0,8(1) @@ -78,8 +81,10 @@ fegetround: .global __fesetround .type __fesetround,@function __fesetround: - # note: invalid input is not checked, r3 < 4 must hold - # fpscr = (fpscr & -4U) | r3 + /* + * note: invalid input is not checked, r3 < 4 must hold + * fpscr = (fpscr & -4U) | r3 + */ stwu 1,-16(1) mffs 0 stfd 0,8(1) @@ -90,7 +95,7 @@ __fesetround: lfd 0,8(1) mtfsf 255,0 - # return 0 + /* return 0 */ li 3,0 addi 1,1,16 blr @@ -98,10 +103,10 @@ __fesetround: .global fegetenv .type fegetenv,@function fegetenv: - # *r3 = fpscr + /* *r3 = fpscr */ mffs 0 stfd 0,0(3) - # return 0 + /* return 0 */ li 3,0 blr @@ -115,9 +120,10 @@ fesetenv: .zero 8 2: mflr 3 mtlr 4 -1: # fpscr = *r3 +1: /* fpscr = *r3 */ lfd 0,0(3) mtfsf 255,0 - # return 0 + /* return 0 */ li 3,0 blr +#endif diff --git a/src/setjmp/powerpc/longjmp.s b/src/setjmp/powerpc/longjmp.S similarity index 63% rename from src/setjmp/powerpc/longjmp.s rename to src/setjmp/powerpc/longjmp.S index bab17511..e598bd05 100644 --- a/src/setjmp/powerpc/longjmp.s +++ b/src/setjmp/powerpc/longjmp.S @@ -4,19 +4,21 @@ .type longjmp,@function _longjmp: longjmp: -# void longjmp(jmp_buf env, int val); -# put val into return register and restore the env saved in setjmp -# if val(r4) is 0, put 1 there. - # 0) move old return address into r0 + /* + * void longjmp(jmp_buf env, int val); + * put val into return register and restore the env saved in setjmp + * if val(r4) is 0, put 1 there. + */ + /* 0) move old return address into r0 */ lwz 0, 0(3) - # 1) put it into link reg + /* 1) put it into link reg */ mtlr 0 - #2 ) restore stack ptr + /* 2 ) restore stack ptr */ lwz 1, 4(3) - #3) restore control reg + /* 3) restore control reg */ lwz 0, 8(3) mtcr 0 - #4) restore r14-r31 + /* 4) restore r14-r31 */ lwz 14, 12(3) lwz 15, 16(3) lwz 16, 20(3) @@ -35,6 +37,7 @@ longjmp: lwz 29, 72(3) lwz 30, 76(3) lwz 31, 80(3) +#ifndef _SOFT_FLOAT lfd 14,88(3) lfd 15,96(3) lfd 16,104(3) @@ -53,10 +56,11 @@ longjmp: lfd 29,208(3) lfd 30,216(3) lfd 31,224(3) - #5) put val into return reg r3 +#endif + /* 5) put val into return reg r3 */ mr 3, 4 - #6) check if return value is 0, make it 1 in that case + /* 6) check if return value is 0, make it 1 in that case */ cmpwi cr7, 4, 0 bne cr7, 1f li 3, 1 diff --git a/src/setjmp/powerpc/setjmp.s b/src/setjmp/powerpc/setjmp.S similarity index 79% rename from src/setjmp/powerpc/setjmp.s rename to src/setjmp/powerpc/setjmp.S index 122177f1..cd91a207 100644 --- a/src/setjmp/powerpc/setjmp.s +++ b/src/setjmp/powerpc/setjmp.S @@ -10,15 +10,15 @@ ___setjmp: __setjmp: _setjmp: setjmp: - # 0) store IP int 0, then into the jmpbuf pointed to by r3 (first arg) + /* 0) store IP int 0, then into the jmpbuf pointed to by r3 (first arg) */ mflr 0 stw 0, 0(3) - # 1) store reg1 (SP) + /* 1) store reg1 (SP) */ stw 1, 4(3) - # 2) store cr + /* 2) store cr */ mfcr 0 stw 0, 8(3) - # 3) store r14-31 + /* 3) store r14-31 */ stw 14, 12(3) stw 15, 16(3) stw 16, 20(3) @@ -37,6 +37,7 @@ setjmp: stw 29, 72(3) stw 30, 76(3) stw 31, 80(3) +#ifndef _SOFT_FLOAT stfd 14,88(3) stfd 15,96(3) stfd 16,104(3) @@ -55,7 +56,8 @@ setjmp: stfd 29,208(3) stfd 30,216(3) stfd 31,224(3) - # 4) set return value to 0 +#endif + /* 4) set return value to 0 */ li 3, 0 - # 5) return + /* 5) return */ blr From 636a4799dd5bf11a1fcd209906c088ed948b821c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 6 Mar 2016 17:11:29 -0500 Subject: [PATCH 077/412] make configure check for unsupported (SPE) powerpc hard-float models the SPE ABI may be compatible with soft-float, but actually making it work requires some additional work, so for now it's best to make sure broken builds don't happen. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 9c0762c9..213a8254 100755 --- a/configure +++ b/configure @@ -622,6 +622,8 @@ trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi if test "$ARCH" = "powerpc" ; then +trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \ + "$0: error: compiler's floating point configuration is unsupported" trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf fi From 27bf42cd9d85e242f1ffac8d99330da120c8dfdb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 11 Mar 2016 00:02:10 -0500 Subject: [PATCH 078/412] make mips64 a_sc_p atomic primitive's asm constraints work with clang apparently clang does not accept matching-register input and output constraints that differ in size (32-bit vs 64-bit). based on patch by Jaydeep Patil. --- arch/mips64/atomic_arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips64/atomic_arch.h b/arch/mips64/atomic_arch.h index 49d9884a..8664e11c 100644 --- a/arch/mips64/atomic_arch.h +++ b/arch/mips64/atomic_arch.h @@ -31,7 +31,7 @@ static inline void *a_ll_p(volatile long *p) #define a_sc_p a_sc_p static inline int a_sc_p(volatile long *p, void *v) { - int r; + long r; __asm__ __volatile__ ( "scd %0, %1" : "=r"(r), "=m"(*p) : "0"(v) : "memory"); From de400b6609becbc6a5ae87fa8b155f02a860e257 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 11 Mar 2016 05:12:56 +0000 Subject: [PATCH 079/412] correct pointer types for a_ll_p and a_sc_p primitives on mips64 these changes should not affect generated code, but they reflect that the underlying objects operated on by a_cas_p are supposed to have type volatile void *, not volatile long. in theory a compiler could treat the effective type mismatch in the "m" memory operands as undefined behavior. --- arch/mips64/atomic_arch.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mips64/atomic_arch.h b/arch/mips64/atomic_arch.h index 8664e11c..b468fd95 100644 --- a/arch/mips64/atomic_arch.h +++ b/arch/mips64/atomic_arch.h @@ -19,22 +19,22 @@ static inline int a_sc(volatile int *p, int v) } #define a_ll_p a_ll_p -static inline void *a_ll_p(volatile long *p) +static inline void *a_ll_p(volatile void *p) { void *v; __asm__ __volatile__ ( "lld %0, %1" - : "=r"(v) : "m"(*p)); + : "=r"(v) : "m"(*(void *volatile *)p)); return v; } #define a_sc_p a_sc_p -static inline int a_sc_p(volatile long *p, void *v) +static inline int a_sc_p(volatile void *p, void *v) { long r; __asm__ __volatile__ ( "scd %0, %1" - : "=r"(r), "=m"(*p) : "0"(v) : "memory"); + : "=r"(r), "=m"(*(void *volatile *)p) : "0"(v) : "memory"); return r; } From 4aac019a0efd59011a48d031ad046c934c7e8365 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 16 Mar 2016 16:35:22 -0400 Subject: [PATCH 080/412] fix padding string formats to width in wide printf variants the idiom fprintf(f, "%.*s", n, "") was wrongly used in vfwprintf as a means of producing n spaces; instead it produces no output. the correct form is fprintf(f, "%*s", n, ""), using width instead of precision, since for %s the later is a maximum rather than a minimum. --- src/stdio/vfwprintf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index f06d5aed..f9f1ecfd 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -288,9 +288,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ z = wmemchr(a, 0, p); if (z) p=z-a; if (w Date: Fri, 18 Mar 2016 00:57:52 +0000 Subject: [PATCH 081/412] deduplicate bits/mman.h currently five targets use the same mman.h constants and the rest share most constants too, so move them to sys/mman.h before the bits/mman.h include where the differences can be corrected by redefinition of the macros. this fixes two minor bugs: POSIX_MADV_DONTNEED was wrong on most targets (it should be the same as MADV_DONTNEED), and sh defined the x86-only MAP_32BIT mmap flag. --- arch/aarch64/bits/mman.h | 58 ----------------------------------- arch/arm/bits/mman.h | 59 ------------------------------------ arch/generic/bits/mman.h | 0 arch/i386/bits/mman.h | 59 ------------------------------------ arch/microblaze/bits/mman.h | 59 ------------------------------------ arch/mips/bits/mman.h | 56 +++++++--------------------------- arch/mips64/bits/mman.h | 56 +++++++--------------------------- arch/or1k/bits/mman.h | 59 ------------------------------------ arch/powerpc/bits/mman.h | 58 ++--------------------------------- arch/sh/bits/mman.h | 60 ------------------------------------- arch/x32/bits/mman.h | 59 ------------------------------------ arch/x86_64/bits/mman.h | 59 ------------------------------------ include/sys/mman.h | 59 ++++++++++++++++++++++++++++++++++++ 13 files changed, 84 insertions(+), 617 deletions(-) delete mode 100644 arch/aarch64/bits/mman.h delete mode 100644 arch/arm/bits/mman.h create mode 100644 arch/generic/bits/mman.h delete mode 100644 arch/microblaze/bits/mman.h delete mode 100644 arch/or1k/bits/mman.h delete mode 100644 arch/sh/bits/mman.h diff --git a/arch/aarch64/bits/mman.h b/arch/aarch64/bits/mman.h deleted file mode 100644 index 31ece5bf..00000000 --- a/arch/aarch64/bits/mman.h +++ /dev/null @@ -1,58 +0,0 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/arm/bits/mman.h b/arch/arm/bits/mman.h deleted file mode 100644 index ea6f6a78..00000000 --- a/arch/arm/bits/mman.h +++ /dev/null @@ -1,59 +0,0 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/generic/bits/mman.h b/arch/generic/bits/mman.h new file mode 100644 index 00000000..e69de29b diff --git a/arch/i386/bits/mman.h b/arch/i386/bits/mman.h index 0c9022fd..ba2d6f7a 100644 --- a/arch/i386/bits/mman.h +++ b/arch/i386/bits/mman.h @@ -1,60 +1 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON #define MAP_32BIT 0x40 -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/microblaze/bits/mman.h b/arch/microblaze/bits/mman.h deleted file mode 100644 index ea6f6a78..00000000 --- a/arch/microblaze/bits/mman.h +++ /dev/null @@ -1,59 +0,0 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/mips/bits/mman.h b/arch/mips/bits/mman.h index cb9ac539..c68aea88 100644 --- a/arch/mips/bits/mman.h +++ b/arch/mips/bits/mman.h @@ -1,58 +1,24 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 +#undef MAP_ANON #define MAP_ANON 0x800 -#define MAP_ANONYMOUS MAP_ANON +#undef MAP_NORESERVE #define MAP_NORESERVE 0x0400 +#undef MAP_GROWSDOWN #define MAP_GROWSDOWN 0x1000 +#undef MAP_DENYWRITE #define MAP_DENYWRITE 0x2000 +#undef MAP_EXECUTABLE #define MAP_EXECUTABLE 0x4000 +#undef MAP_LOCKED #define MAP_LOCKED 0x8000 +#undef MAP_POPULATE #define MAP_POPULATE 0x10000 +#undef MAP_NONBLOCK #define MAP_NONBLOCK 0x20000 +#undef MAP_STACK #define MAP_STACK 0x40000 +#undef MAP_HUGETLB #define MAP_HUGETLB 0x80000 -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 +#undef MADV_SOFT_OFFLINE #endif diff --git a/arch/mips64/bits/mman.h b/arch/mips64/bits/mman.h index cb9ac539..c68aea88 100644 --- a/arch/mips64/bits/mman.h +++ b/arch/mips64/bits/mman.h @@ -1,58 +1,24 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 +#undef MAP_ANON #define MAP_ANON 0x800 -#define MAP_ANONYMOUS MAP_ANON +#undef MAP_NORESERVE #define MAP_NORESERVE 0x0400 +#undef MAP_GROWSDOWN #define MAP_GROWSDOWN 0x1000 +#undef MAP_DENYWRITE #define MAP_DENYWRITE 0x2000 +#undef MAP_EXECUTABLE #define MAP_EXECUTABLE 0x4000 +#undef MAP_LOCKED #define MAP_LOCKED 0x8000 +#undef MAP_POPULATE #define MAP_POPULATE 0x10000 +#undef MAP_NONBLOCK #define MAP_NONBLOCK 0x20000 +#undef MAP_STACK #define MAP_STACK 0x40000 +#undef MAP_HUGETLB #define MAP_HUGETLB 0x80000 -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 +#undef MADV_SOFT_OFFLINE #endif diff --git a/arch/or1k/bits/mman.h b/arch/or1k/bits/mman.h deleted file mode 100644 index ea6f6a78..00000000 --- a/arch/or1k/bits/mman.h +++ /dev/null @@ -1,59 +0,0 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h index 6581edc5..b6a15a12 100644 --- a/arch/powerpc/bits/mman.h +++ b/arch/powerpc/bits/mman.h @@ -1,60 +1,8 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 #define PROT_SAO 0x10 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_NORESERVE 0x40 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x80 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 +#undef MCL_CURRENT #define MCL_CURRENT 0x2000 +#undef MCL_FUTURE #define MCL_FUTURE 0x4000 +#undef MCL_ONFAULT #define MCL_ONFAULT 0x8000 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/sh/bits/mman.h b/arch/sh/bits/mman.h deleted file mode 100644 index 3a25df1e..00000000 --- a/arch/sh/bits/mman.h +++ /dev/null @@ -1,60 +0,0 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_32BIT 0x40 -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 4 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/x32/bits/mman.h b/arch/x32/bits/mman.h index f3235f4e..ba2d6f7a 100644 --- a/arch/x32/bits/mman.h +++ b/arch/x32/bits/mman.h @@ -1,60 +1 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON #define MAP_32BIT 0x40 -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/arch/x86_64/bits/mman.h b/arch/x86_64/bits/mman.h index f3235f4e..ba2d6f7a 100644 --- a/arch/x86_64/bits/mman.h +++ b/arch/x86_64/bits/mman.h @@ -1,60 +1 @@ -#define MAP_FAILED ((void *) -1) - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 -#define PROT_GROWSDOWN 0x01000000 -#define PROT_GROWSUP 0x02000000 - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_FIXED 0x10 - -#define MAP_TYPE 0x0f -#define MAP_FILE 0x00 -#define MAP_ANON 0x20 -#define MAP_ANONYMOUS MAP_ANON #define MAP_32BIT 0x40 -#define MAP_NORESERVE 0x4000 -#define MAP_GROWSDOWN 0x0100 -#define MAP_DENYWRITE 0x0800 -#define MAP_EXECUTABLE 0x1000 -#define MAP_LOCKED 0x2000 -#define MAP_POPULATE 0x8000 -#define MAP_NONBLOCK 0x10000 -#define MAP_STACK 0x20000 -#define MAP_HUGETLB 0x40000 - -#define POSIX_MADV_NORMAL 0 -#define POSIX_MADV_RANDOM 1 -#define POSIX_MADV_SEQUENTIAL 2 -#define POSIX_MADV_WILLNEED 3 -#define POSIX_MADV_DONTNEED 0 - -#define MS_ASYNC 1 -#define MS_INVALIDATE 2 -#define MS_SYNC 4 - -#define MCL_CURRENT 1 -#define MCL_FUTURE 2 -#define MCL_ONFAULT 4 - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MADV_NORMAL 0 -#define MADV_RANDOM 1 -#define MADV_SEQUENTIAL 2 -#define MADV_WILLNEED 3 -#define MADV_DONTNEED 4 -#define MADV_REMOVE 9 -#define MADV_DONTFORK 10 -#define MADV_DOFORK 11 -#define MADV_MERGEABLE 12 -#define MADV_UNMERGEABLE 13 -#define MADV_HUGEPAGE 14 -#define MADV_NOHUGEPAGE 15 -#define MADV_DONTDUMP 16 -#define MADV_DODUMP 17 -#define MADV_HWPOISON 100 -#define MADV_SOFT_OFFLINE 101 -#endif diff --git a/include/sys/mman.h b/include/sys/mman.h index a1864ec8..596a03a7 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -16,6 +16,65 @@ extern "C" { #include +#define MAP_FAILED ((void *) -1) + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_TYPE 0x0f +#define MAP_FIXED 0x10 +#define MAP_ANON 0x20 +#define MAP_ANONYMOUS MAP_ANON +#define MAP_NORESERVE 0x4000 +#define MAP_GROWSDOWN 0x0100 +#define MAP_DENYWRITE 0x0800 +#define MAP_EXECUTABLE 0x1000 +#define MAP_LOCKED 0x2000 +#define MAP_POPULATE 0x8000 +#define MAP_NONBLOCK 0x10000 +#define MAP_STACK 0x20000 +#define MAP_HUGETLB 0x40000 +#define MAP_FILE 0 + +#define PROT_NONE 0 +#define PROT_READ 1 +#define PROT_WRITE 2 +#define PROT_EXEC 4 +#define PROT_GROWSDOWN 0x01000000 +#define PROT_GROWSUP 0x02000000 + +#define MS_ASYNC 1 +#define MS_INVALIDATE 2 +#define MS_SYNC 4 + +#define MCL_CURRENT 1 +#define MCL_FUTURE 2 +#define MCL_ONFAULT 4 + +#define POSIX_MADV_NORMAL 0 +#define POSIX_MADV_RANDOM 1 +#define POSIX_MADV_SEQUENTIAL 2 +#define POSIX_MADV_WILLNEED 3 +#define POSIX_MADV_DONTNEED 4 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MADV_NORMAL 0 +#define MADV_RANDOM 1 +#define MADV_SEQUENTIAL 2 +#define MADV_WILLNEED 3 +#define MADV_DONTNEED 4 +#define MADV_REMOVE 9 +#define MADV_DONTFORK 10 +#define MADV_DOFORK 11 +#define MADV_MERGEABLE 12 +#define MADV_UNMERGEABLE 13 +#define MADV_HUGEPAGE 14 +#define MADV_NOHUGEPAGE 15 +#define MADV_DONTDUMP 16 +#define MADV_DODUMP 17 +#define MADV_HWPOISON 100 +#define MADV_SOFT_OFFLINE 101 +#endif + #include void *mmap (void *, size_t, int, int, int, off_t); From dc4520d9c0b79bc5944f509e4e9061e5081e38ca Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 18 Mar 2016 23:46:41 -0400 Subject: [PATCH 082/412] fix outdated pathnames in COPYRIGHT file --- COPYRIGHT | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 1b20b230..7768600b 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -94,14 +94,14 @@ Copyright © 2008 Stephen L. Moshier and labelled as such in comments in the individual source files. All have been licensed under extremely permissive terms. -The ARM memcpy code (src/string/armel/memcpy.s) is Copyright © 2008 +The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008 The Android Open Source Project and is licensed under a two-clause BSD license. It was taken from Bionic libc, used on Android. -The implementation of DES for crypt (src/misc/crypt_des.c) is +The implementation of DES for crypt (src/crypt/crypt_des.c) is Copyright © 1994 David Burren. It is licensed under a BSD license. -The implementation of blowfish crypt (src/misc/crypt_blowfish.c) was +The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was originally written by Solar Designer and placed into the public domain. The code also comes with a fallback permissive license for use in jurisdictions that may not recognize the public domain. From 2de52704ca644f129cc87ac1b28a06198d7dd829 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 19 Mar 2016 13:35:08 +0100 Subject: [PATCH 083/412] mips64: add recent linux syscall numbers add userfaultfd, membarrier and mlock2 system call numbers. --- arch/mips64/bits/syscall.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips64/bits/syscall.h b/arch/mips64/bits/syscall.h index d9b4f42f..8c818825 100644 --- a/arch/mips64/bits/syscall.h +++ b/arch/mips64/bits/syscall.h @@ -314,6 +314,9 @@ #define __NR_memfd_create 5314 #define __NR_bpf 5315 #define __NR_execveat 5316 +#define __NR_userfaultfd 5317 +#define __NR_membarrier 5318 +#define __NR_mlock2 5319 #define SYS_read 5000 #define SYS_write 5001 @@ -631,3 +634,6 @@ #define SYS_memfd_create 5314 #define SYS_bpf 5315 #define SYS_execveat 5316 +#define SYS_userfaultfd 5317 +#define SYS_membarrier 5318 +#define SYS_mlock2 5319 From 84d4f5eee5a291dcb25a2a8f781a9a48f70f4731 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 19 Mar 2016 13:35:43 +0100 Subject: [PATCH 084/412] add copy_file_range syscall numbers from linux v4.5 it was introduced for offloading copying between regular files in linux commit 29732938a6289a15e907da234d6692a2ead71855 (microblaze and sh does not yet have the syscall number.) --- arch/aarch64/bits/syscall.h | 2 ++ arch/arm/bits/syscall.h | 2 ++ arch/i386/bits/syscall.h | 2 ++ arch/mips/bits/syscall.h | 2 ++ arch/mips64/bits/syscall.h | 2 ++ arch/or1k/bits/syscall.h | 2 ++ arch/powerpc/bits/syscall.h | 2 ++ arch/x32/bits/syscall.h | 2 ++ arch/x86_64/bits/syscall.h | 2 ++ 9 files changed, 18 insertions(+) diff --git a/arch/aarch64/bits/syscall.h b/arch/aarch64/bits/syscall.h index 31bed730..eddbe929 100644 --- a/arch/aarch64/bits/syscall.h +++ b/arch/aarch64/bits/syscall.h @@ -268,6 +268,7 @@ #define __NR_userfaultfd 282 #define __NR_membarrier 283 #define __NR_mlock2 284 +#define __NR_copy_file_range 285 #define SYS_io_setup __NR_io_setup #define SYS_io_destroy __NR_io_destroy @@ -539,3 +540,4 @@ #define SYS_userfaultfd __NR_userfaultfd #define SYS_membarrier __NR_membarrier #define SYS_mlock2 __NR_mlock2 +#define SYS_copy_file_range __NR_copy_file_range diff --git a/arch/arm/bits/syscall.h b/arch/arm/bits/syscall.h index 036c562f..be30be70 100644 --- a/arch/arm/bits/syscall.h +++ b/arch/arm/bits/syscall.h @@ -344,6 +344,7 @@ #define __NR_userfaultfd 388 #define __NR_membarrier 389 #define __NR_mlock2 390 +#define __NR_copy_file_range 391 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 @@ -699,3 +700,4 @@ #define SYS_userfaultfd 388 #define SYS_membarrier 389 #define SYS_mlock2 390 +#define SYS_copy_file_range 391 diff --git a/arch/i386/bits/syscall.h b/arch/i386/bits/syscall.h index b1a389b4..25cd50ab 100644 --- a/arch/i386/bits/syscall.h +++ b/arch/i386/bits/syscall.h @@ -375,6 +375,7 @@ #define __NR_userfaultfd 374 #define __NR_membarrier 375 #define __NR_mlock2 376 +#define __NR_copy_file_range 377 /* Repeated with SYS_ prefix */ @@ -756,3 +757,4 @@ #define SYS_userfaultfd 374 #define SYS_membarrier 375 #define SYS_mlock2 376 +#define SYS_copy_file_range 377 diff --git a/arch/mips/bits/syscall.h b/arch/mips/bits/syscall.h index 340c5873..40ca6ba1 100644 --- a/arch/mips/bits/syscall.h +++ b/arch/mips/bits/syscall.h @@ -357,6 +357,7 @@ #define __NR_userfaultfd 4357 #define __NR_membarrier 4358 #define __NR_mlock2 4359 +#define __NR_copy_file_range 4360 /* Repeated with SYS_ prefix */ @@ -719,3 +720,4 @@ #define SYS_userfaultfd 4357 #define SYS_membarrier 4358 #define SYS_mlock2 4359 +#define SYS_copy_file_range 4360 diff --git a/arch/mips64/bits/syscall.h b/arch/mips64/bits/syscall.h index 8c818825..a84a5197 100644 --- a/arch/mips64/bits/syscall.h +++ b/arch/mips64/bits/syscall.h @@ -317,6 +317,7 @@ #define __NR_userfaultfd 5317 #define __NR_membarrier 5318 #define __NR_mlock2 5319 +#define __NR_copy_file_range 5320 #define SYS_read 5000 #define SYS_write 5001 @@ -637,3 +638,4 @@ #define SYS_userfaultfd 5317 #define SYS_membarrier 5318 #define SYS_mlock2 5319 +#define SYS_copy_file_range 5320 diff --git a/arch/or1k/bits/syscall.h b/arch/or1k/bits/syscall.h index a73b2324..de810a4d 100644 --- a/arch/or1k/bits/syscall.h +++ b/arch/or1k/bits/syscall.h @@ -268,6 +268,7 @@ #define __NR_userfaultfd 282 #define __NR_membarrier 283 #define __NR_mlock2 284 +#define __NR_copy_file_range 285 #define SYS_io_setup __NR_io_setup #define SYS_io_destroy __NR_io_destroy @@ -539,3 +540,4 @@ #define SYS_userfaultfd __NR_userfaultfd #define SYS_membarrier __NR_membarrier #define SYS_mlock2 __NR_mlock2 +#define SYS_copy_file_range __NR_copy_file_range diff --git a/arch/powerpc/bits/syscall.h b/arch/powerpc/bits/syscall.h index e02f56f1..eb5295f6 100644 --- a/arch/powerpc/bits/syscall.h +++ b/arch/powerpc/bits/syscall.h @@ -368,6 +368,7 @@ #define __NR_userfaultfd 364 #define __NR_membarrier 365 #define __NR_mlock2 378 +#define __NR_copy_file_range 379 /* * repeated with SYS prefix @@ -742,3 +743,4 @@ #define SYS_userfaultfd 364 #define SYS_membarrier 365 #define SYS_mlock2 378 +#define SYS_copy_file_range 379 diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h index 4a1099d3..bd5ab3b4 100644 --- a/arch/x32/bits/syscall.h +++ b/arch/x32/bits/syscall.h @@ -280,6 +280,7 @@ #define __NR_userfaultfd (__X32_SYSCALL_BIT + 323) #define __NR_membarrier (__X32_SYSCALL_BIT + 324) #define __NR_mlock2 (__X32_SYSCALL_BIT + 325) +#define __NR_copy_file_range (__X32_SYSCALL_BIT + 326) #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) @@ -613,6 +614,7 @@ #define SYS_userfaultfd __NR_userfaultfd #define SYS_membarrier __NR_membarrier #define SYS_mlock2 __NR_mlock2 +#define SYS_copy_file_range __NR_copy_file_range #define SYS_rt_sigaction __NR_rt_sigaction diff --git a/arch/x86_64/bits/syscall.h b/arch/x86_64/bits/syscall.h index 22aa716c..1b02df9f 100644 --- a/arch/x86_64/bits/syscall.h +++ b/arch/x86_64/bits/syscall.h @@ -324,6 +324,7 @@ #define __NR_userfaultfd 323 #define __NR_membarrier 324 #define __NR_mlock2 325 +#define __NR_copy_file_range 326 @@ -655,3 +656,4 @@ #define SYS_userfaultfd 323 #define SYS_membarrier 324 #define SYS_mlock2 325 +#define SYS_copy_file_range 326 From 8ffa0375f2008818f443b4fdc7d481715cd6a5a0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 19 Mar 2016 13:36:09 +0100 Subject: [PATCH 085/412] add IPV6_HDRINCL socket option from linux v4.5 new in linux commit 715f504b118998c41a2079a17e16bf5a8a114885 same as IP_HDRINCL but for SOL_IPV6 sockets. --- include/netinet/in.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/in.h b/include/netinet/in.h index 622bdfec..04cc81cd 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -344,6 +344,7 @@ struct ip6_mtuinfo #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 +#define IPV6_HDRINCL 36 #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 From c1aabc6cacc15feef8e5db4cbfee14ee8be2ff26 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 19 Mar 2016 13:36:42 +0100 Subject: [PATCH 086/412] add SO_ATTACH_REUSEPORT_[CE]BPF socket options from linux v4.5 new socket options for setting classic or extended BPF program for sockets in a SO_REUSEPORT group. added in linux commit 538950a1b7527a0a52ccd9337e3fcd304f027f13 --- include/sys/socket.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index a4db9402..fd653490 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -220,7 +220,8 @@ struct linger #define SO_INCOMING_CPU 49 #define SO_ATTACH_BPF 50 #define SO_DETACH_BPF SO_DETACH_FILTER - +#define SO_ATTACH_REUSEPORT_CBPF 51 +#define SO_ATTACH_REUSEPORT_EBPF 52 #ifndef SOL_SOCKET #define SOL_SOCKET 1 From b10ca0f560491ed9e353ead6e35f8992e9800c7a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 19 Mar 2016 13:37:03 +0100 Subject: [PATCH 087/412] add EPOLLEXCLUSIVE epoll flag from linux v4.5 new flag for exclusive wakeup mode when an event source fd is attached to multiple epoll fds but they should not all receive the events. new in linux commit df0108c5da561c66c333bb46bfe3c1fc65905898 --- include/sys/epoll.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/epoll.h b/include/sys/epoll.h index 1f0312e5..ffe2311f 100644 --- a/include/sys/epoll.h +++ b/include/sys/epoll.h @@ -28,6 +28,7 @@ enum EPOLL_EVENTS { __EPOLL_DUMMY }; #define EPOLLERR 0x008 #define EPOLLHUP 0x010 #define EPOLLRDHUP 0x2000 +#define EPOLLEXCLUSIVE (1U<<28) #define EPOLLWAKEUP (1U<<29) #define EPOLLONESHOT (1U<<30) #define EPOLLET (1U<<31) From d578c74e677c9c29bfa0b5eec1f21506b9c05558 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 19 Mar 2016 13:37:37 +0100 Subject: [PATCH 088/412] add MADV_FREE madvise command from linux v4.5 allows the os to free the marked pages lazily on memory pressure. expected to increase malloc performance. new in linux commit 854e9ed09dedf0c19ac8640e91bcc74bc3f9e5c9 --- include/sys/mman.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/mman.h b/include/sys/mman.h index 596a03a7..8a5149c9 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -62,6 +62,7 @@ extern "C" { #define MADV_SEQUENTIAL 2 #define MADV_WILLNEED 3 #define MADV_DONTNEED 4 +#define MADV_FREE 8 #define MADV_REMOVE 9 #define MADV_DONTFORK 10 #define MADV_DOFORK 11 From 5978eb703ce0e64dd778a88c1ffffb76fe5e2202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 22 Mar 2016 16:27:51 +0200 Subject: [PATCH 089/412] fix gethostbyaddr_r to fill struct hostent.h_length as appropriate --- src/network/gethostbyaddr_r.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c index 66e03309..0f1e61aa 100644 --- a/src/network/gethostbyaddr_r.c +++ b/src/network/gethostbyaddr_r.c @@ -64,6 +64,7 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af, } h->h_addrtype = af; + h->h_length = l; h->h_name = h->h_aliases[0]; *res = h; return 0; From 6d1a3dfeaf2caac4033a3c65822fb4e7e14866c7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 28 Mar 2016 23:41:17 -0400 Subject: [PATCH 090/412] fix undefined pointer comparison in stdio-internal __toread the comparison f->wpos > f->buf has undefined behavior when f->wpos is a null pointer, despite the intuition (and actual compiler behavior, for all known compilers) being that NULL > ptr is false for all valid pointers ptr. the purpose of the comparison is to determine if the write buffer is non-empty, and the idiom used elsewhere for that is comparison against f->wbase, which is either a null pointer when not writing, or equal to f->buf when writing. in the former case, both f->wpos and f->wbase are null; in the latter they are both non-null and point into the same array. --- src/stdio/__toread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdio/__toread.c b/src/stdio/__toread.c index b08f5bb4..35f67b8f 100644 --- a/src/stdio/__toread.c +++ b/src/stdio/__toread.c @@ -3,7 +3,7 @@ int __toread(FILE *f) { f->mode |= f->mode-1; - if (f->wpos > f->buf) f->write(f, 0, 0); + if (f->wpos > f->wbase) f->write(f, 0, 0); f->wpos = f->wbase = f->wend = 0; if (f->flags & F_NORD) { f->flags |= F_ERR; From 5c3412d22555d03a1c00578ba8faaa8dc9206420 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Mar 2016 21:22:52 -0400 Subject: [PATCH 091/412] fix regression disabling use of pause instruction for x86 a_spin commits e24984efd5c6ac5ea8e6cb6cd914fa8435d458bc and 16b55298dc4b6a54d287d7494e04542667ef8861 inadvertently disabled the a_spin implementations for i386, x86_64, and x32 by defining a macro named a_pause instead of a_spin. this should not have caused any functional regression, but it inhibited cpu relaxation while spinning for locks. bug reported by George Kulakowski. --- arch/i386/atomic_arch.h | 2 +- arch/x32/atomic_arch.h | 2 +- arch/x86_64/atomic_arch.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/i386/atomic_arch.h b/arch/i386/atomic_arch.h index 6e67c4ce..2b1a0490 100644 --- a/arch/i386/atomic_arch.h +++ b/arch/i386/atomic_arch.h @@ -71,7 +71,7 @@ static inline void a_barrier() __asm__ __volatile__( "" : : : "memory" ); } -#define a_pause a_pause +#define a_spin a_spin static inline void a_spin() { __asm__ __volatile__( "pause" : : : "memory" ); diff --git a/arch/x32/atomic_arch.h b/arch/x32/atomic_arch.h index 26098d3f..7daf4ae2 100644 --- a/arch/x32/atomic_arch.h +++ b/arch/x32/atomic_arch.h @@ -87,7 +87,7 @@ static inline void a_barrier() __asm__ __volatile__( "" : : : "memory" ); } -#define a_pause a_pause +#define a_spin a_spin static inline void a_spin() { __asm__ __volatile__( "pause" : : : "memory" ); diff --git a/arch/x86_64/atomic_arch.h b/arch/x86_64/atomic_arch.h index 9f47f808..55fc6fb9 100644 --- a/arch/x86_64/atomic_arch.h +++ b/arch/x86_64/atomic_arch.h @@ -96,7 +96,7 @@ static inline void a_barrier() __asm__ __volatile__( "" : : : "memory" ); } -#define a_pause a_pause +#define a_spin a_spin static inline void a_spin() { __asm__ __volatile__( "pause" : : : "memory" ); From c718f9fc1b4bd913eff10d0c12763f90b2bc487c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 1 Apr 2016 13:36:15 -0400 Subject: [PATCH 092/412] fix read past end of haystack buffer for short needles in memmem the two/three/four byte memmem specializations are not prepared to handle haystacks shorter than the needle; they unconditionally read at least up to the needle length and subtract from the haystack length. if the haystack is shorter, the remaining haystack length underflows and produces an unbounded search which will eventually either crash or find a spurious match. the top-level memmem function attempted to avoid this case already by checking for haystack shorter than needle, but it failed to re-check after using memchr to remove the maximal prefix not containing the first byte of the needle. --- src/string/memmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/string/memmem.c b/src/string/memmem.c index d7e12219..4be6a310 100644 --- a/src/string/memmem.c +++ b/src/string/memmem.c @@ -140,6 +140,7 @@ void *memmem(const void *h0, size_t k, const void *n0, size_t l) h = memchr(h0, *n, k); if (!h || l==1) return (void *)h; k -= h - (const unsigned char *)h0; + if (k Date: Sun, 3 Apr 2016 10:42:37 +0000 Subject: [PATCH 093/412] add support for mips and mips64 r6 isa mips32r6 and mips64r6 are actually new isas at both the asm source and opcode levels (pre-r6 code cannot run on r6) and thus need to be treated as a new subarch. the following changes are made, some of which yield code generation improvements for non-r6 targets too: - add subarch logic in configure script and reloc.h files for dynamic linker name. - suppress use of .set mips2 asm directives (used to allow mips2 atomic instructions on baseline mips1 builds; the kernel has to emulate them on mips1) except when actually needed. they cause wrong instruction encodings on r6, and pessimize inlining on at least some compilers. - only hard-code sync instruction encoding on mips1. - use "ZC" constraint instead of "m" constraint for llsc memory operands on r6, where the ll/sc instructions no longer accept full 16-bit offsets. - only hard-code rdhwr instruction encoding with .word on targets (pre-r2) where it may need trap-and-emulate by the kernel. otherwise, just use the instruction mnemonic, and allow an arbitrary destination register to be used. --- arch/mips/atomic_arch.h | 27 +++++++++++++++++++++++---- arch/mips/pthread_arch.h | 9 ++++----- arch/mips/reloc.h | 8 +++++++- arch/mips64/atomic_arch.h | 20 +++++++++++++------- arch/mips64/pthread_arch.h | 8 ++++---- arch/mips64/reloc.h | 8 +++++++- configure | 2 ++ 7 files changed, 60 insertions(+), 22 deletions(-) diff --git a/arch/mips/atomic_arch.h b/arch/mips/atomic_arch.h index ce2823b8..1248d177 100644 --- a/arch/mips/atomic_arch.h +++ b/arch/mips/atomic_arch.h @@ -1,12 +1,24 @@ +#if __mips_isa_rev < 6 +#define LLSC_M "m" +#else +#define LLSC_M "ZC" +#endif + #define a_ll a_ll static inline int a_ll(volatile int *p) { int v; +#if __mips < 2 __asm__ __volatile__ ( ".set push ; .set mips2\n\t" "ll %0, %1" "\n\t.set pop" : "=r"(v) : "m"(*p)); +#else + __asm__ __volatile__ ( + "ll %0, %1" + : "=r"(v) : LLSC_M(*p)); +#endif return v; } @@ -14,26 +26,33 @@ static inline int a_ll(volatile int *p) static inline int a_sc(volatile int *p, int v) { int r; +#if __mips < 2 __asm__ __volatile__ ( ".set push ; .set mips2\n\t" "sc %0, %1" "\n\t.set pop" : "=r"(r), "=m"(*p) : "0"(v) : "memory"); +#else + __asm__ __volatile__ ( + "sc %0, %1" + : "=r"(r), "="LLSC_M(*p) : "0"(v) : "memory"); +#endif return r; } #define a_barrier a_barrier static inline void a_barrier() { +#if __mips < 2 /* mips2 sync, but using too many directives causes * gcc not to inline it, so encode with .long instead. */ __asm__ __volatile__ (".long 0xf" : : : "memory"); -#if 0 - __asm__ __volatile__ ( - ".set push ; .set mips2 ; sync ; .set pop" - : : : "memory"); +#else + __asm__ __volatile__ ("sync" : : : "memory"); #endif } #define a_pre_llsc a_barrier #define a_post_llsc a_barrier + +#undef LLSC_M diff --git a/arch/mips/pthread_arch.h b/arch/mips/pthread_arch.h index 8a499654..e5812655 100644 --- a/arch/mips/pthread_arch.h +++ b/arch/mips/pthread_arch.h @@ -1,12 +1,11 @@ static inline struct pthread *__pthread_self() { -#ifdef __clang__ - char *tp; - __asm__ __volatile__ (".word 0x7c03e83b ; move %0, $3" : "=r" (tp) : : "$3" ); -#else +#if __mips_isa_rev < 2 register char *tp __asm__("$3"); - /* rdhwr $3,$29 */ __asm__ __volatile__ (".word 0x7c03e83b" : "=r" (tp) ); +#else + char *tp; + __asm__ __volatile__ ("rdhwr %0, $29" : "=r" (tp) ); #endif return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); } diff --git a/arch/mips/reloc.h b/arch/mips/reloc.h index 8c52df09..b3d59a45 100644 --- a/arch/mips/reloc.h +++ b/arch/mips/reloc.h @@ -1,5 +1,11 @@ #include +#if __mips_isa_rev >= 6 +#define ISA_SUFFIX "r6" +#else +#define ISA_SUFFIX "" +#endif + #if __BYTE_ORDER == __LITTLE_ENDIAN #define ENDIAN_SUFFIX "el" #else @@ -12,7 +18,7 @@ #define FP_SUFFIX "" #endif -#define LDSO_ARCH "mips" ENDIAN_SUFFIX FP_SUFFIX +#define LDSO_ARCH "mips" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX #define TPOFF_K (-0x7000) diff --git a/arch/mips64/atomic_arch.h b/arch/mips64/atomic_arch.h index b468fd95..d0f8b4ad 100644 --- a/arch/mips64/atomic_arch.h +++ b/arch/mips64/atomic_arch.h @@ -1,10 +1,16 @@ +#if __mips_isa_rev < 6 +#define LLSC_M "m" +#else +#define LLSC_M "ZC" +#endif + #define a_ll a_ll static inline int a_ll(volatile int *p) { int v; __asm__ __volatile__ ( "ll %0, %1" - : "=r"(v) : "m"(*p)); + : "=r"(v) : LLSC_M(*p)); return v; } @@ -14,7 +20,7 @@ static inline int a_sc(volatile int *p, int v) int r; __asm__ __volatile__ ( "sc %0, %1" - : "=r"(r), "=m"(*p) : "0"(v) : "memory"); + : "=r"(r), "="LLSC_M(*p) : "0"(v) : "memory"); return r; } @@ -24,7 +30,7 @@ static inline void *a_ll_p(volatile void *p) void *v; __asm__ __volatile__ ( "lld %0, %1" - : "=r"(v) : "m"(*(void *volatile *)p)); + : "=r"(v) : LLSC_M(*(void *volatile *)p)); return v; } @@ -34,17 +40,17 @@ static inline int a_sc_p(volatile void *p, void *v) long r; __asm__ __volatile__ ( "scd %0, %1" - : "=r"(r), "=m"(*(void *volatile *)p) : "0"(v) : "memory"); + : "=r"(r), "="LLSC_M(*(void *volatile *)p) : "0"(v) : "memory"); return r; } #define a_barrier a_barrier static inline void a_barrier() { - /* mips2 sync, but using too many directives causes - * gcc not to inline it, so encode with .long instead. */ - __asm__ __volatile__ (".long 0xf" : : : "memory"); + __asm__ __volatile__ ("sync" : : : "memory"); } #define a_pre_llsc a_barrier #define a_post_llsc a_barrier + +#undef LLSC_M diff --git a/arch/mips64/pthread_arch.h b/arch/mips64/pthread_arch.h index b42edbe3..e5812655 100644 --- a/arch/mips64/pthread_arch.h +++ b/arch/mips64/pthread_arch.h @@ -1,11 +1,11 @@ static inline struct pthread *__pthread_self() { -#ifdef __clang__ - char *tp; - __asm__ __volatile__ (".word 0x7c03e83b ; move %0, $3" : "=r" (tp) : : "$3" ); -#else +#if __mips_isa_rev < 2 register char *tp __asm__("$3"); __asm__ __volatile__ (".word 0x7c03e83b" : "=r" (tp) ); +#else + char *tp; + __asm__ __volatile__ ("rdhwr %0, $29" : "=r" (tp) ); #endif return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); } diff --git a/arch/mips64/reloc.h b/arch/mips64/reloc.h index 5933147c..bbd9bd9d 100644 --- a/arch/mips64/reloc.h +++ b/arch/mips64/reloc.h @@ -4,6 +4,12 @@ #define _GNU_SOURCE #include +#if __mips_isa_rev >= 6 +#define ISA_SUFFIX "r6" +#else +#define ISA_SUFFIX "" +#endif + #if __BYTE_ORDER == __LITTLE_ENDIAN #define ENDIAN_SUFFIX "el" #else @@ -16,7 +22,7 @@ #define FP_SUFFIX "" #endif -#define LDSO_ARCH "mips64" ENDIAN_SUFFIX FP_SUFFIX +#define LDSO_ARCH "mips64" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX #define TPOFF_K (-0x7000) diff --git a/configure b/configure index 213a8254..969671dd 100755 --- a/configure +++ b/configure @@ -612,11 +612,13 @@ trycppif __AARCH64EB__ "$t" && SUBARCH=${SUBARCH}_be fi if test "$ARCH" = "mips" ; then +trycppif "__mips_isa_rev >= 6" "$t" && SUBARCH=${SUBARCH}r6 trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi if test "$ARCH" = "mips64" ; then +trycppif "__mips_isa_rev >= 6" "$t" && SUBARCH=${SUBARCH}r6 trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi From 5972c4a4113e2a4de5edf519faf15296ae1eb3ed Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 18 Apr 2016 05:19:13 +0000 Subject: [PATCH 094/412] add mips n32 port (ILP32 ABI for mips64) based on patch submitted by Jaydeep Patil, with minor changes. --- arch/mipsn32/atomic_arch.h | 52 +++ arch/mipsn32/bits/alltypes.h.in | 26 ++ arch/mipsn32/bits/endian.h | 5 + arch/mipsn32/bits/errno.h | 134 +++++++ arch/mipsn32/bits/fcntl.h | 40 ++ arch/mipsn32/bits/fenv.h | 25 ++ arch/mipsn32/bits/float.h | 16 + arch/mipsn32/bits/ioctl.h | 210 ++++++++++ arch/mipsn32/bits/limits.h | 7 + arch/mipsn32/bits/mman.h | 24 ++ arch/mipsn32/bits/msg.h | 25 ++ arch/mipsn32/bits/poll.h | 2 + arch/mipsn32/bits/posix.h | 2 + arch/mipsn32/bits/reg.h | 47 +++ arch/mipsn32/bits/resource.h | 5 + arch/mipsn32/bits/sem.h | 14 + arch/mipsn32/bits/setjmp.h | 1 + arch/mipsn32/bits/shm.h | 24 ++ arch/mipsn32/bits/signal.h | 143 +++++++ arch/mipsn32/bits/socket.h | 52 +++ arch/mipsn32/bits/stat.h | 22 ++ arch/mipsn32/bits/statfs.h | 8 + arch/mipsn32/bits/stdint.h | 20 + arch/mipsn32/bits/syscall.h | 649 +++++++++++++++++++++++++++++++ arch/mipsn32/bits/termios.h | 166 ++++++++ arch/mipsn32/bits/user.h | 15 + arch/mipsn32/crt_arch.h | 32 ++ arch/mipsn32/ksigaction.h | 8 + arch/mipsn32/pthread_arch.h | 18 + arch/mipsn32/reloc.h | 52 +++ arch/mipsn32/syscall_arch.h | 165 ++++++++ configure | 1 + crt/mipsn32/crti.s | 18 + crt/mipsn32/crtn.s | 12 + src/fenv/mipsn32/fenv-sf.c | 3 + src/fenv/mipsn32/fenv.S | 70 ++++ src/internal/mipsn32/syscall.s | 19 + src/ldso/mipsn32/dlsym.s | 17 + src/setjmp/mipsn32/longjmp.S | 36 ++ src/setjmp/mipsn32/setjmp.S | 34 ++ src/signal/mipsn32/restore.s | 9 + src/signal/mipsn32/sigsetjmp.s | 38 ++ src/thread/mipsn32/__unmapself.s | 9 + src/thread/mipsn32/clone.s | 30 ++ src/thread/mipsn32/syscall_cp.s | 51 +++ src/unistd/mipsn32/pipe.s | 19 + 46 files changed, 2375 insertions(+) create mode 100644 arch/mipsn32/atomic_arch.h create mode 100644 arch/mipsn32/bits/alltypes.h.in create mode 100644 arch/mipsn32/bits/endian.h create mode 100644 arch/mipsn32/bits/errno.h create mode 100644 arch/mipsn32/bits/fcntl.h create mode 100644 arch/mipsn32/bits/fenv.h create mode 100644 arch/mipsn32/bits/float.h create mode 100644 arch/mipsn32/bits/ioctl.h create mode 100644 arch/mipsn32/bits/limits.h create mode 100644 arch/mipsn32/bits/mman.h create mode 100644 arch/mipsn32/bits/msg.h create mode 100644 arch/mipsn32/bits/poll.h create mode 100644 arch/mipsn32/bits/posix.h create mode 100644 arch/mipsn32/bits/reg.h create mode 100644 arch/mipsn32/bits/resource.h create mode 100644 arch/mipsn32/bits/sem.h create mode 100644 arch/mipsn32/bits/setjmp.h create mode 100644 arch/mipsn32/bits/shm.h create mode 100644 arch/mipsn32/bits/signal.h create mode 100644 arch/mipsn32/bits/socket.h create mode 100644 arch/mipsn32/bits/stat.h create mode 100644 arch/mipsn32/bits/statfs.h create mode 100644 arch/mipsn32/bits/stdint.h create mode 100644 arch/mipsn32/bits/syscall.h create mode 100644 arch/mipsn32/bits/termios.h create mode 100644 arch/mipsn32/bits/user.h create mode 100644 arch/mipsn32/crt_arch.h create mode 100644 arch/mipsn32/ksigaction.h create mode 100644 arch/mipsn32/pthread_arch.h create mode 100644 arch/mipsn32/reloc.h create mode 100644 arch/mipsn32/syscall_arch.h create mode 100644 crt/mipsn32/crti.s create mode 100644 crt/mipsn32/crtn.s create mode 100644 src/fenv/mipsn32/fenv-sf.c create mode 100644 src/fenv/mipsn32/fenv.S create mode 100644 src/internal/mipsn32/syscall.s create mode 100644 src/ldso/mipsn32/dlsym.s create mode 100644 src/setjmp/mipsn32/longjmp.S create mode 100644 src/setjmp/mipsn32/setjmp.S create mode 100644 src/signal/mipsn32/restore.s create mode 100644 src/signal/mipsn32/sigsetjmp.s create mode 100644 src/thread/mipsn32/__unmapself.s create mode 100644 src/thread/mipsn32/clone.s create mode 100644 src/thread/mipsn32/syscall_cp.s create mode 100644 src/unistd/mipsn32/pipe.s diff --git a/arch/mipsn32/atomic_arch.h b/arch/mipsn32/atomic_arch.h new file mode 100644 index 00000000..ccc3878c --- /dev/null +++ b/arch/mipsn32/atomic_arch.h @@ -0,0 +1,52 @@ +#if __mips_isa_rev < 6 +#define LLSC_M "m" +#else +#define LLSC_M "ZC" +#endif + +#define a_ll a_ll +static inline int a_ll(volatile int *p) +{ + int v; +#if __mips < 2 + __asm__ __volatile__ ( + ".set push ; .set mips2\n\t" + "ll %0, %1" + "\n\t.set pop" + : "=r"(v) : "m"(*p)); +#else + __asm__ __volatile__ ( + "ll %0, %1" + : "=r"(v) : LLSC_M(*p)); +#endif + return v; +} + +#define a_sc a_sc +static inline int a_sc(volatile int *p, int v) +{ + int r; +#if __mips < 2 + __asm__ __volatile__ ( + ".set push ; .set mips2\n\t" + "sc %0, %1" + "\n\t.set pop" + : "=r"(r), "=m"(*p) : "0"(v) : "memory"); +#else + __asm__ __volatile__ ( + "sc %0, %1" + : "=r"(r), "="LLSC_M(*p) : "0"(v) : "memory"); +#endif + return r; +} + +#define a_barrier a_barrier +static inline void a_barrier() +{ + __asm__ __volatile__ ("sync" : : : "memory"); +} + +#define a_pre_llsc a_barrier +#define a_post_llsc a_barrier + +#undef LLSC_M diff --git a/arch/mipsn32/bits/alltypes.h.in b/arch/mipsn32/bits/alltypes.h.in new file mode 100644 index 00000000..66ca18ad --- /dev/null +++ b/arch/mipsn32/bits/alltypes.h.in @@ -0,0 +1,26 @@ +#define _Addr int +#define _Int64 long long +#define _Reg int + +TYPEDEF __builtin_va_list va_list; +TYPEDEF __builtin_va_list __isoc_va_list; + +#ifndef __cplusplus +TYPEDEF int wchar_t; +#endif + +TYPEDEF float float_t; +TYPEDEF double double_t; + +TYPEDEF struct { long long __ll; long double __ld; } max_align_t; + +TYPEDEF long time_t; +TYPEDEF long suseconds_t; + +TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; +TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; +TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; +TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/mipsn32/bits/endian.h b/arch/mipsn32/bits/endian.h new file mode 100644 index 00000000..5399dcb5 --- /dev/null +++ b/arch/mipsn32/bits/endian.h @@ -0,0 +1,5 @@ +#if _MIPSEL || __MIPSEL || __MIPSEL__ +#define __BYTE_ORDER __LITTLE_ENDIAN +#else +#define __BYTE_ORDER __BIG_ENDIAN +#endif diff --git a/arch/mipsn32/bits/errno.h b/arch/mipsn32/bits/errno.h new file mode 100644 index 00000000..1bb91e3d --- /dev/null +++ b/arch/mipsn32/bits/errno.h @@ -0,0 +1,134 @@ +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define ENOTBLK 15 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define EINVAL 22 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define ETXTBSY 26 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 +#define EDOM 33 +#define ERANGE 34 +#define ENOMSG 35 +#define EIDRM 36 +#define ECHRNG 37 +#define EL2NSYNC 38 +#define EL3HLT 39 +#define EL3RST 40 +#define ELNRNG 41 +#define EUNATCH 42 +#define ENOCSI 43 +#define EL2HLT 44 +#define EDEADLK 45 +#define ENOLCK 46 +#define EBADE 50 +#define EBADR 51 +#define EXFULL 52 +#define ENOANO 53 +#define EBADRQC 54 +#define EBADSLT 55 +#define EDEADLOCK 56 +#define EBFONT 59 +#define ENOSTR 60 +#define ENODATA 61 +#define ETIME 62 +#define ENOSR 63 +#define ENONET 64 +#define ENOPKG 65 +#define EREMOTE 66 +#define ENOLINK 67 +#define EADV 68 +#define ESRMNT 69 +#define ECOMM 70 +#define EPROTO 71 +#define EDOTDOT 73 +#define EMULTIHOP 74 +#define EBADMSG 77 +#define ENAMETOOLONG 78 +#define EOVERFLOW 79 +#define ENOTUNIQ 80 +#define EBADFD 81 +#define EREMCHG 82 +#define ELIBACC 83 +#define ELIBBAD 84 +#define ELIBSCN 85 +#define ELIBMAX 86 +#define ELIBEXEC 87 +#define EILSEQ 88 +#define ENOSYS 89 +#define ELOOP 90 +#define ERESTART 91 +#define ESTRPIPE 92 +#define ENOTEMPTY 93 +#define EUSERS 94 +#define ENOTSOCK 95 +#define EDESTADDRREQ 96 +#define EMSGSIZE 97 +#define EPROTOTYPE 98 +#define ENOPROTOOPT 99 +#define EPROTONOSUPPORT 120 +#define ESOCKTNOSUPPORT 121 +#define EOPNOTSUPP 122 +#define ENOTSUP EOPNOTSUPP +#define EPFNOSUPPORT 123 +#define EAFNOSUPPORT 124 +#define EADDRINUSE 125 +#define EADDRNOTAVAIL 126 +#define ENETDOWN 127 +#define ENETUNREACH 128 +#define ENETRESET 129 +#define ECONNABORTED 130 +#define ECONNRESET 131 +#define ENOBUFS 132 +#define EISCONN 133 +#define ENOTCONN 134 +#define EUCLEAN 135 +#define ENOTNAM 137 +#define ENAVAIL 138 +#define EISNAM 139 +#define EREMOTEIO 140 +#define ESHUTDOWN 143 +#define ETOOMANYREFS 144 +#define ETIMEDOUT 145 +#define ECONNREFUSED 146 +#define EHOSTDOWN 147 +#define EHOSTUNREACH 148 +#define EWOULDBLOCK EAGAIN +#define EALREADY 149 +#define EINPROGRESS 150 +#define ESTALE 151 +#define ECANCELED 158 +#define ENOMEDIUM 159 +#define EMEDIUMTYPE 160 +#define ENOKEY 161 +#define EKEYEXPIRED 162 +#define EKEYREVOKED 163 +#define EKEYREJECTED 164 +#define EOWNERDEAD 165 +#define ENOTRECOVERABLE 166 +#define ERFKILL 167 +#define EHWPOISON 168 +#define EDQUOT 1133 diff --git a/arch/mipsn32/bits/fcntl.h b/arch/mipsn32/bits/fcntl.h new file mode 100644 index 00000000..9fd8c23e --- /dev/null +++ b/arch/mipsn32/bits/fcntl.h @@ -0,0 +1,40 @@ +#define O_CREAT 0400 +#define O_EXCL 02000 +#define O_NOCTTY 04000 +#define O_TRUNC 01000 +#define O_APPEND 0010 +#define O_NONBLOCK 0200 +#define O_DSYNC 0020 +#define O_SYNC 040020 +#define O_RSYNC 040020 +#define O_DIRECTORY 0200000 +#define O_NOFOLLOW 0400000 +#define O_CLOEXEC 02000000 + +#define O_ASYNC 010000 +#define O_DIRECT 0100000 +#define O_LARGEFILE 020000 +#define O_NOATIME 01000000 +#define O_PATH 010000000 +#define O_TMPFILE 020200000 +#define O_NDELAY O_NONBLOCK + +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_SETFD 2 +#define F_GETFL 3 +#define F_SETFL 4 + +#define F_SETOWN 24 +#define F_GETOWN 23 +#define F_SETSIG 10 +#define F_GETSIG 11 + +#define F_GETLK 33 +#define F_SETLK 34 +#define F_SETLKW 35 + +#define F_SETOWN_EX 15 +#define F_GETOWN_EX 16 + +#define F_GETOWNER_UIDS 17 diff --git a/arch/mipsn32/bits/fenv.h b/arch/mipsn32/bits/fenv.h new file mode 100644 index 00000000..589e71c1 --- /dev/null +++ b/arch/mipsn32/bits/fenv.h @@ -0,0 +1,25 @@ +#ifdef __mips_soft_float +#define FE_ALL_EXCEPT 0 +#define FE_TONEAREST 0 +#else +#define FE_INEXACT 4 +#define FE_UNDERFLOW 8 +#define FE_OVERFLOW 16 +#define FE_DIVBYZERO 32 +#define FE_INVALID 64 + +#define FE_ALL_EXCEPT 124 + +#define FE_TONEAREST 0 +#define FE_TOWARDZERO 1 +#define FE_UPWARD 2 +#define FE_DOWNWARD 3 +#endif + +typedef unsigned short fexcept_t; + +typedef struct { + unsigned __cw; +} fenv_t; + +#define FE_DFL_ENV ((const fenv_t *) -1) diff --git a/arch/mipsn32/bits/float.h b/arch/mipsn32/bits/float.h new file mode 100644 index 00000000..719c7908 --- /dev/null +++ b/arch/mipsn32/bits/float.h @@ -0,0 +1,16 @@ +#define FLT_EVAL_METHOD 0 + +#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L +#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L +#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L +#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L + +#define LDBL_MANT_DIG 113 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MAX_EXP 16384 + +#define LDBL_DIG 33 +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_10_EXP 4932 + +#define DECIMAL_DIG 36 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h new file mode 100644 index 00000000..041be560 --- /dev/null +++ b/arch/mipsn32/bits/ioctl.h @@ -0,0 +1,210 @@ +#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) ) +#define _IOC_NONE 1U +#define _IOC_READ 2U +#define _IOC_WRITE 4U + +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) + +#define TCGETA 0x5401 +#define TCSETA 0x5402 +#define TCSETAW 0x5403 +#define TCSETAF 0x5404 +#define TCSBRK 0x5405 +#define TCXONC 0x5406 +#define TCFLSH 0x5407 +#define TCGETS 0x540D +#define TCSETS 0x540E +#define TCSETSW 0x540F +#define TCSETSF 0x5410 + +#define TIOCEXCL 0x740D +#define TIOCNXCL 0x740E +#define TIOCOUTQ 0x7472 +#define TIOCSTI 0x5472 +#define TIOCMGET 0x741D +#define TIOCMBIS 0x741B +#define TIOCMBIC 0x741C +#define TIOCMSET 0x741D + +#define TIOCPKT 0x5470 +#define TIOCSWINSZ _IOW('t', 103, struct winsize) +#define TIOCGWINSZ _IOR('t', 104, struct winsize) +#define TIOCNOTTY 0x5471 +#define TIOCSETD 0x7401 +#define TIOCGETD 0x7400 + +#define FIOCLEX 0x6601 +#define FIONCLEX 0x6602 +#define FIOASYNC 0x667D +#define FIONBIO 0x667E +#define FIOQSIZE 0x667F + +#define TIOCGLTC 0x7474 +#define TIOCSLTC 0x7475 +#define TIOCSPGRP _IOW('t', 118, int) +#define TIOCGPGRP _IOR('t', 119, int) +#define TIOCCONS _IOW('t', 120, int) + +#define FIONREAD 0x467F +#define TIOCINQ FIONREAD + +#define TIOCGETP 0x7408 +#define TIOCSETP 0x7409 +#define TIOCSETN 0x740A + +#define TIOCSBRK 0x5427 +#define TIOCCBRK 0x5428 +#define TIOCGSID 0x7416 +#define TIOCGPTN _IOR('T', 0x30, unsigned int) +#define TIOCSPTLCK _IOW('T', 0x31, int) + +#define TIOCSCTTY 0x5480 +#define TIOCGSOFTCAR 0x5481 +#define TIOCSSOFTCAR 0x5482 +#define TIOCLINUX 0x5483 +#define TIOCGSERIAL 0x5484 +#define TIOCSSERIAL 0x5485 +#define TCSBRKP 0x5486 + +#define TIOCSERCONFIG 0x5488 +#define TIOCSERGWILD 0x5489 +#define TIOCSERSWILD 0x548A +#define TIOCGLCKTRMIOS 0x548B +#define TIOCSLCKTRMIOS 0x548C +#define TIOCSERGSTRUCT 0x548D +#define TIOCSERGETLSR 0x548E +#define TIOCSERGETMULTI 0x548F +#define TIOCSERSETMULTI 0x5490 +#define TIOCMIWAIT 0x5491 +#define TIOCGICOUNT 0x5492 +#define TIOCGHAYESESP 0x5493 +#define TIOCSHAYESESP 0x5494 + +#define TIOCTTYGSTRUCT 0x5426 +#define TCGETX 0x5432 +#define TCSETX 0x5433 +#define TCSETXF 0x5434 +#define TCSETXW 0x5435 + +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 +#define TIOCPKT_IOCTL 64 + +#define TIOCSER_TEMT 0x01 + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 +#define TIOCM_MODEM_BITS TIOCM_OUT2 + +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 +#define N_6PACK 7 +#define N_MASC 8 +#define N_R3964 9 +#define N_PROFIBUS_FDL 10 +#define N_IRDA 11 +#define N_SMSBLOCK 12 +#define N_HDLC 13 +#define N_SYNC_PPP 14 +#define N_HCI 15 + +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 + +#define SIOCADDRT 0x890B +#define SIOCDELRT 0x890C +#define SIOCRTMSG 0x890D + +#define SIOCGIFNAME 0x8910 +#define SIOCSIFLINK 0x8911 +#define SIOCGIFCONF 0x8912 +#define SIOCGIFFLAGS 0x8913 +#define SIOCSIFFLAGS 0x8914 +#define SIOCGIFADDR 0x8915 +#define SIOCSIFADDR 0x8916 +#define SIOCGIFDSTADDR 0x8917 +#define SIOCSIFDSTADDR 0x8918 +#define SIOCGIFBRDADDR 0x8919 +#define SIOCSIFBRDADDR 0x891a +#define SIOCGIFNETMASK 0x891b +#define SIOCSIFNETMASK 0x891c +#define SIOCGIFMETRIC 0x891d +#define SIOCSIFMETRIC 0x891e +#define SIOCGIFMEM 0x891f +#define SIOCSIFMEM 0x8920 +#define SIOCGIFMTU 0x8921 +#define SIOCSIFMTU 0x8922 +#define SIOCSIFHWADDR 0x8924 +#define SIOCGIFENCAP 0x8925 +#define SIOCSIFENCAP 0x8926 +#define SIOCGIFHWADDR 0x8927 +#define SIOCGIFSLAVE 0x8929 +#define SIOCSIFSLAVE 0x8930 +#define SIOCADDMULTI 0x8931 +#define SIOCDELMULTI 0x8932 +#define SIOCGIFINDEX 0x8933 +#define SIOGIFINDEX SIOCGIFINDEX +#define SIOCSIFPFLAGS 0x8934 +#define SIOCGIFPFLAGS 0x8935 +#define SIOCDIFADDR 0x8936 +#define SIOCSIFHWBROADCAST 0x8937 +#define SIOCGIFCOUNT 0x8938 + +#define SIOCGIFBR 0x8940 +#define SIOCSIFBR 0x8941 + +#define SIOCGIFTXQLEN 0x8942 +#define SIOCSIFTXQLEN 0x8943 + +#define SIOCDARP 0x8953 +#define SIOCGARP 0x8954 +#define SIOCSARP 0x8955 + +#define SIOCDRARP 0x8960 +#define SIOCGRARP 0x8961 +#define SIOCSRARP 0x8962 + +#define SIOCGIFMAP 0x8970 +#define SIOCSIFMAP 0x8971 + +#define SIOCADDDLCI 0x8980 +#define SIOCDELDLCI 0x8981 + +#define SIOCDEVPRIVATE 0x89F0 +#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/mipsn32/bits/limits.h b/arch/mipsn32/bits/limits.h new file mode 100644 index 00000000..fbc6d238 --- /dev/null +++ b/arch/mipsn32/bits/limits.h @@ -0,0 +1,7 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define LONG_BIT 32 +#endif + +#define LONG_MAX 0x7fffffffL +#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/arch/mipsn32/bits/mman.h b/arch/mipsn32/bits/mman.h new file mode 100644 index 00000000..c68aea88 --- /dev/null +++ b/arch/mipsn32/bits/mman.h @@ -0,0 +1,24 @@ +#undef MAP_ANON +#define MAP_ANON 0x800 +#undef MAP_NORESERVE +#define MAP_NORESERVE 0x0400 +#undef MAP_GROWSDOWN +#define MAP_GROWSDOWN 0x1000 +#undef MAP_DENYWRITE +#define MAP_DENYWRITE 0x2000 +#undef MAP_EXECUTABLE +#define MAP_EXECUTABLE 0x4000 +#undef MAP_LOCKED +#define MAP_LOCKED 0x8000 +#undef MAP_POPULATE +#define MAP_POPULATE 0x10000 +#undef MAP_NONBLOCK +#define MAP_NONBLOCK 0x20000 +#undef MAP_STACK +#define MAP_STACK 0x40000 +#undef MAP_HUGETLB +#define MAP_HUGETLB 0x80000 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#undef MADV_SOFT_OFFLINE +#endif diff --git a/arch/mipsn32/bits/msg.h b/arch/mipsn32/bits/msg.h new file mode 100644 index 00000000..bfe2b3a7 --- /dev/null +++ b/arch/mipsn32/bits/msg.h @@ -0,0 +1,25 @@ +struct msqid_ds +{ + struct ipc_perm msg_perm; +#if _MIPSEL || __MIPSEL || __MIPSEL__ + time_t msg_stime; + int __unused1; + time_t msg_rtime; + int __unused2; + time_t msg_ctime; + int __unused3; +#else + int __unused1; + time_t msg_stime; + int __unused2; + time_t msg_rtime; + int __unused3; + time_t msg_ctime; +#endif + unsigned long msg_cbytes; + msgqnum_t msg_qnum; + msglen_t msg_qbytes; + pid_t msg_lspid; + pid_t msg_lrpid; + unsigned long __unused[2]; +}; diff --git a/arch/mipsn32/bits/poll.h b/arch/mipsn32/bits/poll.h new file mode 100644 index 00000000..b0b1ed62 --- /dev/null +++ b/arch/mipsn32/bits/poll.h @@ -0,0 +1,2 @@ +#define POLLWRNORM POLLOUT +#define POLLWRBAND 0x100 diff --git a/arch/mipsn32/bits/posix.h b/arch/mipsn32/bits/posix.h new file mode 100644 index 00000000..30a38714 --- /dev/null +++ b/arch/mipsn32/bits/posix.h @@ -0,0 +1,2 @@ +#define _POSIX_V6_ILP32_OFFBIG 1 +#define _POSIX_V7_ILP32_OFFBIG 1 diff --git a/arch/mipsn32/bits/reg.h b/arch/mipsn32/bits/reg.h new file mode 100644 index 00000000..a3f63acc --- /dev/null +++ b/arch/mipsn32/bits/reg.h @@ -0,0 +1,47 @@ +#undef __WORDSIZE +#define __WORDSIZE 64 + +#define EF_R0 0 +#define EF_R1 1 +#define EF_R2 2 +#define EF_R3 3 +#define EF_R4 4 +#define EF_R5 5 +#define EF_R6 6 +#define EF_R7 7 +#define EF_R8 8 +#define EF_R9 9 +#define EF_R10 10 +#define EF_R11 11 +#define EF_R12 12 +#define EF_R13 13 +#define EF_R14 14 +#define EF_R15 15 +#define EF_R16 16 +#define EF_R17 17 +#define EF_R18 18 +#define EF_R19 19 +#define EF_R20 20 +#define EF_R21 21 +#define EF_R22 22 +#define EF_R23 23 +#define EF_R24 24 +#define EF_R25 25 + +#define EF_R26 26 +#define EF_R27 27 +#define EF_R28 28 +#define EF_R29 29 +#define EF_R30 30 +#define EF_R31 31 + +#define EF_LO 32 +#define EF_HI 33 + +#define EF_CP0_EPC 34 +#define EF_CP0_BADVADDR 35 +#define EF_CP0_STATUS 36 +#define EF_CP0_CAUSE 37 +#define EF_UNUSED0 38 + +#define EF_SIZE 304 diff --git a/arch/mipsn32/bits/resource.h b/arch/mipsn32/bits/resource.h new file mode 100644 index 00000000..414a4054 --- /dev/null +++ b/arch/mipsn32/bits/resource.h @@ -0,0 +1,5 @@ +#define RLIMIT_NOFILE 5 +#define RLIMIT_AS 6 +#define RLIMIT_RSS 7 +#define RLIMIT_NPROC 8 +#define RLIMIT_MEMLOCK 9 diff --git a/arch/mipsn32/bits/sem.h b/arch/mipsn32/bits/sem.h new file mode 100644 index 00000000..e46ced95 --- /dev/null +++ b/arch/mipsn32/bits/sem.h @@ -0,0 +1,14 @@ +struct semid_ds { + struct ipc_perm sem_perm; + time_t sem_otime; + time_t sem_ctime; +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned short sem_nsems; + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; +#else + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; + unsigned short sem_nsems; +#endif + time_t __unused3; + time_t __unused4; +}; diff --git a/arch/mipsn32/bits/setjmp.h b/arch/mipsn32/bits/setjmp.h new file mode 100644 index 00000000..4d93267e --- /dev/null +++ b/arch/mipsn32/bits/setjmp.h @@ -0,0 +1 @@ +typedef unsigned long long __jmp_buf[23]; diff --git a/arch/mipsn32/bits/shm.h b/arch/mipsn32/bits/shm.h new file mode 100644 index 00000000..8d193781 --- /dev/null +++ b/arch/mipsn32/bits/shm.h @@ -0,0 +1,24 @@ +#define SHMLBA 4096 + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; + pid_t shm_cpid; + pid_t shm_lpid; + unsigned long shm_nattch; + unsigned long __pad1; + unsigned long __pad2; +}; + +struct shminfo { + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; +}; + +struct shm_info { + int __used_ids; + unsigned long shm_tot, shm_rss, shm_swp; + unsigned long __swap_attempts, __swap_successes; +}; diff --git a/arch/mipsn32/bits/signal.h b/arch/mipsn32/bits/signal.h new file mode 100644 index 00000000..c31ad07e --- /dev/null +++ b/arch/mipsn32/bits/signal.h @@ -0,0 +1,143 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +typedef unsigned long long greg_t, gregset_t[32]; + +typedef struct { + union { + double fp_dregs[32]; + struct { + float _fp_fregs; + unsigned _fp_pad; + } fp_fregs[32]; + } fp_r; +} fpregset_t; + +struct sigcontext { + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned long long sc_mdhi; + unsigned long long sc_hi1; + unsigned long long sc_hi2; + unsigned long long sc_hi3; + unsigned long long sc_mdlo; + unsigned long long sc_lo1; + unsigned long long sc_lo2; + unsigned long long sc_lo3; + unsigned long long sc_pc; + unsigned int sc_fpc_csr; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned int sc_reserved; +}; + +typedef struct { + gregset_t gregs; + fpregset_t fpregs; + greg_t mdhi; + greg_t hi1; + greg_t hi2; + greg_t hi3; + greg_t mdlo; + greg_t lo1; + greg_t lo2; + greg_t lo3; + greg_t pc; + unsigned int fpc_csr; + unsigned int used_math; + unsigned int dsp; + unsigned int reserved; +} mcontext_t; + +#else +typedef struct { + unsigned long long __mc1[32]; + double __mc2[32]; + unsigned long long __mc3[9]; + unsigned __mc4[4]; +} mcontext_t; +#endif + +struct sigaltstack { + void *ss_sp; + size_t ss_size; + int ss_flags; +}; + +typedef struct __ucontext { + unsigned long uc_flags; + struct __ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; +} ucontext_t; + +#define SA_NOCLDSTOP 1 +#define SA_NOCLDWAIT 0x10000 +#define SA_SIGINFO 8 +#define SA_ONSTACK 0x08000000 +#define SA_RESTART 0x10000000 +#define SA_NODEFER 0x40000000 +#define SA_RESETHAND 0x80000000 +#define SA_RESTORER 0x04000000 + +#undef SIG_BLOCK +#undef SIG_UNBLOCK +#undef SIG_SETMASK +#define SIG_BLOCK 1 +#define SIG_UNBLOCK 2 +#define SIG_SETMASK 3 + +#undef SI_ASYNCIO +#undef SI_MESGQ +#undef SI_TIMER +#define SI_ASYNCIO (-2) +#define SI_MESGQ (-4) +#define SI_TIMER (-3) + +#define __SI_SWAP_ERRNO_CODE + +#endif + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT SIGABRT +#define SIGSTKFLT 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGBUS 10 +#define SIGSEGV 11 +#define SIGSYS 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGUSR1 16 +#define SIGUSR2 17 +#define SIGCHLD 18 +#define SIGPWR 19 +#define SIGWINCH 20 +#define SIGURG 21 +#define SIGIO 22 +#define SIGPOLL SIGIO +#define SIGSTOP 23 +#define SIGTSTP 24 +#define SIGCONT 25 +#define SIGTTIN 26 +#define SIGTTOU 27 +#define SIGVTALRM 28 +#define SIGPROF 29 +#define SIGXCPU 30 +#define SIGXFSZ 31 +#define SIGUNUSED SIGSYS + +#define _NSIG 128 diff --git a/arch/mipsn32/bits/socket.h b/arch/mipsn32/bits/socket.h new file mode 100644 index 00000000..191ebdb5 --- /dev/null +++ b/arch/mipsn32/bits/socket.h @@ -0,0 +1,52 @@ +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen; + void *msg_control; + socklen_t msg_controllen; + int msg_flags; +}; + +struct cmsghdr { + socklen_t cmsg_len; + int cmsg_level; + int cmsg_type; +}; + +#define SOCK_STREAM 2 +#define SOCK_DGRAM 1 + +#define SOL_SOCKET 65535 + +#define SO_DEBUG 1 + +#define SO_REUSEADDR 0x0004 +#define SO_KEEPALIVE 0x0008 +#define SO_DONTROUTE 0x0010 +#define SO_BROADCAST 0x0020 +#define SO_LINGER 0x0080 +#define SO_OOBINLINE 0x0100 +#define SO_REUSEPORT 0x0200 +#define SO_SNDBUF 0x1001 +#define SO_RCVBUF 0x1002 +#define SO_SNDLOWAT 0x1003 +#define SO_RCVLOWAT 0x1004 +#define SO_RCVTIMEO 0x1006 +#define SO_SNDTIMEO 0x1005 +#define SO_ERROR 0x1007 +#define SO_TYPE 0x1008 +#define SO_ACCEPTCONN 0x1009 +#define SO_PROTOCOL 0x1028 +#define SO_DOMAIN 0x1029 + +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_BSDCOMPAT 14 +#define SO_PASSCRED 17 +#define SO_PEERCRED 18 +#define SO_SNDBUFFORCE 31 +#define SO_RCVBUFFORCE 33 + +#define SOCK_NONBLOCK 0200 +#define SOCK_CLOEXEC 02000000 diff --git a/arch/mipsn32/bits/stat.h b/arch/mipsn32/bits/stat.h new file mode 100644 index 00000000..f4d1df83 --- /dev/null +++ b/arch/mipsn32/bits/stat.h @@ -0,0 +1,22 @@ +#include +#include + +struct stat { + dev_t st_dev; + long __pad1[2]; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + long __pad2[2]; + off_t st_size; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + blksize_t st_blksize; + long __pad3; + blkcnt_t st_blocks; + long __pad4[14]; +}; diff --git a/arch/mipsn32/bits/statfs.h b/arch/mipsn32/bits/statfs.h new file mode 100644 index 00000000..a73bd547 --- /dev/null +++ b/arch/mipsn32/bits/statfs.h @@ -0,0 +1,8 @@ +struct statfs { + unsigned long f_type, f_bsize, f_frsize; + fsblkcnt_t f_blocks, f_bfree; + fsfilcnt_t f_files, f_ffree; + fsblkcnt_t f_bavail; + fsid_t f_fsid; + unsigned long f_namelen, f_flags, f_spare[5]; +}; diff --git a/arch/mipsn32/bits/stdint.h b/arch/mipsn32/bits/stdint.h new file mode 100644 index 00000000..d1b27121 --- /dev/null +++ b/arch/mipsn32/bits/stdint.h @@ -0,0 +1,20 @@ +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; + +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN + +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX + +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX + +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#define SIZE_MAX UINT32_MAX diff --git a/arch/mipsn32/bits/syscall.h b/arch/mipsn32/bits/syscall.h new file mode 100644 index 00000000..09e4a25c --- /dev/null +++ b/arch/mipsn32/bits/syscall.h @@ -0,0 +1,649 @@ +#define __NR_read 6000 +#define __NR_write 6001 +#define __NR_open 6002 +#define __NR_close 6003 +#define __NR_stat 6004 +#define __NR_fstat 6005 +#define __NR_lstat 6006 +#define __NR_poll 6007 +#define __NR_lseek 6008 +#define __NR_mmap 6009 +#define __NR_mprotect 6010 +#define __NR_munmap 6011 +#define __NR_brk 6012 +#define __NR_rt_sigaction 6013 +#define __NR_rt_sigprocmask 6014 +#define __NR_ioctl 6015 +#define __NR_pread64 6016 +#define __NR_pwrite64 6017 +#define __NR_readv 6018 +#define __NR_writev 6019 +#define __NR_access 6020 +#define __NR_pipe 6021 +#define __NR__newselect 6022 +#define __NR_sched_yield 6023 +#define __NR_mremap 6024 +#define __NR_msync 6025 +#define __NR_mincore 6026 +#define __NR_madvise 6027 +#define __NR_shmget 6028 +#define __NR_shmat 6029 +#define __NR_shmctl 6030 +#define __NR_dup 6031 +#define __NR_dup2 6032 +#define __NR_pause 6033 +#define __NR_nanosleep 6034 +#define __NR_getitimer 6035 +#define __NR_setitimer 6036 +#define __NR_alarm 6037 +#define __NR_getpid 6038 +#define __NR_sendfile 6039 +#define __NR_socket 6040 +#define __NR_connect 6041 +#define __NR_accept 6042 +#define __NR_sendto 6043 +#define __NR_recvfrom 6044 +#define __NR_sendmsg 6045 +#define __NR_recvmsg 6046 +#define __NR_shutdown 6047 +#define __NR_bind 6048 +#define __NR_listen 6049 +#define __NR_getsockname 6050 +#define __NR_getpeername 6051 +#define __NR_socketpair 6052 +#define __NR_setsockopt 6053 +#define __NR_getsockopt 6054 +#define __NR_clone 6055 +#define __NR_fork 6056 +#define __NR_execve 6057 +#define __NR_exit 6058 +#define __NR_wait4 6059 +#define __NR_kill 6060 +#define __NR_uname 6061 +#define __NR_semget 6062 +#define __NR_semop 6063 +#define __NR_semctl 6064 +#define __NR_shmdt 6065 +#define __NR_msgget 6066 +#define __NR_msgsnd 6067 +#define __NR_msgrcv 6068 +#define __NR_msgctl 6069 +#define __NR_fcntl 6070 +#define __NR_flock 6071 +#define __NR_fsync 6072 +#define __NR_fdatasync 6073 +#define __NR_truncate 6074 +#define __NR_ftruncate 6075 +#define __NR_getdents 6076 +#define __NR_getcwd 6077 +#define __NR_chdir 6078 +#define __NR_fchdir 6079 +#define __NR_rename 6080 +#define __NR_mkdir 6081 +#define __NR_rmdir 6082 +#define __NR_creat 6083 +#define __NR_link 6084 +#define __NR_unlink 6085 +#define __NR_symlink 6086 +#define __NR_readlink 6087 +#define __NR_chmod 6088 +#define __NR_fchmod 6089 +#define __NR_chown 6090 +#define __NR_fchown 6091 +#define __NR_lchown 6092 +#define __NR_umask 6093 +#define __NR_gettimeofday 6094 +#define __NR_getrlimit 6095 +#define __NR_getrusage 6096 +#define __NR_sysinfo 6097 +#define __NR_times 6098 +#define __NR_ptrace 6099 +#define __NR_getuid 6100 +#define __NR_syslog 6101 +#define __NR_getgid 6102 +#define __NR_setuid 6103 +#define __NR_setgid 6104 +#define __NR_geteuid 6105 +#define __NR_getegid 6106 +#define __NR_setpgid 6107 +#define __NR_getppid 6108 +#define __NR_getpgrp 6109 +#define __NR_setsid 6110 +#define __NR_setreuid 6111 +#define __NR_setregid 6112 +#define __NR_getgroups 6113 +#define __NR_setgroups 6114 +#define __NR_setresuid 6115 +#define __NR_getresuid 6116 +#define __NR_setresgid 6117 +#define __NR_getresgid 6118 +#define __NR_getpgid 6119 +#define __NR_setfsuid 6120 +#define __NR_setfsgid 6121 +#define __NR_getsid 6122 +#define __NR_capget 6123 +#define __NR_capset 6124 +#define __NR_rt_sigpending 6125 +#define __NR_rt_sigtimedwait 6126 +#define __NR_rt_sigqueueinfo 6127 +#define __NR_rt_sigsuspend 6128 +#define __NR_sigaltstack 6129 +#define __NR_utime 6130 +#define __NR_mknod 6131 +#define __NR_personality 6132 +#define __NR_ustat 6133 +#define __NR_statfs 6134 +#define __NR_fstatfs 6135 +#define __NR_sysfs 6136 +#define __NR_getpriority 6137 +#define __NR_setpriority 6138 +#define __NR_sched_setparam 6139 +#define __NR_sched_getparam 6140 +#define __NR_sched_setscheduler 6141 +#define __NR_sched_getscheduler 6142 +#define __NR_sched_get_priority_max 6143 +#define __NR_sched_get_priority_min 6144 +#define __NR_sched_rr_get_interval 6145 +#define __NR_mlock 6146 +#define __NR_munlock 6147 +#define __NR_mlockall 6148 +#define __NR_munlockall 6149 +#define __NR_vhangup 6150 +#define __NR_pivot_root 6151 +#define __NR__sysctl 6152 +#define __NR_prctl 6153 +#define __NR_adjtimex 6154 +#define __NR_setrlimit 6155 +#define __NR_chroot 6156 +#define __NR_sync 6157 +#define __NR_acct 6158 +#define __NR_settimeofday 6159 +#define __NR_mount 6160 +#define __NR_umount2 6161 +#define __NR_swapon 6162 +#define __NR_swapoff 6163 +#define __NR_reboot 6164 +#define __NR_sethostname 6165 +#define __NR_setdomainname 6166 +#define __NR_create_module 6167 +#define __NR_init_module 6168 +#define __NR_delete_module 6169 +#define __NR_get_kernel_syms 6170 +#define __NR_query_module 6171 +#define __NR_quotactl 6172 +#define __NR_nfsservctl 6173 +#define __NR_getpmsg 6174 +#define __NR_putpmsg 6175 +#define __NR_afs_syscall 6176 +#define __NR_reserved177 6177 +#define __NR_gettid 6178 +#define __NR_readahead 6179 +#define __NR_setxattr 6180 +#define __NR_lsetxattr 6181 +#define __NR_fsetxattr 6182 +#define __NR_getxattr 6183 +#define __NR_lgetxattr 6184 +#define __NR_fgetxattr 6185 +#define __NR_listxattr 6186 +#define __NR_llistxattr 6187 +#define __NR_flistxattr 6188 +#define __NR_removexattr 6189 +#define __NR_lremovexattr 6190 +#define __NR_fremovexattr 6191 +#define __NR_tkill 6192 +#define __NR_reserved193 6193 +#define __NR_futex 6194 +#define __NR_sched_setaffinity 6195 +#define __NR_sched_getaffinity 6196 +#define __NR_cacheflush 6197 +#define __NR_cachectl 6198 +#define __NR_sysmips 6199 +#define __NR_io_setup 6200 +#define __NR_io_destroy 6201 +#define __NR_io_getevents 6202 +#define __NR_io_submit 6203 +#define __NR_io_cancel 6204 +#define __NR_exit_group 6205 +#define __NR_lookup_dcookie 6206 +#define __NR_epoll_create 6207 +#define __NR_epoll_ctl 6208 +#define __NR_epoll_wait 6209 +#define __NR_remap_file_pages 6210 +#define __NR_rt_sigreturn 6211 +#define __NR_fcntl64 6212 +#define __NR_set_tid_address 6213 +#define __NR_restart_syscall 6214 +#define __NR_semtimedop 6215 +#define __NR_fadvise64 6216 +#define __NR_statfs64 6217 +#define __NR_fstatfs64 6218 +#define __NR_sendfile64 6219 +#define __NR_timer_create 6220 +#define __NR_timer_settime 6221 +#define __NR_timer_gettime 6222 +#define __NR_timer_getoverrun 6223 +#define __NR_timer_delete 6224 +#define __NR_clock_settime 6225 +#define __NR_clock_gettime 6226 +#define __NR_clock_getres 6227 +#define __NR_clock_nanosleep 6228 +#define __NR_tgkill 6229 +#define __NR_utimes 6230 +#define __NR_mbind 6231 +#define __NR_get_mempolicy 6232 +#define __NR_set_mempolicy 6233 +#define __NR_mq_open 6234 +#define __NR_mq_unlink 6235 +#define __NR_mq_timedsend 6236 +#define __NR_mq_timedreceive 6237 +#define __NR_mq_notify 6238 +#define __NR_mq_getsetattr 6239 +#define __NR_vserver 6240 +#define __NR_waitid 6241 +#define __NR_add_key 6243 +#define __NR_request_key 6244 +#define __NR_keyctl 6245 +#define __NR_set_thread_area 6246 +#define __NR_inotify_init 6247 +#define __NR_inotify_add_watch 6248 +#define __NR_inotify_rm_watch 6249 +#define __NR_migrate_pages 6250 +#define __NR_openat 6251 +#define __NR_mkdirat 6252 +#define __NR_mknodat 6253 +#define __NR_fchownat 6254 +#define __NR_futimesat 6255 +#define __NR_fstatat 6256 +#define __NR_unlinkat 6257 +#define __NR_renameat 6258 +#define __NR_linkat 6259 +#define __NR_symlinkat 6260 +#define __NR_readlinkat 6261 +#define __NR_fchmodat 6262 +#define __NR_faccessat 6263 +#define __NR_pselect6 6264 +#define __NR_ppoll 6265 +#define __NR_unshare 6266 +#define __NR_splice 6267 +#define __NR_sync_file_range 6268 +#define __NR_tee 6269 +#define __NR_vmsplice 6270 +#define __NR_move_pages 6271 +#define __NR_set_robust_list 6272 +#define __NR_get_robust_list 6273 +#define __NR_kexec_load 6274 +#define __NR_getcpu 6275 +#define __NR_epoll_pwait 6276 +#define __NR_ioprio_set 6277 +#define __NR_ioprio_get 6278 +#define __NR_utimensat 6279 +#define __NR_signalfd 6280 +#define __NR_timerfd 6281 +#define __NR_eventfd 6282 +#define __NR_fallocate 6283 +#define __NR_timerfd_create 6284 +#define __NR_timerfd_gettime 6285 +#define __NR_timerfd_settime 6286 +#define __NR_signalfd4 6287 +#define __NR_eventfd2 6288 +#define __NR_epoll_create1 6289 +#define __NR_dup3 6290 +#define __NR_pipe2 6291 +#define __NR_inotify_init1 6292 +#define __NR_preadv 6293 +#define __NR_pwritev 6294 +#define __NR_rt_tgsigqueueinfo 6295 +#define __NR_perf_event_open 6296 +#define __NR_accept4 6297 +#define __NR_recvmmsg 6298 +#define __NR_getdents64 6299 +#define __NR_fanotify_init 6300 +#define __NR_fanotify_mark 6301 +#define __NR_prlimit64 6302 +#define __NR_name_to_handle_at 6303 +#define __NR_open_by_handle_at 6304 +#define __NR_clock_adjtime 6305 +#define __NR_syncfs 6306 +#define __NR_sendmmsg 6307 +#define __NR_setns 6308 +#define __NR_process_vm_readv 6309 +#define __NR_process_vm_writev 6310 +#define __NR_kcmp 6311 +#define __NR_finit_module 6312 +#define __NR_sched_setattr 6313 +#define __NR_sched_getattr 6314 +#define __NR_renameat2 6315 +#define __NR_seccomp 6316 +#define __NR_getrandom 6317 +#define __NR_memfd_create 6318 +#define __NR_bpf 6319 +#define __NR_execveat 6320 +#define __NR_userfaultfd 6321 +#define __NR_membarrier 6322 +#define __NR_mlock2 6323 +#define __NR_copy_file_range 6324 + +#define SYS_read 6000 +#define SYS_write 6001 +#define SYS_open 6002 +#define SYS_close 6003 +#define SYS_stat 6004 +#define SYS_fstat 6005 +#define SYS_lstat 6006 +#define SYS_poll 6007 +#define SYS_lseek 6008 +#define SYS_mmap 6009 +#define SYS_mprotect 6010 +#define SYS_munmap 6011 +#define SYS_brk 6012 +#define SYS_rt_sigaction 6013 +#define SYS_rt_sigprocmask 6014 +#define SYS_ioctl 6015 +#define SYS_pread64 6016 +#define SYS_pwrite64 6017 +#define SYS_readv 6018 +#define SYS_writev 6019 +#define SYS_access 6020 +#define SYS_pipe 6021 +#define SYS__newselect 6022 +#define SYS_sched_yield 6023 +#define SYS_mremap 6024 +#define SYS_msync 6025 +#define SYS_mincore 6026 +#define SYS_madvise 6027 +#define SYS_shmget 6028 +#define SYS_shmat 6029 +#define SYS_shmctl 6030 +#define SYS_dup 6031 +#define SYS_dup2 6032 +#define SYS_pause 6033 +#define SYS_nanosleep 6034 +#define SYS_getitimer 6035 +#define SYS_setitimer 6036 +#define SYS_alarm 6037 +#define SYS_getpid 6038 +#define SYS_sendfile 6039 +#define SYS_socket 6040 +#define SYS_connect 6041 +#define SYS_accept 6042 +#define SYS_sendto 6043 +#define SYS_recvfrom 6044 +#define SYS_sendmsg 6045 +#define SYS_recvmsg 6046 +#define SYS_shutdown 6047 +#define SYS_bind 6048 +#define SYS_listen 6049 +#define SYS_getsockname 6050 +#define SYS_getpeername 6051 +#define SYS_socketpair 6052 +#define SYS_setsockopt 6053 +#define SYS_getsockopt 6054 +#define SYS_clone 6055 +#define SYS_fork 6056 +#define SYS_execve 6057 +#define SYS_exit 6058 +#define SYS_wait4 6059 +#define SYS_kill 6060 +#define SYS_uname 6061 +#define SYS_semget 6062 +#define SYS_semop 6063 +#define SYS_semctl 6064 +#define SYS_shmdt 6065 +#define SYS_msgget 6066 +#define SYS_msgsnd 6067 +#define SYS_msgrcv 6068 +#define SYS_msgctl 6069 +#define SYS_fcntl 6070 +#define SYS_flock 6071 +#define SYS_fsync 6072 +#define SYS_fdatasync 6073 +#define SYS_truncate 6074 +#define SYS_ftruncate 6075 +#define SYS_getdents 6076 +#define SYS_getcwd 6077 +#define SYS_chdir 6078 +#define SYS_fchdir 6079 +#define SYS_rename 6080 +#define SYS_mkdir 6081 +#define SYS_rmdir 6082 +#define SYS_creat 6083 +#define SYS_link 6084 +#define SYS_unlink 6085 +#define SYS_symlink 6086 +#define SYS_readlink 6087 +#define SYS_chmod 6088 +#define SYS_fchmod 6089 +#define SYS_chown 6090 +#define SYS_fchown 6091 +#define SYS_lchown 6092 +#define SYS_umask 6093 +#define SYS_gettimeofday 6094 +#define SYS_getrlimit 6095 +#define SYS_getrusage 6096 +#define SYS_sysinfo 6097 +#define SYS_times 6098 +#define SYS_ptrace 6099 +#define SYS_getuid 6100 +#define SYS_syslog 6101 +#define SYS_getgid 6102 +#define SYS_setuid 6103 +#define SYS_setgid 6104 +#define SYS_geteuid 6105 +#define SYS_getegid 6106 +#define SYS_setpgid 6107 +#define SYS_getppid 6108 +#define SYS_getpgrp 6109 +#define SYS_setsid 6110 +#define SYS_setreuid 6111 +#define SYS_setregid 6112 +#define SYS_getgroups 6113 +#define SYS_setgroups 6114 +#define SYS_setresuid 6115 +#define SYS_getresuid 6116 +#define SYS_setresgid 6117 +#define SYS_getresgid 6118 +#define SYS_getpgid 6119 +#define SYS_setfsuid 6120 +#define SYS_setfsgid 6121 +#define SYS_getsid 6122 +#define SYS_capget 6123 +#define SYS_capset 6124 +#define SYS_rt_sigpending 6125 +#define SYS_rt_sigtimedwait 6126 +#define SYS_rt_sigqueueinfo 6127 +#define SYS_rt_sigsuspend 6128 +#define SYS_sigaltstack 6129 +#define SYS_utime 6130 +#define SYS_mknod 6131 +#define SYS_personality 6132 +#define SYS_ustat 6133 +#define SYS_statfs 6134 +#define SYS_fstatfs 6135 +#define SYS_sysfs 6136 +#define SYS_getpriority 6137 +#define SYS_setpriority 6138 +#define SYS_sched_setparam 6139 +#define SYS_sched_getparam 6140 +#define SYS_sched_setscheduler 6141 +#define SYS_sched_getscheduler 6142 +#define SYS_sched_get_priority_max 6143 +#define SYS_sched_get_priority_min 6144 +#define SYS_sched_rr_get_interval 6145 +#define SYS_mlock 6146 +#define SYS_munlock 6147 +#define SYS_mlockall 6148 +#define SYS_munlockall 6149 +#define SYS_vhangup 6150 +#define SYS_pivot_root 6151 +#define SYS__sysctl 6152 +#define SYS_prctl 6153 +#define SYS_adjtimex 6154 +#define SYS_setrlimit 6155 +#define SYS_chroot 6156 +#define SYS_sync 6157 +#define SYS_acct 6158 +#define SYS_settimeofday 6159 +#define SYS_mount 6160 +#define SYS_umount2 6161 +#define SYS_swapon 6162 +#define SYS_swapoff 6163 +#define SYS_reboot 6164 +#define SYS_sethostname 6165 +#define SYS_setdomainname 6166 +#define SYS_create_module 6167 +#define SYS_init_module 6168 +#define SYS_delete_module 6169 +#define SYS_get_kernel_syms 6170 +#define SYS_query_module 6171 +#define SYS_quotactl 6172 +#define SYS_nfsservctl 6173 +#define SYS_getpmsg 6174 +#define SYS_putpmsg 6175 +#define SYS_afs_syscall 6176 +#define SYS_reserved177 6177 +#define SYS_gettid 6178 +#define SYS_readahead 6179 +#define SYS_setxattr 6180 +#define SYS_lsetxattr 6181 +#define SYS_fsetxattr 6182 +#define SYS_getxattr 6183 +#define SYS_lgetxattr 6184 +#define SYS_fgetxattr 6185 +#define SYS_listxattr 6186 +#define SYS_llistxattr 6187 +#define SYS_flistxattr 6188 +#define SYS_removexattr 6189 +#define SYS_lremovexattr 6190 +#define SYS_fremovexattr 6191 +#define SYS_tkill 6192 +#define SYS_reserved193 6193 +#define SYS_futex 6194 +#define SYS_sched_setaffinity 6195 +#define SYS_sched_getaffinity 6196 +#define SYS_cacheflush 6197 +#define SYS_cachectl 6198 +#define SYS_sysmips 6199 +#define SYS_io_setup 6200 +#define SYS_io_destroy 6201 +#define SYS_io_getevents 6202 +#define SYS_io_submit 6203 +#define SYS_io_cancel 6204 +#define SYS_exit_group 6205 +#define SYS_lookup_dcookie 6206 +#define SYS_epoll_create 6207 +#define SYS_epoll_ctl 6208 +#define SYS_epoll_wait 6209 +#define SYS_remap_file_pages 6210 +#define SYS_rt_sigreturn 6211 +#define SYS_fcntl64 6212 +#define SYS_set_tid_address 6213 +#define SYS_restart_syscall 6214 +#define SYS_semtimedop 6215 +#define SYS_fadvise64 6216 +#define SYS_statfs64 6217 +#define SYS_fstatfs64 6218 +#define SYS_sendfile64 6219 +#define SYS_timer_create 6220 +#define SYS_timer_settime 6221 +#define SYS_timer_gettime 6222 +#define SYS_timer_getoverrun 6223 +#define SYS_timer_delete 6224 +#define SYS_clock_settime 6225 +#define SYS_clock_gettime 6226 +#define SYS_clock_getres 6227 +#define SYS_clock_nanosleep 6228 +#define SYS_tgkill 6229 +#define SYS_utimes 6230 +#define SYS_mbind 6231 +#define SYS_get_mempolicy 6232 +#define SYS_set_mempolicy 6233 +#define SYS_mq_open 6234 +#define SYS_mq_unlink 6235 +#define SYS_mq_timedsend 6236 +#define SYS_mq_timedreceive 6237 +#define SYS_mq_notify 6238 +#define SYS_mq_getsetattr 6239 +#define SYS_vserver 6240 +#define SYS_waitid 6241 +#define SYS_add_key 6243 +#define SYS_request_key 6244 +#define SYS_keyctl 6245 +#define SYS_set_thread_area 6246 +#define SYS_inotify_init 6247 +#define SYS_inotify_add_watch 6248 +#define SYS_inotify_rm_watch 6249 +#define SYS_migrate_pages 6250 +#define SYS_openat 6251 +#define SYS_mkdirat 6252 +#define SYS_mknodat 6253 +#define SYS_fchownat 6254 +#define SYS_futimesat 6255 +#define SYS_fstatat 6256 +#define SYS_unlinkat 6257 +#define SYS_renameat 6258 +#define SYS_linkat 6259 +#define SYS_symlinkat 6260 +#define SYS_readlinkat 6261 +#define SYS_fchmodat 6262 +#define SYS_faccessat 6263 +#define SYS_pselect6 6264 +#define SYS_ppoll 6265 +#define SYS_unshare 6266 +#define SYS_splice 6267 +#define SYS_sync_file_range 6268 +#define SYS_tee 6269 +#define SYS_vmsplice 6270 +#define SYS_move_pages 6271 +#define SYS_set_robust_list 6272 +#define SYS_get_robust_list 6273 +#define SYS_kexec_load 6274 +#define SYS_getcpu 6275 +#define SYS_epoll_pwait 6276 +#define SYS_ioprio_set 6277 +#define SYS_ioprio_get 6278 +#define SYS_utimensat 6279 +#define SYS_signalfd 6280 +#define SYS_timerfd 6281 +#define SYS_eventfd 6282 +#define SYS_fallocate 6283 +#define SYS_timerfd_create 6284 +#define SYS_timerfd_gettime 6285 +#define SYS_timerfd_settime 6286 +#define SYS_signalfd4 6287 +#define SYS_eventfd2 6288 +#define SYS_epoll_create1 6289 +#define SYS_dup3 6290 +#define SYS_pipe2 6291 +#define SYS_inotify_init1 6292 +#define SYS_preadv 6293 +#define SYS_pwritev 6294 +#define SYS_rt_tgsigqueueinfo 6295 +#define SYS_perf_event_open 6296 +#define SYS_accept4 6297 +#define SYS_recvmmsg 6298 +#define SYS_getdents64 6299 +#define SYS_fanotify_init 6300 +#define SYS_fanotify_mark 6301 +#define SYS_prlimit64 6302 +#define SYS_name_to_handle_at 6303 +#define SYS_open_by_handle_at 6304 +#define SYS_clock_adjtime 6305 +#define SYS_syncfs 6306 +#define SYS_sendmmsg 6307 +#define SYS_setns 6308 +#define SYS_process_vm_readv 6309 +#define SYS_process_vm_writev 6310 +#define SYS_kcmp 6311 +#define SYS_finit_module 6312 +#define SYS_sched_setattr 6313 +#define SYS_sched_getattr 6314 +#define SYS_renameat2 6315 +#define SYS_seccomp 6316 +#define SYS_getrandom 6317 +#define SYS_memfd_create 6318 +#define SYS_bpf 6319 +#define SYS_execveat 6320 +#define SYS_userfaultfd 6321 +#define SYS_membarrier 6322 +#define SYS_mlock2 6323 +#define SYS_copy_file_range 6324 diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h new file mode 100644 index 00000000..3a7d5a13 --- /dev/null +++ b/arch/mipsn32/bits/termios.h @@ -0,0 +1,166 @@ +struct termios { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_line; + cc_t c_cc[NCCS]; +}; + +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VMIN 4 +#define VTIME 5 +#define VEOL2 6 +#define VSWTC 7 +#define VSWTCH 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 +#define VEOF 16 +#define VEOL 17 + +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IUCLC 0001000 +#define IXON 0002000 +#define IXANY 0004000 +#define IXOFF 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 + +#define OPOST 0000001 +#define OLCUC 0000002 +#define ONLCR 0000004 +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 +#define OFILL 0000100 +#define OFDEL 0000200 +#define NLDLY 0000400 +#define NL0 0000000 +#define NL1 0000400 +#define CRDLY 0003000 +#define CR0 0000000 +#define CR1 0001000 +#define CR2 0002000 +#define CR3 0003000 +#define TABDLY 0014000 +#define TAB0 0000000 +#define TAB1 0004000 +#define TAB2 0010000 +#define TAB3 0014000 +#define BSDLY 0020000 +#define BS0 0000000 +#define BS1 0020000 +#define FFDLY 0100000 +#define FF0 0000000 +#define FF1 0100000 + +#define VTDLY 0040000 +#define VT0 0000000 +#define VT1 0040000 + +#define B0 0000000 +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA 0000016 +#define EXTB 0000017 + +#define BOTHER 0010000 +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define B500000 0010005 +#define B576000 0010006 +#define B921600 0010007 +#define B1000000 0010010 +#define B1152000 0010011 +#define B1500000 0010012 +#define B2000000 0010013 +#define B2500000 0010014 +#define B3000000 0010015 +#define B3500000 0010016 +#define B4000000 0010017 + +#define CBAUD 0010017 + +#define CSIZE 0000060 +#define CS5 0000000 +#define CS6 0000020 +#define CS7 0000040 +#define CS8 0000060 +#define CSTOPB 0000100 +#define CREAD 0000200 +#define PARENB 0000400 +#define PARODD 0001000 +#define HUPCL 0002000 +#define CLOCAL 0004000 + +#define ISIG 0000001 +#define ICANON 0000002 +#define XCASE 0000004 +#define ECHO 0000010 +#define ECHOE 0000020 +#define ECHOK 0000040 +#define ECHONL 0000100 +#define NOFLSH 0000200 +#define IEXTEN 0000400 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0020000 +#define PENDIN 0040000 +#define TOSTOP 0100000 +#define ITOSTOP 0100000 + +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define CBAUDEX 0010000 +#define CIBAUD 002003600000 +#define IBSHIFT 16 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 +#define EXTPROC 0200000 +#define XTABS 0014000 +#define TIOCSER_TEMT 1 +#endif diff --git a/arch/mipsn32/bits/user.h b/arch/mipsn32/bits/user.h new file mode 100644 index 00000000..60fa1fda --- /dev/null +++ b/arch/mipsn32/bits/user.h @@ -0,0 +1,15 @@ +struct user { + unsigned long regs[102]; + unsigned long u_tsize, u_dsize, u_ssize; + unsigned long long start_code, start_data, start_stack; + long long signal; + unsigned long long *u_ar0; + unsigned long long magic; + char u_comm[32]; +}; + +#define ELF_NGREG 45 +#define ELF_NFPREG 33 + +typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; +typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG]; diff --git a/arch/mipsn32/crt_arch.h b/arch/mipsn32/crt_arch.h new file mode 100644 index 00000000..eb5928cc --- /dev/null +++ b/arch/mipsn32/crt_arch.h @@ -0,0 +1,32 @@ +__asm__( +".set push\n" +".set noreorder\n" +".text \n" +".global _" START "\n" +".global " START "\n" +".global " START "_data\n" +".type _" START ", @function\n" +".type " START ", @function\n" +".type " START "_data, @function\n" +"_" START ":\n" +"" START ":\n" +" bal 1f \n" +" move $fp, $0 \n" +"" START "_data: \n" +" .gpword " START "_data \n" +" .gpword " START "_c \n" +".weak _DYNAMIC \n" +".hidden _DYNAMIC \n" +" .gpword _DYNAMIC \n" +"1: lw $gp, 0($ra) \n" +" subu $gp, $ra, $gp \n" +" move $4, $sp \n" +" lw $5, 8($ra) \n" +" addu $5, $5, $gp \n" +" lw $25, 4($ra) \n" +" addu $25, $25, $gp \n" +" and $sp, $sp, -8 \n" +" jalr $25 \n" +" subu $sp, $sp, 16 \n" +".set pop \n" +); diff --git a/arch/mipsn32/ksigaction.h b/arch/mipsn32/ksigaction.h new file mode 100644 index 00000000..9969e3b2 --- /dev/null +++ b/arch/mipsn32/ksigaction.h @@ -0,0 +1,8 @@ +struct k_sigaction { + unsigned flags; + void (*handler)(int); + unsigned long mask[4]; + void (*restorer)(); +}; + +void __restore(), __restore_rt(); diff --git a/arch/mipsn32/pthread_arch.h b/arch/mipsn32/pthread_arch.h new file mode 100644 index 00000000..e5812655 --- /dev/null +++ b/arch/mipsn32/pthread_arch.h @@ -0,0 +1,18 @@ +static inline struct pthread *__pthread_self() +{ +#if __mips_isa_rev < 2 + register char *tp __asm__("$3"); + __asm__ __volatile__ (".word 0x7c03e83b" : "=r" (tp) ); +#else + char *tp; + __asm__ __volatile__ ("rdhwr %0, $29" : "=r" (tp) ); +#endif + return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); +} + +#define TLS_ABOVE_TP +#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000) + +#define DTP_OFFSET 0x8000 + +#define MC_PC pc diff --git a/arch/mipsn32/reloc.h b/arch/mipsn32/reloc.h new file mode 100644 index 00000000..728aaab2 --- /dev/null +++ b/arch/mipsn32/reloc.h @@ -0,0 +1,52 @@ +#include + +#if __mips_isa_rev >= 6 +#define ISA_SUFFIX "r6" +#else +#define ISA_SUFFIX "" +#endif + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define ENDIAN_SUFFIX "el" +#else +#define ENDIAN_SUFFIX "" +#endif + +#ifdef __mips_soft_float +#define FP_SUFFIX "-sf" +#else +#define FP_SUFFIX "" +#endif + +#define LDSO_ARCH "mipsn32" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX + +#define TPOFF_K (-0x7000) + +#define REL_SYM_OR_REL R_MIPS_REL32 +#define REL_PLT R_MIPS_JUMP_SLOT +#define REL_COPY R_MIPS_COPY +#define REL_DTPMOD R_MIPS_TLS_DTPMOD32 +#define REL_DTPOFF R_MIPS_TLS_DTPREL32 +#define REL_TPOFF R_MIPS_TLS_TPREL32 + +#define NEED_MIPS_GOT_RELOCS 1 +#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP +#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) + +#define CRTJMP(pc,sp) __asm__ __volatile__( \ + "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" ) + +#define GETFUNCSYM(fp, sym, got) __asm__ ( \ + ".hidden " #sym "\n" \ + ".set push \n" \ + ".set noreorder \n" \ + " bal 1f \n" \ + " nop \n" \ + " .gpword . \n" \ + " .gpword " #sym " \n" \ + "1: lw %0, ($ra) \n" \ + " subu %0, $ra, %0 \n" \ + " lw $ra, 4($ra) \n" \ + " addu %0, %0, $ra \n" \ + ".set pop \n" \ + : "=r"(*(fp)) : : "memory", "ra" ) diff --git a/arch/mipsn32/syscall_arch.h b/arch/mipsn32/syscall_arch.h new file mode 100644 index 00000000..58d2c8bd --- /dev/null +++ b/arch/mipsn32/syscall_arch.h @@ -0,0 +1,165 @@ +#define __SYSCALL_LL_E(x) (x) +#define __SYSCALL_LL_O(x) (x) + +__attribute__((visibility("hidden"))) +long (__syscall)(long, ...); + +#define SYSCALL_RLIM_INFINITY (-1UL/2) + +#if _MIPSEL || __MIPSEL || __MIPSEL__ +#define __stat_fix(st) ((st),(void)0) +#else +#include +static inline void __stat_fix(long p) +{ + struct stat *st = (struct stat *)p; + st->st_dev >>= 32; + st->st_rdev >>= 32; +} +#endif + +#ifndef __clang__ + +static inline long __syscall0(long n) +{ + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "addu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + return r7 ? -r2 : r2; +} + +static inline long __syscall1(long n, long a) +{ + register long r4 __asm__("$4") = a; + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "addu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + return r7 ? -r2 : r2; +} + +static inline long __syscall2(long n, long a, long b) +{ + register long r4 __asm__("$4") = a; + register long r5 __asm__("$5") = b; + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "addu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4), "r"(r5) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + if (r7) return -r2; + long ret = r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + return ret; +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + register long r4 __asm__("$4") = a; + register long r5 __asm__("$5") = b; + register long r6 __asm__("$6") = c; + register long r7 __asm__("$7"); + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "addu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4), "r"(r5), "r"(r6) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + if (r7) return -r2; + long ret = r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + return ret; +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + register long r4 __asm__("$4") = a; + register long r5 __asm__("$5") = b; + register long r6 __asm__("$6") = c; + register long r7 __asm__("$7") = d; + register long r2 __asm__("$2"); + __asm__ __volatile__ ( + "addu $2,$0,%2 ; syscall" + : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), + "r"(r4), "r"(r5), "r"(r6) + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); + if (r7) return -r2; + long ret = r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + if (n == SYS_fstatat) __stat_fix(c); + return ret; +} + +#else + +static inline long __syscall0(long n) +{ + return (__syscall)(n); +} + +static inline long __syscall1(long n, long a) +{ + return (__syscall)(n, a); +} + +static inline long __syscall2(long n, long a, long b) +{ + long r2 = (__syscall)(n, a, b); + if (r2 > -4096UL) return r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + return r2; +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + long r2 = (__syscall)(n, a, b, c); + if (r2 > -4096UL) return r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + return r2; +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + long r2 = (__syscall)(n, a, b, c, d); + if (r2 > -4096UL) return r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + if (n == SYS_fstatat) __stat_fix(c); + return r2; +} + +#endif + +static inline long __syscall5(long n, long a, long b, long c, long d, long e) +{ + long r2 = (__syscall)(n, a, b, c, d, e); + if (r2 > -4096UL) return r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + if (n == SYS_fstatat) __stat_fix(c); + return r2; +} + +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) +{ + long r2 = (__syscall)(n, a, b, c, d, e, f); + if (r2 > -4096UL) return r2; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); + if (n == SYS_fstatat) __stat_fix(c); + return r2; +} + +#define VDSO_USEFUL +#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT_VER "LINUX_2.6" diff --git a/configure b/configure index 969671dd..53241ab7 100755 --- a/configure +++ b/configure @@ -618,6 +618,7 @@ trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi if test "$ARCH" = "mips64" ; then +trycppif "_MIPS_SIM != _ABI64" "$t" && ARCH=mipsn32 trycppif "__mips_isa_rev >= 6" "$t" && SUBARCH=${SUBARCH}r6 trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf diff --git a/crt/mipsn32/crti.s b/crt/mipsn32/crti.s new file mode 100644 index 00000000..14fa28d9 --- /dev/null +++ b/crt/mipsn32/crti.s @@ -0,0 +1,18 @@ +.set noreorder +.section .init +.global _init +.type _init,@function +.align 2 +_init: + subu $sp, $sp, 32 + sd $gp, 16($sp) + sd $ra, 24($sp) + +.section .fini +.global _fini +.type _fini,@function +.align 2 +_fini: + subu $sp, $sp, 32 + sd $gp, 16($sp) + sd $ra, 24($sp) diff --git a/crt/mipsn32/crtn.s b/crt/mipsn32/crtn.s new file mode 100644 index 00000000..dccd7e89 --- /dev/null +++ b/crt/mipsn32/crtn.s @@ -0,0 +1,12 @@ +.set noreorder +.section .init + ld $gp, 16($sp) + ld $ra, 24($sp) + j $ra + addu $sp, $sp, 32 + +.section .fini + ld $gp, 16($sp) + ld $ra, 24($sp) + j $ra + addu $sp, $sp, 32 diff --git a/src/fenv/mipsn32/fenv-sf.c b/src/fenv/mipsn32/fenv-sf.c new file mode 100644 index 00000000..4aa3dbf1 --- /dev/null +++ b/src/fenv/mipsn32/fenv-sf.c @@ -0,0 +1,3 @@ +#ifdef __mips_soft_float +#include "../fenv.c" +#endif diff --git a/src/fenv/mipsn32/fenv.S b/src/fenv/mipsn32/fenv.S new file mode 100644 index 00000000..cce6436b --- /dev/null +++ b/src/fenv/mipsn32/fenv.S @@ -0,0 +1,70 @@ +#ifndef __mips_soft_float + +.set noreorder +.global feclearexcept +.type feclearexcept,@function +feclearexcept: + and $4, $4, 0x7c + cfc1 $5, $31 + or $5, $5, $4 + xor $5, $5, $4 + ctc1 $5, $31 + jr $ra + li $2, 0 + +.global feraiseexcept +.type feraiseexcept,@function +feraiseexcept: + and $4, $4, 0x7c + cfc1 $5, $31 + or $5, $5, $4 + ctc1 $5, $31 + jr $ra + li $2, 0 + +.global fetestexcept +.type fetestexcept,@function +fetestexcept: + and $4, $4, 0x7c + cfc1 $2, $31 + jr $ra + and $2, $2, $4 + +.global fegetround +.type fegetround,@function +fegetround: + cfc1 $2, $31 + jr $ra + andi $2, $2, 3 + +.global __fesetround +.type __fesetround,@function +__fesetround: + cfc1 $5, $31 + li $6, -4 + and $5, $5, $6 + or $5, $5, $4 + ctc1 $5, $31 + jr $ra + li $2, 0 + +.global fegetenv +.type fegetenv,@function +fegetenv: + cfc1 $5, $31 + sw $5, 0($4) + jr $ra + li $2, 0 + +.global fesetenv +.type fesetenv,@function +fesetenv: + addiu $5, $4, 1 + beq $5, $0, 1f + nop + lw $5, 0($4) +1: ctc1 $5, $31 + jr $ra + li $2, 0 + +#endif diff --git a/src/internal/mipsn32/syscall.s b/src/internal/mipsn32/syscall.s new file mode 100644 index 00000000..510a6fa4 --- /dev/null +++ b/src/internal/mipsn32/syscall.s @@ -0,0 +1,19 @@ +.set noreorder +.global __syscall +.hidden __syscall +.type __syscall,@function +__syscall: + move $2, $4 + move $4, $5 + move $5, $6 + move $6, $7 + move $7, $8 + move $8, $9 + move $9, $10 + move $10, $11 + syscall + beq $7, $0, 1f + nop + subu $2, $0, $2 +1: jr $ra + nop diff --git a/src/ldso/mipsn32/dlsym.s b/src/ldso/mipsn32/dlsym.s new file mode 100644 index 00000000..1c82da30 --- /dev/null +++ b/src/ldso/mipsn32/dlsym.s @@ -0,0 +1,17 @@ +.set noreorder +.global dlsym +.hidden __dlsym +.type dlsym,@function +dlsym: + lui $3, %hi(%neg(%gp_rel(dlsym))) + addiu $3, $3, %lo(%neg(%gp_rel(dlsym))) + addu $3, $3, $25 + move $6, $ra + lw $25, %got_disp(__dlsym)($3) + addiu $sp, $sp, -32 + sd $ra, 16($sp) + jalr $25 + nop + ld $ra, 16($sp) + jr $ra + addiu $sp, $sp, 32 diff --git a/src/setjmp/mipsn32/longjmp.S b/src/setjmp/mipsn32/longjmp.S new file mode 100644 index 00000000..30c3ee0b --- /dev/null +++ b/src/setjmp/mipsn32/longjmp.S @@ -0,0 +1,36 @@ +.set noreorder +.global _longjmp +.global longjmp +.type _longjmp,@function +.type longjmp,@function +_longjmp: +longjmp: + move $2, $5 + bne $2, $0, 1f + nop + addu $2, $2, 1 +1: +#ifndef __mips_soft_float + ldc1 $24, 96($4) + ldc1 $25, 104($4) + ldc1 $26, 112($4) + ldc1 $27, 120($4) + ldc1 $28, 128($4) + ldc1 $29, 136($4) + ldc1 $30, 144($4) + ldc1 $31, 152($4) +#endif + ld $ra, 0($4) + ld $sp, 8($4) + ld $gp, 16($4) + ld $16, 24($4) + ld $17, 32($4) + ld $18, 40($4) + ld $19, 48($4) + ld $20, 56($4) + ld $21, 64($4) + ld $22, 72($4) + ld $23, 80($4) + ld $30, 88($4) + jr $ra + nop diff --git a/src/setjmp/mipsn32/setjmp.S b/src/setjmp/mipsn32/setjmp.S new file mode 100644 index 00000000..b9646c2a --- /dev/null +++ b/src/setjmp/mipsn32/setjmp.S @@ -0,0 +1,34 @@ +.set noreorder +.global __setjmp +.global _setjmp +.global setjmp +.type __setjmp,@function +.type _setjmp,@function +.type setjmp,@function +__setjmp: +_setjmp: +setjmp: + sd $ra, 0($4) + sd $sp, 8($4) + sd $gp, 16($4) + sd $16, 24($4) + sd $17, 32($4) + sd $18, 40($4) + sd $19, 48($4) + sd $20, 56($4) + sd $21, 64($4) + sd $22, 72($4) + sd $23, 80($4) + sd $30, 88($4) +#ifndef __mips_soft_float + sdc1 $24, 96($4) + sdc1 $25, 104($4) + sdc1 $26, 112($4) + sdc1 $27, 120($4) + sdc1 $28, 128($4) + sdc1 $29, 136($4) + sdc1 $30, 144($4) + sdc1 $31, 152($4) +#endif + jr $ra + li $2, 0 diff --git a/src/signal/mipsn32/restore.s b/src/signal/mipsn32/restore.s new file mode 100644 index 00000000..0d1c1c5e --- /dev/null +++ b/src/signal/mipsn32/restore.s @@ -0,0 +1,9 @@ +.set noreorder +.global __restore_rt +.global __restore +.type __restore_rt,@function +.type __restore,@function +__restore_rt: +__restore: + li $2,6211 + syscall diff --git a/src/signal/mipsn32/sigsetjmp.s b/src/signal/mipsn32/sigsetjmp.s new file mode 100644 index 00000000..c0c6961f --- /dev/null +++ b/src/signal/mipsn32/sigsetjmp.s @@ -0,0 +1,38 @@ +.set noreorder +.global sigsetjmp +.global __sigsetjmp +.type sigsetjmp,@function +.type __sigsetjmp,@function +sigsetjmp: +__sigsetjmp: + lui $3, %hi(%neg(%gp_rel(sigsetjmp))) + addiu $3, $3, %lo(%neg(%gp_rel(sigsetjmp))) + + # comparing save mask with 0, if equals to 0 then + # sigsetjmp is equal to setjmp. + beq $5, $0, 1f + addu $3, $3, $25 + sd $ra, 160($4) + sd $16, 168($4) + + # save base of got so that we can use it later + # once we return from 'longjmp' + sd $3, 176($4) + lw $25, %got_disp(setjmp)($3) + jalr $25 + move $16, $4 + + move $5, $2 # Return from 'setjmp' or 'longjmp' + move $4, $16 # Restore the pointer-to-sigjmp_buf + ld $ra, 160($4) # Restore ra of sigsetjmp + ld $16, 168($4) # Restore $16 of sigsetjmp + ld $3, 176($4) # Restore base of got + +.hidden __sigsetjmp_tail + lw $25, %got_disp(__sigsetjmp_tail)($3) + jr $25 + nop +1: + lw $25, %got_disp(setjmp)($3) + jr $25 + nop diff --git a/src/thread/mipsn32/__unmapself.s b/src/thread/mipsn32/__unmapself.s new file mode 100644 index 00000000..4b032e5e --- /dev/null +++ b/src/thread/mipsn32/__unmapself.s @@ -0,0 +1,9 @@ +.set noreorder +.global __unmapself +.type __unmapself,@function +__unmapself: + li $2, 6011 + syscall + li $4, 0 + li $2, 6058 + syscall diff --git a/src/thread/mipsn32/clone.s b/src/thread/mipsn32/clone.s new file mode 100644 index 00000000..51035852 --- /dev/null +++ b/src/thread/mipsn32/clone.s @@ -0,0 +1,30 @@ +.set noreorder +.global __clone +.type __clone,@function +__clone: + # Save function pointer and argument pointer on new thread stack + and $5, $5, -16 # aligning stack to double word + subu $5, $5, 16 + sw $4, 0($5) # save function pointer + sw $7, 4($5) # save argument pointer + + # Shuffle (fn,sp,fl,arg,ptid,tls,ctid) to (fl,sp,ptid,tls,ctid) + # sys_clone(u64 flags, u64 ustack_base, u64 parent_tidptr, u64 child_tidptr, u64 tls) + move $4, $6 + move $6, $8 + move $7, $9 + move $8, $10 + li $2, 6055 + syscall + beq $7, $0, 1f + nop + jr $ra + subu $2, $0, $2 +1: beq $2, $0, 1f + nop + jr $ra + nop +1: lw $25, 0($sp) # function pointer + lw $4, 4($sp) # argument pointer + jr $25 # call the user's function + nop diff --git a/src/thread/mipsn32/syscall_cp.s b/src/thread/mipsn32/syscall_cp.s new file mode 100644 index 00000000..e85615bc --- /dev/null +++ b/src/thread/mipsn32/syscall_cp.s @@ -0,0 +1,51 @@ +.set noreorder +.global __cp_begin +.hidden __cp_begin +.type __cp_begin,@function +.global __cp_end +.hidden __cp_end +.type __cp_end,@function +.global __cp_cancel +.hidden __cp_cancel +.type __cp_cancel,@function +.global __cp_cancel_data +.hidden __cp_cancel_data +.type __cp_cancel_data,@function +.hidden __cancel +.global __syscall_cp_asm +.hidden __syscall_cp_asm +.type __syscall_cp_asm,@function +__syscall_cp_asm: +__cp_begin: + lw $4, 0($4) + bne $4, $0, __cp_cancel + move $2, $5 + move $4, $6 + move $5, $7 + move $6, $8 + move $7, $9 + move $8, $10 + move $9, $11 + lw $10, 0($sp) + syscall +__cp_end: + beq $7, $0, 1f + nop + subu $2, $0, $2 +1: jr $ra + nop + + # if cancellation flag is 1 then call __cancel +__cp_cancel: + move $2, $ra + bal 1f + nop +__cp_cancel_data: + .gpword __cp_cancel_data + .gpword __cancel +1: lw $3, 0($ra) + subu $3, $ra, $3 + lw $25, 4($ra) + addu $25, $25, $3 + jr $25 + move $ra, $2 diff --git a/src/unistd/mipsn32/pipe.s b/src/unistd/mipsn32/pipe.s new file mode 100644 index 00000000..80f882e2 --- /dev/null +++ b/src/unistd/mipsn32/pipe.s @@ -0,0 +1,19 @@ +.set noreorder +.global pipe +.type pipe,@function +pipe: + lui $3, %hi(%neg(%gp_rel(pipe))) + addiu $3, $3, %lo(%neg(%gp_rel(pipe))) + addu $3, $3, $25 + li $2, 6021 + syscall + beq $7, $0, 1f + nop + lw $25, %got_disp(__syscall_ret)($3) + jr $25 + subu $4, $0, $2 +1: sw $2, 0($4) + sw $3, 4($4) + move $2, $0 + jr $ra + nop From e7d05c7894aa15ea6decdeca481ffed3f14cb521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Van=C4=9Bk?= Date: Sun, 17 Apr 2016 14:53:08 +0000 Subject: [PATCH 095/412] remove dead store in res_msend The variable nss is set to zero in following line. --- src/network/res_msend.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/network/res_msend.c b/src/network/res_msend.c index a47d18dd..de7f6157 100644 --- a/src/network/res_msend.c +++ b/src/network/res_msend.c @@ -52,7 +52,6 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, timeout = 1000*conf->timeout; attempts = conf->attempts; - nns = conf->nns; for (nns=0; nnsnns; nns++) { const struct address *iplit = &conf->ns[nns]; if (iplit->family == AF_INET) { From be999f7a54e81656ea0409030205177327a7450c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 25 Apr 2016 19:37:06 -0400 Subject: [PATCH 096/412] fix thread structure/dtv-pointer corruption on powerpc per the powerpc psabi, offset 4 of the stack at call time belongs to the callee and is used for spilling lr (return address). in addition, offset 0 on the stack must contain a pointer to the previous stack frame, or a null pointer for the initial stack frame of a thread. __clone failed to setup any stack frame on the new thread's stack, thereby allowing the start function it called to clobber offset 4 of the new thread's struct __pthread, which contains the dtv pointer. add code to setup a proper stack frame and align the stack pointer to a multiple of 16 (also an abi requirement) if it was not already aligned. --- src/thread/powerpc/clone.s | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/thread/powerpc/clone.s b/src/thread/powerpc/clone.s index dc5c74c6..a57dbcce 100644 --- a/src/thread/powerpc/clone.s +++ b/src/thread/powerpc/clone.s @@ -22,6 +22,11 @@ stw 31, 4(1) mr 30, 3 mr 31, 6 +# create initial stack frame for new thread +clrrwi 4, 4, 4 +li 0, 0 +stwu 0, -16(4) + #move c into first arg mr 3, 5 #mr 4, 4 From 6ed791e768d83b40ed56c99dbb1ed72c1e49aae7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 26 Apr 2016 15:26:40 -0400 Subject: [PATCH 097/412] fix FILE buffer underflow in ungetwc commit 7e816a6487932cbb3cb71d94b609e50e81f4e5bf (version 1.1.11 release cycle) moved the code that performs wchar_t to multibyte conversion across code that used the resulting length in bytes, thereby breaking the unget buffer space check in ungetwc and clobbering up to three bytes below the start of the buffer. for allocated FILEs (all read-enabled FILEs except stdin), the underflow clobbers at most the FILE-specific locale pointer. no stores are performed through this pointer, but subsequent loads may result in a crash or mismatching encoding rule (UTF-8 multibyte vs byte-based). for stdin, the buffer lies in .bss and the underflow may clobber another object. in practice, for libc.so the adjacent object seems to be stderr's buffer, which is completely unused, but this could vary with linking options, or when static linking. applications which do not attempt to use more than one character of ungetwc pushback, or which do not use ungetwc, are not affected. --- src/stdio/ungetwc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stdio/ungetwc.c b/src/stdio/ungetwc.c index 80d6e203..9edf366f 100644 --- a/src/stdio/ungetwc.c +++ b/src/stdio/ungetwc.c @@ -8,7 +8,7 @@ wint_t ungetwc(wint_t c, FILE *f) { unsigned char mbc[MB_LEN_MAX]; - int l=1; + int l; locale_t *ploc = &CURRENT_LOCALE, loc = *ploc; FLOCK(f); @@ -17,8 +17,8 @@ wint_t ungetwc(wint_t c, FILE *f) *ploc = f->locale; if (!f->rpos) __toread(f); - if (!f->rpos || f->rpos < f->buf - UNGET + l || c == WEOF || - (!isascii(c) && (l = wctomb((void *)mbc, c)) < 0)) { + if (!f->rpos || c == WEOF || (l = wcrtomb((void *)mbc, c, 0)) < 0 || + f->rpos < f->buf - UNGET + l) { FUNLOCK(f); *ploc = loc; return WEOF; From f0a61399330bae42beeb27d6ecd05570b3382a60 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Apr 2016 20:41:45 -0400 Subject: [PATCH 098/412] update COPYRIGHT file to clarify that permissions apply for all files these changes are the outcome of a long mailing list thread that took place March 2016, "musl licensing". among minor other issues, prospective users were not confident that the whole-project MIT license would grant permission for files to which the COPYRIGHT file expressed a belief that copyright not apply, if it turned out that these files were actually subject to copyright. in accordance with the original intent of applying a permissive license to the project, which was that license issues not be an obstacle to use, the text which was causing confusion is removed. no new claims of copyright are made, but new text is added to clarify that the grant of permissions applies to all files, and an explicit grant of permission to use public headers and crt files without attribution has been made. this patch was reviewed and approved by all substantial contributors to the affected files: Bobby Bingham, John Spencer (rofl0r), Nicholas J. Kain, Rich Felker, Richard Pennington, Stefan Kristiansson, and Szabolcs Nagy. --- COPYRIGHT | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 7768600b..f0ee3b78 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -115,10 +115,8 @@ licensed under following terms: "Permission to use, copy, modify, and/or distribute this code for any purpose with or without fee is hereby granted. There is no warranty." -The x86_64 port was written by Nicholas J. Kain. Several files (crt) -were released into the public domain; others are licensed under the -standard MIT license terms at the top of this file. See individual -files for their copyright status. +The x86_64 port was written by Nicholas J. Kain and is licensed under +the standard MIT terms. The mips and microblaze ports were originally written by Richard Pennington for use in the ellcc project. The original code was adapted @@ -140,15 +138,26 @@ can be found in the git version control history of the project. The omission of copyright and license comments in each file is in the interest of source tree size. -All public header files (include/* and arch/*/bits/*) should be -treated as Public Domain as they intentionally contain no content -which can be covered by copyright. Some source modules may fall in -this category as well. If you believe that a file is so trivial that -it should be in the Public Domain, please contact the authors and -request an explicit statement releasing it from copyright. +In addition, permission is hereby granted for all public header files +(include/* and arch/*/bits/*) and crt files intended to be linked into +applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit +the copyright notice and permission notice otherwise required by the +license, and to use these files without any requirement of +attribution. These files include substantial contributions from: -The following files are trivial, believed not to be copyrightable in -the first place, and hereby explicitly released to the Public Domain: +Bobby Bingham +John Spencer +Nicholas J. Kain +Rich Felker +Richard Pennington +Stefan Kristiansson +Szabolcs Nagy -All public headers: include/*, arch/*/bits/* -Startup files: crt/* +all of whom have explicitly granted such permission. + +This file previously contained text expressing a belief that most of +the files covered by the above exception were sufficiently trivial not +to be subject to copyright, resulting in confusion over whether it +negated the permissions granted in the license. In the spirit of +permissive licensing, and of not having licensing issues being an +obstacle to adoption, that text has been removed. From 2d49c2243fbe3322961e6f0a052cc3a28acd1fe2 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 29 Apr 2016 19:50:33 -0400 Subject: [PATCH 099/412] follow standard configure behavior for cross compile prefix the standard configure interface, which our configure script tries to implement, identifies cross compiling (build != host) and searches for the properly-prefixed cross tools. our script was not doing that, forcing users to explicitly provide either CC or a CROSS_COMPILE tool prefix, and the more common choice, just providing CC, was incomplete because the Makefile would still invoke the native ar and ranlib programs. this happened to work when building on ELF-based systems with GNU binutils, but could easily fail when cross-compiling from dissimilar systems. like before, and like the standard configure behavior, an explicit CC or CROSS_COMPILE variable on the command line or in the environment overrides the automatic prefixing. --- configure | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 53241ab7..37942918 100755 --- a/configure +++ b/configure @@ -25,6 +25,7 @@ Fine tuning of the installation directories: System types: --target=TARGET configure to run on target TARGET [detected] --host=HOST same as --target + --build=BUILD build system type; used only to infer cross-compiling Optional features: --enable-optimize=... optimize listed components for speed over size [auto] @@ -129,6 +130,7 @@ includedir='$(prefix)/include' syslibdir='/lib' tools= tool_libs= +build= target= optimize=auto debug=no @@ -172,6 +174,7 @@ case "$arg" in --disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;; --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;; --host=*|--target=*) target=${arg#*=} ;; +--build=*) build=${arg#*=} ;; -* ) echo "$0: unknown option $arg" ;; CC=*) CC=${arg#*=} ;; CFLAGS=*) CFLAGS=${arg#*=} ;; @@ -180,7 +183,7 @@ LDFLAGS=*) LDFLAGS=${arg#*=} ;; CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;; LIBCC=*) LIBCC=${arg#*=} ;; *=*) ;; -*) target=$arg ;; +*) build=$arg ; target=$arg ;; esac done @@ -213,6 +216,15 @@ done set +C trap 'rm "$tmpc"' EXIT INT QUIT TERM HUP +# +# Check whether we are cross-compiling, and set a default +# CROSS_COMPILE prefix if none was provided. +# +test "$target" && \ +test "$target" != "$build" && \ +test -z "$CROSS_COMPILE" && \ +CROSS_COMPILE="$target-" + # # Find a C compiler to use # From 4b619e5c61d7d4cf344b355be8b1acb0f0795ea9 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 4 May 2016 13:29:11 -0700 Subject: [PATCH 100/412] fix incorrect protocol name and number for egp previously if you called getprotobyname("egp") you would get NULL because \008 is invalid octal and so the protocol id was interpreted as 0 and name as "8egp". --- src/network/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/proto.c b/src/network/proto.c index a42d1456..c4fd34ef 100644 --- a/src/network/proto.c +++ b/src/network/proto.c @@ -12,7 +12,7 @@ static const unsigned char protos[] = { "\004ipencap\0" "\005st\0" "\006tcp\0" - "\008egp\0" + "\010egp\0" "\014pup\0" "\021udp\0" "\024hmp\0" From 6bc7d9c411c3a32cfa9d239b73fffb2ba66dd9ff Mon Sep 17 00:00:00 2001 From: "LeMay, Michael" Date: Wed, 4 May 2016 03:29:42 +0000 Subject: [PATCH 101/412] fix redundant processing of --build flag in configure script The --build flag is listed in two case statement entries in configure, which causes the second entry to be ignored. This patch removes it from the first entry. Signed-off-by: Michael LeMay --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 37942918..3432b58d 100755 --- a/configure +++ b/configure @@ -172,7 +172,7 @@ case "$arg" in --disable-wrapper|--enable-wrapper=no) wrapper=no ;; --enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ; gcc_wrapper=yes ;; --disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;; ---enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;; +--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;; --host=*|--target=*) target=${arg#*=} ;; --build=*) build=${arg#*=} ;; -* ) echo "$0: unknown option $arg" ;; From c0ede9e4046a0882d83ae4b45c7dfac86fb7c15d Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sat, 30 Apr 2016 19:18:17 -0500 Subject: [PATCH 102/412] add powerpc64 port --- arch/powerpc64/atomic_arch.h | 63 ++ arch/powerpc64/bits/alltypes.h.in | 26 + arch/powerpc64/bits/endian.h | 5 + arch/powerpc64/bits/errno.h | 134 +++++ arch/powerpc64/bits/fcntl.h | 40 ++ arch/powerpc64/bits/fenv.h | 31 + arch/powerpc64/bits/float.h | 16 + arch/powerpc64/bits/ioctl.h | 229 ++++++++ arch/powerpc64/bits/ipc.h | 16 + arch/powerpc64/bits/limits.h | 7 + arch/powerpc64/bits/mman.h | 8 + arch/powerpc64/bits/msg.h | 13 + arch/powerpc64/bits/posix.h | 2 + arch/powerpc64/bits/reg.h | 3 + arch/powerpc64/bits/sem.h | 13 + arch/powerpc64/bits/setjmp.h | 1 + arch/powerpc64/bits/shm.h | 25 + arch/powerpc64/bits/signal.h | 108 ++++ arch/powerpc64/bits/socket.h | 62 ++ arch/powerpc64/bits/stat.h | 17 + arch/powerpc64/bits/stdint.h | 20 + arch/powerpc64/bits/syscall.h | 718 +++++++++++++++++++++++ arch/powerpc64/bits/termios.h | 170 ++++++ arch/powerpc64/bits/user.h | 25 + arch/powerpc64/crt_arch.h | 19 + arch/powerpc64/pthread_arch.h | 17 + arch/powerpc64/reloc.h | 32 + arch/powerpc64/syscall_arch.h | 87 +++ configure | 8 +- crt/powerpc64/crti.s | 21 + crt/powerpc64/crtn.s | 13 + src/fenv/powerpc64/fenv.c | 68 +++ src/internal/powerpc64/syscall.s | 17 + src/ldso/powerpc64/dlsym.s | 12 + src/setjmp/powerpc64/longjmp.s | 77 +++ src/setjmp/powerpc64/setjmp.s | 78 +++ src/signal/powerpc64/restore.s | 11 + src/signal/powerpc64/sigsetjmp.s | 30 + src/thread/powerpc64/__set_thread_area.s | 8 + src/thread/powerpc64/__unmapself.s | 9 + src/thread/powerpc64/clone.s | 47 ++ src/thread/powerpc64/syscall_cp.s | 37 ++ 42 files changed, 2342 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc64/atomic_arch.h create mode 100644 arch/powerpc64/bits/alltypes.h.in create mode 100644 arch/powerpc64/bits/endian.h create mode 100644 arch/powerpc64/bits/errno.h create mode 100644 arch/powerpc64/bits/fcntl.h create mode 100644 arch/powerpc64/bits/fenv.h create mode 100644 arch/powerpc64/bits/float.h create mode 100644 arch/powerpc64/bits/ioctl.h create mode 100644 arch/powerpc64/bits/ipc.h create mode 100644 arch/powerpc64/bits/limits.h create mode 100644 arch/powerpc64/bits/mman.h create mode 100644 arch/powerpc64/bits/msg.h create mode 100644 arch/powerpc64/bits/posix.h create mode 100644 arch/powerpc64/bits/reg.h create mode 100644 arch/powerpc64/bits/sem.h create mode 100644 arch/powerpc64/bits/setjmp.h create mode 100644 arch/powerpc64/bits/shm.h create mode 100644 arch/powerpc64/bits/signal.h create mode 100644 arch/powerpc64/bits/socket.h create mode 100644 arch/powerpc64/bits/stat.h create mode 100644 arch/powerpc64/bits/stdint.h create mode 100644 arch/powerpc64/bits/syscall.h create mode 100644 arch/powerpc64/bits/termios.h create mode 100644 arch/powerpc64/bits/user.h create mode 100644 arch/powerpc64/crt_arch.h create mode 100644 arch/powerpc64/pthread_arch.h create mode 100644 arch/powerpc64/reloc.h create mode 100644 arch/powerpc64/syscall_arch.h create mode 100644 crt/powerpc64/crti.s create mode 100644 crt/powerpc64/crtn.s create mode 100644 src/fenv/powerpc64/fenv.c create mode 100644 src/internal/powerpc64/syscall.s create mode 100644 src/ldso/powerpc64/dlsym.s create mode 100644 src/setjmp/powerpc64/longjmp.s create mode 100644 src/setjmp/powerpc64/setjmp.s create mode 100644 src/signal/powerpc64/restore.s create mode 100644 src/signal/powerpc64/sigsetjmp.s create mode 100644 src/thread/powerpc64/__set_thread_area.s create mode 100644 src/thread/powerpc64/__unmapself.s create mode 100644 src/thread/powerpc64/clone.s create mode 100644 src/thread/powerpc64/syscall_cp.s diff --git a/arch/powerpc64/atomic_arch.h b/arch/powerpc64/atomic_arch.h new file mode 100644 index 00000000..269d79c6 --- /dev/null +++ b/arch/powerpc64/atomic_arch.h @@ -0,0 +1,63 @@ +#define a_ll a_ll +static inline int a_ll(volatile int *p) +{ + int v; + __asm__ __volatile__ ("lwarx %0, 0, %2" : "=r"(v) : "m"(*p), "r"(p)); + return v; +} + +#define a_sc a_sc +static inline int a_sc(volatile int *p, int v) +{ + int r; + __asm__ __volatile__ ( + "stwcx. %2, 0, %3 ; mfcr %0" + : "=r"(r), "=m"(*p) : "r"(v), "r"(p) : "memory", "cc"); + return r & 0x20000000; /* "bit 2" of "cr0" (backwards bit order) */ +} + +#define a_ll_p a_ll_p +static inline void *a_ll_p(volatile void *p) +{ + void *v; + __asm__ __volatile__ ("ldarx %0, 0, %2" : "=r"(v) : "m"(*(void *volatile *)p), "r"(p)); + return v; +} + +#define a_sc_p a_sc_p +static inline int a_sc_p(volatile void *p, void *v) +{ + int r; + __asm__ __volatile__ ( + "stdcx. %2, 0, %3 ; mfcr %0" + : "=r"(r), "=m"(*(void *volatile *)p) : "r"(v), "r"(p) : "memory", "cc"); + return r & 0x20000000; /* "bit 2" of "cr0" (backwards bit order) */ +} + +#define a_barrier a_barrier +static inline void a_barrier() +{ + __asm__ __volatile__ ("sync" : : : "memory"); +} + +#define a_pre_llsc a_barrier + +#define a_post_llsc a_post_llsc +static inline void a_post_llsc() +{ + __asm__ __volatile__ ("isync" : : : "memory"); +} + +#define a_store a_store +static inline void a_store(volatile int *p, int v) +{ + a_pre_llsc(); + *p = v; + a_post_llsc(); +} + +#define a_crash a_crash +static inline void a_crash() +{ + __asm__ __volatile__ (".long 0"); +} diff --git a/arch/powerpc64/bits/alltypes.h.in b/arch/powerpc64/bits/alltypes.h.in new file mode 100644 index 00000000..5b205851 --- /dev/null +++ b/arch/powerpc64/bits/alltypes.h.in @@ -0,0 +1,26 @@ +#define _Addr long +#define _Int64 long +#define _Reg long + +TYPEDEF __builtin_va_list va_list; +TYPEDEF __builtin_va_list __isoc_va_list; + +#ifndef __cplusplus +TYPEDEF int wchar_t; +#endif + +TYPEDEF float float_t; +TYPEDEF double double_t; + +TYPEDEF struct { long long __ll; long double __ld; } max_align_t; + +TYPEDEF long time_t; +TYPEDEF long suseconds_t; + +TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; +TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; +TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; +TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/arch/powerpc64/bits/endian.h b/arch/powerpc64/bits/endian.h new file mode 100644 index 00000000..2016cb20 --- /dev/null +++ b/arch/powerpc64/bits/endian.h @@ -0,0 +1,5 @@ +#if __BIG_ENDIAN__ +#define __BYTE_ORDER __BIG_ENDIAN +#else +#define __BYTE_ORDER __LITTLE_ENDIAN +#endif diff --git a/arch/powerpc64/bits/errno.h b/arch/powerpc64/bits/errno.h new file mode 100644 index 00000000..36ad2f90 --- /dev/null +++ b/arch/powerpc64/bits/errno.h @@ -0,0 +1,134 @@ +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define ENOTBLK 15 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define EINVAL 22 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define ETXTBSY 26 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 +#define EDOM 33 +#define ERANGE 34 +#define EDEADLK 35 +#define ENAMETOOLONG 36 +#define ENOLCK 37 +#define ENOSYS 38 +#define ENOTEMPTY 39 +#define ELOOP 40 +#define EWOULDBLOCK EAGAIN +#define ENOMSG 42 +#define EIDRM 43 +#define ECHRNG 44 +#define EL2NSYNC 45 +#define EL3HLT 46 +#define EL3RST 47 +#define ELNRNG 48 +#define EUNATCH 49 +#define ENOCSI 50 +#define EL2HLT 51 +#define EBADE 52 +#define EBADR 53 +#define EXFULL 54 +#define ENOANO 55 +#define EBADRQC 56 +#define EBADSLT 57 +#define EDEADLOCK 58 +#define EBFONT 59 +#define ENOSTR 60 +#define ENODATA 61 +#define ETIME 62 +#define ENOSR 63 +#define ENONET 64 +#define ENOPKG 65 +#define EREMOTE 66 +#define ENOLINK 67 +#define EADV 68 +#define ESRMNT 69 +#define ECOMM 70 +#define EPROTO 71 +#define EMULTIHOP 72 +#define EDOTDOT 73 +#define EBADMSG 74 +#define EOVERFLOW 75 +#define ENOTUNIQ 76 +#define EBADFD 77 +#define EREMCHG 78 +#define ELIBACC 79 +#define ELIBBAD 80 +#define ELIBSCN 81 +#define ELIBMAX 82 +#define ELIBEXEC 83 +#define EILSEQ 84 +#define ERESTART 85 +#define ESTRPIPE 86 +#define EUSERS 87 +#define ENOTSOCK 88 +#define EDESTADDRREQ 89 +#define EMSGSIZE 90 +#define EPROTOTYPE 91 +#define ENOPROTOOPT 92 +#define EPROTONOSUPPORT 93 +#define ESOCKTNOSUPPORT 94 +#define EOPNOTSUPP 95 +#define ENOTSUP EOPNOTSUPP +#define EPFNOSUPPORT 96 +#define EAFNOSUPPORT 97 +#define EADDRINUSE 98 +#define EADDRNOTAVAIL 99 +#define ENETDOWN 100 +#define ENETUNREACH 101 +#define ENETRESET 102 +#define ECONNABORTED 103 +#define ECONNRESET 104 +#define ENOBUFS 105 +#define EISCONN 106 +#define ENOTCONN 107 +#define ESHUTDOWN 108 +#define ETOOMANYREFS 109 +#define ETIMEDOUT 110 +#define ECONNREFUSED 111 +#define EHOSTDOWN 112 +#define EHOSTUNREACH 113 +#define EALREADY 114 +#define EINPROGRESS 115 +#define ESTALE 116 +#define EUCLEAN 117 +#define ENOTNAM 118 +#define ENAVAIL 119 +#define EISNAM 120 +#define EREMOTEIO 121 +#define EDQUOT 122 +#define ENOMEDIUM 123 +#define EMEDIUMTYPE 124 +#define ECANCELED 125 +#define ENOKEY 126 +#define EKEYEXPIRED 127 +#define EKEYREVOKED 128 +#define EKEYREJECTED 129 +#define EOWNERDEAD 130 +#define ENOTRECOVERABLE 131 +#define ERFKILL 132 +#define EHWPOISON 133 diff --git a/arch/powerpc64/bits/fcntl.h b/arch/powerpc64/bits/fcntl.h new file mode 100644 index 00000000..6f20bac5 --- /dev/null +++ b/arch/powerpc64/bits/fcntl.h @@ -0,0 +1,40 @@ +#define O_CREAT 0100 +#define O_EXCL 0200 +#define O_NOCTTY 0400 +#define O_TRUNC 01000 +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_DSYNC 010000 +#define O_SYNC 04010000 +#define O_RSYNC 04010000 +#define O_DIRECTORY 040000 +#define O_NOFOLLOW 0100000 +#define O_CLOEXEC 02000000 + +#define O_ASYNC 020000 +#define O_DIRECT 0400000 +#define O_LARGEFILE 0200000 +#define O_NOATIME 01000000 +#define O_PATH 010000000 +#define O_TMPFILE 020040000 +#define O_NDELAY O_NONBLOCK + +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_SETFD 2 +#define F_GETFL 3 +#define F_SETFL 4 + +#define F_GETLK 5 +#define F_SETLK 6 +#define F_SETLKW 7 + +#define F_SETOWN 8 +#define F_GETOWN 9 +#define F_SETSIG 10 +#define F_GETSIG 11 + +#define F_SETOWN_EX 15 +#define F_GETOWN_EX 16 + +#define F_GETOWNER_UIDS 17 diff --git a/arch/powerpc64/bits/fenv.h b/arch/powerpc64/bits/fenv.h new file mode 100644 index 00000000..2f722e6b --- /dev/null +++ b/arch/powerpc64/bits/fenv.h @@ -0,0 +1,31 @@ +#define FE_TONEAREST 0 +#define FE_TOWARDZERO 1 +#define FE_UPWARD 2 +#define FE_DOWNWARD 3 + +#define FE_INEXACT 0x02000000 +#define FE_DIVBYZERO 0x04000000 +#define FE_UNDERFLOW 0x08000000 +#define FE_OVERFLOW 0x10000000 +#define FE_INVALID 0x20000000 + +#define FE_ALL_EXCEPT 0x3e000000 + +#ifdef _GNU_SOURCE +#define FE_INVALID_SNAN 0x01000000 +#define FE_INVALID_ISI 0x00800000 +#define FE_INVALID_IDI 0x00400000 +#define FE_INVALID_ZDZ 0x00200000 +#define FE_INVALID_IMZ 0x00100000 +#define FE_INVALID_COMPARE 0x00080000 +#define FE_INVALID_SOFTWARE 0x00000400 +#define FE_INVALID_SQRT 0x00000200 +#define FE_INVALID_INTEGER_CONVERSION 0x00000100 + +#define FE_ALL_INVALID 0x01f80700 +#endif + +typedef unsigned fexcept_t; +typedef double fenv_t; + +#define FE_DFL_ENV ((const fenv_t *)-1) diff --git a/arch/powerpc64/bits/float.h b/arch/powerpc64/bits/float.h new file mode 100644 index 00000000..c4a655e7 --- /dev/null +++ b/arch/powerpc64/bits/float.h @@ -0,0 +1,16 @@ +#define FLT_EVAL_METHOD 0 + +#define LDBL_TRUE_MIN 4.94065645841246544177e-324L +#define LDBL_MIN 2.22507385850720138309e-308L +#define LDBL_MAX 1.79769313486231570815e+308L +#define LDBL_EPSILON 2.22044604925031308085e-16L + +#define LDBL_MANT_DIG 53 +#define LDBL_MIN_EXP (-1021) +#define LDBL_MAX_EXP 1024 + +#define LDBL_DIG 15 +#define LDBL_MIN_10_EXP (-307) +#define LDBL_MAX_10_EXP 308 + +#define DECIMAL_DIG 17 diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h new file mode 100644 index 00000000..44a6cb65 --- /dev/null +++ b/arch/powerpc64/bits/ioctl.h @@ -0,0 +1,229 @@ +#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) ) +#define _IOC_NONE 1U +#define _IOC_WRITE 4U +#define _IOC_READ 2U + +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) + +#define FIONCLEX _IO('f', 2) +#define FIOCLEX _IO('f', 1) +#define FIOASYNC _IOW('f', 125, int) +#define FIONBIO _IOW('f', 126, int) +#define FIONREAD _IOR('f', 127, int) +#define TIOCINQ FIONREAD +#define FIOQSIZE _IOR('f', 128, char[8]) +#define TIOCGETP _IOR('t', 8, char[6]) +#define TIOCSETP _IOW('t', 9, char[6]) +#define TIOCSETN _IOW('t', 10, char[6]) + +#define TIOCSETC _IOW('t', 17, char[6]) +#define TIOCGETC _IOR('t', 18, char[6]) +#define TCGETS _IOR('t', 19, char[44]) +#define TCSETS _IOW('t', 20, char[44]) +#define TCSETSW _IOW('t', 21, char[44]) +#define TCSETSF _IOW('t', 22, char[44]) + +#define TCGETA _IOR('t', 23, char[20]) +#define TCSETA _IOW('t', 24, char[20]) +#define TCSETAW _IOW('t', 25, char[20]) +#define TCSETAF _IOW('t', 28, char[20]) + +#define TCSBRK _IO('t', 29) +#define TCXONC _IO('t', 30) +#define TCFLSH _IO('t', 31) + +#define TIOCSWINSZ _IOW('t', 103, char[8]) +#define TIOCGWINSZ _IOR('t', 104, char[8]) +#define TIOCSTART _IO('t', 110) +#define TIOCSTOP _IO('t', 111) + +#define TIOCOUTQ _IOR('t', 115, int) + +#define TIOCGLTC _IOR('t', 116, char[6]) +#define TIOCSLTC _IOW('t', 117, char[6]) +#define TIOCSPGRP _IOW('t', 118, int) +#define TIOCGPGRP _IOR('t', 119, int) + +#define TIOCEXCL 0x540C +#define TIOCNXCL 0x540D +#define TIOCSCTTY 0x540E + +#define TIOCSTI 0x5412 +#define TIOCMGET 0x5415 +#define TIOCMBIS 0x5416 +#define TIOCMBIC 0x5417 +#define TIOCMSET 0x5418 +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 + +#define TIOCGSOFTCAR 0x5419 +#define TIOCSSOFTCAR 0x541A +#define TIOCLINUX 0x541C +#define TIOCCONS 0x541D +#define TIOCGSERIAL 0x541E +#define TIOCSSERIAL 0x541F +#define TIOCPKT 0x5420 +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 +#define TIOCPKT_IOCTL 64 + +#define TIOCNOTTY 0x5422 +#define TIOCSETD 0x5423 +#define TIOCGETD 0x5424 +#define TCSBRKP 0x5425 +#define TIOCSBRK 0x5427 +#define TIOCCBRK 0x5428 +#define TIOCGSID 0x5429 +#define TIOCGRS485 0x542e +#define TIOCSRS485 0x542f +#define TIOCGPTN _IOR('T',0x30, unsigned int) +#define TIOCSPTLCK _IOW('T',0x31, int) +#define TIOCGDEV _IOR('T',0x32, unsigned int) +#define TIOCSIG _IOW('T',0x36, int) +#define TIOCVHANGUP 0x5437 +#define TIOCGPKT _IOR('T',0x38, int) +#define TIOCGPTLCK _IOR('T',0x39, int) +#define TIOCGEXCL _IOR('T',0x40, int) + +#define TIOCSERCONFIG 0x5453 +#define TIOCSERGWILD 0x5454 +#define TIOCSERSWILD 0x5455 +#define TIOCGLCKTRMIOS 0x5456 +#define TIOCSLCKTRMIOS 0x5457 +#define TIOCSERGSTRUCT 0x5458 +#define TIOCSERGETLSR 0x5459 +#define TIOCSER_TEMT 0x01 +#define TIOCSERGETMULTI 0x545A +#define TIOCSERSETMULTI 0x545B + +#define TIOCMIWAIT 0x545C +#define TIOCGICOUNT 0x545D + + +/* end kernel header ioctls.h */ + + +#define TIOCTTYGSTRUCT 0x5426 + +#define TCGETX 0x5432 +#define TCSETX 0x5433 +#define TCSETXF 0x5434 +#define TCSETXW 0x5435 + +#define TIOCGHAYESESP 0x545E +#define TIOCSHAYESESP 0x545F + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define TIOCM_MODEM_BITS TIOCM_OUT2 + +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 +#define N_6PACK 7 +#define N_MASC 8 +#define N_R3964 9 +#define N_PROFIBUS_FDL 10 +#define N_IRDA 11 +#define N_SMSBLOCK 12 +#define N_HDLC 13 +#define N_SYNC_PPP 14 +#define N_HCI 15 + +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 + +#define SIOCADDRT 0x890B +#define SIOCDELRT 0x890C +#define SIOCRTMSG 0x890D + +#define SIOCGIFNAME 0x8910 +#define SIOCSIFLINK 0x8911 +#define SIOCGIFCONF 0x8912 +#define SIOCGIFFLAGS 0x8913 +#define SIOCSIFFLAGS 0x8914 +#define SIOCGIFADDR 0x8915 +#define SIOCSIFADDR 0x8916 +#define SIOCGIFDSTADDR 0x8917 +#define SIOCSIFDSTADDR 0x8918 +#define SIOCGIFBRDADDR 0x8919 +#define SIOCSIFBRDADDR 0x891a +#define SIOCGIFNETMASK 0x891b +#define SIOCSIFNETMASK 0x891c +#define SIOCGIFMETRIC 0x891d +#define SIOCSIFMETRIC 0x891e +#define SIOCGIFMEM 0x891f +#define SIOCSIFMEM 0x8920 +#define SIOCGIFMTU 0x8921 +#define SIOCSIFMTU 0x8922 +#define SIOCSIFHWADDR 0x8924 +#define SIOCGIFENCAP 0x8925 +#define SIOCSIFENCAP 0x8926 +#define SIOCGIFHWADDR 0x8927 +#define SIOCGIFSLAVE 0x8929 +#define SIOCSIFSLAVE 0x8930 +#define SIOCADDMULTI 0x8931 +#define SIOCDELMULTI 0x8932 +#define SIOCGIFINDEX 0x8933 +#define SIOGIFINDEX SIOCGIFINDEX +#define SIOCSIFPFLAGS 0x8934 +#define SIOCGIFPFLAGS 0x8935 +#define SIOCDIFADDR 0x8936 +#define SIOCSIFHWBROADCAST 0x8937 +#define SIOCGIFCOUNT 0x8938 + +#define SIOCGIFBR 0x8940 +#define SIOCSIFBR 0x8941 + +#define SIOCGIFTXQLEN 0x8942 +#define SIOCSIFTXQLEN 0x8943 + +#define SIOCDARP 0x8953 +#define SIOCGARP 0x8954 +#define SIOCSARP 0x8955 + +#define SIOCDRARP 0x8960 +#define SIOCGRARP 0x8961 +#define SIOCSRARP 0x8962 + +#define SIOCGIFMAP 0x8970 +#define SIOCSIFMAP 0x8971 + +#define SIOCADDDLCI 0x8980 +#define SIOCDELDLCI 0x8981 + +#define SIOCDEVPRIVATE 0x89F0 +#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/powerpc64/bits/ipc.h b/arch/powerpc64/bits/ipc.h new file mode 100644 index 00000000..e1bfe2f5 --- /dev/null +++ b/arch/powerpc64/bits/ipc.h @@ -0,0 +1,16 @@ +struct ipc_perm +{ + key_t __ipc_perm_key; + uid_t uid; + gid_t gid; + uid_t cuid; + gid_t cgid; + mode_t mode; + int __ipc_perm_seq; + int __pad1; + long long __pad2; + long long __pad3; +}; + +#define IPC_64 0x100 + diff --git a/arch/powerpc64/bits/limits.h b/arch/powerpc64/bits/limits.h new file mode 100644 index 00000000..0226588c --- /dev/null +++ b/arch/powerpc64/bits/limits.h @@ -0,0 +1,7 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define LONG_BIT 64 +#endif + +#define LONG_MAX 0x7fffffffffffffffL +#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/arch/powerpc64/bits/mman.h b/arch/powerpc64/bits/mman.h new file mode 100644 index 00000000..f5974f82 --- /dev/null +++ b/arch/powerpc64/bits/mman.h @@ -0,0 +1,8 @@ +#define PROT_SAO 0x10 + +#undef MCL_CURRENT +#define MCL_CURRENT 0x2000 +#undef MCL_FUTURE +#define MCL_FUTURE 0x4000 +#undef MCL_ONFAULT +#define MCL_ONFAULT 0x8000 diff --git a/arch/powerpc64/bits/msg.h b/arch/powerpc64/bits/msg.h new file mode 100644 index 00000000..badcf168 --- /dev/null +++ b/arch/powerpc64/bits/msg.h @@ -0,0 +1,13 @@ +struct msqid_ds +{ + struct ipc_perm msg_perm; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; + unsigned long msg_cbytes; + msgqnum_t msg_qnum; + msglen_t msg_qbytes; + pid_t msg_lspid; + pid_t msg_lrpid; + unsigned long __unused[2]; +}; diff --git a/arch/powerpc64/bits/posix.h b/arch/powerpc64/bits/posix.h new file mode 100644 index 00000000..c37b94c1 --- /dev/null +++ b/arch/powerpc64/bits/posix.h @@ -0,0 +1,2 @@ +#define _POSIX_V6_LP64_OFF64 1 +#define _POSIX_V7_LP64_OFF64 1 diff --git a/arch/powerpc64/bits/reg.h b/arch/powerpc64/bits/reg.h new file mode 100644 index 00000000..49382c8f --- /dev/null +++ b/arch/powerpc64/bits/reg.h @@ -0,0 +1,3 @@ +#undef __WORDSIZE +#define __WORDSIZE 64 +/* FIXME */ diff --git a/arch/powerpc64/bits/sem.h b/arch/powerpc64/bits/sem.h new file mode 100644 index 00000000..558184db --- /dev/null +++ b/arch/powerpc64/bits/sem.h @@ -0,0 +1,13 @@ +#include + +struct semid_ds { + struct ipc_perm sem_perm; + time_t sem_otime; + time_t sem_ctime; +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned short __pad[3], sem_nsems; +#else + unsigned short sem_nsems, __pad[3]; +#endif + unsigned long __unused[2]; +}; diff --git a/arch/powerpc64/bits/setjmp.h b/arch/powerpc64/bits/setjmp.h new file mode 100644 index 00000000..f7370e3e --- /dev/null +++ b/arch/powerpc64/bits/setjmp.h @@ -0,0 +1 @@ +typedef unsigned __int128 __jmp_buf[32]; diff --git a/arch/powerpc64/bits/shm.h b/arch/powerpc64/bits/shm.h new file mode 100644 index 00000000..91268516 --- /dev/null +++ b/arch/powerpc64/bits/shm.h @@ -0,0 +1,25 @@ +#define SHMLBA 4096 + +struct shmid_ds +{ + struct ipc_perm shm_perm; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; + size_t shm_segsz; + pid_t shm_cpid; + pid_t shm_lpid; + unsigned long shm_nattch; + unsigned long __unused[2]; +}; + +struct shminfo { + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; +}; + +struct shm_info { + int __used_ids; + unsigned long shm_tot, shm_rss, shm_swp; + unsigned long __swap_attempts, __swap_successes; +}; + diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h new file mode 100644 index 00000000..45aeea0d --- /dev/null +++ b/arch/powerpc64/bits/signal.h @@ -0,0 +1,108 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MINSIGSTKSZ 4096 +#define SIGSTKSZ 10240 +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +typedef unsigned long greg_t, gregset_t[48]; + +typedef struct { + double fpregs[32]; + double fpscr; +} fpregset_t; + +typedef struct { + unsigned __int128 vrregs[32]; + unsigned _pad[3]; + unsigned vrsave; + unsigned vscr; + unsigned _pad2[3]; +} vrregset_t; + +typedef struct sigcontext +{ + unsigned long _unused[4]; + int signal; + int _pad0; + unsigned long handler; + unsigned long oldmask; + void *regs; + gregset_t gp_regs; + fpregset_t fp_regs; + vrregset_t *v_regs; + long vmx_reserve[34+34+32+1]; +} mcontext_t; + +#else + +typedef struct { + long __regs[4+4+48+33+1+34+34+32+1]; +} mcontext_t; + +#endif + +struct sigaltstack { + void *ss_sp; + int ss_flags; + size_t ss_size; +}; + +typedef struct __ucontext { + unsigned long uc_flags; + struct __ucontext *uc_link; + stack_t uc_stack; + sigset_t uc_sigmask; + mcontext_t uc_mcontext; +} ucontext_t; + +#define SA_NOCLDSTOP 1U +#define SA_NOCLDWAIT 2U +#define SA_SIGINFO 4U +#define SA_ONSTACK 0x08000000U +#define SA_RESTART 0x10000000U +#define SA_NODEFER 0x40000000U +#define SA_RESETHAND 0x80000000U +#define SA_RESTORER 0x04000000U + +#endif + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT SIGABRT +#define SIGBUS 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGUSR1 10 +#define SIGSEGV 11 +#define SIGUSR2 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGSTKFLT 16 +#define SIGCHLD 17 +#define SIGCONT 18 +#define SIGSTOP 19 +#define SIGTSTP 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGURG 23 +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGIO 29 +#define SIGPOLL SIGIO +#define SIGPWR 30 +#define SIGSYS 31 +#define SIGUNUSED SIGSYS + +#define _NSIG 65 diff --git a/arch/powerpc64/bits/socket.h b/arch/powerpc64/bits/socket.h new file mode 100644 index 00000000..ec3590c6 --- /dev/null +++ b/arch/powerpc64/bits/socket.h @@ -0,0 +1,62 @@ +#include + +struct msghdr +{ + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; +#if __BYTE_ORDER == __BIG_ENDIAN + int __pad1, msg_iovlen; +#else + int msg_iovlen, __pad1; +#endif + void *msg_control; +#if __BYTE_ORDER == __BIG_ENDIAN + int __pad2; + socklen_t msg_controllen; +#else + socklen_t msg_controllen; + int __pad2; +#endif + int msg_flags; +}; + +struct cmsghdr +{ +#if __BYTE_ORDER == __BIG_ENDIAN + int __pad1; + socklen_t cmsg_len; +#else + socklen_t cmsg_len; + int __pad1; +#endif + int cmsg_level; + int cmsg_type; +}; + +#define SO_DEBUG 1 +#define SO_REUSEADDR 2 +#define SO_TYPE 3 +#define SO_ERROR 4 +#define SO_DONTROUTE 5 +#define SO_BROADCAST 6 +#define SO_SNDBUF 7 +#define SO_RCVBUF 8 +#define SO_KEEPALIVE 9 +#define SO_OOBINLINE 10 +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_LINGER 13 +#define SO_BSDCOMPAT 14 +#define SO_REUSEPORT 15 +#define SO_RCVLOWAT 16 +#define SO_SNDLOWAT 17 +#define SO_RCVTIMEO 18 +#define SO_SNDTIMEO 19 +#define SO_PASSCRED 20 +#define SO_PEERCRED 21 +#define SO_ACCEPTCONN 30 +#define SO_SNDBUFFORCE 32 +#define SO_RCVBUFFORCE 33 +#define SO_PROTOCOL 38 +#define SO_DOMAIN 39 diff --git a/arch/powerpc64/bits/stat.h b/arch/powerpc64/bits/stat.h new file mode 100644 index 00000000..8172cff7 --- /dev/null +++ b/arch/powerpc64/bits/stat.h @@ -0,0 +1,17 @@ +struct stat +{ + dev_t st_dev; + ino_t st_ino; + nlink_t st_nlink; + mode_t st_mode; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + off_t st_size; + blksize_t st_blksize; + blkcnt_t st_blocks; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + unsigned long __unused[3]; +}; diff --git a/arch/powerpc64/bits/stdint.h b/arch/powerpc64/bits/stdint.h new file mode 100644 index 00000000..1bb147f2 --- /dev/null +++ b/arch/powerpc64/bits/stdint.h @@ -0,0 +1,20 @@ +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; + +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN + +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX + +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX + +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#define SIZE_MAX UINT64_MAX diff --git a/arch/powerpc64/bits/syscall.h b/arch/powerpc64/bits/syscall.h new file mode 100644 index 00000000..1c5c2ea8 --- /dev/null +++ b/arch/powerpc64/bits/syscall.h @@ -0,0 +1,718 @@ +#define __NR_restart_syscall 0 +#define __NR_exit 1 +#define __NR_fork 2 +#define __NR_read 3 +#define __NR_write 4 +#define __NR_open 5 +#define __NR_close 6 +#define __NR_waitpid 7 +#define __NR_creat 8 +#define __NR_link 9 +#define __NR_unlink 10 +#define __NR_execve 11 +#define __NR_chdir 12 +#define __NR_time 13 +#define __NR_mknod 14 +#define __NR_chmod 15 +#define __NR_lchown 16 +#define __NR_break 17 +#define __NR_oldstat 18 +#define __NR_lseek 19 +#define __NR_getpid 20 +#define __NR_mount 21 +#define __NR_umount 22 +#define __NR_setuid 23 +#define __NR_getuid 24 +#define __NR_stime 25 +#define __NR_ptrace 26 +#define __NR_alarm 27 +#define __NR_oldfstat 28 +#define __NR_pause 29 +#define __NR_utime 30 +#define __NR_stty 31 +#define __NR_gtty 32 +#define __NR_access 33 +#define __NR_nice 34 +#define __NR_ftime 35 +#define __NR_sync 36 +#define __NR_kill 37 +#define __NR_rename 38 +#define __NR_mkdir 39 +#define __NR_rmdir 40 +#define __NR_dup 41 +#define __NR_pipe 42 +#define __NR_times 43 +#define __NR_prof 44 +#define __NR_brk 45 +#define __NR_setgid 46 +#define __NR_getgid 47 +#define __NR_signal 48 +#define __NR_geteuid 49 +#define __NR_getegid 50 +#define __NR_acct 51 +#define __NR_umount2 52 +#define __NR_lock 53 +#define __NR_ioctl 54 +#define __NR_fcntl 55 +#define __NR_mpx 56 +#define __NR_setpgid 57 +#define __NR_ulimit 58 +#define __NR_oldolduname 59 +#define __NR_umask 60 +#define __NR_chroot 61 +#define __NR_ustat 62 +#define __NR_dup2 63 +#define __NR_getppid 64 +#define __NR_getpgrp 65 +#define __NR_setsid 66 +#define __NR_sigaction 67 +#define __NR_sgetmask 68 +#define __NR_ssetmask 69 +#define __NR_setreuid 70 +#define __NR_setregid 71 +#define __NR_sigsuspend 72 +#define __NR_sigpending 73 +#define __NR_sethostname 74 +#define __NR_setrlimit 75 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_gettimeofday 78 +#define __NR_settimeofday 79 +#define __NR_getgroups 80 +#define __NR_setgroups 81 +#define __NR_select 82 +#define __NR_symlink 83 +#define __NR_oldlstat 84 +#define __NR_readlink 85 +#define __NR_uselib 86 +#define __NR_swapon 87 +#define __NR_reboot 88 +#define __NR_readdir 89 +#define __NR_mmap 90 +#define __NR_munmap 91 +#define __NR_truncate 92 +#define __NR_ftruncate 93 +#define __NR_fchmod 94 +#define __NR_fchown 95 +#define __NR_getpriority 96 +#define __NR_setpriority 97 +#define __NR_profil 98 +#define __NR_statfs 99 +#define __NR_fstatfs 100 +#define __NR_ioperm 101 +#define __NR_socketcall 102 +#define __NR_syslog 103 +#define __NR_setitimer 104 +#define __NR_getitimer 105 +#define __NR_stat 106 +#define __NR_lstat 107 +#define __NR_fstat 108 +#define __NR_olduname 109 +#define __NR_iopl 110 +#define __NR_vhangup 111 +#define __NR_idle 112 +#define __NR_vm86 113 +#define __NR_wait4 114 +#define __NR_swapoff 115 +#define __NR_sysinfo 116 +#define __NR_ipc 117 +#define __NR_fsync 118 +#define __NR_sigreturn 119 +#define __NR_clone 120 +#define __NR_setdomainname 121 +#define __NR_uname 122 +#define __NR_modify_ldt 123 +#define __NR_adjtimex 124 +#define __NR_mprotect 125 +#define __NR_sigprocmask 126 +#define __NR_create_module 127 +#define __NR_init_module 128 +#define __NR_delete_module 129 +#define __NR_get_kernel_syms 130 +#define __NR_quotactl 131 +#define __NR_getpgid 132 +#define __NR_fchdir 133 +#define __NR_bdflush 134 +#define __NR_sysfs 135 +#define __NR_personality 136 +#define __NR_afs_syscall 137 +#define __NR_setfsuid 138 +#define __NR_setfsgid 139 +#define __NR__llseek 140 +#define __NR_getdents 141 +#define __NR__newselect 142 +#define __NR_flock 143 +#define __NR_msync 144 +#define __NR_readv 145 +#define __NR_writev 146 +#define __NR_getsid 147 +#define __NR_fdatasync 148 +#define __NR__sysctl 149 +#define __NR_mlock 150 +#define __NR_munlock 151 +#define __NR_mlockall 152 +#define __NR_munlockall 153 +#define __NR_sched_setparam 154 +#define __NR_sched_getparam 155 +#define __NR_sched_setscheduler 156 +#define __NR_sched_getscheduler 157 +#define __NR_sched_yield 158 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_rr_get_interval 161 +#define __NR_nanosleep 162 +#define __NR_mremap 163 +#define __NR_setresuid 164 +#define __NR_getresuid 165 +#define __NR_query_module 166 +#define __NR_poll 167 +#define __NR_nfsservctl 168 +#define __NR_setresgid 169 +#define __NR_getresgid 170 +#define __NR_prctl 171 +#define __NR_rt_sigreturn 172 +#define __NR_rt_sigaction 173 +#define __NR_rt_sigprocmask 174 +#define __NR_rt_sigpending 175 +#define __NR_rt_sigtimedwait 176 +#define __NR_rt_sigqueueinfo 177 +#define __NR_rt_sigsuspend 178 +#define __NR_pread64 179 +#define __NR_pwrite64 180 +#define __NR_chown 181 +#define __NR_getcwd 182 +#define __NR_capget 183 +#define __NR_capset 184 +#define __NR_sigaltstack 185 +#define __NR_sendfile 186 +#define __NR_getpmsg 187 +#define __NR_putpmsg 188 +#define __NR_vfork 189 +#define __NR_ugetrlimit 190 +#define __NR_readahead 191 +#define __NR_pciconfig_read 198 +#define __NR_pciconfig_write 199 +#define __NR_pciconfig_iobase 200 +#define __NR_multiplexer 201 +#define __NR_getdents64 202 +#define __NR_pivot_root 203 +#define __NR_madvise 205 +#define __NR_mincore 206 +#define __NR_gettid 207 +#define __NR_tkill 208 +#define __NR_setxattr 209 +#define __NR_lsetxattr 210 +#define __NR_fsetxattr 211 +#define __NR_getxattr 212 +#define __NR_lgetxattr 213 +#define __NR_fgetxattr 214 +#define __NR_listxattr 215 +#define __NR_llistxattr 216 +#define __NR_flistxattr 217 +#define __NR_removexattr 218 +#define __NR_lremovexattr 219 +#define __NR_fremovexattr 220 +#define __NR_futex 221 +#define __NR_sched_setaffinity 222 +#define __NR_sched_getaffinity 223 +#define __NR_tuxcall 225 +#define __NR_io_setup 227 +#define __NR_io_destroy 228 +#define __NR_io_getevents 229 +#define __NR_io_submit 230 +#define __NR_io_cancel 231 +#define __NR_set_tid_address 232 +#define __NR_fadvise64 233 +#define __NR_exit_group 234 +#define __NR_lookup_dcookie 235 +#define __NR_epoll_create 236 +#define __NR_epoll_ctl 237 +#define __NR_epoll_wait 238 +#define __NR_remap_file_pages 239 +#define __NR_timer_create 240 +#define __NR_timer_settime 241 +#define __NR_timer_gettime 242 +#define __NR_timer_getoverrun 243 +#define __NR_timer_delete 244 +#define __NR_clock_settime 245 +#define __NR_clock_gettime 246 +#define __NR_clock_getres 247 +#define __NR_clock_nanosleep 248 +#define __NR_swapcontext 249 +#define __NR_tgkill 250 +#define __NR_utimes 251 +#define __NR_statfs64 252 +#define __NR_fstatfs64 253 +#define __NR_rtas 255 +#define __NR_sys_debug_setcontext 256 +#define __NR_migrate_pages 258 +#define __NR_mbind 259 +#define __NR_get_mempolicy 260 +#define __NR_set_mempolicy 261 +#define __NR_mq_open 262 +#define __NR_mq_unlink 263 +#define __NR_mq_timedsend 264 +#define __NR_mq_timedreceive 265 +#define __NR_mq_notify 266 +#define __NR_mq_getsetattr 267 +#define __NR_kexec_load 268 +#define __NR_add_key 269 +#define __NR_request_key 270 +#define __NR_keyctl 271 +#define __NR_waitid 272 +#define __NR_ioprio_set 273 +#define __NR_ioprio_get 274 +#define __NR_inotify_init 275 +#define __NR_inotify_add_watch 276 +#define __NR_inotify_rm_watch 277 +#define __NR_spu_run 278 +#define __NR_spu_create 279 +#define __NR_pselect6 280 +#define __NR_ppoll 281 +#define __NR_unshare 282 +#define __NR_splice 283 +#define __NR_tee 284 +#define __NR_vmsplice 285 +#define __NR_openat 286 +#define __NR_mkdirat 287 +#define __NR_mknodat 288 +#define __NR_fchownat 289 +#define __NR_futimesat 290 +#define __NR_newfstatat 291 +#define __NR_unlinkat 292 +#define __NR_renameat 293 +#define __NR_linkat 294 +#define __NR_symlinkat 295 +#define __NR_readlinkat 296 +#define __NR_fchmodat 297 +#define __NR_faccessat 298 +#define __NR_get_robust_list 299 +#define __NR_set_robust_list 300 +#define __NR_move_pages 301 +#define __NR_getcpu 302 +#define __NR_epoll_pwait 303 +#define __NR_utimensat 304 +#define __NR_signalfd 305 +#define __NR_timerfd_create 306 +#define __NR_eventfd 307 +#define __NR_sync_file_range2 308 +#define __NR_fallocate 309 +#define __NR_subpage_prot 310 +#define __NR_timerfd_settime 311 +#define __NR_timerfd_gettime 312 +#define __NR_signalfd4 313 +#define __NR_eventfd2 314 +#define __NR_epoll_create1 315 +#define __NR_dup3 316 +#define __NR_pipe2 317 +#define __NR_inotify_init1 318 +#define __NR_perf_event_open 319 +#define __NR_preadv 320 +#define __NR_pwritev 321 +#define __NR_rt_tgsigqueueinfo 322 +#define __NR_fanotify_init 323 +#define __NR_fanotify_mark 324 +#define __NR_prlimit64 325 +#define __NR_socket 326 +#define __NR_bind 327 +#define __NR_connect 328 +#define __NR_listen 329 +#define __NR_accept 330 +#define __NR_getsockname 331 +#define __NR_getpeername 332 +#define __NR_socketpair 333 +#define __NR_send 334 +#define __NR_sendto 335 +#define __NR_recv 336 +#define __NR_recvfrom 337 +#define __NR_shutdown 338 +#define __NR_setsockopt 339 +#define __NR_getsockopt 340 +#define __NR_sendmsg 341 +#define __NR_recvmsg 342 +#define __NR_recvmmsg 343 +#define __NR_accept4 344 +#define __NR_name_to_handle_at 345 +#define __NR_open_by_handle_at 346 +#define __NR_clock_adjtime 347 +#define __NR_syncfs 348 +#define __NR_sendmmsg 349 +#define __NR_setns 350 +#define __NR_process_vm_readv 351 +#define __NR_process_vm_writev 352 +#define __NR_finit_module 353 +#define __NR_kcmp 354 +#define __NR_sched_setattr 355 +#define __NR_sched_getattr 356 +#define __NR_renameat2 357 +#define __NR_seccomp 358 +#define __NR_getrandom 359 +#define __NR_memfd_create 360 +#define __NR_bpf 361 +#define __NR_execveat 362 +#define __NR_switch_endian 363 +#define __NR_userfaultfd 364 +#define __NR_membarrier 365 +#define __NR_mlock2 378 +#define __NR_copy_file_range 379 + +/* + * repeated with SYS prefix + */ +#define SYS_restart_syscall 0 +#define SYS_exit 1 +#define SYS_fork 2 +#define SYS_read 3 +#define SYS_write 4 +#define SYS_open 5 +#define SYS_close 6 +#define SYS_waitpid 7 +#define SYS_creat 8 +#define SYS_link 9 +#define SYS_unlink 10 +#define SYS_execve 11 +#define SYS_chdir 12 +#define SYS_time 13 +#define SYS_mknod 14 +#define SYS_chmod 15 +#define SYS_lchown 16 +#define SYS_break 17 +#define SYS_oldstat 18 +#define SYS_lseek 19 +#define SYS_getpid 20 +#define SYS_mount 21 +#define SYS_umount 22 +#define SYS_setuid 23 +#define SYS_getuid 24 +#define SYS_stime 25 +#define SYS_ptrace 26 +#define SYS_alarm 27 +#define SYS_oldfstat 28 +#define SYS_pause 29 +#define SYS_utime 30 +#define SYS_stty 31 +#define SYS_gtty 32 +#define SYS_access 33 +#define SYS_nice 34 +#define SYS_ftime 35 +#define SYS_sync 36 +#define SYS_kill 37 +#define SYS_rename 38 +#define SYS_mkdir 39 +#define SYS_rmdir 40 +#define SYS_dup 41 +#define SYS_pipe 42 +#define SYS_times 43 +#define SYS_prof 44 +#define SYS_brk 45 +#define SYS_setgid 46 +#define SYS_getgid 47 +#define SYS_signal 48 +#define SYS_geteuid 49 +#define SYS_getegid 50 +#define SYS_acct 51 +#define SYS_umount2 52 +#define SYS_lock 53 +#define SYS_ioctl 54 +#define SYS_fcntl 55 +#define SYS_mpx 56 +#define SYS_setpgid 57 +#define SYS_ulimit 58 +#define SYS_oldolduname 59 +#define SYS_umask 60 +#define SYS_chroot 61 +#define SYS_ustat 62 +#define SYS_dup2 63 +#define SYS_getppid 64 +#define SYS_getpgrp 65 +#define SYS_setsid 66 +#define SYS_sigaction 67 +#define SYS_sgetmask 68 +#define SYS_ssetmask 69 +#define SYS_setreuid 70 +#define SYS_setregid 71 +#define SYS_sigsuspend 72 +#define SYS_sigpending 73 +#define SYS_sethostname 74 +#define SYS_setrlimit 75 +#define SYS_getrlimit 76 +#define SYS_getrusage 77 +#define SYS_gettimeofday 78 +#define SYS_settimeofday 79 +#define SYS_getgroups 80 +#define SYS_setgroups 81 +#define SYS_select 82 +#define SYS_symlink 83 +#define SYS_oldlstat 84 +#define SYS_readlink 85 +#define SYS_uselib 86 +#define SYS_swapon 87 +#define SYS_reboot 88 +#define SYS_readdir 89 +#define SYS_mmap 90 +#define SYS_munmap 91 +#define SYS_truncate 92 +#define SYS_ftruncate 93 +#define SYS_fchmod 94 +#define SYS_fchown 95 +#define SYS_getpriority 96 +#define SYS_setpriority 97 +#define SYS_profil 98 +#define SYS_statfs 99 +#define SYS_fstatfs 100 +#define SYS_ioperm 101 +#define SYS_socketcall 102 +#define SYS_syslog 103 +#define SYS_setitimer 104 +#define SYS_getitimer 105 +#define SYS_stat 106 +#define SYS_lstat 107 +#define SYS_fstat 108 +#define SYS_olduname 109 +#define SYS_iopl 110 +#define SYS_vhangup 111 +#define SYS_idle 112 +#define SYS_vm86 113 +#define SYS_wait4 114 +#define SYS_swapoff 115 +#define SYS_sysinfo 116 +#define SYS_ipc 117 +#define SYS_fsync 118 +#define SYS_sigreturn 119 +#define SYS_clone 120 +#define SYS_setdomainname 121 +#define SYS_uname 122 +#define SYS_modify_ldt 123 +#define SYS_adjtimex 124 +#define SYS_mprotect 125 +#define SYS_sigprocmask 126 +#define SYS_create_module 127 +#define SYS_init_module 128 +#define SYS_delete_module 129 +#define SYS_get_kernel_syms 130 +#define SYS_quotactl 131 +#define SYS_getpgid 132 +#define SYS_fchdir 133 +#define SYS_bdflush 134 +#define SYS_sysfs 135 +#define SYS_personality 136 +#define SYS_afs_syscall 137 +#define SYS_setfsuid 138 +#define SYS_setfsgid 139 +#define SYS__llseek 140 +#define SYS_getdents 141 +#define SYS__newselect 142 +#define SYS_flock 143 +#define SYS_msync 144 +#define SYS_readv 145 +#define SYS_writev 146 +#define SYS_getsid 147 +#define SYS_fdatasync 148 +#define SYS__sysctl 149 +#define SYS_mlock 150 +#define SYS_munlock 151 +#define SYS_mlockall 152 +#define SYS_munlockall 153 +#define SYS_sched_setparam 154 +#define SYS_sched_getparam 155 +#define SYS_sched_setscheduler 156 +#define SYS_sched_getscheduler 157 +#define SYS_sched_yield 158 +#define SYS_sched_get_priority_max 159 +#define SYS_sched_get_priority_min 160 +#define SYS_sched_rr_get_interval 161 +#define SYS_nanosleep 162 +#define SYS_mremap 163 +#define SYS_setresuid 164 +#define SYS_getresuid 165 +#define SYS_query_module 166 +#define SYS_poll 167 +#define SYS_nfsservctl 168 +#define SYS_setresgid 169 +#define SYS_getresgid 170 +#define SYS_prctl 171 +#define SYS_rt_sigreturn 172 +#define SYS_rt_sigaction 173 +#define SYS_rt_sigprocmask 174 +#define SYS_rt_sigpending 175 +#define SYS_rt_sigtimedwait 176 +#define SYS_rt_sigqueueinfo 177 +#define SYS_rt_sigsuspend 178 +#define SYS_pread64 179 +#define SYS_pwrite64 180 +#define SYS_chown 181 +#define SYS_getcwd 182 +#define SYS_capget 183 +#define SYS_capset 184 +#define SYS_sigaltstack 185 +#define SYS_sendfile 186 +#define SYS_getpmsg 187 +#define SYS_putpmsg 188 +#define SYS_vfork 189 +#define SYS_ugetrlimit 190 +#define SYS_readahead 191 +#define SYS_pciconfig_read 198 +#define SYS_pciconfig_write 199 +#define SYS_pciconfig_iobase 200 +#define SYS_multiplexer 201 +#define SYS_getdents64 202 +#define SYS_pivot_root 203 +#define SYS_madvise 205 +#define SYS_mincore 206 +#define SYS_gettid 207 +#define SYS_tkill 208 +#define SYS_setxattr 209 +#define SYS_lsetxattr 210 +#define SYS_fsetxattr 211 +#define SYS_getxattr 212 +#define SYS_lgetxattr 213 +#define SYS_fgetxattr 214 +#define SYS_listxattr 215 +#define SYS_llistxattr 216 +#define SYS_flistxattr 217 +#define SYS_removexattr 218 +#define SYS_lremovexattr 219 +#define SYS_fremovexattr 220 +#define SYS_futex 221 +#define SYS_sched_setaffinity 222 +#define SYS_sched_getaffinity 223 +#define SYS_tuxcall 225 +#define SYS_io_setup 227 +#define SYS_io_destroy 228 +#define SYS_io_getevents 229 +#define SYS_io_submit 230 +#define SYS_io_cancel 231 +#define SYS_set_tid_address 232 +#define SYS_fadvise64 233 +#define SYS_exit_group 234 +#define SYS_lookup_dcookie 235 +#define SYS_epoll_create 236 +#define SYS_epoll_ctl 237 +#define SYS_epoll_wait 238 +#define SYS_remap_file_pages 239 +#define SYS_timer_create 240 +#define SYS_timer_settime 241 +#define SYS_timer_gettime 242 +#define SYS_timer_getoverrun 243 +#define SYS_timer_delete 244 +#define SYS_clock_settime 245 +#define SYS_clock_gettime 246 +#define SYS_clock_getres 247 +#define SYS_clock_nanosleep 248 +#define SYS_swapcontext 249 +#define SYS_tgkill 250 +#define SYS_utimes 251 +#define SYS_statfs64 252 +#define SYS_fstatfs64 253 +#define SYS_rtas 255 +#define SYS_sys_debug_setcontext 256 +#define SYS_migrate_pages 258 +#define SYS_mbind 259 +#define SYS_get_mempolicy 260 +#define SYS_set_mempolicy 261 +#define SYS_mq_open 262 +#define SYS_mq_unlink 263 +#define SYS_mq_timedsend 264 +#define SYS_mq_timedreceive 265 +#define SYS_mq_notify 266 +#define SYS_mq_getsetattr 267 +#define SYS_kexec_load 268 +#define SYS_add_key 269 +#define SYS_request_key 270 +#define SYS_keyctl 271 +#define SYS_waitid 272 +#define SYS_ioprio_set 273 +#define SYS_ioprio_get 274 +#define SYS_inotify_init 275 +#define SYS_inotify_add_watch 276 +#define SYS_inotify_rm_watch 277 +#define SYS_spu_run 278 +#define SYS_spu_create 279 +#define SYS_pselect6 280 +#define SYS_ppoll 281 +#define SYS_unshare 282 +#define SYS_splice 283 +#define SYS_tee 284 +#define SYS_vmsplice 285 +#define SYS_openat 286 +#define SYS_mkdirat 287 +#define SYS_mknodat 288 +#define SYS_fchownat 289 +#define SYS_futimesat 290 +#define SYS_newfstatat 291 +#define SYS_unlinkat 292 +#define SYS_renameat 293 +#define SYS_linkat 294 +#define SYS_symlinkat 295 +#define SYS_readlinkat 296 +#define SYS_fchmodat 297 +#define SYS_faccessat 298 +#define SYS_get_robust_list 299 +#define SYS_set_robust_list 300 +#define SYS_move_pages 301 +#define SYS_getcpu 302 +#define SYS_epoll_pwait 303 +#define SYS_utimensat 304 +#define SYS_signalfd 305 +#define SYS_timerfd_create 306 +#define SYS_eventfd 307 +#define SYS_sync_file_range2 308 +#define SYS_fallocate 309 +#define SYS_subpage_prot 310 +#define SYS_timerfd_settime 311 +#define SYS_timerfd_gettime 312 +#define SYS_signalfd4 313 +#define SYS_eventfd2 314 +#define SYS_epoll_create1 315 +#define SYS_dup3 316 +#define SYS_pipe2 317 +#define SYS_inotify_init1 318 +#define SYS_perf_event_open 319 +#define SYS_preadv 320 +#define SYS_pwritev 321 +#define SYS_rt_tgsigqueueinfo 322 +#define SYS_fanotify_init 323 +#define SYS_fanotify_mark 324 +#define SYS_prlimit64 325 +#define SYS_socket 326 +#define SYS_bind 327 +#define SYS_connect 328 +#define SYS_listen 329 +#define SYS_accept 330 +#define SYS_getsockname 331 +#define SYS_getpeername 332 +#define SYS_socketpair 333 +#define SYS_send 334 +#define SYS_sendto 335 +#define SYS_recv 336 +#define SYS_recvfrom 337 +#define SYS_shutdown 338 +#define SYS_setsockopt 339 +#define SYS_getsockopt 340 +#define SYS_sendmsg 341 +#define SYS_recvmsg 342 +#define SYS_recvmmsg 343 +#define SYS_accept4 344 +#define SYS_name_to_handle_at 345 +#define SYS_open_by_handle_at 346 +#define SYS_clock_adjtime 347 +#define SYS_syncfs 348 +#define SYS_sendmmsg 349 +#define SYS_setns 350 +#define SYS_process_vm_readv 351 +#define SYS_process_vm_writev 352 +#define SYS_finit_module 353 +#define SYS_kcmp 354 +#define SYS_sched_setattr 355 +#define SYS_sched_getattr 356 +#define SYS_renameat2 357 +#define SYS_seccomp 358 +#define SYS_getrandom 359 +#define SYS_memfd_create 360 +#define SYS_bpf 361 +#define SYS_execveat 362 +#define SYS_switch_endian 363 +#define SYS_userfaultfd 364 +#define SYS_membarrier 365 +#define SYS_mlock2 378 +#define SYS_copy_file_range 379 diff --git a/arch/powerpc64/bits/termios.h b/arch/powerpc64/bits/termios.h new file mode 100644 index 00000000..7feaf493 --- /dev/null +++ b/arch/powerpc64/bits/termios.h @@ -0,0 +1,170 @@ +#undef NCCS +#define NCCS 19 +struct termios +{ + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_cc[NCCS]; + cc_t c_line; + speed_t __c_ispeed; + speed_t __c_ospeed; +}; + +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VMIN 5 +#define VEOL 6 +#define VTIME 7 +#define VEOL2 8 +#define VSWTC 9 +#define VWERASE 10 +#define VREPRINT 11 +#define VSUSP 12 +#define VSTART 13 +#define VSTOP 14 +#define VLNEXT 15 +#define VDISCARD 16 + +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#define IXANY 0004000 +#define IUCLC 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 + +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 +#define OFILL 0000100 +#define OFDEL 0000200 +#define NLDLY 0001400 +#define NL0 0000000 +#define NL1 0000400 +#define NL2 0001000 +#define NL3 0001400 +#define TABDLY 0006000 +#define TAB0 0000000 +#define TAB1 0002000 +#define TAB2 0004000 +#define TAB3 0006000 +#define CRDLY 0030000 +#define CR0 0000000 +#define CR1 0010000 +#define CR2 0020000 +#define CR3 0030000 +#define FFDLY 0040000 +#define FF0 0000000 +#define FF1 0040000 +#define BSDLY 0100000 +#define BS0 0000000 +#define BS1 0100000 + +#define VTDLY 0200000 +#define VT0 0000000 +#define VT1 0200000 + +#define B0 0000000 +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA 0000016 +#define EXTB 0000017 + +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 +#define B500000 00024 +#define B576000 00025 +#define B921600 00026 +#define B1000000 00027 +#define B1152000 00030 +#define B1500000 00031 +#define B2000000 00032 +#define B2500000 00033 +#define B3000000 00034 +#define B3500000 00035 +#define B4000000 00036 +#define BOTHER 00037 + +#define CBAUD 00377 + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 +#define CLOCAL 00100000 + +#define ECHOKE 0x00000001 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHO 0x00000008 +#define ECHONL 0x00000010 +#define ECHOPRT 0x00000020 +#define ECHOCTL 0x00000040 +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#define IEXTEN 0x00000400 +#define XCASE 0x00004000 +#define TOSTOP 0x00400000 +#define FLUSHO 0x00800000 +#define PENDIN 0x20000000 +#define NOFLSH 0x80000000 + +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define CBAUDEX 0000000 +#define CIBAUD 077600000 +#define IBSHIFT 16 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 +#define EXTPROC 0x10000000 +#define XTABS 00006000 +#endif diff --git a/arch/powerpc64/bits/user.h b/arch/powerpc64/bits/user.h new file mode 100644 index 00000000..7ca459b3 --- /dev/null +++ b/arch/powerpc64/bits/user.h @@ -0,0 +1,25 @@ +struct pt_regs { + unsigned long gpr[32], nip, msr, orig_gpr3, ctr, link, xer, ccr, softe; + unsigned long trap, dar, dsisr, result; +}; + +struct user { + struct pt_regs regs; + unsigned long u_tsize, u_dsize, u_ssize; + unsigned long start_code, start_data, start_stack; + long signal; + void *u_ar0; + unsigned long magic; + char u_comm[32]; +}; + +#define ELF_NGREG 48 +#define ELF_NFPREG 33 +#define ELF_NVRREG 34 +typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; +typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG]; +typedef struct { unsigned u[4]; } +#ifdef __GNUC__ +__attribute__((__aligned__(16))) +#endif + elf_vrreg_t, elf_vrregset_t[ELF_NVRREG]; diff --git a/arch/powerpc64/crt_arch.h b/arch/powerpc64/crt_arch.h new file mode 100644 index 00000000..168669a9 --- /dev/null +++ b/arch/powerpc64/crt_arch.h @@ -0,0 +1,19 @@ +__asm__( +".text \n" +".global " START " \n" +".type " START ", %function \n" +START ": \n" +" addis 2, 12, .TOC.-" START "@ha \n" +" addi 2, 2, .TOC.-" START "@l \n" +" lwz 4, 1f-" START "(12)\n" +" add 4, 4, 12 \n" +" mr 3, 1 \n" +" clrrdi 1, 1, 4 \n" +" li 0, 0 \n" +" stdu 0, -32(1) \n" +" mtlr 0 \n" +" bl " START "_c \n" +".weak _DYNAMIC \n" +".hidden _DYNAMIC \n" +"1: .long _DYNAMIC-" START "\n" +); diff --git a/arch/powerpc64/pthread_arch.h b/arch/powerpc64/pthread_arch.h new file mode 100644 index 00000000..2f976fe2 --- /dev/null +++ b/arch/powerpc64/pthread_arch.h @@ -0,0 +1,17 @@ +static inline struct pthread *__pthread_self() +{ + register char *tp __asm__("r13"); + __asm__ __volatile__ ("" : "=r" (tp) ); + return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); +} + +#define TLS_ABOVE_TP +#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000) + +#define DTP_OFFSET 0x8000 + +// the kernel calls the ip "nip", it's the first saved value after the 32 +// GPRs. +#define MC_PC gp_regs[32] + +#define CANARY canary_at_end diff --git a/arch/powerpc64/reloc.h b/arch/powerpc64/reloc.h new file mode 100644 index 00000000..e1bad009 --- /dev/null +++ b/arch/powerpc64/reloc.h @@ -0,0 +1,32 @@ +#include + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define ENDIAN_SUFFIX "le" +#else +#define ENDIAN_SUFFIX "" +#endif + +#define LDSO_ARCH "powerpc64" ENDIAN_SUFFIX + +#define TPOFF_K (-0x7000) + +#define REL_SYMBOLIC R_PPC64_ADDR64 +#define REL_GOT R_PPC64_GLOB_DAT +#define REL_PLT R_PPC64_JMP_SLOT +#define REL_RELATIVE R_PPC64_RELATIVE +#define REL_COPY R_PPC64_COPY +#define REL_DTPMOD R_PPC64_DTPMOD64 +#define REL_DTPOFF R_PPC64_DTPREL64 +#define REL_TPOFF R_PPC64_TPREL64 + +#define CRTJMP(pc,sp) __asm__ __volatile__( \ + "mr 1,%1; mr 12,%0; mtctr 12; bctrl" : : "r"(pc), "r"(sp) : "memory" ) + +#define GETFUNCSYM(fp, sym, got) __asm__ ( \ + ".hidden " #sym " \n" \ + " bl 1f \n" \ + " .long " #sym "-. \n" \ + "1: mflr %1 \n" \ + " lwz %0, 0(%1) \n" \ + " add %0, %0, %1 \n" \ + : "=r"(*(fp)), "=r"((long){0}) : : "memory", "lr" ) diff --git a/arch/powerpc64/syscall_arch.h b/arch/powerpc64/syscall_arch.h new file mode 100644 index 00000000..1e730625 --- /dev/null +++ b/arch/powerpc64/syscall_arch.h @@ -0,0 +1,87 @@ +#define __SYSCALL_LL_E(x) (x) +#define __SYSCALL_LL_O(x) (x) + +static inline long __syscall0(long n) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3"); + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "=r"(r3) + :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); + return r3; +} + +static inline long __syscall1(long n, long a) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3") = a; + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "+r"(r3) + :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); + return r3; +} + +static inline long __syscall2(long n, long a, long b) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3") = a; + register long r4 __asm__("r4") = b; + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "+r"(r3), "+r"(r4) + :: "memory", "cr0", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); + return r3; +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3") = a; + register long r4 __asm__("r4") = b; + register long r5 __asm__("r5") = c; + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5) + :: "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); + return r3; +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3") = a; + register long r4 __asm__("r4") = b; + register long r5 __asm__("r5") = c; + register long r6 __asm__("r6") = d; + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6) + :: "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12"); + return r3; +} + +static inline long __syscall5(long n, long a, long b, long c, long d, long e) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3") = a; + register long r4 __asm__("r4") = b; + register long r5 __asm__("r5") = c; + register long r6 __asm__("r6") = d; + register long r7 __asm__("r7") = e; + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7) + :: "memory", "cr0", "r8", "r9", "r10", "r11", "r12"); + return r3; +} + +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) +{ + register long r0 __asm__("r0") = n; + register long r3 __asm__("r3") = a; + register long r4 __asm__("r4") = b; + register long r5 __asm__("r5") = c; + register long r6 __asm__("r6") = d; + register long r7 __asm__("r7") = e; + register long r8 __asm__("r8") = f; + __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" + : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7), "+r"(r8) + :: "memory", "cr0", "r9", "r10", "r11", "r12"); + return r3; +} diff --git a/configure b/configure index 3432b58d..af8b45f0 100755 --- a/configure +++ b/configure @@ -311,7 +311,6 @@ printf "%s\n" "$target" # case "$target" in # Catch these early to simplify matching for 32-bit archs -powerpc64*) fail "$0: unsupported target \"$target\"" ;; arm*) ARCH=arm ;; aarch64*) ARCH=aarch64 ;; i?86-nt32*) ARCH=nt32 ;; @@ -323,6 +322,7 @@ mips64*) ARCH=mips64 ;; mips*) ARCH=mips ;; microblaze*) ARCH=microblaze ;; or1k*) ARCH=or1k ;; +powerpc64*) ARCH=powerpc64 ;; powerpc*) ARCH=powerpc ;; sh[1-9bel-]*|sh|superh*) ARCH=sh ;; unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; @@ -645,6 +645,12 @@ fi test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ && SUBARCH=${SUBARCH}el +if test "$ARCH" = "powerpc64" ; then +trycppif "_CALL_ELF == 2" "$t" || fail "$0: error: unsupported powerpc64 ABI" +trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le +trycppif _SOFT_FLOAT "$t" && fail "$0: error: soft-float not supported on powerpc64" +fi + if test "$ARCH" = "sh" ; then tryflag CFLAGS_AUTO -Wa,--isa=any trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb diff --git a/crt/powerpc64/crti.s b/crt/powerpc64/crti.s new file mode 100644 index 00000000..9f712f0e --- /dev/null +++ b/crt/powerpc64/crti.s @@ -0,0 +1,21 @@ +.section .init +.align 2 +.global _init +_init: + addis 2, 12, .TOC.-_init@ha + addi 2, 2, .TOC.-_init@l + .localentry _init,.-_init + mflr 0 + std 0, 16(1) + stdu 1,-32(1) + +.section .fini +.align 2 +.global _fini +_fini: + addis 2, 12, .TOC.-_fini@ha + addi 2, 2, .TOC.-_fini@l + .localentry _fini,.-_fini + mflr 0 + std 0, 16(1) + stdu 1,-32(1) diff --git a/crt/powerpc64/crtn.s b/crt/powerpc64/crtn.s new file mode 100644 index 00000000..a7a9f4a0 --- /dev/null +++ b/crt/powerpc64/crtn.s @@ -0,0 +1,13 @@ +.section .init +.align 2 + addi 1, 1, 32 + ld 0, 16(1) + mtlr 0 + blr + +.section .fini +.align 2 + addi 1, 1, 32 + ld 0, 16(1) + mtlr 0 + blr diff --git a/src/fenv/powerpc64/fenv.c b/src/fenv/powerpc64/fenv.c new file mode 100644 index 00000000..739420b7 --- /dev/null +++ b/src/fenv/powerpc64/fenv.c @@ -0,0 +1,68 @@ +#define _GNU_SOURCE +#include + +static inline double get_fpscr_f(void) +{ + double d; + __asm__ __volatile__("mffs %0" : "=d"(d)); + return d; +} + +static inline long get_fpscr(void) +{ + return (union {double f; long i;}) {get_fpscr_f()}.i; +} + +static inline void set_fpscr_f(double fpscr) +{ + __asm__ __volatile__("mtfsf 255, %0" : : "d"(fpscr)); +} + +static void set_fpscr(long fpscr) +{ + set_fpscr_f((union {long i; double f;}) {fpscr}.f); +} + +int feclearexcept(int mask) +{ + mask &= FE_ALL_EXCEPT; + if (mask & FE_INVALID) mask |= FE_ALL_INVALID; + set_fpscr(get_fpscr() & ~mask); + return 0; +} + +int feraiseexcept(int mask) +{ + mask &= FE_ALL_EXCEPT; + if (mask & FE_INVALID) mask |= FE_INVALID_SOFTWARE; + set_fpscr(get_fpscr() | mask); + return 0; +} + +int fetestexcept(int mask) +{ + return get_fpscr() & mask & FE_ALL_EXCEPT; +} + +int fegetround(void) +{ + return get_fpscr() & 3; +} + +int __fesetround(int r) +{ + set_fpscr(get_fpscr() & ~3L | r); + return 0; +} + +int fegetenv(fenv_t *envp) +{ + *envp = get_fpscr_f(); + return 0; +} + +int fesetenv(const fenv_t *envp) +{ + set_fpscr_f(envp != FE_DFL_ENV ? *envp : 0); + return 0; +} diff --git a/src/internal/powerpc64/syscall.s b/src/internal/powerpc64/syscall.s new file mode 100644 index 00000000..fe21f9e1 --- /dev/null +++ b/src/internal/powerpc64/syscall.s @@ -0,0 +1,17 @@ + .global __syscall + .hidden __syscall + .type __syscall,@function +__syscall: + mr 0, 3 # Save the system call number + mr 3, 4 # Shift the arguments: arg1 + mr 4, 5 # arg2 + mr 5, 6 # arg3 + mr 6, 7 # arg4 + mr 7, 8 # arg5 + mr 8, 9 # arg6 + sc + bnslr+ # return if not summary overflow + neg 3, 3 # otherwise error: return negated value. + blr + .end __syscall + .size __syscall, .-__syscall diff --git a/src/ldso/powerpc64/dlsym.s b/src/ldso/powerpc64/dlsym.s new file mode 100644 index 00000000..7eb691d9 --- /dev/null +++ b/src/ldso/powerpc64/dlsym.s @@ -0,0 +1,12 @@ + .text + .global dlsym + .hidden __dlsym + .type dlsym,@function +dlsym: + addis 2, 12, .TOC.-dlsym@ha + addi 2, 2, .TOC.-dlsym@l + .localentry dlsym,.-dlsym + mflr 5 # The return address is arg3. + b __dlsym + .end dlsym + .size dlsym, .-dlsym diff --git a/src/setjmp/powerpc64/longjmp.s b/src/setjmp/powerpc64/longjmp.s new file mode 100644 index 00000000..7f241c2d --- /dev/null +++ b/src/setjmp/powerpc64/longjmp.s @@ -0,0 +1,77 @@ + .global _longjmp + .global longjmp + .type _longjmp,@function + .type longjmp,@function +_longjmp: +longjmp: + # 0) move old return address into the link register + ld 0, 0*8(3) + mtlr 0 + # 1) restore cr + ld 0, 1*8(3) + mtcr 0 + # 2) restore r1-r2 (SP and TOC) + ld 1, 2*8(3) + ld 2, 3*8(3) + # 3) restore r14-r31 + ld 14, 4*8(3) + ld 15, 5*8(3) + ld 16, 6*8(3) + ld 17, 7*8(3) + ld 18, 8*8(3) + ld 19, 9*8(3) + ld 20, 10*8(3) + ld 21, 11*8(3) + ld 22, 12*8(3) + ld 23, 13*8(3) + ld 24, 14*8(3) + ld 25, 15*8(3) + ld 26, 16*8(3) + ld 27, 17*8(3) + ld 28, 18*8(3) + ld 29, 19*8(3) + ld 30, 20*8(3) + ld 31, 21*8(3) + # 4) restore floating point registers f14-f31 + lfd 14, 22*8(3) + lfd 15, 23*8(3) + lfd 16, 24*8(3) + lfd 17, 25*8(3) + lfd 18, 26*8(3) + lfd 19, 27*8(3) + lfd 20, 28*8(3) + lfd 21, 29*8(3) + lfd 22, 30*8(3) + lfd 23, 31*8(3) + lfd 24, 32*8(3) + lfd 25, 33*8(3) + lfd 26, 34*8(3) + lfd 27, 35*8(3) + lfd 28, 36*8(3) + lfd 29, 37*8(3) + lfd 30, 38*8(3) + lfd 31, 39*8(3) + + # 5) restore vector registers v20-v31 + addi 3, 3, 40*8 + lvx 20, 0, 3 ; addi 3, 3, 16 + lvx 21, 0, 3 ; addi 3, 3, 16 + lvx 22, 0, 3 ; addi 3, 3, 16 + lvx 23, 0, 3 ; addi 3, 3, 16 + lvx 24, 0, 3 ; addi 3, 3, 16 + lvx 25, 0, 3 ; addi 3, 3, 16 + lvx 26, 0, 3 ; addi 3, 3, 16 + lvx 27, 0, 3 ; addi 3, 3, 16 + lvx 28, 0, 3 ; addi 3, 3, 16 + lvx 29, 0, 3 ; addi 3, 3, 16 + lvx 30, 0, 3 ; addi 3, 3, 16 + lvx 31, 0, 3 + + # 6) return r4 ? r4 : 1 + mr 3, 4 + cmpwi cr7, 4, 0 + bne cr7, 1f + li 3, 1 +1: + blr + diff --git a/src/setjmp/powerpc64/setjmp.s b/src/setjmp/powerpc64/setjmp.s new file mode 100644 index 00000000..d16d4bae --- /dev/null +++ b/src/setjmp/powerpc64/setjmp.s @@ -0,0 +1,78 @@ + .global ___setjmp + .hidden ___setjmp + .global __setjmp + .global _setjmp + .global setjmp + .type __setjmp,@function + .type _setjmp,@function + .type setjmp,@function +___setjmp: +__setjmp: +_setjmp: +setjmp: + # 0) store IP into 0, then into the jmpbuf pointed to by r3 (first arg) + mflr 0 + std 0, 0*8(3) + # 1) store cr + mfcr 0 + std 0, 1*8(3) + # 2) store r1-r2 (SP and TOC) + std 1, 2*8(3) + std 2, 3*8(3) + # 3) store r14-31 + std 14, 4*8(3) + std 15, 5*8(3) + std 16, 6*8(3) + std 17, 7*8(3) + std 18, 8*8(3) + std 19, 9*8(3) + std 20, 10*8(3) + std 21, 11*8(3) + std 22, 12*8(3) + std 23, 13*8(3) + std 24, 14*8(3) + std 25, 15*8(3) + std 26, 16*8(3) + std 27, 17*8(3) + std 28, 18*8(3) + std 29, 19*8(3) + std 30, 20*8(3) + std 31, 21*8(3) + # 4) store floating point registers f14-f31 + stfd 14, 22*8(3) + stfd 15, 23*8(3) + stfd 16, 24*8(3) + stfd 17, 25*8(3) + stfd 18, 26*8(3) + stfd 19, 27*8(3) + stfd 20, 28*8(3) + stfd 21, 29*8(3) + stfd 22, 30*8(3) + stfd 23, 31*8(3) + stfd 24, 32*8(3) + stfd 25, 33*8(3) + stfd 26, 34*8(3) + stfd 27, 35*8(3) + stfd 28, 36*8(3) + stfd 29, 37*8(3) + stfd 30, 38*8(3) + stfd 31, 39*8(3) + + # 5) store vector registers v20-v31 + addi 3, 3, 40*8 + stvx 20, 0, 3 ; addi 3, 3, 16 + stvx 21, 0, 3 ; addi 3, 3, 16 + stvx 22, 0, 3 ; addi 3, 3, 16 + stvx 23, 0, 3 ; addi 3, 3, 16 + stvx 24, 0, 3 ; addi 3, 3, 16 + stvx 25, 0, 3 ; addi 3, 3, 16 + stvx 26, 0, 3 ; addi 3, 3, 16 + stvx 27, 0, 3 ; addi 3, 3, 16 + stvx 28, 0, 3 ; addi 3, 3, 16 + stvx 29, 0, 3 ; addi 3, 3, 16 + stvx 30, 0, 3 ; addi 3, 3, 16 + stvx 31, 0, 3 + + # 6) return 0 + li 3, 0 + blr diff --git a/src/signal/powerpc64/restore.s b/src/signal/powerpc64/restore.s new file mode 100644 index 00000000..4d41c27a --- /dev/null +++ b/src/signal/powerpc64/restore.s @@ -0,0 +1,11 @@ + .global __restore + .type __restore,%function +__restore: + li 0, 119 #__NR_sigreturn + sc + + .global __restore_rt + .type __restore_rt,%function +__restore_rt: + li 0, 172 # __NR_rt_sigreturn + sc diff --git a/src/signal/powerpc64/sigsetjmp.s b/src/signal/powerpc64/sigsetjmp.s new file mode 100644 index 00000000..52ac1d03 --- /dev/null +++ b/src/signal/powerpc64/sigsetjmp.s @@ -0,0 +1,30 @@ + .global sigsetjmp + .global __sigsetjmp + .type sigsetjmp,%function + .type __sigsetjmp,%function + .hidden ___setjmp +sigsetjmp: +__sigsetjmp: + addis 2, 12, .TOC.-__sigsetjmp@ha + addi 2, 2, .TOC.-__sigsetjmp@l + .localentry sigsetjmp,.-sigsetjmp + .localentry __sigsetjmp,.-__sigsetjmp + + cmpwi cr7, 4, 0 + beq- cr7, ___setjmp + + mflr 5 + std 5, 512(3) + std 16, 512+8+8(3) + mr 16, 3 + + bl ___setjmp + + mr 4, 3 + mr 3, 16 + ld 5, 512(3) + mtlr 5 + ld 16, 512+8+8(3) + +.hidden __sigsetjmp_tail + b __sigsetjmp_tail diff --git a/src/thread/powerpc64/__set_thread_area.s b/src/thread/powerpc64/__set_thread_area.s new file mode 100644 index 00000000..9622826d --- /dev/null +++ b/src/thread/powerpc64/__set_thread_area.s @@ -0,0 +1,8 @@ +.text +.global __set_thread_area +.type __set_thread_area, %function +__set_thread_area: + mr 13, 3 + li 3, 0 + blr + diff --git a/src/thread/powerpc64/__unmapself.s b/src/thread/powerpc64/__unmapself.s new file mode 100644 index 00000000..c9360b47 --- /dev/null +++ b/src/thread/powerpc64/__unmapself.s @@ -0,0 +1,9 @@ + .text + .global __unmapself + .type __unmapself,%function +__unmapself: + li 0, 91 # __NR_munmap + sc + li 0, 1 #__NR_exit + sc + blr diff --git a/src/thread/powerpc64/clone.s b/src/thread/powerpc64/clone.s new file mode 100644 index 00000000..03aa4468 --- /dev/null +++ b/src/thread/powerpc64/clone.s @@ -0,0 +1,47 @@ +.text +.global __clone +.type __clone, %function +__clone: + # int clone(fn, stack, flags, arg, ptid, tls, ctid) + # a b c d e f g + # 3 4 5 6 7 8 9 + # pseudo C code: + # tid = syscall(SYS_clone,c,b,e,f,g); + # if (!tid) syscall(SYS_exit, a(d)); + # return tid; + + # create initial stack frame for new thread + clrrdi 4, 4, 4 + li 0, 0 + stdu 0,-32(4) + + # save fn and arg to child stack + std 3, 8(4) + std 6, 16(4) + + # shuffle args into correct registers and call SYS_clone + mr 3, 5 + #mr 4, 4 + mr 5, 7 + mr 6, 8 + mr 7, 9 + li 0, 120 # SYS_clone = 120 + sc + + # if error, negate return (errno) + bns+ 1f + neg 3, 3 + +1: # if we're the parent, return + cmpwi cr7, 3, 0 + bnelr cr7 + + # we're the child. call fn(arg) + ld 3, 16(1) + ld 12, 8(1) + mtctr 12 + bctrl + + # call SYS_exit. exit code is already in r3 from fn return value + li 0, 1 # SYS_exit = 1 + sc diff --git a/src/thread/powerpc64/syscall_cp.s b/src/thread/powerpc64/syscall_cp.s new file mode 100644 index 00000000..d420dbde --- /dev/null +++ b/src/thread/powerpc64/syscall_cp.s @@ -0,0 +1,37 @@ + .global __cp_begin + .hidden __cp_begin + .global __cp_end + .hidden __cp_end + .global __cp_cancel + .hidden __cp_cancel + .hidden __cancel + .global __syscall_cp_asm + .hidden __syscall_cp_asm + .text + .type __syscall_cp_asm,%function +__syscall_cp_asm: + # at enter: r3 = pointer to self->cancel, r4: syscall no, r5: first arg, r6: 2nd, r7: 3rd, r8: 4th, r9: 5th, r10: 6th +__cp_begin: + # if (self->cancel) goto __cp_cancel + lwz 0, 0(3) + cmpwi cr7, 0, 0 + bne- cr7, __cp_cancel + + # make syscall + mr 0, 4 + mr 3, 5 + mr 4, 6 + mr 5, 7 + mr 6, 8 + mr 7, 9 + mr 8, 10 + sc + +__cp_end: + # return error ? -r3 : r3 + bnslr+ + neg 3, 3 + blr + +__cp_cancel: + b __cancel From 49631b7b6c8b8c055aae5b6948930c219b95fdef Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 8 May 2016 23:16:14 -0400 Subject: [PATCH 103/412] fix spurious trailing whitespace in powerpc & powerpc64 bits/errno.h --- arch/powerpc/bits/errno.h | 2 +- arch/powerpc64/bits/errno.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/bits/errno.h b/arch/powerpc/bits/errno.h index 36ad2f90..cae3f386 100644 --- a/arch/powerpc/bits/errno.h +++ b/arch/powerpc/bits/errno.h @@ -55,7 +55,7 @@ #define ENOANO 55 #define EBADRQC 56 #define EBADSLT 57 -#define EDEADLOCK 58 +#define EDEADLOCK 58 #define EBFONT 59 #define ENOSTR 60 #define ENODATA 61 diff --git a/arch/powerpc64/bits/errno.h b/arch/powerpc64/bits/errno.h index 36ad2f90..cae3f386 100644 --- a/arch/powerpc64/bits/errno.h +++ b/arch/powerpc64/bits/errno.h @@ -55,7 +55,7 @@ #define ENOANO 55 #define EBADRQC 56 #define EBADSLT 57 -#define EDEADLOCK 58 +#define EDEADLOCK 58 #define EBFONT 59 #define ENOSTR 60 #define ENODATA 61 From 622fe8b5cf15858b6cbb8346fb3d7c388f635849 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 12 May 2016 00:30:51 -0500 Subject: [PATCH 104/412] x32: remove arch-specific syscall remapping These system calls are already all remapped in an arch-agnostic manner in src/internal/syscall.h --- arch/x32/bits/syscall.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h index bd5ab3b4..654dfcdf 100644 --- a/arch/x32/bits/syscall.h +++ b/arch/x32/bits/syscall.h @@ -317,16 +317,6 @@ #define __NR_io_submit (__X32_SYSCALL_BIT + 544) #define __NR_execveat (__X32_SYSCALL_BIT + 545) -#undef __NR_fstatat -#undef __NR_pread -#undef __NR_pwrite -#undef __NR_getdents -#define __NR_fstatat __NR_newfstatat -#define __NR_pread __NR_pread64 -#define __NR_pwrite __NR_pwrite64 -#define __NR_getdents __NR_getdents64 -#define __NR_fadvise __NR_fadvise64 - /* Repeat with SYS_ prefix */ @@ -651,13 +641,3 @@ #define SYS_io_setup __NR_io_setup #define SYS_io_submit __NR_io_submit #define SYS_execveat __NR_execveat - -#undef SYS_fstatat -#undef SYS_pread -#undef SYS_pwrite -#undef SYS_getdents -#define SYS_fstatat SYS_newfstatat -#define SYS_pread SYS_pread64 -#define SYS_pwrite SYS_pwrite64 -#define SYS_getdents SYS_getdents64 -#define SYS_fadvise SYS_fadvise64 From 8ef6170b43e36d4daedc61f0f8177a8cbe18ceda Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Wed, 11 May 2016 23:00:02 -0500 Subject: [PATCH 105/412] x32: eliminate __X32_SYSCALL_BIT constant --- arch/x32/bits/syscall.h | 633 ++++++++++++++++++++-------------------- 1 file changed, 316 insertions(+), 317 deletions(-) diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h index 654dfcdf..9384bc11 100644 --- a/arch/x32/bits/syscall.h +++ b/arch/x32/bits/syscall.h @@ -1,321 +1,320 @@ -#define __X32_SYSCALL_BIT 0x40000000 -#define __NR_read (__X32_SYSCALL_BIT + 0) -#define __NR_write (__X32_SYSCALL_BIT + 1) -#define __NR_open (__X32_SYSCALL_BIT + 2) -#define __NR_close (__X32_SYSCALL_BIT + 3) -#define __NR_stat (__X32_SYSCALL_BIT + 4) -#define __NR_fstat (__X32_SYSCALL_BIT + 5) -#define __NR_lstat (__X32_SYSCALL_BIT + 6) -#define __NR_poll (__X32_SYSCALL_BIT + 7) -#define __NR_lseek (__X32_SYSCALL_BIT + 8) -#define __NR_mmap (__X32_SYSCALL_BIT + 9) -#define __NR_mprotect (__X32_SYSCALL_BIT + 10) -#define __NR_munmap (__X32_SYSCALL_BIT + 11) -#define __NR_brk (__X32_SYSCALL_BIT + 12) -#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14) -#define __NR_pread64 (__X32_SYSCALL_BIT + 17) -#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18) -#define __NR_access (__X32_SYSCALL_BIT + 21) -#define __NR_pipe (__X32_SYSCALL_BIT + 22) -#define __NR_select (__X32_SYSCALL_BIT + 23) -#define __NR_sched_yield (__X32_SYSCALL_BIT + 24) -#define __NR_mremap (__X32_SYSCALL_BIT + 25) -#define __NR_msync (__X32_SYSCALL_BIT + 26) -#define __NR_mincore (__X32_SYSCALL_BIT + 27) -#define __NR_madvise (__X32_SYSCALL_BIT + 28) -#define __NR_shmget (__X32_SYSCALL_BIT + 29) -#define __NR_shmat (__X32_SYSCALL_BIT + 30) -#define __NR_shmctl (__X32_SYSCALL_BIT + 31) -#define __NR_dup (__X32_SYSCALL_BIT + 32) -#define __NR_dup2 (__X32_SYSCALL_BIT + 33) -#define __NR_pause (__X32_SYSCALL_BIT + 34) -#define __NR_nanosleep (__X32_SYSCALL_BIT + 35) -#define __NR_getitimer (__X32_SYSCALL_BIT + 36) -#define __NR_alarm (__X32_SYSCALL_BIT + 37) -#define __NR_setitimer (__X32_SYSCALL_BIT + 38) -#define __NR_getpid (__X32_SYSCALL_BIT + 39) -#define __NR_sendfile (__X32_SYSCALL_BIT + 40) -#define __NR_socket (__X32_SYSCALL_BIT + 41) -#define __NR_connect (__X32_SYSCALL_BIT + 42) -#define __NR_accept (__X32_SYSCALL_BIT + 43) -#define __NR_sendto (__X32_SYSCALL_BIT + 44) -#define __NR_shutdown (__X32_SYSCALL_BIT + 48) -#define __NR_bind (__X32_SYSCALL_BIT + 49) -#define __NR_listen (__X32_SYSCALL_BIT + 50) -#define __NR_getsockname (__X32_SYSCALL_BIT + 51) -#define __NR_getpeername (__X32_SYSCALL_BIT + 52) -#define __NR_socketpair (__X32_SYSCALL_BIT + 53) -#define __NR_clone (__X32_SYSCALL_BIT + 56) -#define __NR_fork (__X32_SYSCALL_BIT + 57) -#define __NR_vfork (__X32_SYSCALL_BIT + 58) -#define __NR_exit (__X32_SYSCALL_BIT + 60) -#define __NR_wait4 (__X32_SYSCALL_BIT + 61) -#define __NR_kill (__X32_SYSCALL_BIT + 62) -#define __NR_uname (__X32_SYSCALL_BIT + 63) -#define __NR_semget (__X32_SYSCALL_BIT + 64) -#define __NR_semop (__X32_SYSCALL_BIT + 65) -#define __NR_semctl (__X32_SYSCALL_BIT + 66) -#define __NR_shmdt (__X32_SYSCALL_BIT + 67) -#define __NR_msgget (__X32_SYSCALL_BIT + 68) -#define __NR_msgsnd (__X32_SYSCALL_BIT + 69) -#define __NR_msgrcv (__X32_SYSCALL_BIT + 70) -#define __NR_msgctl (__X32_SYSCALL_BIT + 71) -#define __NR_fcntl (__X32_SYSCALL_BIT + 72) -#define __NR_flock (__X32_SYSCALL_BIT + 73) -#define __NR_fsync (__X32_SYSCALL_BIT + 74) -#define __NR_fdatasync (__X32_SYSCALL_BIT + 75) -#define __NR_truncate (__X32_SYSCALL_BIT + 76) -#define __NR_ftruncate (__X32_SYSCALL_BIT + 77) -#define __NR_getdents (__X32_SYSCALL_BIT + 78) -#define __NR_getcwd (__X32_SYSCALL_BIT + 79) -#define __NR_chdir (__X32_SYSCALL_BIT + 80) -#define __NR_fchdir (__X32_SYSCALL_BIT + 81) -#define __NR_rename (__X32_SYSCALL_BIT + 82) -#define __NR_mkdir (__X32_SYSCALL_BIT + 83) -#define __NR_rmdir (__X32_SYSCALL_BIT + 84) -#define __NR_creat (__X32_SYSCALL_BIT + 85) -#define __NR_link (__X32_SYSCALL_BIT + 86) -#define __NR_unlink (__X32_SYSCALL_BIT + 87) -#define __NR_symlink (__X32_SYSCALL_BIT + 88) -#define __NR_readlink (__X32_SYSCALL_BIT + 89) -#define __NR_chmod (__X32_SYSCALL_BIT + 90) -#define __NR_fchmod (__X32_SYSCALL_BIT + 91) -#define __NR_chown (__X32_SYSCALL_BIT + 92) -#define __NR_fchown (__X32_SYSCALL_BIT + 93) -#define __NR_lchown (__X32_SYSCALL_BIT + 94) -#define __NR_umask (__X32_SYSCALL_BIT + 95) -#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96) -#define __NR_getrlimit (__X32_SYSCALL_BIT + 97) -#define __NR_getrusage (__X32_SYSCALL_BIT + 98) -#define __NR_sysinfo (__X32_SYSCALL_BIT + 99) -#define __NR_times (__X32_SYSCALL_BIT + 100) -#define __NR_getuid (__X32_SYSCALL_BIT + 102) -#define __NR_syslog (__X32_SYSCALL_BIT + 103) -#define __NR_getgid (__X32_SYSCALL_BIT + 104) -#define __NR_setuid (__X32_SYSCALL_BIT + 105) -#define __NR_setgid (__X32_SYSCALL_BIT + 106) -#define __NR_geteuid (__X32_SYSCALL_BIT + 107) -#define __NR_getegid (__X32_SYSCALL_BIT + 108) -#define __NR_setpgid (__X32_SYSCALL_BIT + 109) -#define __NR_getppid (__X32_SYSCALL_BIT + 110) -#define __NR_getpgrp (__X32_SYSCALL_BIT + 111) -#define __NR_setsid (__X32_SYSCALL_BIT + 112) -#define __NR_setreuid (__X32_SYSCALL_BIT + 113) -#define __NR_setregid (__X32_SYSCALL_BIT + 114) -#define __NR_getgroups (__X32_SYSCALL_BIT + 115) -#define __NR_setgroups (__X32_SYSCALL_BIT + 116) -#define __NR_setresuid (__X32_SYSCALL_BIT + 117) -#define __NR_getresuid (__X32_SYSCALL_BIT + 118) -#define __NR_setresgid (__X32_SYSCALL_BIT + 119) -#define __NR_getresgid (__X32_SYSCALL_BIT + 120) -#define __NR_getpgid (__X32_SYSCALL_BIT + 121) -#define __NR_setfsuid (__X32_SYSCALL_BIT + 122) -#define __NR_setfsgid (__X32_SYSCALL_BIT + 123) -#define __NR_getsid (__X32_SYSCALL_BIT + 124) -#define __NR_capget (__X32_SYSCALL_BIT + 125) -#define __NR_capset (__X32_SYSCALL_BIT + 126) -#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130) -#define __NR_utime (__X32_SYSCALL_BIT + 132) -#define __NR_mknod (__X32_SYSCALL_BIT + 133) -#define __NR_personality (__X32_SYSCALL_BIT + 135) -#define __NR_ustat (__X32_SYSCALL_BIT + 136) -#define __NR_statfs (__X32_SYSCALL_BIT + 137) -#define __NR_fstatfs (__X32_SYSCALL_BIT + 138) -#define __NR_sysfs (__X32_SYSCALL_BIT + 139) -#define __NR_getpriority (__X32_SYSCALL_BIT + 140) -#define __NR_setpriority (__X32_SYSCALL_BIT + 141) -#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142) -#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143) -#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144) -#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145) -#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146) -#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147) -#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148) -#define __NR_mlock (__X32_SYSCALL_BIT + 149) -#define __NR_munlock (__X32_SYSCALL_BIT + 150) -#define __NR_mlockall (__X32_SYSCALL_BIT + 151) -#define __NR_munlockall (__X32_SYSCALL_BIT + 152) -#define __NR_vhangup (__X32_SYSCALL_BIT + 153) -#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154) -#define __NR_pivot_root (__X32_SYSCALL_BIT + 155) -#define __NR_prctl (__X32_SYSCALL_BIT + 157) -#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158) -#define __NR_adjtimex (__X32_SYSCALL_BIT + 159) -#define __NR_setrlimit (__X32_SYSCALL_BIT + 160) -#define __NR_chroot (__X32_SYSCALL_BIT + 161) -#define __NR_sync (__X32_SYSCALL_BIT + 162) -#define __NR_acct (__X32_SYSCALL_BIT + 163) -#define __NR_settimeofday (__X32_SYSCALL_BIT + 164) -#define __NR_mount (__X32_SYSCALL_BIT + 165) -#define __NR_umount2 (__X32_SYSCALL_BIT + 166) -#define __NR_swapon (__X32_SYSCALL_BIT + 167) -#define __NR_swapoff (__X32_SYSCALL_BIT + 168) -#define __NR_reboot (__X32_SYSCALL_BIT + 169) -#define __NR_sethostname (__X32_SYSCALL_BIT + 170) -#define __NR_setdomainname (__X32_SYSCALL_BIT + 171) -#define __NR_iopl (__X32_SYSCALL_BIT + 172) -#define __NR_ioperm (__X32_SYSCALL_BIT + 173) -#define __NR_init_module (__X32_SYSCALL_BIT + 175) -#define __NR_delete_module (__X32_SYSCALL_BIT + 176) -#define __NR_quotactl (__X32_SYSCALL_BIT + 179) -#define __NR_getpmsg (__X32_SYSCALL_BIT + 181) -#define __NR_putpmsg (__X32_SYSCALL_BIT + 182) -#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183) -#define __NR_tuxcall (__X32_SYSCALL_BIT + 184) -#define __NR_security (__X32_SYSCALL_BIT + 185) -#define __NR_gettid (__X32_SYSCALL_BIT + 186) -#define __NR_readahead (__X32_SYSCALL_BIT + 187) -#define __NR_setxattr (__X32_SYSCALL_BIT + 188) -#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189) -#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190) -#define __NR_getxattr (__X32_SYSCALL_BIT + 191) -#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192) -#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193) -#define __NR_listxattr (__X32_SYSCALL_BIT + 194) -#define __NR_llistxattr (__X32_SYSCALL_BIT + 195) -#define __NR_flistxattr (__X32_SYSCALL_BIT + 196) -#define __NR_removexattr (__X32_SYSCALL_BIT + 197) -#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198) -#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199) -#define __NR_tkill (__X32_SYSCALL_BIT + 200) -#define __NR_time (__X32_SYSCALL_BIT + 201) -#define __NR_futex (__X32_SYSCALL_BIT + 202) -#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203) -#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204) -#define __NR_io_destroy (__X32_SYSCALL_BIT + 207) -#define __NR_io_getevents (__X32_SYSCALL_BIT + 208) -#define __NR_io_cancel (__X32_SYSCALL_BIT + 210) -#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212) -#define __NR_epoll_create (__X32_SYSCALL_BIT + 213) -#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216) -#define __NR_getdents64 (__X32_SYSCALL_BIT + 217) -#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218) -#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219) -#define __NR_semtimedop (__X32_SYSCALL_BIT + 220) -#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221) -#define __NR_timer_settime (__X32_SYSCALL_BIT + 223) -#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224) -#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225) -#define __NR_timer_delete (__X32_SYSCALL_BIT + 226) -#define __NR_clock_settime (__X32_SYSCALL_BIT + 227) -#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228) -#define __NR_clock_getres (__X32_SYSCALL_BIT + 229) -#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230) -#define __NR_exit_group (__X32_SYSCALL_BIT + 231) -#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232) -#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233) -#define __NR_tgkill (__X32_SYSCALL_BIT + 234) -#define __NR_utimes (__X32_SYSCALL_BIT + 235) -#define __NR_mbind (__X32_SYSCALL_BIT + 237) -#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238) -#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239) -#define __NR_mq_open (__X32_SYSCALL_BIT + 240) -#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241) -#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242) -#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243) -#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245) -#define __NR_add_key (__X32_SYSCALL_BIT + 248) -#define __NR_request_key (__X32_SYSCALL_BIT + 249) -#define __NR_keyctl (__X32_SYSCALL_BIT + 250) -#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251) -#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252) -#define __NR_inotify_init (__X32_SYSCALL_BIT + 253) -#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254) -#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255) -#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256) -#define __NR_openat (__X32_SYSCALL_BIT + 257) -#define __NR_mkdirat (__X32_SYSCALL_BIT + 258) -#define __NR_mknodat (__X32_SYSCALL_BIT + 259) -#define __NR_fchownat (__X32_SYSCALL_BIT + 260) -#define __NR_futimesat (__X32_SYSCALL_BIT + 261) -#define __NR_newfstatat (__X32_SYSCALL_BIT + 262) -#define __NR_unlinkat (__X32_SYSCALL_BIT + 263) -#define __NR_renameat (__X32_SYSCALL_BIT + 264) -#define __NR_linkat (__X32_SYSCALL_BIT + 265) -#define __NR_symlinkat (__X32_SYSCALL_BIT + 266) -#define __NR_readlinkat (__X32_SYSCALL_BIT + 267) -#define __NR_fchmodat (__X32_SYSCALL_BIT + 268) -#define __NR_faccessat (__X32_SYSCALL_BIT + 269) -#define __NR_pselect6 (__X32_SYSCALL_BIT + 270) -#define __NR_ppoll (__X32_SYSCALL_BIT + 271) -#define __NR_unshare (__X32_SYSCALL_BIT + 272) -#define __NR_splice (__X32_SYSCALL_BIT + 275) -#define __NR_tee (__X32_SYSCALL_BIT + 276) -#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277) -#define __NR_utimensat (__X32_SYSCALL_BIT + 280) -#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281) -#define __NR_signalfd (__X32_SYSCALL_BIT + 282) -#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283) -#define __NR_eventfd (__X32_SYSCALL_BIT + 284) -#define __NR_fallocate (__X32_SYSCALL_BIT + 285) -#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286) -#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287) -#define __NR_accept4 (__X32_SYSCALL_BIT + 288) -#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289) -#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290) -#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291) -#define __NR_dup3 (__X32_SYSCALL_BIT + 292) -#define __NR_pipe2 (__X32_SYSCALL_BIT + 293) -#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294) -#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298) -#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300) -#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301) -#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302) -#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303) -#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304) -#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305) -#define __NR_syncfs (__X32_SYSCALL_BIT + 306) -#define __NR_setns (__X32_SYSCALL_BIT + 308) -#define __NR_getcpu (__X32_SYSCALL_BIT + 309) -#define __NR_kcmp (__X32_SYSCALL_BIT + 312) -#define __NR_finit_module (__X32_SYSCALL_BIT + 313) -#define __NR_sched_setattr (__X32_SYSCALL_BIT + 314) -#define __NR_sched_getattr (__X32_SYSCALL_BIT + 315) -#define __NR_renameat2 (__X32_SYSCALL_BIT + 316) -#define __NR_seccomp (__X32_SYSCALL_BIT + 317) -#define __NR_getrandom (__X32_SYSCALL_BIT + 318) -#define __NR_memfd_create (__X32_SYSCALL_BIT + 319) -#define __NR_kexec_file_load (__X32_SYSCALL_BIT + 320) -#define __NR_bpf (__X32_SYSCALL_BIT + 321) -#define __NR_userfaultfd (__X32_SYSCALL_BIT + 323) -#define __NR_membarrier (__X32_SYSCALL_BIT + 324) -#define __NR_mlock2 (__X32_SYSCALL_BIT + 325) -#define __NR_copy_file_range (__X32_SYSCALL_BIT + 326) +#define __NR_read (0x40000000 + 0) +#define __NR_write (0x40000000 + 1) +#define __NR_open (0x40000000 + 2) +#define __NR_close (0x40000000 + 3) +#define __NR_stat (0x40000000 + 4) +#define __NR_fstat (0x40000000 + 5) +#define __NR_lstat (0x40000000 + 6) +#define __NR_poll (0x40000000 + 7) +#define __NR_lseek (0x40000000 + 8) +#define __NR_mmap (0x40000000 + 9) +#define __NR_mprotect (0x40000000 + 10) +#define __NR_munmap (0x40000000 + 11) +#define __NR_brk (0x40000000 + 12) +#define __NR_rt_sigprocmask (0x40000000 + 14) +#define __NR_pread64 (0x40000000 + 17) +#define __NR_pwrite64 (0x40000000 + 18) +#define __NR_access (0x40000000 + 21) +#define __NR_pipe (0x40000000 + 22) +#define __NR_select (0x40000000 + 23) +#define __NR_sched_yield (0x40000000 + 24) +#define __NR_mremap (0x40000000 + 25) +#define __NR_msync (0x40000000 + 26) +#define __NR_mincore (0x40000000 + 27) +#define __NR_madvise (0x40000000 + 28) +#define __NR_shmget (0x40000000 + 29) +#define __NR_shmat (0x40000000 + 30) +#define __NR_shmctl (0x40000000 + 31) +#define __NR_dup (0x40000000 + 32) +#define __NR_dup2 (0x40000000 + 33) +#define __NR_pause (0x40000000 + 34) +#define __NR_nanosleep (0x40000000 + 35) +#define __NR_getitimer (0x40000000 + 36) +#define __NR_alarm (0x40000000 + 37) +#define __NR_setitimer (0x40000000 + 38) +#define __NR_getpid (0x40000000 + 39) +#define __NR_sendfile (0x40000000 + 40) +#define __NR_socket (0x40000000 + 41) +#define __NR_connect (0x40000000 + 42) +#define __NR_accept (0x40000000 + 43) +#define __NR_sendto (0x40000000 + 44) +#define __NR_shutdown (0x40000000 + 48) +#define __NR_bind (0x40000000 + 49) +#define __NR_listen (0x40000000 + 50) +#define __NR_getsockname (0x40000000 + 51) +#define __NR_getpeername (0x40000000 + 52) +#define __NR_socketpair (0x40000000 + 53) +#define __NR_clone (0x40000000 + 56) +#define __NR_fork (0x40000000 + 57) +#define __NR_vfork (0x40000000 + 58) +#define __NR_exit (0x40000000 + 60) +#define __NR_wait4 (0x40000000 + 61) +#define __NR_kill (0x40000000 + 62) +#define __NR_uname (0x40000000 + 63) +#define __NR_semget (0x40000000 + 64) +#define __NR_semop (0x40000000 + 65) +#define __NR_semctl (0x40000000 + 66) +#define __NR_shmdt (0x40000000 + 67) +#define __NR_msgget (0x40000000 + 68) +#define __NR_msgsnd (0x40000000 + 69) +#define __NR_msgrcv (0x40000000 + 70) +#define __NR_msgctl (0x40000000 + 71) +#define __NR_fcntl (0x40000000 + 72) +#define __NR_flock (0x40000000 + 73) +#define __NR_fsync (0x40000000 + 74) +#define __NR_fdatasync (0x40000000 + 75) +#define __NR_truncate (0x40000000 + 76) +#define __NR_ftruncate (0x40000000 + 77) +#define __NR_getdents (0x40000000 + 78) +#define __NR_getcwd (0x40000000 + 79) +#define __NR_chdir (0x40000000 + 80) +#define __NR_fchdir (0x40000000 + 81) +#define __NR_rename (0x40000000 + 82) +#define __NR_mkdir (0x40000000 + 83) +#define __NR_rmdir (0x40000000 + 84) +#define __NR_creat (0x40000000 + 85) +#define __NR_link (0x40000000 + 86) +#define __NR_unlink (0x40000000 + 87) +#define __NR_symlink (0x40000000 + 88) +#define __NR_readlink (0x40000000 + 89) +#define __NR_chmod (0x40000000 + 90) +#define __NR_fchmod (0x40000000 + 91) +#define __NR_chown (0x40000000 + 92) +#define __NR_fchown (0x40000000 + 93) +#define __NR_lchown (0x40000000 + 94) +#define __NR_umask (0x40000000 + 95) +#define __NR_gettimeofday (0x40000000 + 96) +#define __NR_getrlimit (0x40000000 + 97) +#define __NR_getrusage (0x40000000 + 98) +#define __NR_sysinfo (0x40000000 + 99) +#define __NR_times (0x40000000 + 100) +#define __NR_getuid (0x40000000 + 102) +#define __NR_syslog (0x40000000 + 103) +#define __NR_getgid (0x40000000 + 104) +#define __NR_setuid (0x40000000 + 105) +#define __NR_setgid (0x40000000 + 106) +#define __NR_geteuid (0x40000000 + 107) +#define __NR_getegid (0x40000000 + 108) +#define __NR_setpgid (0x40000000 + 109) +#define __NR_getppid (0x40000000 + 110) +#define __NR_getpgrp (0x40000000 + 111) +#define __NR_setsid (0x40000000 + 112) +#define __NR_setreuid (0x40000000 + 113) +#define __NR_setregid (0x40000000 + 114) +#define __NR_getgroups (0x40000000 + 115) +#define __NR_setgroups (0x40000000 + 116) +#define __NR_setresuid (0x40000000 + 117) +#define __NR_getresuid (0x40000000 + 118) +#define __NR_setresgid (0x40000000 + 119) +#define __NR_getresgid (0x40000000 + 120) +#define __NR_getpgid (0x40000000 + 121) +#define __NR_setfsuid (0x40000000 + 122) +#define __NR_setfsgid (0x40000000 + 123) +#define __NR_getsid (0x40000000 + 124) +#define __NR_capget (0x40000000 + 125) +#define __NR_capset (0x40000000 + 126) +#define __NR_rt_sigsuspend (0x40000000 + 130) +#define __NR_utime (0x40000000 + 132) +#define __NR_mknod (0x40000000 + 133) +#define __NR_personality (0x40000000 + 135) +#define __NR_ustat (0x40000000 + 136) +#define __NR_statfs (0x40000000 + 137) +#define __NR_fstatfs (0x40000000 + 138) +#define __NR_sysfs (0x40000000 + 139) +#define __NR_getpriority (0x40000000 + 140) +#define __NR_setpriority (0x40000000 + 141) +#define __NR_sched_setparam (0x40000000 + 142) +#define __NR_sched_getparam (0x40000000 + 143) +#define __NR_sched_setscheduler (0x40000000 + 144) +#define __NR_sched_getscheduler (0x40000000 + 145) +#define __NR_sched_get_priority_max (0x40000000 + 146) +#define __NR_sched_get_priority_min (0x40000000 + 147) +#define __NR_sched_rr_get_interval (0x40000000 + 148) +#define __NR_mlock (0x40000000 + 149) +#define __NR_munlock (0x40000000 + 150) +#define __NR_mlockall (0x40000000 + 151) +#define __NR_munlockall (0x40000000 + 152) +#define __NR_vhangup (0x40000000 + 153) +#define __NR_modify_ldt (0x40000000 + 154) +#define __NR_pivot_root (0x40000000 + 155) +#define __NR_prctl (0x40000000 + 157) +#define __NR_arch_prctl (0x40000000 + 158) +#define __NR_adjtimex (0x40000000 + 159) +#define __NR_setrlimit (0x40000000 + 160) +#define __NR_chroot (0x40000000 + 161) +#define __NR_sync (0x40000000 + 162) +#define __NR_acct (0x40000000 + 163) +#define __NR_settimeofday (0x40000000 + 164) +#define __NR_mount (0x40000000 + 165) +#define __NR_umount2 (0x40000000 + 166) +#define __NR_swapon (0x40000000 + 167) +#define __NR_swapoff (0x40000000 + 168) +#define __NR_reboot (0x40000000 + 169) +#define __NR_sethostname (0x40000000 + 170) +#define __NR_setdomainname (0x40000000 + 171) +#define __NR_iopl (0x40000000 + 172) +#define __NR_ioperm (0x40000000 + 173) +#define __NR_init_module (0x40000000 + 175) +#define __NR_delete_module (0x40000000 + 176) +#define __NR_quotactl (0x40000000 + 179) +#define __NR_getpmsg (0x40000000 + 181) +#define __NR_putpmsg (0x40000000 + 182) +#define __NR_afs_syscall (0x40000000 + 183) +#define __NR_tuxcall (0x40000000 + 184) +#define __NR_security (0x40000000 + 185) +#define __NR_gettid (0x40000000 + 186) +#define __NR_readahead (0x40000000 + 187) +#define __NR_setxattr (0x40000000 + 188) +#define __NR_lsetxattr (0x40000000 + 189) +#define __NR_fsetxattr (0x40000000 + 190) +#define __NR_getxattr (0x40000000 + 191) +#define __NR_lgetxattr (0x40000000 + 192) +#define __NR_fgetxattr (0x40000000 + 193) +#define __NR_listxattr (0x40000000 + 194) +#define __NR_llistxattr (0x40000000 + 195) +#define __NR_flistxattr (0x40000000 + 196) +#define __NR_removexattr (0x40000000 + 197) +#define __NR_lremovexattr (0x40000000 + 198) +#define __NR_fremovexattr (0x40000000 + 199) +#define __NR_tkill (0x40000000 + 200) +#define __NR_time (0x40000000 + 201) +#define __NR_futex (0x40000000 + 202) +#define __NR_sched_setaffinity (0x40000000 + 203) +#define __NR_sched_getaffinity (0x40000000 + 204) +#define __NR_io_destroy (0x40000000 + 207) +#define __NR_io_getevents (0x40000000 + 208) +#define __NR_io_cancel (0x40000000 + 210) +#define __NR_lookup_dcookie (0x40000000 + 212) +#define __NR_epoll_create (0x40000000 + 213) +#define __NR_remap_file_pages (0x40000000 + 216) +#define __NR_getdents64 (0x40000000 + 217) +#define __NR_set_tid_address (0x40000000 + 218) +#define __NR_restart_syscall (0x40000000 + 219) +#define __NR_semtimedop (0x40000000 + 220) +#define __NR_fadvise64 (0x40000000 + 221) +#define __NR_timer_settime (0x40000000 + 223) +#define __NR_timer_gettime (0x40000000 + 224) +#define __NR_timer_getoverrun (0x40000000 + 225) +#define __NR_timer_delete (0x40000000 + 226) +#define __NR_clock_settime (0x40000000 + 227) +#define __NR_clock_gettime (0x40000000 + 228) +#define __NR_clock_getres (0x40000000 + 229) +#define __NR_clock_nanosleep (0x40000000 + 230) +#define __NR_exit_group (0x40000000 + 231) +#define __NR_epoll_wait (0x40000000 + 232) +#define __NR_epoll_ctl (0x40000000 + 233) +#define __NR_tgkill (0x40000000 + 234) +#define __NR_utimes (0x40000000 + 235) +#define __NR_mbind (0x40000000 + 237) +#define __NR_set_mempolicy (0x40000000 + 238) +#define __NR_get_mempolicy (0x40000000 + 239) +#define __NR_mq_open (0x40000000 + 240) +#define __NR_mq_unlink (0x40000000 + 241) +#define __NR_mq_timedsend (0x40000000 + 242) +#define __NR_mq_timedreceive (0x40000000 + 243) +#define __NR_mq_getsetattr (0x40000000 + 245) +#define __NR_add_key (0x40000000 + 248) +#define __NR_request_key (0x40000000 + 249) +#define __NR_keyctl (0x40000000 + 250) +#define __NR_ioprio_set (0x40000000 + 251) +#define __NR_ioprio_get (0x40000000 + 252) +#define __NR_inotify_init (0x40000000 + 253) +#define __NR_inotify_add_watch (0x40000000 + 254) +#define __NR_inotify_rm_watch (0x40000000 + 255) +#define __NR_migrate_pages (0x40000000 + 256) +#define __NR_openat (0x40000000 + 257) +#define __NR_mkdirat (0x40000000 + 258) +#define __NR_mknodat (0x40000000 + 259) +#define __NR_fchownat (0x40000000 + 260) +#define __NR_futimesat (0x40000000 + 261) +#define __NR_newfstatat (0x40000000 + 262) +#define __NR_unlinkat (0x40000000 + 263) +#define __NR_renameat (0x40000000 + 264) +#define __NR_linkat (0x40000000 + 265) +#define __NR_symlinkat (0x40000000 + 266) +#define __NR_readlinkat (0x40000000 + 267) +#define __NR_fchmodat (0x40000000 + 268) +#define __NR_faccessat (0x40000000 + 269) +#define __NR_pselect6 (0x40000000 + 270) +#define __NR_ppoll (0x40000000 + 271) +#define __NR_unshare (0x40000000 + 272) +#define __NR_splice (0x40000000 + 275) +#define __NR_tee (0x40000000 + 276) +#define __NR_sync_file_range (0x40000000 + 277) +#define __NR_utimensat (0x40000000 + 280) +#define __NR_epoll_pwait (0x40000000 + 281) +#define __NR_signalfd (0x40000000 + 282) +#define __NR_timerfd_create (0x40000000 + 283) +#define __NR_eventfd (0x40000000 + 284) +#define __NR_fallocate (0x40000000 + 285) +#define __NR_timerfd_settime (0x40000000 + 286) +#define __NR_timerfd_gettime (0x40000000 + 287) +#define __NR_accept4 (0x40000000 + 288) +#define __NR_signalfd4 (0x40000000 + 289) +#define __NR_eventfd2 (0x40000000 + 290) +#define __NR_epoll_create1 (0x40000000 + 291) +#define __NR_dup3 (0x40000000 + 292) +#define __NR_pipe2 (0x40000000 + 293) +#define __NR_inotify_init1 (0x40000000 + 294) +#define __NR_perf_event_open (0x40000000 + 298) +#define __NR_fanotify_init (0x40000000 + 300) +#define __NR_fanotify_mark (0x40000000 + 301) +#define __NR_prlimit64 (0x40000000 + 302) +#define __NR_name_to_handle_at (0x40000000 + 303) +#define __NR_open_by_handle_at (0x40000000 + 304) +#define __NR_clock_adjtime (0x40000000 + 305) +#define __NR_syncfs (0x40000000 + 306) +#define __NR_setns (0x40000000 + 308) +#define __NR_getcpu (0x40000000 + 309) +#define __NR_kcmp (0x40000000 + 312) +#define __NR_finit_module (0x40000000 + 313) +#define __NR_sched_setattr (0x40000000 + 314) +#define __NR_sched_getattr (0x40000000 + 315) +#define __NR_renameat2 (0x40000000 + 316) +#define __NR_seccomp (0x40000000 + 317) +#define __NR_getrandom (0x40000000 + 318) +#define __NR_memfd_create (0x40000000 + 319) +#define __NR_kexec_file_load (0x40000000 + 320) +#define __NR_bpf (0x40000000 + 321) +#define __NR_userfaultfd (0x40000000 + 323) +#define __NR_membarrier (0x40000000 + 324) +#define __NR_mlock2 (0x40000000 + 325) +#define __NR_copy_file_range (0x40000000 + 326) -#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) -#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) -#define __NR_ioctl (__X32_SYSCALL_BIT + 514) -#define __NR_readv (__X32_SYSCALL_BIT + 515) -#define __NR_writev (__X32_SYSCALL_BIT + 516) -#define __NR_recvfrom (__X32_SYSCALL_BIT + 517) -#define __NR_sendmsg (__X32_SYSCALL_BIT + 518) -#define __NR_recvmsg (__X32_SYSCALL_BIT + 519) -#define __NR_execve (__X32_SYSCALL_BIT + 520) -#define __NR_ptrace (__X32_SYSCALL_BIT + 521) -#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522) -#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523) -#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524) -#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525) -#define __NR_timer_create (__X32_SYSCALL_BIT + 526) -#define __NR_mq_notify (__X32_SYSCALL_BIT + 527) -#define __NR_kexec_load (__X32_SYSCALL_BIT + 528) -#define __NR_waitid (__X32_SYSCALL_BIT + 529) -#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530) -#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531) -#define __NR_vmsplice (__X32_SYSCALL_BIT + 532) -#define __NR_move_pages (__X32_SYSCALL_BIT + 533) -#define __NR_preadv (__X32_SYSCALL_BIT + 534) -#define __NR_pwritev (__X32_SYSCALL_BIT + 535) -#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536) -#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537) -#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538) -#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539) -#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540) -#define __NR_setsockopt (__X32_SYSCALL_BIT + 541) -#define __NR_getsockopt (__X32_SYSCALL_BIT + 542) -#define __NR_io_setup (__X32_SYSCALL_BIT + 543) -#define __NR_io_submit (__X32_SYSCALL_BIT + 544) -#define __NR_execveat (__X32_SYSCALL_BIT + 545) +#define __NR_rt_sigaction (0x40000000 + 512) +#define __NR_rt_sigreturn (0x40000000 + 513) +#define __NR_ioctl (0x40000000 + 514) +#define __NR_readv (0x40000000 + 515) +#define __NR_writev (0x40000000 + 516) +#define __NR_recvfrom (0x40000000 + 517) +#define __NR_sendmsg (0x40000000 + 518) +#define __NR_recvmsg (0x40000000 + 519) +#define __NR_execve (0x40000000 + 520) +#define __NR_ptrace (0x40000000 + 521) +#define __NR_rt_sigpending (0x40000000 + 522) +#define __NR_rt_sigtimedwait (0x40000000 + 523) +#define __NR_rt_sigqueueinfo (0x40000000 + 524) +#define __NR_sigaltstack (0x40000000 + 525) +#define __NR_timer_create (0x40000000 + 526) +#define __NR_mq_notify (0x40000000 + 527) +#define __NR_kexec_load (0x40000000 + 528) +#define __NR_waitid (0x40000000 + 529) +#define __NR_set_robust_list (0x40000000 + 530) +#define __NR_get_robust_list (0x40000000 + 531) +#define __NR_vmsplice (0x40000000 + 532) +#define __NR_move_pages (0x40000000 + 533) +#define __NR_preadv (0x40000000 + 534) +#define __NR_pwritev (0x40000000 + 535) +#define __NR_rt_tgsigqueueinfo (0x40000000 + 536) +#define __NR_recvmmsg (0x40000000 + 537) +#define __NR_sendmmsg (0x40000000 + 538) +#define __NR_process_vm_readv (0x40000000 + 539) +#define __NR_process_vm_writev (0x40000000 + 540) +#define __NR_setsockopt (0x40000000 + 541) +#define __NR_getsockopt (0x40000000 + 542) +#define __NR_io_setup (0x40000000 + 543) +#define __NR_io_submit (0x40000000 + 544) +#define __NR_execveat (0x40000000 + 545) From 63e3a1661f1fa5552e2023683617ce09fac3248b Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 12 May 2016 00:34:05 -0500 Subject: [PATCH 106/412] deduplicate __NR_* and SYS_* syscall number definitions --- Makefile | 6 +- arch/aarch64/bits/syscall.h | 543 -------------- arch/aarch64/bits/syscall.h.in | 272 +++++++ arch/arm/bits/{syscall.h => syscall.h.in} | 349 --------- arch/i386/bits/{syscall.h => syscall.h.in} | 381 ---------- .../bits/{syscall.h => syscall.h.in} | 388 ---------- arch/mips/bits/{syscall.h => syscall.h.in} | 362 --------- arch/mips64/bits/{syscall.h => syscall.h.in} | 320 -------- arch/mipsn32/bits/{syscall.h => syscall.h.in} | 324 --------- arch/or1k/bits/syscall.h | 543 -------------- arch/or1k/bits/syscall.h.in | 272 +++++++ arch/powerpc/bits/{syscall.h => syscall.h.in} | 374 ---------- .../bits/{syscall.h => syscall.h.in} | 360 --------- arch/sh/bits/syscall.h | 684 ------------------ arch/sh/bits/syscall.h.in | 341 +++++++++ arch/x32/bits/{syscall.h => syscall.h.in} | 324 --------- arch/x86_64/bits/{syscall.h => syscall.h.in} | 331 --------- 17 files changed, 890 insertions(+), 5284 deletions(-) delete mode 100644 arch/aarch64/bits/syscall.h create mode 100644 arch/aarch64/bits/syscall.h.in rename arch/arm/bits/{syscall.h => syscall.h.in} (51%) rename arch/i386/bits/{syscall.h => syscall.h.in} (50%) rename arch/microblaze/bits/{syscall.h => syscall.h.in} (50%) rename arch/mips/bits/{syscall.h => syscall.h.in} (50%) rename arch/mips64/bits/{syscall.h => syscall.h.in} (50%) rename arch/mipsn32/bits/{syscall.h => syscall.h.in} (50%) delete mode 100644 arch/or1k/bits/syscall.h create mode 100644 arch/or1k/bits/syscall.h.in rename arch/powerpc/bits/{syscall.h => syscall.h.in} (50%) rename arch/powerpc64/bits/{syscall.h => syscall.h.in} (50%) delete mode 100644 arch/sh/bits/syscall.h create mode 100644 arch/sh/bits/syscall.h.in rename arch/x32/bits/{syscall.h => syscall.h.in} (53%) rename arch/x86_64/bits/{syscall.h => syscall.h.in} (50%) diff --git a/Makefile b/Makefile index ec54880d..8246b78f 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS)) AOBJS = $(LIBC_OBJS) LOBJS = $(LIBC_OBJS:.o=.lo) -GENH = obj/include/bits/alltypes.h +GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h GENH_INT = obj/src/internal/version.h IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h) @@ -96,6 +96,10 @@ $(OBJ_DIRS): obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@ +obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in + cp $< $@ + sed -n -e s/__NR_/SYS_/p < $< >> $@ + obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git) printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@ diff --git a/arch/aarch64/bits/syscall.h b/arch/aarch64/bits/syscall.h deleted file mode 100644 index eddbe929..00000000 --- a/arch/aarch64/bits/syscall.h +++ /dev/null @@ -1,543 +0,0 @@ -#define __NR_io_setup 0 -#define __NR_io_destroy 1 -#define __NR_io_submit 2 -#define __NR_io_cancel 3 -#define __NR_io_getevents 4 -#define __NR_setxattr 5 -#define __NR_lsetxattr 6 -#define __NR_fsetxattr 7 -#define __NR_getxattr 8 -#define __NR_lgetxattr 9 -#define __NR_fgetxattr 10 -#define __NR_listxattr 11 -#define __NR_llistxattr 12 -#define __NR_flistxattr 13 -#define __NR_removexattr 14 -#define __NR_lremovexattr 15 -#define __NR_fremovexattr 16 -#define __NR_getcwd 17 -#define __NR_lookup_dcookie 18 -#define __NR_eventfd2 19 -#define __NR_epoll_create1 20 -#define __NR_epoll_ctl 21 -#define __NR_epoll_pwait 22 -#define __NR_dup 23 -#define __NR_dup3 24 -#define __NR_fcntl 25 -#define __NR_inotify_init1 26 -#define __NR_inotify_add_watch 27 -#define __NR_inotify_rm_watch 28 -#define __NR_ioctl 29 -#define __NR_ioprio_set 30 -#define __NR_ioprio_get 31 -#define __NR_flock 32 -#define __NR_mknodat 33 -#define __NR_mkdirat 34 -#define __NR_unlinkat 35 -#define __NR_symlinkat 36 -#define __NR_linkat 37 -#define __NR_renameat 38 -#define __NR_umount2 39 -#define __NR_mount 40 -#define __NR_pivot_root 41 -#define __NR_nfsservctl 42 -#define __NR_statfs 43 -#define __NR_fstatfs 44 -#define __NR_truncate 45 -#define __NR_ftruncate 46 -#define __NR_fallocate 47 -#define __NR_faccessat 48 -#define __NR_chdir 49 -#define __NR_fchdir 50 -#define __NR_chroot 51 -#define __NR_fchmod 52 -#define __NR_fchmodat 53 -#define __NR_fchownat 54 -#define __NR_fchown 55 -#define __NR_openat 56 -#define __NR_close 57 -#define __NR_vhangup 58 -#define __NR_pipe2 59 -#define __NR_quotactl 60 -#define __NR_getdents64 61 -#define __NR_lseek 62 -#define __NR_read 63 -#define __NR_write 64 -#define __NR_readv 65 -#define __NR_writev 66 -#define __NR_pread64 67 -#define __NR_pwrite64 68 -#define __NR_preadv 69 -#define __NR_pwritev 70 -#define __NR_sendfile 71 -#define __NR_pselect6 72 -#define __NR_ppoll 73 -#define __NR_signalfd4 74 -#define __NR_vmsplice 75 -#define __NR_splice 76 -#define __NR_tee 77 -#define __NR_readlinkat 78 -#define __NR_fstatat 79 -#define __NR_fstat 80 -#define __NR_sync 81 -#define __NR_fsync 82 -#define __NR_fdatasync 83 -#define __NR_sync_file_range 84 -#define __NR_timerfd_create 85 -#define __NR_timerfd_settime 86 -#define __NR_timerfd_gettime 87 -#define __NR_utimensat 88 -#define __NR_acct 89 -#define __NR_capget 90 -#define __NR_capset 91 -#define __NR_personality 92 -#define __NR_exit 93 -#define __NR_exit_group 94 -#define __NR_waitid 95 -#define __NR_set_tid_address 96 -#define __NR_unshare 97 -#define __NR_futex 98 -#define __NR_set_robust_list 99 -#define __NR_get_robust_list 100 -#define __NR_nanosleep 101 -#define __NR_getitimer 102 -#define __NR_setitimer 103 -#define __NR_kexec_load 104 -#define __NR_init_module 105 -#define __NR_delete_module 106 -#define __NR_timer_create 107 -#define __NR_timer_gettime 108 -#define __NR_timer_getoverrun 109 -#define __NR_timer_settime 110 -#define __NR_timer_delete 111 -#define __NR_clock_settime 112 -#define __NR_clock_gettime 113 -#define __NR_clock_getres 114 -#define __NR_clock_nanosleep 115 -#define __NR_syslog 116 -#define __NR_ptrace 117 -#define __NR_sched_setparam 118 -#define __NR_sched_setscheduler 119 -#define __NR_sched_getscheduler 120 -#define __NR_sched_getparam 121 -#define __NR_sched_setaffinity 122 -#define __NR_sched_getaffinity 123 -#define __NR_sched_yield 124 -#define __NR_sched_get_priority_max 125 -#define __NR_sched_get_priority_min 126 -#define __NR_sched_rr_get_interval 127 -#define __NR_restart_syscall 128 -#define __NR_kill 129 -#define __NR_tkill 130 -#define __NR_tgkill 131 -#define __NR_sigaltstack 132 -#define __NR_rt_sigsuspend 133 -#define __NR_rt_sigaction 134 -#define __NR_rt_sigprocmask 135 -#define __NR_rt_sigpending 136 -#define __NR_rt_sigtimedwait 137 -#define __NR_rt_sigqueueinfo 138 -#define __NR_rt_sigreturn 139 -#define __NR_setpriority 140 -#define __NR_getpriority 141 -#define __NR_reboot 142 -#define __NR_setregid 143 -#define __NR_setgid 144 -#define __NR_setreuid 145 -#define __NR_setuid 146 -#define __NR_setresuid 147 -#define __NR_getresuid 148 -#define __NR_setresgid 149 -#define __NR_getresgid 150 -#define __NR_setfsuid 151 -#define __NR_setfsgid 152 -#define __NR_times 153 -#define __NR_setpgid 154 -#define __NR_getpgid 155 -#define __NR_getsid 156 -#define __NR_setsid 157 -#define __NR_getgroups 158 -#define __NR_setgroups 159 -#define __NR_uname 160 -#define __NR_sethostname 161 -#define __NR_setdomainname 162 -#define __NR_getrlimit 163 -#define __NR_setrlimit 164 -#define __NR_getrusage 165 -#define __NR_umask 166 -#define __NR_prctl 167 -#define __NR_getcpu 168 -#define __NR_gettimeofday 169 -#define __NR_settimeofday 170 -#define __NR_adjtimex 171 -#define __NR_getpid 172 -#define __NR_getppid 173 -#define __NR_getuid 174 -#define __NR_geteuid 175 -#define __NR_getgid 176 -#define __NR_getegid 177 -#define __NR_gettid 178 -#define __NR_sysinfo 179 -#define __NR_mq_open 180 -#define __NR_mq_unlink 181 -#define __NR_mq_timedsend 182 -#define __NR_mq_timedreceive 183 -#define __NR_mq_notify 184 -#define __NR_mq_getsetattr 185 -#define __NR_msgget 186 -#define __NR_msgctl 187 -#define __NR_msgrcv 188 -#define __NR_msgsnd 189 -#define __NR_semget 190 -#define __NR_semctl 191 -#define __NR_semtimedop 192 -#define __NR_semop 193 -#define __NR_shmget 194 -#define __NR_shmctl 195 -#define __NR_shmat 196 -#define __NR_shmdt 197 -#define __NR_socket 198 -#define __NR_socketpair 199 -#define __NR_bind 200 -#define __NR_listen 201 -#define __NR_accept 202 -#define __NR_connect 203 -#define __NR_getsockname 204 -#define __NR_getpeername 205 -#define __NR_sendto 206 -#define __NR_recvfrom 207 -#define __NR_setsockopt 208 -#define __NR_getsockopt 209 -#define __NR_shutdown 210 -#define __NR_sendmsg 211 -#define __NR_recvmsg 212 -#define __NR_readahead 213 -#define __NR_brk 214 -#define __NR_munmap 215 -#define __NR_mremap 216 -#define __NR_add_key 217 -#define __NR_request_key 218 -#define __NR_keyctl 219 -#define __NR_clone 220 -#define __NR_execve 221 -#define __NR_mmap 222 -#define __NR_fadvise64 223 -#define __NR_swapon 224 -#define __NR_swapoff 225 -#define __NR_mprotect 226 -#define __NR_msync 227 -#define __NR_mlock 228 -#define __NR_munlock 229 -#define __NR_mlockall 230 -#define __NR_munlockall 231 -#define __NR_mincore 232 -#define __NR_madvise 233 -#define __NR_remap_file_pages 234 -#define __NR_mbind 235 -#define __NR_get_mempolicy 236 -#define __NR_set_mempolicy 237 -#define __NR_migrate_pages 238 -#define __NR_move_pages 239 -#define __NR_rt_tgsigqueueinfo 240 -#define __NR_perf_event_open 241 -#define __NR_accept4 242 -#define __NR_recvmmsg 243 -#define __NR_or1k_atomic 244 -#define __NR_wait4 260 -#define __NR_prlimit64 261 -#define __NR_fanotify_init 262 -#define __NR_fanotify_mark 263 -#define __NR_name_to_handle_at 264 -#define __NR_open_by_handle_at 265 -#define __NR_clock_adjtime 266 -#define __NR_syncfs 267 -#define __NR_setns 268 -#define __NR_sendmmsg 269 -#define __NR_process_vm_readv 270 -#define __NR_process_vm_writev 271 -#define __NR_kcmp 272 -#define __NR_finit_module 273 -#define __NR_sched_setattr 274 -#define __NR_sched_getattr 275 -#define __NR_renameat2 276 -#define __NR_seccomp 277 -#define __NR_getrandom 278 -#define __NR_memfd_create 279 -#define __NR_bpf 280 -#define __NR_execveat 281 -#define __NR_userfaultfd 282 -#define __NR_membarrier 283 -#define __NR_mlock2 284 -#define __NR_copy_file_range 285 - -#define SYS_io_setup __NR_io_setup -#define SYS_io_destroy __NR_io_destroy -#define SYS_io_submit __NR_io_submit -#define SYS_io_cancel __NR_io_cancel -#define SYS_io_getevents __NR_io_getevents -#define SYS_setxattr __NR_setxattr -#define SYS_lsetxattr __NR_lsetxattr -#define SYS_fsetxattr __NR_fsetxattr -#define SYS_getxattr __NR_getxattr -#define SYS_lgetxattr __NR_lgetxattr -#define SYS_fgetxattr __NR_fgetxattr -#define SYS_listxattr __NR_listxattr -#define SYS_llistxattr __NR_llistxattr -#define SYS_flistxattr __NR_flistxattr -#define SYS_removexattr __NR_removexattr -#define SYS_lremovexattr __NR_lremovexattr -#define SYS_fremovexattr __NR_fremovexattr -#define SYS_getcwd __NR_getcwd -#define SYS_lookup_dcookie __NR_lookup_dcookie -#define SYS_eventfd2 __NR_eventfd2 -#define SYS_epoll_create1 __NR_epoll_create1 -#define SYS_epoll_ctl __NR_epoll_ctl -#define SYS_epoll_pwait __NR_epoll_pwait -#define SYS_dup __NR_dup -#define SYS_dup3 __NR_dup3 -#define SYS_fcntl __NR_fcntl -#define SYS_inotify_init1 __NR_inotify_init1 -#define SYS_inotify_add_watch __NR_inotify_add_watch -#define SYS_inotify_rm_watch __NR_inotify_rm_watch -#define SYS_ioctl __NR_ioctl -#define SYS_ioprio_set __NR_ioprio_set -#define SYS_ioprio_get __NR_ioprio_get -#define SYS_flock __NR_flock -#define SYS_mknodat __NR_mknodat -#define SYS_mkdirat __NR_mkdirat -#define SYS_unlinkat __NR_unlinkat -#define SYS_symlinkat __NR_symlinkat -#define SYS_linkat __NR_linkat -#define SYS_renameat __NR_renameat -#define SYS_umount2 __NR_umount2 -#define SYS_mount __NR_mount -#define SYS_pivot_root __NR_pivot_root -#define SYS_nfsservctl __NR_nfsservctl -#define SYS_statfs __NR_statfs -#define SYS_fstatfs __NR_fstatfs -#define SYS_truncate __NR_truncate -#define SYS_ftruncate __NR_ftruncate -#define SYS_fallocate __NR_fallocate -#define SYS_faccessat __NR_faccessat -#define SYS_chdir __NR_chdir -#define SYS_fchdir __NR_fchdir -#define SYS_chroot __NR_chroot -#define SYS_fchmod __NR_fchmod -#define SYS_fchmodat __NR_fchmodat -#define SYS_fchownat __NR_fchownat -#define SYS_fchown __NR_fchown -#define SYS_openat __NR_openat -#define SYS_close __NR_close -#define SYS_vhangup __NR_vhangup -#define SYS_pipe2 __NR_pipe2 -#define SYS_quotactl __NR_quotactl -#define SYS_getdents64 __NR_getdents64 -#define SYS_lseek __NR_lseek -#define SYS_read __NR_read -#define SYS_write __NR_write -#define SYS_readv __NR_readv -#define SYS_writev __NR_writev -#define SYS_pread64 __NR_pread64 -#define SYS_pwrite64 __NR_pwrite64 -#define SYS_preadv __NR_preadv -#define SYS_pwritev __NR_pwritev -#define SYS_sendfile __NR_sendfile -#define SYS_pselect6 __NR_pselect6 -#define SYS_ppoll __NR_ppoll -#define SYS_signalfd4 __NR_signalfd4 -#define SYS_vmsplice __NR_vmsplice -#define SYS_splice __NR_splice -#define SYS_tee __NR_tee -#define SYS_readlinkat __NR_readlinkat -#define SYS_fstatat __NR_fstatat -#define SYS_fstat __NR_fstat -#define SYS_sync __NR_sync -#define SYS_fsync __NR_fsync -#define SYS_fdatasync __NR_fdatasync -#define SYS_sync_file_range __NR_sync_file_range -#define SYS_timerfd_create __NR_timerfd_create -#define SYS_timerfd_settime __NR_timerfd_settime -#define SYS_timerfd_gettime __NR_timerfd_gettime -#define SYS_utimensat __NR_utimensat -#define SYS_acct __NR_acct -#define SYS_capget __NR_capget -#define SYS_capset __NR_capset -#define SYS_personality __NR_personality -#define SYS_exit __NR_exit -#define SYS_exit_group __NR_exit_group -#define SYS_waitid __NR_waitid -#define SYS_set_tid_address __NR_set_tid_address -#define SYS_unshare __NR_unshare -#define SYS_futex __NR_futex -#define SYS_set_robust_list __NR_set_robust_list -#define SYS_get_robust_list __NR_get_robust_list -#define SYS_nanosleep __NR_nanosleep -#define SYS_getitimer __NR_getitimer -#define SYS_setitimer __NR_setitimer -#define SYS_kexec_load __NR_kexec_load -#define SYS_init_module __NR_init_module -#define SYS_delete_module __NR_delete_module -#define SYS_timer_create __NR_timer_create -#define SYS_timer_gettime __NR_timer_gettime -#define SYS_timer_getoverrun __NR_timer_getoverrun -#define SYS_timer_settime __NR_timer_settime -#define SYS_timer_delete __NR_timer_delete -#define SYS_clock_settime __NR_clock_settime -#define SYS_clock_gettime __NR_clock_gettime -#define SYS_clock_getres __NR_clock_getres -#define SYS_clock_nanosleep __NR_clock_nanosleep -#define SYS_syslog __NR_syslog -#define SYS_ptrace __NR_ptrace -#define SYS_sched_setparam __NR_sched_setparam -#define SYS_sched_setscheduler __NR_sched_setscheduler -#define SYS_sched_getscheduler __NR_sched_getscheduler -#define SYS_sched_getparam __NR_sched_getparam -#define SYS_sched_setaffinity __NR_sched_setaffinity -#define SYS_sched_getaffinity __NR_sched_getaffinity -#define SYS_sched_yield __NR_sched_yield -#define SYS_sched_get_priority_max __NR_sched_get_priority_max -#define SYS_sched_get_priority_min __NR_sched_get_priority_min -#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval -#define SYS_restart_syscall __NR_restart_syscall -#define SYS_kill __NR_kill -#define SYS_tkill __NR_tkill -#define SYS_tgkill __NR_tgkill -#define SYS_sigaltstack __NR_sigaltstack -#define SYS_rt_sigsuspend __NR_rt_sigsuspend -#define SYS_rt_sigaction __NR_rt_sigaction -#define SYS_rt_sigprocmask __NR_rt_sigprocmask -#define SYS_rt_sigpending __NR_rt_sigpending -#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait -#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo -#define SYS_rt_sigreturn __NR_rt_sigreturn -#define SYS_setpriority __NR_setpriority -#define SYS_getpriority __NR_getpriority -#define SYS_reboot __NR_reboot -#define SYS_setregid __NR_setregid -#define SYS_setgid __NR_setgid -#define SYS_setreuid __NR_setreuid -#define SYS_setuid __NR_setuid -#define SYS_setresuid __NR_setresuid -#define SYS_getresuid __NR_getresuid -#define SYS_setresgid __NR_setresgid -#define SYS_getresgid __NR_getresgid -#define SYS_setfsuid __NR_setfsuid -#define SYS_setfsgid __NR_setfsgid -#define SYS_times __NR_times -#define SYS_setpgid __NR_setpgid -#define SYS_getpgid __NR_getpgid -#define SYS_getsid __NR_getsid -#define SYS_setsid __NR_setsid -#define SYS_getgroups __NR_getgroups -#define SYS_setgroups __NR_setgroups -#define SYS_uname __NR_uname -#define SYS_sethostname __NR_sethostname -#define SYS_setdomainname __NR_setdomainname -#define SYS_getrlimit __NR_getrlimit -#define SYS_setrlimit __NR_setrlimit -#define SYS_getrusage __NR_getrusage -#define SYS_umask __NR_umask -#define SYS_prctl __NR_prctl -#define SYS_getcpu __NR_getcpu -#define SYS_gettimeofday __NR_gettimeofday -#define SYS_settimeofday __NR_settimeofday -#define SYS_adjtimex __NR_adjtimex -#define SYS_getpid __NR_getpid -#define SYS_getppid __NR_getppid -#define SYS_getuid __NR_getuid -#define SYS_geteuid __NR_geteuid -#define SYS_getgid __NR_getgid -#define SYS_getegid __NR_getegid -#define SYS_gettid __NR_gettid -#define SYS_sysinfo __NR_sysinfo -#define SYS_mq_open __NR_mq_open -#define SYS_mq_unlink __NR_mq_unlink -#define SYS_mq_timedsend __NR_mq_timedsend -#define SYS_mq_timedreceive __NR_mq_timedreceive -#define SYS_mq_notify __NR_mq_notify -#define SYS_mq_getsetattr __NR_mq_getsetattr -#define SYS_msgget __NR_msgget -#define SYS_msgctl __NR_msgctl -#define SYS_msgrcv __NR_msgrcv -#define SYS_msgsnd __NR_msgsnd -#define SYS_semget __NR_semget -#define SYS_semctl __NR_semctl -#define SYS_semtimedop __NR_semtimedop -#define SYS_semop __NR_semop -#define SYS_shmget __NR_shmget -#define SYS_shmctl __NR_shmctl -#define SYS_shmat __NR_shmat -#define SYS_shmdt __NR_shmdt -#define SYS_socket __NR_socket -#define SYS_socketpair __NR_socketpair -#define SYS_bind __NR_bind -#define SYS_listen __NR_listen -#define SYS_accept __NR_accept -#define SYS_connect __NR_connect -#define SYS_getsockname __NR_getsockname -#define SYS_getpeername __NR_getpeername -#define SYS_sendto __NR_sendto -#define SYS_recvfrom __NR_recvfrom -#define SYS_setsockopt __NR_setsockopt -#define SYS_getsockopt __NR_getsockopt -#define SYS_shutdown __NR_shutdown -#define SYS_sendmsg __NR_sendmsg -#define SYS_recvmsg __NR_recvmsg -#define SYS_readahead __NR_readahead -#define SYS_brk __NR_brk -#define SYS_munmap __NR_munmap -#define SYS_mremap __NR_mremap -#define SYS_add_key __NR_add_key -#define SYS_request_key __NR_request_key -#define SYS_keyctl __NR_keyctl -#define SYS_clone __NR_clone -#define SYS_execve __NR_execve -#define SYS_mmap __NR_mmap -#define SYS_fadvise64 __NR_fadvise64 -#define SYS_swapon __NR_swapon -#define SYS_swapoff __NR_swapoff -#define SYS_mprotect __NR_mprotect -#define SYS_msync __NR_msync -#define SYS_mlock __NR_mlock -#define SYS_munlock __NR_munlock -#define SYS_mlockall __NR_mlockall -#define SYS_munlockall __NR_munlockall -#define SYS_mincore __NR_mincore -#define SYS_madvise __NR_madvise -#define SYS_remap_file_pages __NR_remap_file_pages -#define SYS_mbind __NR_mbind -#define SYS_get_mempolicy __NR_get_mempolicy -#define SYS_set_mempolicy __NR_set_mempolicy -#define SYS_migrate_pages __NR_migrate_pages -#define SYS_move_pages __NR_move_pages -#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo -#define SYS_perf_event_open __NR_perf_event_open -#define SYS_accept4 __NR_accept4 -#define SYS_recvmmsg __NR_recvmmsg -#define SYS_or1k_atomic __NR_or1k_atomic -#define SYS_wait4 __NR_wait4 -#define SYS_prlimit64 __NR_prlimit64 -#define SYS_fanotify_init __NR_fanotify_init -#define SYS_fanotify_mark __NR_fanotify_mark -#define SYS_name_to_handle_at __NR_name_to_handle_at -#define SYS_open_by_handle_at __NR_open_by_handle_at -#define SYS_clock_adjtime __NR_clock_adjtime -#define SYS_syncfs __NR_syncfs -#define SYS_setns __NR_setns -#define SYS_sendmmsg __NR_sendmmsg -#define SYS_process_vm_readv __NR_process_vm_readv -#define SYS_process_vm_writev __NR_process_vm_writev -#define SYS_kcmp __NR_kcmp -#define SYS_finit_module __NR_finit_module -#define SYS_sched_setattr __NR_sched_setattr -#define SYS_sched_getattr __NR_sched_getattr -#define SYS_renameat2 __NR_renameat2 -#define SYS_seccomp __NR_seccomp -#define SYS_getrandom __NR_getrandom -#define SYS_memfd_create __NR_memfd_create -#define SYS_bpf __NR_bpf -#define SYS_execveat __NR_execveat -#define SYS_userfaultfd __NR_userfaultfd -#define SYS_membarrier __NR_membarrier -#define SYS_mlock2 __NR_mlock2 -#define SYS_copy_file_range __NR_copy_file_range diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in new file mode 100644 index 00000000..bcf69d20 --- /dev/null +++ b/arch/aarch64/bits/syscall.h.in @@ -0,0 +1,272 @@ +#define __NR_io_setup 0 +#define __NR_io_destroy 1 +#define __NR_io_submit 2 +#define __NR_io_cancel 3 +#define __NR_io_getevents 4 +#define __NR_setxattr 5 +#define __NR_lsetxattr 6 +#define __NR_fsetxattr 7 +#define __NR_getxattr 8 +#define __NR_lgetxattr 9 +#define __NR_fgetxattr 10 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_flistxattr 13 +#define __NR_removexattr 14 +#define __NR_lremovexattr 15 +#define __NR_fremovexattr 16 +#define __NR_getcwd 17 +#define __NR_lookup_dcookie 18 +#define __NR_eventfd2 19 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_fcntl 25 +#define __NR_inotify_init1 26 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_rm_watch 28 +#define __NR_ioctl 29 +#define __NR_ioprio_set 30 +#define __NR_ioprio_get 31 +#define __NR_flock 32 +#define __NR_mknodat 33 +#define __NR_mkdirat 34 +#define __NR_unlinkat 35 +#define __NR_symlinkat 36 +#define __NR_linkat 37 +#define __NR_renameat 38 +#define __NR_umount2 39 +#define __NR_mount 40 +#define __NR_pivot_root 41 +#define __NR_nfsservctl 42 +#define __NR_statfs 43 +#define __NR_fstatfs 44 +#define __NR_truncate 45 +#define __NR_ftruncate 46 +#define __NR_fallocate 47 +#define __NR_faccessat 48 +#define __NR_chdir 49 +#define __NR_fchdir 50 +#define __NR_chroot 51 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchownat 54 +#define __NR_fchown 55 +#define __NR_openat 56 +#define __NR_close 57 +#define __NR_vhangup 58 +#define __NR_pipe2 59 +#define __NR_quotactl 60 +#define __NR_getdents64 61 +#define __NR_lseek 62 +#define __NR_read 63 +#define __NR_write 64 +#define __NR_readv 65 +#define __NR_writev 66 +#define __NR_pread64 67 +#define __NR_pwrite64 68 +#define __NR_preadv 69 +#define __NR_pwritev 70 +#define __NR_sendfile 71 +#define __NR_pselect6 72 +#define __NR_ppoll 73 +#define __NR_signalfd4 74 +#define __NR_vmsplice 75 +#define __NR_splice 76 +#define __NR_tee 77 +#define __NR_readlinkat 78 +#define __NR_fstatat 79 +#define __NR_fstat 80 +#define __NR_sync 81 +#define __NR_fsync 82 +#define __NR_fdatasync 83 +#define __NR_sync_file_range 84 +#define __NR_timerfd_create 85 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_gettime 87 +#define __NR_utimensat 88 +#define __NR_acct 89 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_personality 92 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_waitid 95 +#define __NR_set_tid_address 96 +#define __NR_unshare 97 +#define __NR_futex 98 +#define __NR_set_robust_list 99 +#define __NR_get_robust_list 100 +#define __NR_nanosleep 101 +#define __NR_getitimer 102 +#define __NR_setitimer 103 +#define __NR_kexec_load 104 +#define __NR_init_module 105 +#define __NR_delete_module 106 +#define __NR_timer_create 107 +#define __NR_timer_gettime 108 +#define __NR_timer_getoverrun 109 +#define __NR_timer_settime 110 +#define __NR_timer_delete 111 +#define __NR_clock_settime 112 +#define __NR_clock_gettime 113 +#define __NR_clock_getres 114 +#define __NR_clock_nanosleep 115 +#define __NR_syslog 116 +#define __NR_ptrace 117 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_getscheduler 120 +#define __NR_sched_getparam 121 +#define __NR_sched_setaffinity 122 +#define __NR_sched_getaffinity 123 +#define __NR_sched_yield 124 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_rr_get_interval 127 +#define __NR_restart_syscall 128 +#define __NR_kill 129 +#define __NR_tkill 130 +#define __NR_tgkill 131 +#define __NR_sigaltstack 132 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_setpriority 140 +#define __NR_getpriority 141 +#define __NR_reboot 142 +#define __NR_setregid 143 +#define __NR_setgid 144 +#define __NR_setreuid 145 +#define __NR_setuid 146 +#define __NR_setresuid 147 +#define __NR_getresuid 148 +#define __NR_setresgid 149 +#define __NR_getresgid 150 +#define __NR_setfsuid 151 +#define __NR_setfsgid 152 +#define __NR_times 153 +#define __NR_setpgid 154 +#define __NR_getpgid 155 +#define __NR_getsid 156 +#define __NR_setsid 157 +#define __NR_getgroups 158 +#define __NR_setgroups 159 +#define __NR_uname 160 +#define __NR_sethostname 161 +#define __NR_setdomainname 162 +#define __NR_getrlimit 163 +#define __NR_setrlimit 164 +#define __NR_getrusage 165 +#define __NR_umask 166 +#define __NR_prctl 167 +#define __NR_getcpu 168 +#define __NR_gettimeofday 169 +#define __NR_settimeofday 170 +#define __NR_adjtimex 171 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getuid 174 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getegid 177 +#define __NR_gettid 178 +#define __NR_sysinfo 179 +#define __NR_mq_open 180 +#define __NR_mq_unlink 181 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedreceive 183 +#define __NR_mq_notify 184 +#define __NR_mq_getsetattr 185 +#define __NR_msgget 186 +#define __NR_msgctl 187 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_semget 190 +#define __NR_semctl 191 +#define __NR_semtimedop 192 +#define __NR_semop 193 +#define __NR_shmget 194 +#define __NR_shmctl 195 +#define __NR_shmat 196 +#define __NR_shmdt 197 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_bind 200 +#define __NR_listen 201 +#define __NR_accept 202 +#define __NR_connect 203 +#define __NR_getsockname 204 +#define __NR_getpeername 205 +#define __NR_sendto 206 +#define __NR_recvfrom 207 +#define __NR_setsockopt 208 +#define __NR_getsockopt 209 +#define __NR_shutdown 210 +#define __NR_sendmsg 211 +#define __NR_recvmsg 212 +#define __NR_readahead 213 +#define __NR_brk 214 +#define __NR_munmap 215 +#define __NR_mremap 216 +#define __NR_add_key 217 +#define __NR_request_key 218 +#define __NR_keyctl 219 +#define __NR_clone 220 +#define __NR_execve 221 +#define __NR_mmap 222 +#define __NR_fadvise64 223 +#define __NR_swapon 224 +#define __NR_swapoff 225 +#define __NR_mprotect 226 +#define __NR_msync 227 +#define __NR_mlock 228 +#define __NR_munlock 229 +#define __NR_mlockall 230 +#define __NR_munlockall 231 +#define __NR_mincore 232 +#define __NR_madvise 233 +#define __NR_remap_file_pages 234 +#define __NR_mbind 235 +#define __NR_get_mempolicy 236 +#define __NR_set_mempolicy 237 +#define __NR_migrate_pages 238 +#define __NR_move_pages 239 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_perf_event_open 241 +#define __NR_accept4 242 +#define __NR_recvmmsg 243 +#define __NR_or1k_atomic 244 +#define __NR_wait4 260 +#define __NR_prlimit64 261 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_name_to_handle_at 264 +#define __NR_open_by_handle_at 265 +#define __NR_clock_adjtime 266 +#define __NR_syncfs 267 +#define __NR_setns 268 +#define __NR_sendmmsg 269 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_kcmp 272 +#define __NR_finit_module 273 +#define __NR_sched_setattr 274 +#define __NR_sched_getattr 275 +#define __NR_renameat2 276 +#define __NR_seccomp 277 +#define __NR_getrandom 278 +#define __NR_memfd_create 279 +#define __NR_bpf 280 +#define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 +#define __NR_mlock2 284 +#define __NR_copy_file_range 285 + diff --git a/arch/arm/bits/syscall.h b/arch/arm/bits/syscall.h.in similarity index 51% rename from arch/arm/bits/syscall.h rename to arch/arm/bits/syscall.h.in index be30be70..143b0a8d 100644 --- a/arch/arm/bits/syscall.h +++ b/arch/arm/bits/syscall.h.in @@ -352,352 +352,3 @@ #define __ARM_NR_usr32 0x0f0004 #define __ARM_NR_set_tls 0x0f0005 -/* Repeated with SYS_ prefix */ - -#define SYS_restart_syscall 0 -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execve 11 -#define SYS_chdir 12 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_lchown 16 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_mount 21 -#define SYS_setuid 23 -#define SYS_getuid 24 -#define SYS_ptrace 26 -#define SYS_pause 29 -#define SYS_access 33 -#define SYS_nice 34 -#define SYS_sync 36 -#define SYS_kill 37 -#define SYS_rename 38 -#define SYS_mkdir 39 -#define SYS_rmdir 40 -#define SYS_dup 41 -#define SYS_pipe 42 -#define SYS_times 43 -#define SYS_brk 45 -#define SYS_setgid 46 -#define SYS_getgid 47 -#define SYS_geteuid 49 -#define SYS_getegid 50 -#define SYS_acct 51 -#define SYS_umount2 52 -#define SYS_ioctl 54 -#define SYS_fcntl 55 -#define SYS_setpgid 57 -#define SYS_umask 60 -#define SYS_chroot 61 -#define SYS_ustat 62 -#define SYS_dup2 63 -#define SYS_getppid 64 -#define SYS_getpgrp 65 -#define SYS_setsid 66 -#define SYS_sigaction 67 -#define SYS_setreuid 70 -#define SYS_setregid 71 -#define SYS_sigsuspend 72 -#define SYS_sigpending 73 -#define SYS_sethostname 74 -#define SYS_setrlimit 75 -#define SYS_getrusage 77 -#define SYS_gettimeofday 78 -#define SYS_settimeofday 79 -#define SYS_getgroups 80 -#define SYS_setgroups 81 -#define SYS_symlink 83 -#define SYS_readlink 85 -#define SYS_uselib 86 -#define SYS_swapon 87 -#define SYS_reboot 88 -#define SYS_munmap 91 -#define SYS_truncate 92 -#define SYS_ftruncate 93 -#define SYS_fchmod 94 -#define SYS_fchown 95 -#define SYS_getpriority 96 -#define SYS_setpriority 97 -#define SYS_statfs 99 -#define SYS_fstatfs 100 -#define SYS_syslog 103 -#define SYS_setitimer 104 -#define SYS_getitimer 105 -#define SYS_stat 106 -#define SYS_lstat 107 -#define SYS_fstat 108 -#define SYS_vhangup 111 -#define SYS_wait4 114 -#define SYS_swapoff 115 -#define SYS_sysinfo 116 -#define SYS_fsync 118 -#define SYS_sigreturn 119 -#define SYS_clone 120 -#define SYS_setdomainname 121 -#define SYS_uname 122 -#define SYS_adjtimex 124 -#define SYS_mprotect 125 -#define SYS_sigprocmask 126 -#define SYS_init_module 128 -#define SYS_delete_module 129 -#define SYS_quotactl 131 -#define SYS_getpgid 132 -#define SYS_fchdir 133 -#define SYS_bdflush 134 -#define SYS_sysfs 135 -#define SYS_personality 136 -#define SYS_setfsuid 138 -#define SYS_setfsgid 139 -#define SYS__llseek 140 -#define SYS_getdents 141 -#define SYS__newselect 142 -#define SYS_flock 143 -#define SYS_msync 144 -#define SYS_readv 145 -#define SYS_writev 146 -#define SYS_getsid 147 -#define SYS_fdatasync 148 -#define SYS__sysctl 149 -#define SYS_mlock 150 -#define SYS_munlock 151 -#define SYS_mlockall 152 -#define SYS_munlockall 153 -#define SYS_sched_setparam 154 -#define SYS_sched_getparam 155 -#define SYS_sched_setscheduler 156 -#define SYS_sched_getscheduler 157 -#define SYS_sched_yield 158 -#define SYS_sched_get_priority_max 159 -#define SYS_sched_get_priority_min 160 -#define SYS_sched_rr_get_interval 161 -#define SYS_nanosleep 162 -#define SYS_mremap 163 -#define SYS_setresuid 164 -#define SYS_getresuid 165 -#define SYS_poll 168 -#define SYS_nfsservctl 169 -#define SYS_setresgid 170 -#define SYS_getresgid 171 -#define SYS_prctl 172 -#define SYS_rt_sigreturn 173 -#define SYS_rt_sigaction 174 -#define SYS_rt_sigprocmask 175 -#define SYS_rt_sigpending 176 -#define SYS_rt_sigtimedwait 177 -#define SYS_rt_sigqueueinfo 178 -#define SYS_rt_sigsuspend 179 -#define SYS_pread64 180 -#define SYS_pwrite64 181 -#define SYS_chown 182 -#define SYS_getcwd 183 -#define SYS_capget 184 -#define SYS_capset 185 -#define SYS_sigaltstack 186 -#define SYS_sendfile 187 -#define SYS_vfork 190 -#define SYS_ugetrlimit 191 -#define SYS_mmap2 192 -#define SYS_truncate64 193 -#define SYS_ftruncate64 194 -#define SYS_stat64 195 -#define SYS_lstat64 196 -#define SYS_fstat64 197 -#define SYS_lchown32 198 -#define SYS_getuid32 199 -#define SYS_getgid32 200 -#define SYS_geteuid32 201 -#define SYS_getegid32 202 -#define SYS_setreuid32 203 -#define SYS_setregid32 204 -#define SYS_getgroups32 205 -#define SYS_setgroups32 206 -#define SYS_fchown32 207 -#define SYS_setresuid32 208 -#define SYS_getresuid32 209 -#define SYS_setresgid32 210 -#define SYS_getresgid32 211 -#define SYS_chown32 212 -#define SYS_setuid32 213 -#define SYS_setgid32 214 -#define SYS_setfsuid32 215 -#define SYS_setfsgid32 216 -#define SYS_getdents64 217 -#define SYS_pivot_root 218 -#define SYS_mincore 219 -#define SYS_madvise 220 -#define SYS_fcntl64 221 -#define SYS_gettid 224 -#define SYS_readahead 225 -#define SYS_setxattr 226 -#define SYS_lsetxattr 227 -#define SYS_fsetxattr 228 -#define SYS_getxattr 229 -#define SYS_lgetxattr 230 -#define SYS_fgetxattr 231 -#define SYS_listxattr 232 -#define SYS_llistxattr 233 -#define SYS_flistxattr 234 -#define SYS_removexattr 235 -#define SYS_lremovexattr 236 -#define SYS_fremovexattr 237 -#define SYS_tkill 238 -#define SYS_sendfile64 239 -#define SYS_futex 240 -#define SYS_sched_setaffinity 241 -#define SYS_sched_getaffinity 242 -#define SYS_io_setup 243 -#define SYS_io_destroy 244 -#define SYS_io_getevents 245 -#define SYS_io_submit 246 -#define SYS_io_cancel 247 -#define SYS_exit_group 248 -#define SYS_lookup_dcookie 249 -#define SYS_epoll_create 250 -#define SYS_epoll_ctl 251 -#define SYS_epoll_wait 252 -#define SYS_remap_file_pages 253 -#define SYS_set_tid_address 256 -#define SYS_timer_create 257 -#define SYS_timer_settime 258 -#define SYS_timer_gettime 259 -#define SYS_timer_getoverrun 260 -#define SYS_timer_delete 261 -#define SYS_clock_settime 262 -#define SYS_clock_gettime 263 -#define SYS_clock_getres 264 -#define SYS_clock_nanosleep 265 -#define SYS_statfs64 266 -#define SYS_fstatfs64 267 -#define SYS_tgkill 268 -#define SYS_utimes 269 -#define SYS_fadvise64_64 270 -#define SYS_pciconfig_iobase 271 -#define SYS_pciconfig_read 272 -#define SYS_pciconfig_write 273 -#define SYS_mq_open 274 -#define SYS_mq_unlink 275 -#define SYS_mq_timedsend 276 -#define SYS_mq_timedreceive 277 -#define SYS_mq_notify 278 -#define SYS_mq_getsetattr 279 -#define SYS_waitid 280 -#define SYS_socket 281 -#define SYS_bind 282 -#define SYS_connect 283 -#define SYS_listen 284 -#define SYS_accept 285 -#define SYS_getsockname 286 -#define SYS_getpeername 287 -#define SYS_socketpair 288 -#define SYS_send 289 -#define SYS_sendto 290 -#define SYS_recv 291 -#define SYS_recvfrom 292 -#define SYS_shutdown 293 -#define SYS_setsockopt 294 -#define SYS_getsockopt 295 -#define SYS_sendmsg 296 -#define SYS_recvmsg 297 -#define SYS_semop 298 -#define SYS_semget 299 -#define SYS_semctl 300 -#define SYS_msgsnd 301 -#define SYS_msgrcv 302 -#define SYS_msgget 303 -#define SYS_msgctl 304 -#define SYS_shmat 305 -#define SYS_shmdt 306 -#define SYS_shmget 307 -#define SYS_shmctl 308 -#define SYS_add_key 309 -#define SYS_request_key 310 -#define SYS_keyctl 311 -#define SYS_semtimedop 312 -#define SYS_vserver 313 -#define SYS_ioprio_set 314 -#define SYS_ioprio_get 315 -#define SYS_inotify_init 316 -#define SYS_inotify_add_watch 317 -#define SYS_inotify_rm_watch 318 -#define SYS_mbind 319 -#define SYS_get_mempolicy 320 -#define SYS_set_mempolicy 321 -#define SYS_openat 322 -#define SYS_mkdirat 323 -#define SYS_mknodat 324 -#define SYS_fchownat 325 -#define SYS_futimesat 326 -#define SYS_fstatat64 327 -#define SYS_unlinkat 328 -#define SYS_renameat 329 -#define SYS_linkat 330 -#define SYS_symlinkat 331 -#define SYS_readlinkat 332 -#define SYS_fchmodat 333 -#define SYS_faccessat 334 -#define SYS_pselect6 335 -#define SYS_ppoll 336 -#define SYS_unshare 337 -#define SYS_set_robust_list 338 -#define SYS_get_robust_list 339 -#define SYS_splice 340 -#define SYS_sync_file_range2 341 -#define SYS_tee 342 -#define SYS_vmsplice 343 -#define SYS_move_pages 344 -#define SYS_getcpu 345 -#define SYS_epoll_pwait 346 -#define SYS_kexec_load 347 -#define SYS_utimensat 348 -#define SYS_signalfd 349 -#define SYS_timerfd_create 350 -#define SYS_eventfd 351 -#define SYS_fallocate 352 -#define SYS_timerfd_settime 353 -#define SYS_timerfd_gettime 354 -#define SYS_signalfd4 355 -#define SYS_eventfd2 356 -#define SYS_epoll_create1 357 -#define SYS_dup3 358 -#define SYS_pipe2 359 -#define SYS_inotify_init1 360 -#define SYS_preadv 361 -#define SYS_pwritev 362 -#define SYS_rt_tgsigqueueinfo 363 -#define SYS_perf_event_open 364 -#define SYS_recvmmsg 365 -#define SYS_accept4 366 -#define SYS_fanotify_init 367 -#define SYS_fanotify_mark 368 -#define SYS_prlimit64 369 -#define SYS_name_to_handle_at 370 -#define SYS_open_by_handle_at 371 -#define SYS_clock_adjtime 372 -#define SYS_syncfs 373 -#define SYS_sendmmsg 374 -#define SYS_setns 375 -#define SYS_process_vm_readv 376 -#define SYS_process_vm_writev 377 -#define SYS_kcmp 378 -#define SYS_finit_module 379 -#define SYS_sched_setattr 380 -#define SYS_sched_getattr 381 -#define SYS_renameat2 382 -#define SYS_seccomp 383 -#define SYS_getrandom 384 -#define SYS_memfd_create 385 -#define SYS_bpf 386 -#define SYS_execveat 387 -#define SYS_userfaultfd 388 -#define SYS_membarrier 389 -#define SYS_mlock2 390 -#define SYS_copy_file_range 391 diff --git a/arch/i386/bits/syscall.h b/arch/i386/bits/syscall.h.in similarity index 50% rename from arch/i386/bits/syscall.h rename to arch/i386/bits/syscall.h.in index 25cd50ab..108fbbce 100644 --- a/arch/i386/bits/syscall.h +++ b/arch/i386/bits/syscall.h.in @@ -377,384 +377,3 @@ #define __NR_mlock2 376 #define __NR_copy_file_range 377 - -/* Repeated with SYS_ prefix */ - -#define SYS_restart_syscall 0 -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_waitpid 7 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execve 11 -#define SYS_chdir 12 -#define SYS_time 13 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_lchown 16 -#define SYS_break 17 -#define SYS_oldstat 18 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_mount 21 -#define SYS_umount 22 -#define SYS_setuid 23 -#define SYS_getuid 24 -#define SYS_stime 25 -#define SYS_ptrace 26 -#define SYS_alarm 27 -#define SYS_oldfstat 28 -#define SYS_pause 29 -#define SYS_utime 30 -#define SYS_stty 31 -#define SYS_gtty 32 -#define SYS_access 33 -#define SYS_nice 34 -#define SYS_ftime 35 -#define SYS_sync 36 -#define SYS_kill 37 -#define SYS_rename 38 -#define SYS_mkdir 39 -#define SYS_rmdir 40 -#define SYS_dup 41 -#define SYS_pipe 42 -#define SYS_times 43 -#define SYS_prof 44 -#define SYS_brk 45 -#define SYS_setgid 46 -#define SYS_getgid 47 -#define SYS_signal 48 -#define SYS_geteuid 49 -#define SYS_getegid 50 -#define SYS_acct 51 -#define SYS_umount2 52 -#define SYS_lock 53 -#define SYS_ioctl 54 -#define SYS_fcntl 55 -#define SYS_mpx 56 -#define SYS_setpgid 57 -#define SYS_ulimit 58 -#define SYS_oldolduname 59 -#define SYS_umask 60 -#define SYS_chroot 61 -#define SYS_ustat 62 -#define SYS_dup2 63 -#define SYS_getppid 64 -#define SYS_getpgrp 65 -#define SYS_setsid 66 -#define SYS_sigaction 67 -#define SYS_sgetmask 68 -#define SYS_ssetmask 69 -#define SYS_setreuid 70 -#define SYS_setregid 71 -#define SYS_sigsuspend 72 -#define SYS_sigpending 73 -#define SYS_sethostname 74 -#define SYS_setrlimit 75 -#define SYS_getrlimit 76 /* Back compatible 2Gig limited rlimit */ -#define SYS_getrusage 77 -#define SYS_gettimeofday 78 -#define SYS_settimeofday 79 -#define SYS_getgroups 80 -#define SYS_setgroups 81 -#define SYS_select 82 -#define SYS_symlink 83 -#define SYS_oldlstat 84 -#define SYS_readlink 85 -#define SYS_uselib 86 -#define SYS_swapon 87 -#define SYS_reboot 88 -#define SYS_readdir 89 -#define SYS_mmap 90 -#define SYS_munmap 91 -#define SYS_truncate 92 -#define SYS_ftruncate 93 -#define SYS_fchmod 94 -#define SYS_fchown 95 -#define SYS_getpriority 96 -#define SYS_setpriority 97 -#define SYS_profil 98 -#define SYS_statfs 99 -#define SYS_fstatfs 100 -#define SYS_ioperm 101 -#define SYS_socketcall 102 -#define SYS_syslog 103 -#define SYS_setitimer 104 -#define SYS_getitimer 105 -#define SYS_stat 106 -#define SYS_lstat 107 -#define SYS_fstat 108 -#define SYS_olduname 109 -#define SYS_iopl 110 -#define SYS_vhangup 111 -#define SYS_idle 112 -#define SYS_vm86old 113 -#define SYS_wait4 114 -#define SYS_swapoff 115 -#define SYS_sysinfo 116 -#define SYS_ipc 117 -#define SYS_fsync 118 -#define SYS_sigreturn 119 -#define SYS_clone 120 -#define SYS_setdomainname 121 -#define SYS_uname 122 -#define SYS_modify_ldt 123 -#define SYS_adjtimex 124 -#define SYS_mprotect 125 -#define SYS_sigprocmask 126 -#define SYS_create_module 127 -#define SYS_init_module 128 -#define SYS_delete_module 129 -#define SYS_get_kernel_syms 130 -#define SYS_quotactl 131 -#define SYS_getpgid 132 -#define SYS_fchdir 133 -#define SYS_bdflush 134 -#define SYS_sysfs 135 -#define SYS_personality 136 -#define SYS_afs_syscall 137 -#define SYS_setfsuid 138 -#define SYS_setfsgid 139 -#define SYS__llseek 140 -#define SYS_getdents 141 -#define SYS__newselect 142 -#define SYS_flock 143 -#define SYS_msync 144 -#define SYS_readv 145 -#define SYS_writev 146 -#define SYS_getsid 147 -#define SYS_fdatasync 148 -#define SYS__sysctl 149 -#define SYS_mlock 150 -#define SYS_munlock 151 -#define SYS_mlockall 152 -#define SYS_munlockall 153 -#define SYS_sched_setparam 154 -#define SYS_sched_getparam 155 -#define SYS_sched_setscheduler 156 -#define SYS_sched_getscheduler 157 -#define SYS_sched_yield 158 -#define SYS_sched_get_priority_max 159 -#define SYS_sched_get_priority_min 160 -#define SYS_sched_rr_get_interval 161 -#define SYS_nanosleep 162 -#define SYS_mremap 163 -#define SYS_setresuid 164 -#define SYS_getresuid 165 -#define SYS_vm86 166 -#define SYS_query_module 167 -#define SYS_poll 168 -#define SYS_nfsservctl 169 -#define SYS_setresgid 170 -#define SYS_getresgid 171 -#define SYS_prctl 172 -#define SYS_rt_sigreturn 173 -#define SYS_rt_sigaction 174 -#define SYS_rt_sigprocmask 175 -#define SYS_rt_sigpending 176 -#define SYS_rt_sigtimedwait 177 -#define SYS_rt_sigqueueinfo 178 -#define SYS_rt_sigsuspend 179 -#define SYS_pread64 180 -#define SYS_pwrite64 181 -#define SYS_chown 182 -#define SYS_getcwd 183 -#define SYS_capget 184 -#define SYS_capset 185 -#define SYS_sigaltstack 186 -#define SYS_sendfile 187 -#define SYS_getpmsg 188 -#define SYS_putpmsg 189 -#define SYS_vfork 190 -#define SYS_ugetrlimit 191 -#define SYS_mmap2 192 -#define SYS_truncate64 193 -#define SYS_ftruncate64 194 -#define SYS_stat64 195 -#define SYS_lstat64 196 -#define SYS_fstat64 197 -#define SYS_lchown32 198 -#define SYS_getuid32 199 -#define SYS_getgid32 200 -#define SYS_geteuid32 201 -#define SYS_getegid32 202 -#define SYS_setreuid32 203 -#define SYS_setregid32 204 -#define SYS_getgroups32 205 -#define SYS_setgroups32 206 -#define SYS_fchown32 207 -#define SYS_setresuid32 208 -#define SYS_getresuid32 209 -#define SYS_setresgid32 210 -#define SYS_getresgid32 211 -#define SYS_chown32 212 -#define SYS_setuid32 213 -#define SYS_setgid32 214 -#define SYS_setfsuid32 215 -#define SYS_setfsgid32 216 -#define SYS_pivot_root 217 -#define SYS_mincore 218 -#define SYS_madvise 219 -#define SYS_madvise1 219 -#define SYS_getdents64 220 -#define SYS_fcntl64 221 -/* 223 is unused */ -#define SYS_gettid 224 -#define SYS_readahead 225 -#define SYS_setxattr 226 -#define SYS_lsetxattr 227 -#define SYS_fsetxattr 228 -#define SYS_getxattr 229 -#define SYS_lgetxattr 230 -#define SYS_fgetxattr 231 -#define SYS_listxattr 232 -#define SYS_llistxattr 233 -#define SYS_flistxattr 234 -#define SYS_removexattr 235 -#define SYS_lremovexattr 236 -#define SYS_fremovexattr 237 -#define SYS_tkill 238 -#define SYS_sendfile64 239 -#define SYS_futex 240 -#define SYS_sched_setaffinity 241 -#define SYS_sched_getaffinity 242 -#define SYS_set_thread_area 243 -#define SYS_get_thread_area 244 -#define SYS_io_setup 245 -#define SYS_io_destroy 246 -#define SYS_io_getevents 247 -#define SYS_io_submit 248 -#define SYS_io_cancel 249 -#define SYS_fadvise64 250 -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ -#define SYS_exit_group 252 -#define SYS_lookup_dcookie 253 -#define SYS_epoll_create 254 -#define SYS_epoll_ctl 255 -#define SYS_epoll_wait 256 -#define SYS_remap_file_pages 257 -#define SYS_set_tid_address 258 -#define SYS_timer_create 259 -#define SYS_timer_settime (SYS_timer_create+1) -#define SYS_timer_gettime (SYS_timer_create+2) -#define SYS_timer_getoverrun (SYS_timer_create+3) -#define SYS_timer_delete (SYS_timer_create+4) -#define SYS_clock_settime (SYS_timer_create+5) -#define SYS_clock_gettime (SYS_timer_create+6) -#define SYS_clock_getres (SYS_timer_create+7) -#define SYS_clock_nanosleep (SYS_timer_create+8) -#define SYS_statfs64 268 -#define SYS_fstatfs64 269 -#define SYS_tgkill 270 -#define SYS_utimes 271 -#define SYS_fadvise64_64 272 -#define SYS_vserver 273 -#define SYS_mbind 274 -#define SYS_get_mempolicy 275 -#define SYS_set_mempolicy 276 -#define SYS_mq_open 277 -#define SYS_mq_unlink (SYS_mq_open+1) -#define SYS_mq_timedsend (SYS_mq_open+2) -#define SYS_mq_timedreceive (SYS_mq_open+3) -#define SYS_mq_notify (SYS_mq_open+4) -#define SYS_mq_getsetattr (SYS_mq_open+5) -#define SYS_kexec_load 283 -#define SYS_waitid 284 -/* #define SYS_sys_setaltroot 285 */ -#define SYS_add_key 286 -#define SYS_request_key 287 -#define SYS_keyctl 288 -#define SYS_ioprio_set 289 -#define SYS_ioprio_get 290 -#define SYS_inotify_init 291 -#define SYS_inotify_add_watch 292 -#define SYS_inotify_rm_watch 293 -#define SYS_migrate_pages 294 -#define SYS_openat 295 -#define SYS_mkdirat 296 -#define SYS_mknodat 297 -#define SYS_fchownat 298 -#define SYS_futimesat 299 -#define SYS_fstatat64 300 -#define SYS_unlinkat 301 -#define SYS_renameat 302 -#define SYS_linkat 303 -#define SYS_symlinkat 304 -#define SYS_readlinkat 305 -#define SYS_fchmodat 306 -#define SYS_faccessat 307 -#define SYS_pselect6 308 -#define SYS_ppoll 309 -#define SYS_unshare 310 -#define SYS_set_robust_list 311 -#define SYS_get_robust_list 312 -#define SYS_splice 313 -#define SYS_sync_file_range 314 -#define SYS_tee 315 -#define SYS_vmsplice 316 -#define SYS_move_pages 317 -#define SYS_getcpu 318 -#define SYS_epoll_pwait 319 -#define SYS_utimensat 320 -#define SYS_signalfd 321 -#define SYS_timerfd_create 322 -#define SYS_eventfd 323 -#define SYS_fallocate 324 -#define SYS_timerfd_settime 325 -#define SYS_timerfd_gettime 326 -#define SYS_signalfd4 327 -#define SYS_eventfd2 328 -#define SYS_epoll_create1 329 -#define SYS_dup3 330 -#define SYS_pipe2 331 -#define SYS_inotify_init1 332 -#define SYS_preadv 333 -#define SYS_pwritev 334 -#define SYS_rt_tgsigqueueinfo 335 -#define SYS_perf_event_open 336 -#define SYS_recvmmsg 337 -#define SYS_fanotify_init 338 -#define SYS_fanotify_mark 339 -#define SYS_prlimit64 340 -#define SYS_name_to_handle_at 341 -#define SYS_open_by_handle_at 342 -#define SYS_clock_adjtime 343 -#define SYS_syncfs 344 -#define SYS_sendmmsg 345 -#define SYS_setns 346 -#define SYS_process_vm_readv 347 -#define SYS_process_vm_writev 348 -#define SYS_kcmp 349 -#define SYS_finit_module 350 -#define SYS_sched_setattr 351 -#define SYS_sched_getattr 352 -#define SYS_renameat2 353 -#define SYS_seccomp 354 -#define SYS_getrandom 355 -#define SYS_memfd_create 356 -#define SYS_bpf 357 -#define SYS_execveat 358 -#define SYS_socket 359 -#define SYS_socketpair 360 -#define SYS_bind 361 -#define SYS_connect 362 -#define SYS_listen 363 -#define SYS_accept4 364 -#define SYS_getsockopt 365 -#define SYS_setsockopt 366 -#define SYS_getsockname 367 -#define SYS_getpeername 368 -#define SYS_sendto 369 -#define SYS_sendmsg 370 -#define SYS_recvfrom 371 -#define SYS_recvmsg 372 -#define SYS_shutdown 373 -#define SYS_userfaultfd 374 -#define SYS_membarrier 375 -#define SYS_mlock2 376 -#define SYS_copy_file_range 377 diff --git a/arch/microblaze/bits/syscall.h b/arch/microblaze/bits/syscall.h.in similarity index 50% rename from arch/microblaze/bits/syscall.h rename to arch/microblaze/bits/syscall.h.in index e386d73c..0f67f1d9 100644 --- a/arch/microblaze/bits/syscall.h +++ b/arch/microblaze/bits/syscall.h.in @@ -384,391 +384,3 @@ #define __NR_bpf 387 #define __NR_execveat 388 -/* Repeated with SYS_ prefix */ - -#define SYS_SYSCALL_BASE 0 -#define SYS_restart_syscall 0 -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_waitpid 7 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execve 11 -#define SYS_chdir 12 -#define SYS_time 13 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_lchown 16 -#define SYS_break 17 -#define SYS_oldstat 18 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_mount 21 -#define SYS_umount 22 -#define SYS_setuid 23 -#define SYS_getuid 24 -#define SYS_stime 25 -#define SYS_ptrace 26 -#define SYS_alarm 27 -#define SYS_oldfstat 28 -#define SYS_pause 29 -#define SYS_utime 30 -#define SYS_stty 31 -#define SYS_gtty 32 -#define SYS_access 33 -#define SYS_nice 34 -#define SYS_ftime 35 -#define SYS_sync 36 -#define SYS_kill 37 -#define SYS_rename 38 -#define SYS_mkdir 39 -#define SYS_rmdir 40 -#define SYS_dup 41 -#define SYS_pipe 42 -#define SYS_times 43 -#define SYS_prof 44 -#define SYS_brk 45 -#define SYS_setgid 46 -#define SYS_getgid 47 -#define SYS_signal 48 -#define SYS_geteuid 49 -#define SYS_getegid 50 -#define SYS_acct 51 -#define SYS_umount2 52 -#define SYS_lock 53 -#define SYS_ioctl 54 -#define SYS_fcntl 55 -#define SYS_mpx 56 -#define SYS_setpgid 57 -#define SYS_ulimit 58 -#define SYS_oldolduname 59 -#define SYS_umask 60 -#define SYS_chroot 61 -#define SYS_ustat 62 -#define SYS_dup2 63 -#define SYS_getppid 64 -#define SYS_getpgrp 65 -#define SYS_setsid 66 -#define SYS_sigaction 67 -#define SYS_sgetmask 68 -#define SYS_ssetmask 69 -#define SYS_setreuid 70 -#define SYS_setregid 71 -#define SYS_sigsuspend 72 -#define SYS_sigpending 73 -#define SYS_sethostname 74 -#define SYS_setrlimit 75 -#define SYS_getrlimit 76 -#define SYS_getrusage 77 -#define SYS_gettimeofday 78 -#define SYS_settimeofday 79 -#define SYS_getgroups 80 -#define SYS_setgroups 81 -#define SYS_select 82 -#define SYS_symlink 83 -#define SYS_oldlstat 84 -#define SYS_readlink 85 -#define SYS_uselib 86 -#define SYS_swapon 87 -#define SYS_reboot 88 -#define SYS_readdir 89 -#define SYS_mmap 90 -#define SYS_munmap 91 -#define SYS_truncate 92 -#define SYS_ftruncate 93 -#define SYS_fchmod 94 -#define SYS_fchown 95 -#define SYS_getpriority 96 -#define SYS_setpriority 97 -#define SYS_profil 98 -#define SYS_statfs 99 -#define SYS_fstatfs 100 -#define SYS_ioperm 101 -#define SYS_socketcall 102 -#define SYS_syslog 103 -#define SYS_setitimer 104 -#define SYS_getitimer 105 -#define SYS_stat 106 -#define SYS_lstat 107 -#define SYS_fstat 108 -#define SYS_olduname 109 -#define SYS_iopl 110 -#define SYS_vhangup 111 -#define SYS_idle 112 -#define SYS_vm86old 113 -#define SYS_wait4 114 -#define SYS_swapoff 115 -#define SYS_sysinfo 116 -#define SYS_ipc 117 -#define SYS_fsync 118 -#define SYS_sigreturn 119 -#define SYS_clone 120 -#define SYS_setdomainname 121 -#define SYS_uname 122 -#define SYS_modify_ldt 123 -#define SYS_adjtimex 124 -#define SYS_mprotect 125 -#define SYS_sigprocmask 126 -#define SYS_create_module 127 -#define SYS_init_module 128 -#define SYS_delete_module 129 -#define SYS_get_kernel_syms 130 -#define SYS_quotactl 131 -#define SYS_getpgid 132 -#define SYS_fchdir 133 -#define SYS_bdflush 134 -#define SYS_sysfs 135 -#define SYS_personality 136 -#define SYS_afs_syscall 137 -#define SYS_setfsuid 138 -#define SYS_setfsgid 139 -#define SYS__llseek 140 -#define SYS_getdents 141 -#define SYS__newselect 142 -#define SYS_flock 143 -#define SYS_msync 144 -#define SYS_readv 145 -#define SYS_writev 146 -#define SYS_getsid 147 -#define SYS_fdatasync 148 -#define SYS__sysctl 149 -#define SYS_mlock 150 -#define SYS_munlock 151 -#define SYS_mlockall 152 -#define SYS_munlockall 153 -#define SYS_sched_setparam 154 -#define SYS_sched_getparam 155 -#define SYS_sched_setscheduler 156 -#define SYS_sched_getscheduler 157 -#define SYS_sched_yield 158 -#define SYS_sched_get_priority_max 159 -#define SYS_sched_get_priority_min 160 -#define SYS_sched_rr_get_interval 161 -#define SYS_nanosleep 162 -#define SYS_mremap 163 -#define SYS_setresuid 164 -#define SYS_getresuid 165 -#define SYS_vm86 166 -#define SYS_query_module 167 -#define SYS_poll 168 -#define SYS_nfsservctl 169 -#define SYS_setresgid 170 -#define SYS_getresgid 171 -#define SYS_prctl 172 -#define SYS_rt_sigreturn 173 -#define SYS_rt_sigaction 174 -#define SYS_rt_sigprocmask 175 -#define SYS_rt_sigpending 176 -#define SYS_rt_sigtimedwait 177 -#define SYS_rt_sigqueueinfo 178 -#define SYS_rt_sigsuspend 179 -#define SYS_pread 180 -#define SYS_pwrite 181 -#define SYS_chown 182 -#define SYS_getcwd 183 -#define SYS_capget 184 -#define SYS_capset 185 -#define SYS_sigaltstack 186 -#define SYS_sendfile 187 -#define SYS_getpmsg 188 -#define SYS_putpmsg 189 -#define SYS_vfork 190 -#define SYS_ugetrlimit 191 -#define SYS_mmap2 192 -#define SYS_truncate64 193 -#define SYS_ftruncate64 194 -#define SYS_stat64 195 -#define SYS_lstat64 196 -#define SYS_fstat64 197 -#define SYS_lchown32 198 -#define SYS_getuid32 199 -#define SYS_getgid32 200 -#define SYS_geteuid32 201 -#define SYS_getegid32 202 -#define SYS_setreuid32 203 -#define SYS_setregid32 204 -#define SYS_getgroups32 205 -#define SYS_setgroups32 206 -#define SYS_fchown32 207 -#define SYS_setresuid32 208 -#define SYS_getresuid32 209 -#define SYS_setresgid32 210 -#define SYS_getresgid32 211 -#define SYS_chown32 212 -#define SYS_setuid32 213 -#define SYS_setgid32 214 -#define SYS_setfsuid32 215 -#define SYS_setfsgid32 216 -#define SYS_pivot_root 217 -#define SYS_mincore 218 -#define SYS_madvise 219 -#define SYS_getdents64 220 -#define SYS_fcntl64 221 -#define SYS_gettid 224 -#define SYS_readahead 225 -#define SYS_setxattr 226 -#define SYS_lsetxattr 227 -#define SYS_fsetxattr 228 -#define SYS_getxattr 229 -#define SYS_lgetxattr 230 -#define SYS_fgetxattr 231 -#define SYS_listxattr 232 -#define SYS_llistxattr 233 -#define SYS_flistxattr 234 -#define SYS_removexattr 235 -#define SYS_lremovexattr 236 -#define SYS_fremovexattr 237 -#define SYS_tkill 238 -#define SYS_sendfile64 239 -#define SYS_futex 240 -#define SYS_sched_setaffinity 241 -#define SYS_sched_getaffinity 242 -#define SYS_set_thread_area 243 -#define SYS_get_thread_area 244 -#define SYS_io_setup 245 -#define SYS_io_destroy 246 -#define SYS_io_getevents 247 -#define SYS_io_submit 248 -#define SYS_io_cancel 249 -#define SYS_fadvise 250 -#define SYS_exit_group 252 -#define SYS_lookup_dcookie 253 -#define SYS_epoll_create 254 -#define SYS_epoll_ctl 255 -#define SYS_epoll_wait 256 -#define SYS_remap_file_pages 257 -#define SYS_set_tid_address 258 -#define SYS_timer_create 259 -#define SYS_timer_settime 260 -#define SYS_timer_gettime 261 -#define SYS_timer_getoverrun 262 -#define SYS_timer_delete 263 -#define SYS_clock_settime 264 -#define SYS_clock_gettime 265 -#define SYS_clock_getres 266 -#define SYS_clock_nanosleep 267 -#define SYS_statfs64 268 -#define SYS_fstatfs64 269 -#define SYS_tgkill 270 -#define SYS_utimes 271 -#define SYS_fadvise64_64 272 -#define SYS_vserver 273 -#define SYS_mbind 274 -#define SYS_get_mempolicy 275 -#define SYS_set_mempolicy 276 -#define SYS_mq_open 277 -#define SYS_mq_unlink 278 -#define SYS_mq_timedsend 279 -#define SYS_mq_timedreceive 280 -#define SYS_mq_notify 281 -#define SYS_mq_getsetattr 282 -#define SYS_kexec_load 283 -#define SYS_waitid 284 -#define SYS_add_key 286 -#define SYS_request_key 287 -#define SYS_keyctl 288 -#define SYS_ioprio_set 289 -#define SYS_ioprio_get 290 -#define SYS_inotify_init 291 -#define SYS_inotify_add_watch 292 -#define SYS_inotify_rm_watch 293 -#define SYS_migrate_pages 294 -#define SYS_openat 295 -#define SYS_mkdirat 296 -#define SYS_mknodat 297 -#define SYS_fchownat 298 -#define SYS_futimesat 299 -#define SYS_fstatat 300 -#define SYS_unlinkat 301 -#define SYS_renameat 302 -#define SYS_linkat 303 -#define SYS_symlinkat 304 -#define SYS_readlinkat 305 -#define SYS_fchmodat 306 -#define SYS_faccessat 307 -#define SYS_pselect6 308 -#define SYS_ppoll 309 -#define SYS_unshare 310 -#define SYS_set_robust_list 311 -#define SYS_get_robust_list 312 -#define SYS_splice 313 -#define SYS_sync_file_range 314 -#define SYS_tee 315 -#define SYS_vmsplice 316 -#define SYS_move_pages 317 -#define SYS_getcpu 318 -#define SYS_epoll_pwait 319 -#define SYS_utimensat 320 -#define SYS_signalfd 321 -#define SYS_timerfd_create 322 -#define SYS_eventfd 323 -#define SYS_fallocate 324 -#define SYS_semtimedop 325 -#define SYS_timerfd_settime 326 -#define SYS_timerfd_gettime 327 -#define SYS_semctl 328 -#define SYS_semget 329 -#define SYS_semop 330 -#define SYS_msgctl 331 -#define SYS_msgget 332 -#define SYS_msgrcv 333 -#define SYS_msgsnd 334 -#define SYS_shmat 335 -#define SYS_shmctl 336 -#define SYS_shmdt 337 -#define SYS_shmget 338 -#define SYS_signalfd4 339 -#define SYS_eventfd2 340 -#define SYS_epoll_create1 341 -#define SYS_dup3 342 -#define SYS_pipe2 343 -#define SYS_inotify_init1 344 -#define SYS_socket 345 -#define SYS_socketpair 346 -#define SYS_bind 347 -#define SYS_listen 348 -#define SYS_accept 349 -#define SYS_connect 350 -#define SYS_getsockname 351 -#define SYS_getpeername 352 -#define SYS_sendto 353 -#define SYS_send 354 -#define SYS_recvfrom 355 -#define SYS_recv 356 -#define SYS_setsockopt 357 -#define SYS_getsockopt 358 -#define SYS_shutdown 359 -#define SYS_sendmsg 360 -#define SYS_recvmsg 361 -#define SYS_accept4 362 -#define SYS_preadv 363 -#define SYS_pwritev 364 -#define SYS_rt_tgsigqueueinfo 365 -#define SYS_perf_event_open 366 -#define SYS_recvmmsg 367 -#define SYS_fanotify_init 368 -#define SYS_fanotify_mark 369 -#define SYS_prlimit64 370 -#define SYS_name_to_handle_at 371 -#define SYS_open_by_handle_at 372 -#define SYS_clock_adjtime 373 -#define SYS_syncfs 374 -#define SYS_setns 375 -#define SYS_sendmmsg 376 -#define SYS_process_vm_readv 377 -#define SYS_process_vm_writev 378 -#define SYS_kcmp 379 -#define SYS_finit_module 380 -#define SYS_sched_setattr 381 -#define SYS_sched_getattr 382 -#define SYS_renameat2 383 -#define SYS_seccomp 384 -#define SYS_getrandom 385 -#define SYS_memfd_create 386 -#define SYS_bpf 387 -#define SYS_execveat 388 diff --git a/arch/mips/bits/syscall.h b/arch/mips/bits/syscall.h.in similarity index 50% rename from arch/mips/bits/syscall.h rename to arch/mips/bits/syscall.h.in index 40ca6ba1..61ff7a58 100644 --- a/arch/mips/bits/syscall.h +++ b/arch/mips/bits/syscall.h.in @@ -359,365 +359,3 @@ #define __NR_mlock2 4359 #define __NR_copy_file_range 4360 - -/* Repeated with SYS_ prefix */ -#define SYS_syscall 4000 -#define SYS_exit 4001 -#define SYS_fork 4002 -#define SYS_read 4003 -#define SYS_write 4004 -#define SYS_open 4005 -#define SYS_close 4006 -#define SYS_waitpid 4007 -#define SYS_creat 4008 -#define SYS_link 4009 -#define SYS_unlink 4010 -#define SYS_execve 4011 -#define SYS_chdir 4012 -#define SYS_time 4013 -#define SYS_mknod 4014 -#define SYS_chmod 4015 -#define SYS_lchown 4016 -#define SYS_break 4017 -#define SYS_unused18 4018 -#define SYS_lseek 4019 -#define SYS_getpid 4020 -#define SYS_mount 4021 -#define SYS_umount 4022 -#define SYS_setuid 4023 -#define SYS_getuid 4024 -#define SYS_stime 4025 -#define SYS_ptrace 4026 -#define SYS_alarm 4027 -#define SYS_unused28 4028 -#define SYS_pause 4029 -#define SYS_utime 4030 -#define SYS_stty 4031 -#define SYS_gtty 4032 -#define SYS_access 4033 -#define SYS_nice 4034 -#define SYS_ftime 4035 -#define SYS_sync 4036 -#define SYS_kill 4037 -#define SYS_rename 4038 -#define SYS_mkdir 4039 -#define SYS_rmdir 4040 -#define SYS_dup 4041 -#define SYS_pipe 4042 -#define SYS_times 4043 -#define SYS_prof 4044 -#define SYS_brk 4045 -#define SYS_setgid 4046 -#define SYS_getgid 4047 -#define SYS_signal 4048 -#define SYS_geteuid 4049 -#define SYS_getegid 4050 -#define SYS_acct 4051 -#define SYS_umount2 4052 -#define SYS_lock 4053 -#define SYS_ioctl 4054 -#define SYS_fcntl 4055 -#define SYS_mpx 4056 -#define SYS_setpgid 4057 -#define SYS_ulimit 4058 -#define SYS_unused59 4059 -#define SYS_umask 4060 -#define SYS_chroot 4061 -#define SYS_ustat 4062 -#define SYS_dup2 4063 -#define SYS_getppid 4064 -#define SYS_getpgrp 4065 -#define SYS_setsid 4066 -#define SYS_sigaction 4067 -#define SYS_sgetmask 4068 -#define SYS_ssetmask 4069 -#define SYS_setreuid 4070 -#define SYS_setregid 4071 -#define SYS_sigsuspend 4072 -#define SYS_sigpending 4073 -#define SYS_sethostname 4074 -#define SYS_setrlimit 4075 -#define SYS_getrlimit 4076 -#define SYS_getrusage 4077 -#define SYS_gettimeofday 4078 -#define SYS_settimeofday 4079 -#define SYS_getgroups 4080 -#define SYS_setgroups 4081 -#define SYS_reserved82 4082 -#define SYS_symlink 4083 -#define SYS_unused84 4084 -#define SYS_readlink 4085 -#define SYS_uselib 4086 -#define SYS_swapon 4087 -#define SYS_reboot 4088 -#define SYS_readdir 4089 -#define SYS_mmap 4090 -#define SYS_munmap 4091 -#define SYS_truncate 4092 -#define SYS_ftruncate 4093 -#define SYS_fchmod 4094 -#define SYS_fchown 4095 -#define SYS_getpriority 4096 -#define SYS_setpriority 4097 -#define SYS_profil 4098 -#define SYS_statfs 4099 -#define SYS_fstatfs 4100 -#define SYS_ioperm 4101 -#define SYS_socketcall 4102 -#define SYS_syslog 4103 -#define SYS_setitimer 4104 -#define SYS_getitimer 4105 -#define SYS_stat 4106 -#define SYS_lstat 4107 -#define SYS_fstat 4108 -#define SYS_unused109 4109 -#define SYS_iopl 4110 -#define SYS_vhangup 4111 -#define SYS_idle 4112 -#define SYS_vm86 4113 -#define SYS_wait4 4114 -#define SYS_swapoff 4115 -#define SYS_sysinfo 4116 -#define SYS_ipc 4117 -#define SYS_fsync 4118 -#define SYS_sigreturn 4119 -#define SYS_clone 4120 -#define SYS_setdomainname 4121 -#define SYS_uname 4122 -#define SYS_modify_ldt 4123 -#define SYS_adjtimex 4124 -#define SYS_mprotect 4125 -#define SYS_sigprocmask 4126 -#define SYS_create_module 4127 -#define SYS_init_module 4128 -#define SYS_delete_module 4129 -#define SYS_get_kernel_syms 4130 -#define SYS_quotactl 4131 -#define SYS_getpgid 4132 -#define SYS_fchdir 4133 -#define SYS_bdflush 4134 -#define SYS_sysfs 4135 -#define SYS_personality 4136 -#define SYS_afs_syscall 4137 -#define SYS_setfsuid 4138 -#define SYS_setfsgid 4139 -#define SYS__llseek 4140 -#define SYS_getdents 4141 -#define SYS_select 4142 -#define SYS_flock 4143 -#define SYS_msync 4144 -#define SYS_readv 4145 -#define SYS_writev 4146 -#define SYS_cacheflush 4147 -#define SYS_cachectl 4148 -#define SYS_sysmips 4149 -#define SYS_unused150 4150 -#define SYS_getsid 4151 -#define SYS_fdatasync 4152 -#define SYS__sysctl 4153 -#define SYS_mlock 4154 -#define SYS_munlock 4155 -#define SYS_mlockall 4156 -#define SYS_munlockall 4157 -#define SYS_sched_setparam 4158 -#define SYS_sched_getparam 4159 -#define SYS_sched_setscheduler 4160 -#define SYS_sched_getscheduler 4161 -#define SYS_sched_yield 4162 -#define SYS_sched_get_priority_max 4163 -#define SYS_sched_get_priority_min 4164 -#define SYS_sched_rr_get_interval 4165 -#define SYS_nanosleep 4166 -#define SYS_mremap 4167 -#define SYS_accept 4168 -#define SYS_bind 4169 -#define SYS_connect 4170 -#define SYS_getpeername 4171 -#define SYS_getsockname 4172 -#define SYS_getsockopt 4173 -#define SYS_listen 4174 -#define SYS_recv 4175 -#define SYS_recvfrom 4176 -#define SYS_recvmsg 4177 -#define SYS_send 4178 -#define SYS_sendmsg 4179 -#define SYS_sendto 4180 -#define SYS_setsockopt 4181 -#define SYS_shutdown 4182 -#define SYS_socket 4183 -#define SYS_socketpair 4184 -#define SYS_setresuid 4185 -#define SYS_getresuid 4186 -#define SYS_query_module 4187 -#define SYS_poll 4188 -#define SYS_nfsservctl 4189 -#define SYS_setresgid 4190 -#define SYS_getresgid 4191 -#define SYS_prctl 4192 -#define SYS_rt_sigreturn 4193 -#define SYS_rt_sigaction 4194 -#define SYS_rt_sigprocmask 4195 -#define SYS_rt_sigpending 4196 -#define SYS_rt_sigtimedwait 4197 -#define SYS_rt_sigqueueinfo 4198 -#define SYS_rt_sigsuspend 4199 -#define SYS_pread 4200 -#define SYS_pwrite 4201 -#define SYS_chown 4202 -#define SYS_getcwd 4203 -#define SYS_capget 4204 -#define SYS_capset 4205 -#define SYS_sigaltstack 4206 -#define SYS_sendfile 4207 -#define SYS_getpmsg 4208 -#define SYS_putpmsg 4209 -#define SYS_mmap2 4210 -#define SYS_truncate64 4211 -#define SYS_ftruncate64 4212 -#define SYS_stat64 4213 -#define SYS_lstat64 4214 -#define SYS_fstat64 4215 -#define SYS_pivot_root 4216 -#define SYS_mincore 4217 -#define SYS_madvise 4218 -#define SYS_getdents64 4219 -#define SYS_fcntl64 4220 -#define SYS_reserved221 4221 -#define SYS_gettid 4222 -#define SYS_readahead 4223 -#define SYS_setxattr 4224 -#define SYS_lsetxattr 4225 -#define SYS_fsetxattr 4226 -#define SYS_getxattr 4227 -#define SYS_lgetxattr 4228 -#define SYS_fgetxattr 4229 -#define SYS_listxattr 4230 -#define SYS_llistxattr 4231 -#define SYS_flistxattr 4232 -#define SYS_removexattr 4233 -#define SYS_lremovexattr 4234 -#define SYS_fremovexattr 4235 -#define SYS_tkill 4236 -#define SYS_sendfile64 4237 -#define SYS_futex 4238 -#define SYS_sched_setaffinity 4239 -#define SYS_sched_getaffinity 4240 -#define SYS_io_setup 4241 -#define SYS_io_destroy 4242 -#define SYS_io_getevents 4243 -#define SYS_io_submit 4244 -#define SYS_io_cancel 4245 -#define SYS_exit_group 4246 -#define SYS_lookup_dcookie 4247 -#define SYS_epoll_create 4248 -#define SYS_epoll_ctl 4249 -#define SYS_epoll_wait 4250 -#define SYS_remap_file_pages 4251 -#define SYS_set_tid_address 4252 -#define SYS_restart_syscall 4253 -#define SYS_fadvise 4254 -#define SYS_statfs64 4255 -#define SYS_fstatfs64 4256 -#define SYS_timer_create 4257 -#define SYS_timer_settime 4258 -#define SYS_timer_gettime 4259 -#define SYS_timer_getoverrun 4260 -#define SYS_timer_delete 4261 -#define SYS_clock_settime 4262 -#define SYS_clock_gettime 4263 -#define SYS_clock_getres 4264 -#define SYS_clock_nanosleep 4265 -#define SYS_tgkill 4266 -#define SYS_utimes 4267 -#define SYS_mbind 4268 -#define SYS_get_mempolicy 4269 -#define SYS_set_mempolicy 4270 -#define SYS_mq_open 4271 -#define SYS_mq_unlink 4272 -#define SYS_mq_timedsend 4273 -#define SYS_mq_timedreceive 4274 -#define SYS_mq_notify 4275 -#define SYS_mq_getsetattr 4276 -#define SYS_vserver 4277 -#define SYS_waitid 4278 -#define SYS_add_key 4280 -#define SYS_request_key 4281 -#define SYS_keyctl 4282 -#define SYS_set_thread_area 4283 -#define SYS_inotify_init 4284 -#define SYS_inotify_add_watch 4285 -#define SYS_inotify_rm_watch 4286 -#define SYS_migrate_pages 4287 -#define SYS_openat 4288 -#define SYS_mkdirat 4289 -#define SYS_mknodat 4290 -#define SYS_fchownat 4291 -#define SYS_futimesat 4292 -#define SYS_fstatat 4293 -#define SYS_unlinkat 4294 -#define SYS_renameat 4295 -#define SYS_linkat 4296 -#define SYS_symlinkat 4297 -#define SYS_readlinkat 4298 -#define SYS_fchmodat 4299 -#define SYS_faccessat 4300 -#define SYS_pselect6 4301 -#define SYS_ppoll 4302 -#define SYS_unshare 4303 -#define SYS_splice 4304 -#define SYS_sync_file_range 4305 -#define SYS_tee 4306 -#define SYS_vmsplice 4307 -#define SYS_move_pages 4308 -#define SYS_set_robust_list 4309 -#define SYS_get_robust_list 4310 -#define SYS_kexec_load 4311 -#define SYS_getcpu 4312 -#define SYS_epoll_pwait 4313 -#define SYS_ioprio_set 4314 -#define SYS_ioprio_get 4315 -#define SYS_utimensat 4316 -#define SYS_signalfd 4317 -#define SYS_timerfd 4318 -#define SYS_eventfd 4319 -#define SYS_fallocate 4320 -#define SYS_timerfd_create 4321 -#define SYS_timerfd_gettime 4322 -#define SYS_timerfd_settime 4323 -#define SYS_signalfd4 4324 -#define SYS_eventfd2 4325 -#define SYS_epoll_create1 4326 -#define SYS_dup3 4327 -#define SYS_pipe2 4328 -#define SYS_inotify_init1 4329 -#define SYS_preadv 4330 -#define SYS_pwritev 4331 -#define SYS_rt_tgsigqueueinfo 4332 -#define SYS_perf_event_open 4333 -#define SYS_accept4 4334 -#define SYS_recvmmsg 4335 -#define SYS_fanotify_init 4336 -#define SYS_fanotify_mark 4337 -#define SYS_prlimit64 4338 -#define SYS_name_to_handle_at 4339 -#define SYS_open_by_handle_at 4340 -#define SYS_clock_adjtime 4341 -#define SYS_syncfs 4342 -#define SYS_sendmmsg 4343 -#define SYS_setns 4344 -#define SYS_process_vm_readv 4345 -#define SYS_process_vm_writev 4346 -#define SYS_kcmp 4347 -#define SYS_finit_module 4348 -#define SYS_sched_setattr 4349 -#define SYS_sched_getattr 4350 -#define SYS_renameat2 4351 -#define SYS_seccomp 4352 -#define SYS_getrandom 4353 -#define SYS_memfd_create 4354 -#define SYS_bpf 4355 -#define SYS_execveat 4356 -#define SYS_userfaultfd 4357 -#define SYS_membarrier 4358 -#define SYS_mlock2 4359 -#define SYS_copy_file_range 4360 diff --git a/arch/mips64/bits/syscall.h b/arch/mips64/bits/syscall.h.in similarity index 50% rename from arch/mips64/bits/syscall.h rename to arch/mips64/bits/syscall.h.in index a84a5197..0e206830 100644 --- a/arch/mips64/bits/syscall.h +++ b/arch/mips64/bits/syscall.h.in @@ -319,323 +319,3 @@ #define __NR_mlock2 5319 #define __NR_copy_file_range 5320 -#define SYS_read 5000 -#define SYS_write 5001 -#define SYS_open 5002 -#define SYS_close 5003 -#define SYS_stat 5004 -#define SYS_fstat 5005 -#define SYS_lstat 5006 -#define SYS_poll 5007 -#define SYS_lseek 5008 -#define SYS_mmap 5009 -#define SYS_mprotect 5010 -#define SYS_munmap 5011 -#define SYS_brk 5012 -#define SYS_rt_sigaction 5013 -#define SYS_rt_sigprocmask 5014 -#define SYS_ioctl 5015 -#define SYS_pread64 5016 -#define SYS_pwrite64 5017 -#define SYS_readv 5018 -#define SYS_writev 5019 -#define SYS_access 5020 -#define SYS_pipe 5021 -#define SYS__newselect 5022 -#define SYS_sched_yield 5023 -#define SYS_mremap 5024 -#define SYS_msync 5025 -#define SYS_mincore 5026 -#define SYS_madvise 5027 -#define SYS_shmget 5028 -#define SYS_shmat 5029 -#define SYS_shmctl 5030 -#define SYS_dup 5031 -#define SYS_dup2 5032 -#define SYS_pause 5033 -#define SYS_nanosleep 5034 -#define SYS_getitimer 5035 -#define SYS_setitimer 5036 -#define SYS_alarm 5037 -#define SYS_getpid 5038 -#define SYS_sendfile 5039 -#define SYS_socket 5040 -#define SYS_connect 5041 -#define SYS_accept 5042 -#define SYS_sendto 5043 -#define SYS_recvfrom 5044 -#define SYS_sendmsg 5045 -#define SYS_recvmsg 5046 -#define SYS_shutdown 5047 -#define SYS_bind 5048 -#define SYS_listen 5049 -#define SYS_getsockname 5050 -#define SYS_getpeername 5051 -#define SYS_socketpair 5052 -#define SYS_setsockopt 5053 -#define SYS_getsockopt 5054 -#define SYS_clone 5055 -#define SYS_fork 5056 -#define SYS_execve 5057 -#define SYS_exit 5058 -#define SYS_wait4 5059 -#define SYS_kill 5060 -#define SYS_uname 5061 -#define SYS_semget 5062 -#define SYS_semop 5063 -#define SYS_semctl 5064 -#define SYS_shmdt 5065 -#define SYS_msgget 5066 -#define SYS_msgsnd 5067 -#define SYS_msgrcv 5068 -#define SYS_msgctl 5069 -#define SYS_fcntl 5070 -#define SYS_flock 5071 -#define SYS_fsync 5072 -#define SYS_fdatasync 5073 -#define SYS_truncate 5074 -#define SYS_ftruncate 5075 -#define SYS_getdents 5076 -#define SYS_getcwd 5077 -#define SYS_chdir 5078 -#define SYS_fchdir 5079 -#define SYS_rename 5080 -#define SYS_mkdir 5081 -#define SYS_rmdir 5082 -#define SYS_creat 5083 -#define SYS_link 5084 -#define SYS_unlink 5085 -#define SYS_symlink 5086 -#define SYS_readlink 5087 -#define SYS_chmod 5088 -#define SYS_fchmod 5089 -#define SYS_chown 5090 -#define SYS_fchown 5091 -#define SYS_lchown 5092 -#define SYS_umask 5093 -#define SYS_gettimeofday 5094 -#define SYS_getrlimit 5095 -#define SYS_getrusage 5096 -#define SYS_sysinfo 5097 -#define SYS_times 5098 -#define SYS_ptrace 5099 -#define SYS_getuid 5100 -#define SYS_syslog 5101 -#define SYS_getgid 5102 -#define SYS_setuid 5103 -#define SYS_setgid 5104 -#define SYS_geteuid 5105 -#define SYS_getegid 5106 -#define SYS_setpgid 5107 -#define SYS_getppid 5108 -#define SYS_getpgrp 5109 -#define SYS_setsid 5110 -#define SYS_setreuid 5111 -#define SYS_setregid 5112 -#define SYS_getgroups 5113 -#define SYS_setgroups 5114 -#define SYS_setresuid 5115 -#define SYS_getresuid 5116 -#define SYS_setresgid 5117 -#define SYS_getresgid 5118 -#define SYS_getpgid 5119 -#define SYS_setfsuid 5120 -#define SYS_setfsgid 5121 -#define SYS_getsid 5122 -#define SYS_capget 5123 -#define SYS_capset 5124 -#define SYS_rt_sigpending 5125 -#define SYS_rt_sigtimedwait 5126 -#define SYS_rt_sigqueueinfo 5127 -#define SYS_rt_sigsuspend 5128 -#define SYS_sigaltstack 5129 -#define SYS_utime 5130 -#define SYS_mknod 5131 -#define SYS_personality 5132 -#define SYS_ustat 5133 -#define SYS_statfs 5134 -#define SYS_fstatfs 5135 -#define SYS_sysfs 5136 -#define SYS_getpriority 5137 -#define SYS_setpriority 5138 -#define SYS_sched_setparam 5139 -#define SYS_sched_getparam 5140 -#define SYS_sched_setscheduler 5141 -#define SYS_sched_getscheduler 5142 -#define SYS_sched_get_priority_max 5143 -#define SYS_sched_get_priority_min 5144 -#define SYS_sched_rr_get_interval 5145 -#define SYS_mlock 5146 -#define SYS_munlock 5147 -#define SYS_mlockall 5148 -#define SYS_munlockall 5149 -#define SYS_vhangup 5150 -#define SYS_pivot_root 5151 -#define SYS__sysctl 5152 -#define SYS_prctl 5153 -#define SYS_adjtimex 5154 -#define SYS_setrlimit 5155 -#define SYS_chroot 5156 -#define SYS_sync 5157 -#define SYS_acct 5158 -#define SYS_settimeofday 5159 -#define SYS_mount 5160 -#define SYS_umount2 5161 -#define SYS_swapon 5162 -#define SYS_swapoff 5163 -#define SYS_reboot 5164 -#define SYS_sethostname 5165 -#define SYS_setdomainname 5166 -#define SYS_create_module 5167 -#define SYS_init_module 5168 -#define SYS_delete_module 5169 -#define SYS_get_kernel_syms 5170 -#define SYS_query_module 5171 -#define SYS_quotactl 5172 -#define SYS_nfsservctl 5173 -#define SYS_getpmsg 5174 -#define SYS_putpmsg 5175 -#define SYS_afs_syscall 5176 -#define SYS_reserved177 5177 -#define SYS_gettid 5178 -#define SYS_readahead 5179 -#define SYS_setxattr 5180 -#define SYS_lsetxattr 5181 -#define SYS_fsetxattr 5182 -#define SYS_getxattr 5183 -#define SYS_lgetxattr 5184 -#define SYS_fgetxattr 5185 -#define SYS_listxattr 5186 -#define SYS_llistxattr 5187 -#define SYS_flistxattr 5188 -#define SYS_removexattr 5189 -#define SYS_lremovexattr 5190 -#define SYS_fremovexattr 5191 -#define SYS_tkill 5192 -#define SYS_reserved193 5193 -#define SYS_futex 5194 -#define SYS_sched_setaffinity 5195 -#define SYS_sched_getaffinity 5196 -#define SYS_cacheflush 5197 -#define SYS_cachectl 5198 -#define SYS_sysmips 5199 -#define SYS_io_setup 5200 -#define SYS_io_destroy 5201 -#define SYS_io_getevents 5202 -#define SYS_io_submit 5203 -#define SYS_io_cancel 5204 -#define SYS_exit_group 5205 -#define SYS_lookup_dcookie 5206 -#define SYS_epoll_create 5207 -#define SYS_epoll_ctl 5208 -#define SYS_epoll_wait 5209 -#define SYS_remap_file_pages 5210 -#define SYS_rt_sigreturn 5211 -#define SYS_set_tid_address 5212 -#define SYS_restart_syscall 5213 -#define SYS_semtimedop 5214 -#define SYS_fadvise64 5215 -#define SYS_timer_create 5216 -#define SYS_timer_settime 5217 -#define SYS_timer_gettime 5218 -#define SYS_timer_getoverrun 5219 -#define SYS_timer_delete 5220 -#define SYS_clock_settime 5221 -#define SYS_clock_gettime 5222 -#define SYS_clock_getres 5223 -#define SYS_clock_nanosleep 5224 -#define SYS_tgkill 5225 -#define SYS_utimes 5226 -#define SYS_mbind 5227 -#define SYS_get_mempolicy 5228 -#define SYS_set_mempolicy 5229 -#define SYS_mq_open 5230 -#define SYS_mq_unlink 5231 -#define SYS_mq_timedsend 5232 -#define SYS_mq_timedreceive 5233 -#define SYS_mq_notify 5234 -#define SYS_mq_getsetattr 5235 -#define SYS_vserver 5236 -#define SYS_waitid 5237 -#define SYS_add_key 5239 -#define SYS_request_key 5240 -#define SYS_keyctl 5241 -#define SYS_set_thread_area 5242 -#define SYS_inotify_init 5243 -#define SYS_inotify_add_watch 5244 -#define SYS_inotify_rm_watch 5245 -#define SYS_migrate_pages 5246 -#define SYS_openat 5247 -#define SYS_mkdirat 5248 -#define SYS_mknodat 5249 -#define SYS_fchownat 5250 -#define SYS_futimesat 5251 -#define SYS_newfstatat 5252 -#define SYS_unlinkat 5253 -#define SYS_renameat 5254 -#define SYS_linkat 5255 -#define SYS_symlinkat 5256 -#define SYS_readlinkat 5257 -#define SYS_fchmodat 5258 -#define SYS_faccessat 5259 -#define SYS_pselect6 5260 -#define SYS_ppoll 5261 -#define SYS_unshare 5262 -#define SYS_splice 5263 -#define SYS_sync_file_range 5264 -#define SYS_tee 5265 -#define SYS_vmsplice 5266 -#define SYS_move_pages 5267 -#define SYS_set_robust_list 5268 -#define SYS_get_robust_list 5269 -#define SYS_kexec_load 5270 -#define SYS_getcpu 5271 -#define SYS_epoll_pwait 5272 -#define SYS_ioprio_set 5273 -#define SYS_ioprio_get 5274 -#define SYS_utimensat 5275 -#define SYS_signalfd 5276 -#define SYS_timerfd 5277 -#define SYS_eventfd 5278 -#define SYS_fallocate 5279 -#define SYS_timerfd_create 5280 -#define SYS_timerfd_gettime 5281 -#define SYS_timerfd_settime 5282 -#define SYS_signalfd4 5283 -#define SYS_eventfd2 5284 -#define SYS_epoll_create1 5285 -#define SYS_dup3 5286 -#define SYS_pipe2 5287 -#define SYS_inotify_init1 5288 -#define SYS_preadv 5289 -#define SYS_pwritev 5290 -#define SYS_rt_tgsigqueueinfo 5291 -#define SYS_perf_event_open 5292 -#define SYS_accept4 5293 -#define SYS_recvmmsg 5294 -#define SYS_fanotify_init 5295 -#define SYS_fanotify_mark 5296 -#define SYS_prlimit64 5297 -#define SYS_name_to_handle_at 5298 -#define SYS_open_by_handle_at 5299 -#define SYS_clock_adjtime 5300 -#define SYS_syncfs 5301 -#define SYS_sendmmsg 5302 -#define SYS_setns 5303 -#define SYS_process_vm_readv 5304 -#define SYS_process_vm_writev 5305 -#define SYS_kcmp 5306 -#define SYS_finit_module 5307 -#define SYS_getdents64 5308 -#define SYS_sched_setattr 5309 -#define SYS_sched_getattr 5310 -#define SYS_renameat2 5311 -#define SYS_seccomp 5312 -#define SYS_getrandom 5313 -#define SYS_memfd_create 5314 -#define SYS_bpf 5315 -#define SYS_execveat 5316 -#define SYS_userfaultfd 5317 -#define SYS_membarrier 5318 -#define SYS_mlock2 5319 -#define SYS_copy_file_range 5320 diff --git a/arch/mipsn32/bits/syscall.h b/arch/mipsn32/bits/syscall.h.in similarity index 50% rename from arch/mipsn32/bits/syscall.h rename to arch/mipsn32/bits/syscall.h.in index 09e4a25c..6c38f68d 100644 --- a/arch/mipsn32/bits/syscall.h +++ b/arch/mipsn32/bits/syscall.h.in @@ -323,327 +323,3 @@ #define __NR_mlock2 6323 #define __NR_copy_file_range 6324 -#define SYS_read 6000 -#define SYS_write 6001 -#define SYS_open 6002 -#define SYS_close 6003 -#define SYS_stat 6004 -#define SYS_fstat 6005 -#define SYS_lstat 6006 -#define SYS_poll 6007 -#define SYS_lseek 6008 -#define SYS_mmap 6009 -#define SYS_mprotect 6010 -#define SYS_munmap 6011 -#define SYS_brk 6012 -#define SYS_rt_sigaction 6013 -#define SYS_rt_sigprocmask 6014 -#define SYS_ioctl 6015 -#define SYS_pread64 6016 -#define SYS_pwrite64 6017 -#define SYS_readv 6018 -#define SYS_writev 6019 -#define SYS_access 6020 -#define SYS_pipe 6021 -#define SYS__newselect 6022 -#define SYS_sched_yield 6023 -#define SYS_mremap 6024 -#define SYS_msync 6025 -#define SYS_mincore 6026 -#define SYS_madvise 6027 -#define SYS_shmget 6028 -#define SYS_shmat 6029 -#define SYS_shmctl 6030 -#define SYS_dup 6031 -#define SYS_dup2 6032 -#define SYS_pause 6033 -#define SYS_nanosleep 6034 -#define SYS_getitimer 6035 -#define SYS_setitimer 6036 -#define SYS_alarm 6037 -#define SYS_getpid 6038 -#define SYS_sendfile 6039 -#define SYS_socket 6040 -#define SYS_connect 6041 -#define SYS_accept 6042 -#define SYS_sendto 6043 -#define SYS_recvfrom 6044 -#define SYS_sendmsg 6045 -#define SYS_recvmsg 6046 -#define SYS_shutdown 6047 -#define SYS_bind 6048 -#define SYS_listen 6049 -#define SYS_getsockname 6050 -#define SYS_getpeername 6051 -#define SYS_socketpair 6052 -#define SYS_setsockopt 6053 -#define SYS_getsockopt 6054 -#define SYS_clone 6055 -#define SYS_fork 6056 -#define SYS_execve 6057 -#define SYS_exit 6058 -#define SYS_wait4 6059 -#define SYS_kill 6060 -#define SYS_uname 6061 -#define SYS_semget 6062 -#define SYS_semop 6063 -#define SYS_semctl 6064 -#define SYS_shmdt 6065 -#define SYS_msgget 6066 -#define SYS_msgsnd 6067 -#define SYS_msgrcv 6068 -#define SYS_msgctl 6069 -#define SYS_fcntl 6070 -#define SYS_flock 6071 -#define SYS_fsync 6072 -#define SYS_fdatasync 6073 -#define SYS_truncate 6074 -#define SYS_ftruncate 6075 -#define SYS_getdents 6076 -#define SYS_getcwd 6077 -#define SYS_chdir 6078 -#define SYS_fchdir 6079 -#define SYS_rename 6080 -#define SYS_mkdir 6081 -#define SYS_rmdir 6082 -#define SYS_creat 6083 -#define SYS_link 6084 -#define SYS_unlink 6085 -#define SYS_symlink 6086 -#define SYS_readlink 6087 -#define SYS_chmod 6088 -#define SYS_fchmod 6089 -#define SYS_chown 6090 -#define SYS_fchown 6091 -#define SYS_lchown 6092 -#define SYS_umask 6093 -#define SYS_gettimeofday 6094 -#define SYS_getrlimit 6095 -#define SYS_getrusage 6096 -#define SYS_sysinfo 6097 -#define SYS_times 6098 -#define SYS_ptrace 6099 -#define SYS_getuid 6100 -#define SYS_syslog 6101 -#define SYS_getgid 6102 -#define SYS_setuid 6103 -#define SYS_setgid 6104 -#define SYS_geteuid 6105 -#define SYS_getegid 6106 -#define SYS_setpgid 6107 -#define SYS_getppid 6108 -#define SYS_getpgrp 6109 -#define SYS_setsid 6110 -#define SYS_setreuid 6111 -#define SYS_setregid 6112 -#define SYS_getgroups 6113 -#define SYS_setgroups 6114 -#define SYS_setresuid 6115 -#define SYS_getresuid 6116 -#define SYS_setresgid 6117 -#define SYS_getresgid 6118 -#define SYS_getpgid 6119 -#define SYS_setfsuid 6120 -#define SYS_setfsgid 6121 -#define SYS_getsid 6122 -#define SYS_capget 6123 -#define SYS_capset 6124 -#define SYS_rt_sigpending 6125 -#define SYS_rt_sigtimedwait 6126 -#define SYS_rt_sigqueueinfo 6127 -#define SYS_rt_sigsuspend 6128 -#define SYS_sigaltstack 6129 -#define SYS_utime 6130 -#define SYS_mknod 6131 -#define SYS_personality 6132 -#define SYS_ustat 6133 -#define SYS_statfs 6134 -#define SYS_fstatfs 6135 -#define SYS_sysfs 6136 -#define SYS_getpriority 6137 -#define SYS_setpriority 6138 -#define SYS_sched_setparam 6139 -#define SYS_sched_getparam 6140 -#define SYS_sched_setscheduler 6141 -#define SYS_sched_getscheduler 6142 -#define SYS_sched_get_priority_max 6143 -#define SYS_sched_get_priority_min 6144 -#define SYS_sched_rr_get_interval 6145 -#define SYS_mlock 6146 -#define SYS_munlock 6147 -#define SYS_mlockall 6148 -#define SYS_munlockall 6149 -#define SYS_vhangup 6150 -#define SYS_pivot_root 6151 -#define SYS__sysctl 6152 -#define SYS_prctl 6153 -#define SYS_adjtimex 6154 -#define SYS_setrlimit 6155 -#define SYS_chroot 6156 -#define SYS_sync 6157 -#define SYS_acct 6158 -#define SYS_settimeofday 6159 -#define SYS_mount 6160 -#define SYS_umount2 6161 -#define SYS_swapon 6162 -#define SYS_swapoff 6163 -#define SYS_reboot 6164 -#define SYS_sethostname 6165 -#define SYS_setdomainname 6166 -#define SYS_create_module 6167 -#define SYS_init_module 6168 -#define SYS_delete_module 6169 -#define SYS_get_kernel_syms 6170 -#define SYS_query_module 6171 -#define SYS_quotactl 6172 -#define SYS_nfsservctl 6173 -#define SYS_getpmsg 6174 -#define SYS_putpmsg 6175 -#define SYS_afs_syscall 6176 -#define SYS_reserved177 6177 -#define SYS_gettid 6178 -#define SYS_readahead 6179 -#define SYS_setxattr 6180 -#define SYS_lsetxattr 6181 -#define SYS_fsetxattr 6182 -#define SYS_getxattr 6183 -#define SYS_lgetxattr 6184 -#define SYS_fgetxattr 6185 -#define SYS_listxattr 6186 -#define SYS_llistxattr 6187 -#define SYS_flistxattr 6188 -#define SYS_removexattr 6189 -#define SYS_lremovexattr 6190 -#define SYS_fremovexattr 6191 -#define SYS_tkill 6192 -#define SYS_reserved193 6193 -#define SYS_futex 6194 -#define SYS_sched_setaffinity 6195 -#define SYS_sched_getaffinity 6196 -#define SYS_cacheflush 6197 -#define SYS_cachectl 6198 -#define SYS_sysmips 6199 -#define SYS_io_setup 6200 -#define SYS_io_destroy 6201 -#define SYS_io_getevents 6202 -#define SYS_io_submit 6203 -#define SYS_io_cancel 6204 -#define SYS_exit_group 6205 -#define SYS_lookup_dcookie 6206 -#define SYS_epoll_create 6207 -#define SYS_epoll_ctl 6208 -#define SYS_epoll_wait 6209 -#define SYS_remap_file_pages 6210 -#define SYS_rt_sigreturn 6211 -#define SYS_fcntl64 6212 -#define SYS_set_tid_address 6213 -#define SYS_restart_syscall 6214 -#define SYS_semtimedop 6215 -#define SYS_fadvise64 6216 -#define SYS_statfs64 6217 -#define SYS_fstatfs64 6218 -#define SYS_sendfile64 6219 -#define SYS_timer_create 6220 -#define SYS_timer_settime 6221 -#define SYS_timer_gettime 6222 -#define SYS_timer_getoverrun 6223 -#define SYS_timer_delete 6224 -#define SYS_clock_settime 6225 -#define SYS_clock_gettime 6226 -#define SYS_clock_getres 6227 -#define SYS_clock_nanosleep 6228 -#define SYS_tgkill 6229 -#define SYS_utimes 6230 -#define SYS_mbind 6231 -#define SYS_get_mempolicy 6232 -#define SYS_set_mempolicy 6233 -#define SYS_mq_open 6234 -#define SYS_mq_unlink 6235 -#define SYS_mq_timedsend 6236 -#define SYS_mq_timedreceive 6237 -#define SYS_mq_notify 6238 -#define SYS_mq_getsetattr 6239 -#define SYS_vserver 6240 -#define SYS_waitid 6241 -#define SYS_add_key 6243 -#define SYS_request_key 6244 -#define SYS_keyctl 6245 -#define SYS_set_thread_area 6246 -#define SYS_inotify_init 6247 -#define SYS_inotify_add_watch 6248 -#define SYS_inotify_rm_watch 6249 -#define SYS_migrate_pages 6250 -#define SYS_openat 6251 -#define SYS_mkdirat 6252 -#define SYS_mknodat 6253 -#define SYS_fchownat 6254 -#define SYS_futimesat 6255 -#define SYS_fstatat 6256 -#define SYS_unlinkat 6257 -#define SYS_renameat 6258 -#define SYS_linkat 6259 -#define SYS_symlinkat 6260 -#define SYS_readlinkat 6261 -#define SYS_fchmodat 6262 -#define SYS_faccessat 6263 -#define SYS_pselect6 6264 -#define SYS_ppoll 6265 -#define SYS_unshare 6266 -#define SYS_splice 6267 -#define SYS_sync_file_range 6268 -#define SYS_tee 6269 -#define SYS_vmsplice 6270 -#define SYS_move_pages 6271 -#define SYS_set_robust_list 6272 -#define SYS_get_robust_list 6273 -#define SYS_kexec_load 6274 -#define SYS_getcpu 6275 -#define SYS_epoll_pwait 6276 -#define SYS_ioprio_set 6277 -#define SYS_ioprio_get 6278 -#define SYS_utimensat 6279 -#define SYS_signalfd 6280 -#define SYS_timerfd 6281 -#define SYS_eventfd 6282 -#define SYS_fallocate 6283 -#define SYS_timerfd_create 6284 -#define SYS_timerfd_gettime 6285 -#define SYS_timerfd_settime 6286 -#define SYS_signalfd4 6287 -#define SYS_eventfd2 6288 -#define SYS_epoll_create1 6289 -#define SYS_dup3 6290 -#define SYS_pipe2 6291 -#define SYS_inotify_init1 6292 -#define SYS_preadv 6293 -#define SYS_pwritev 6294 -#define SYS_rt_tgsigqueueinfo 6295 -#define SYS_perf_event_open 6296 -#define SYS_accept4 6297 -#define SYS_recvmmsg 6298 -#define SYS_getdents64 6299 -#define SYS_fanotify_init 6300 -#define SYS_fanotify_mark 6301 -#define SYS_prlimit64 6302 -#define SYS_name_to_handle_at 6303 -#define SYS_open_by_handle_at 6304 -#define SYS_clock_adjtime 6305 -#define SYS_syncfs 6306 -#define SYS_sendmmsg 6307 -#define SYS_setns 6308 -#define SYS_process_vm_readv 6309 -#define SYS_process_vm_writev 6310 -#define SYS_kcmp 6311 -#define SYS_finit_module 6312 -#define SYS_sched_setattr 6313 -#define SYS_sched_getattr 6314 -#define SYS_renameat2 6315 -#define SYS_seccomp 6316 -#define SYS_getrandom 6317 -#define SYS_memfd_create 6318 -#define SYS_bpf 6319 -#define SYS_execveat 6320 -#define SYS_userfaultfd 6321 -#define SYS_membarrier 6322 -#define SYS_mlock2 6323 -#define SYS_copy_file_range 6324 diff --git a/arch/or1k/bits/syscall.h b/arch/or1k/bits/syscall.h deleted file mode 100644 index de810a4d..00000000 --- a/arch/or1k/bits/syscall.h +++ /dev/null @@ -1,543 +0,0 @@ -#define __NR_io_setup 0 -#define __NR_io_destroy 1 -#define __NR_io_submit 2 -#define __NR_io_cancel 3 -#define __NR_io_getevents 4 -#define __NR_setxattr 5 -#define __NR_lsetxattr 6 -#define __NR_fsetxattr 7 -#define __NR_getxattr 8 -#define __NR_lgetxattr 9 -#define __NR_fgetxattr 10 -#define __NR_listxattr 11 -#define __NR_llistxattr 12 -#define __NR_flistxattr 13 -#define __NR_removexattr 14 -#define __NR_lremovexattr 15 -#define __NR_fremovexattr 16 -#define __NR_getcwd 17 -#define __NR_lookup_dcookie 18 -#define __NR_eventfd2 19 -#define __NR_epoll_create1 20 -#define __NR_epoll_ctl 21 -#define __NR_epoll_pwait 22 -#define __NR_dup 23 -#define __NR_dup3 24 -#define __NR_fcntl64 25 -#define __NR_inotify_init1 26 -#define __NR_inotify_add_watch 27 -#define __NR_inotify_rm_watch 28 -#define __NR_ioctl 29 -#define __NR_ioprio_set 30 -#define __NR_ioprio_get 31 -#define __NR_flock 32 -#define __NR_mknodat 33 -#define __NR_mkdirat 34 -#define __NR_unlinkat 35 -#define __NR_symlinkat 36 -#define __NR_linkat 37 -#define __NR_renameat 38 -#define __NR_umount2 39 -#define __NR_mount 40 -#define __NR_pivot_root 41 -#define __NR_nfsservctl 42 -#define __NR_statfs64 43 -#define __NR_fstatfs64 44 -#define __NR_truncate64 45 -#define __NR_ftruncate64 46 -#define __NR_fallocate 47 -#define __NR_faccessat 48 -#define __NR_chdir 49 -#define __NR_fchdir 50 -#define __NR_chroot 51 -#define __NR_fchmod 52 -#define __NR_fchmodat 53 -#define __NR_fchownat 54 -#define __NR_fchown 55 -#define __NR_openat 56 -#define __NR_close 57 -#define __NR_vhangup 58 -#define __NR_pipe2 59 -#define __NR_quotactl 60 -#define __NR_getdents64 61 -#define __NR__llseek 62 -#define __NR_read 63 -#define __NR_write 64 -#define __NR_readv 65 -#define __NR_writev 66 -#define __NR_pread64 67 -#define __NR_pwrite64 68 -#define __NR_preadv 69 -#define __NR_pwritev 70 -#define __NR_sendfile64 71 -#define __NR_pselect6 72 -#define __NR_ppoll 73 -#define __NR_signalfd4 74 -#define __NR_vmsplice 75 -#define __NR_splice 76 -#define __NR_tee 77 -#define __NR_readlinkat 78 -#define __NR_fstatat64 79 -#define __NR_fstat64 80 -#define __NR_sync 81 -#define __NR_fsync 82 -#define __NR_fdatasync 83 -#define __NR_sync_file_range 84 -#define __NR_timerfd_create 85 -#define __NR_timerfd_settime 86 -#define __NR_timerfd_gettime 87 -#define __NR_utimensat 88 -#define __NR_acct 89 -#define __NR_capget 90 -#define __NR_capset 91 -#define __NR_personality 92 -#define __NR_exit 93 -#define __NR_exit_group 94 -#define __NR_waitid 95 -#define __NR_set_tid_address 96 -#define __NR_unshare 97 -#define __NR_futex 98 -#define __NR_set_robust_list 99 -#define __NR_get_robust_list 100 -#define __NR_nanosleep 101 -#define __NR_getitimer 102 -#define __NR_setitimer 103 -#define __NR_kexec_load 104 -#define __NR_init_module 105 -#define __NR_delete_module 106 -#define __NR_timer_create 107 -#define __NR_timer_gettime 108 -#define __NR_timer_getoverrun 109 -#define __NR_timer_settime 110 -#define __NR_timer_delete 111 -#define __NR_clock_settime 112 -#define __NR_clock_gettime 113 -#define __NR_clock_getres 114 -#define __NR_clock_nanosleep 115 -#define __NR_syslog 116 -#define __NR_ptrace 117 -#define __NR_sched_setparam 118 -#define __NR_sched_setscheduler 119 -#define __NR_sched_getscheduler 120 -#define __NR_sched_getparam 121 -#define __NR_sched_setaffinity 122 -#define __NR_sched_getaffinity 123 -#define __NR_sched_yield 124 -#define __NR_sched_get_priority_max 125 -#define __NR_sched_get_priority_min 126 -#define __NR_sched_rr_get_interval 127 -#define __NR_restart_syscall 128 -#define __NR_kill 129 -#define __NR_tkill 130 -#define __NR_tgkill 131 -#define __NR_sigaltstack 132 -#define __NR_rt_sigsuspend 133 -#define __NR_rt_sigaction 134 -#define __NR_rt_sigprocmask 135 -#define __NR_rt_sigpending 136 -#define __NR_rt_sigtimedwait 137 -#define __NR_rt_sigqueueinfo 138 -#define __NR_rt_sigreturn 139 -#define __NR_setpriority 140 -#define __NR_getpriority 141 -#define __NR_reboot 142 -#define __NR_setregid 143 -#define __NR_setgid 144 -#define __NR_setreuid 145 -#define __NR_setuid 146 -#define __NR_setresuid 147 -#define __NR_getresuid 148 -#define __NR_setresgid 149 -#define __NR_getresgid 150 -#define __NR_setfsuid 151 -#define __NR_setfsgid 152 -#define __NR_times 153 -#define __NR_setpgid 154 -#define __NR_getpgid 155 -#define __NR_getsid 156 -#define __NR_setsid 157 -#define __NR_getgroups 158 -#define __NR_setgroups 159 -#define __NR_uname 160 -#define __NR_sethostname 161 -#define __NR_setdomainname 162 -#define __NR_getrlimit 163 -#define __NR_setrlimit 164 -#define __NR_getrusage 165 -#define __NR_umask 166 -#define __NR_prctl 167 -#define __NR_getcpu 168 -#define __NR_gettimeofday 169 -#define __NR_settimeofday 170 -#define __NR_adjtimex 171 -#define __NR_getpid 172 -#define __NR_getppid 173 -#define __NR_getuid 174 -#define __NR_geteuid 175 -#define __NR_getgid 176 -#define __NR_getegid 177 -#define __NR_gettid 178 -#define __NR_sysinfo 179 -#define __NR_mq_open 180 -#define __NR_mq_unlink 181 -#define __NR_mq_timedsend 182 -#define __NR_mq_timedreceive 183 -#define __NR_mq_notify 184 -#define __NR_mq_getsetattr 185 -#define __NR_msgget 186 -#define __NR_msgctl 187 -#define __NR_msgrcv 188 -#define __NR_msgsnd 189 -#define __NR_semget 190 -#define __NR_semctl 191 -#define __NR_semtimedop 192 -#define __NR_semop 193 -#define __NR_shmget 194 -#define __NR_shmctl 195 -#define __NR_shmat 196 -#define __NR_shmdt 197 -#define __NR_socket 198 -#define __NR_socketpair 199 -#define __NR_bind 200 -#define __NR_listen 201 -#define __NR_accept 202 -#define __NR_connect 203 -#define __NR_getsockname 204 -#define __NR_getpeername 205 -#define __NR_sendto 206 -#define __NR_recvfrom 207 -#define __NR_setsockopt 208 -#define __NR_getsockopt 209 -#define __NR_shutdown 210 -#define __NR_sendmsg 211 -#define __NR_recvmsg 212 -#define __NR_readahead 213 -#define __NR_brk 214 -#define __NR_munmap 215 -#define __NR_mremap 216 -#define __NR_add_key 217 -#define __NR_request_key 218 -#define __NR_keyctl 219 -#define __NR_clone 220 -#define __NR_execve 221 -#define __NR_mmap2 222 -#define __NR_fadvise64_64 223 -#define __NR_swapon 224 -#define __NR_swapoff 225 -#define __NR_mprotect 226 -#define __NR_msync 227 -#define __NR_mlock 228 -#define __NR_munlock 229 -#define __NR_mlockall 230 -#define __NR_munlockall 231 -#define __NR_mincore 232 -#define __NR_madvise 233 -#define __NR_remap_file_pages 234 -#define __NR_mbind 235 -#define __NR_get_mempolicy 236 -#define __NR_set_mempolicy 237 -#define __NR_migrate_pages 238 -#define __NR_move_pages 239 -#define __NR_rt_tgsigqueueinfo 240 -#define __NR_perf_event_open 241 -#define __NR_accept4 242 -#define __NR_recvmmsg 243 -#define __NR_or1k_atomic 244 -#define __NR_wait4 260 -#define __NR_prlimit64 261 -#define __NR_fanotify_init 262 -#define __NR_fanotify_mark 263 -#define __NR_name_to_handle_at 264 -#define __NR_open_by_handle_at 265 -#define __NR_clock_adjtime 266 -#define __NR_syncfs 267 -#define __NR_setns 268 -#define __NR_sendmmsg 269 -#define __NR_process_vm_readv 270 -#define __NR_process_vm_writev 271 -#define __NR_kcmp 272 -#define __NR_finit_module 273 -#define __NR_sched_setattr 274 -#define __NR_sched_getattr 275 -#define __NR_renameat2 276 -#define __NR_seccomp 277 -#define __NR_getrandom 278 -#define __NR_memfd_create 279 -#define __NR_bpf 280 -#define __NR_execveat 281 -#define __NR_userfaultfd 282 -#define __NR_membarrier 283 -#define __NR_mlock2 284 -#define __NR_copy_file_range 285 - -#define SYS_io_setup __NR_io_setup -#define SYS_io_destroy __NR_io_destroy -#define SYS_io_submit __NR_io_submit -#define SYS_io_cancel __NR_io_cancel -#define SYS_io_getevents __NR_io_getevents -#define SYS_setxattr __NR_setxattr -#define SYS_lsetxattr __NR_lsetxattr -#define SYS_fsetxattr __NR_fsetxattr -#define SYS_getxattr __NR_getxattr -#define SYS_lgetxattr __NR_lgetxattr -#define SYS_fgetxattr __NR_fgetxattr -#define SYS_listxattr __NR_listxattr -#define SYS_llistxattr __NR_llistxattr -#define SYS_flistxattr __NR_flistxattr -#define SYS_removexattr __NR_removexattr -#define SYS_lremovexattr __NR_lremovexattr -#define SYS_fremovexattr __NR_fremovexattr -#define SYS_getcwd __NR_getcwd -#define SYS_lookup_dcookie __NR_lookup_dcookie -#define SYS_eventfd2 __NR_eventfd2 -#define SYS_epoll_create1 __NR_epoll_create1 -#define SYS_epoll_ctl __NR_epoll_ctl -#define SYS_epoll_pwait __NR_epoll_pwait -#define SYS_dup __NR_dup -#define SYS_dup3 __NR_dup3 -#define SYS_fcntl64 __NR_fcntl64 -#define SYS_inotify_init1 __NR_inotify_init1 -#define SYS_inotify_add_watch __NR_inotify_add_watch -#define SYS_inotify_rm_watch __NR_inotify_rm_watch -#define SYS_ioctl __NR_ioctl -#define SYS_ioprio_set __NR_ioprio_set -#define SYS_ioprio_get __NR_ioprio_get -#define SYS_flock __NR_flock -#define SYS_mknodat __NR_mknodat -#define SYS_mkdirat __NR_mkdirat -#define SYS_unlinkat __NR_unlinkat -#define SYS_symlinkat __NR_symlinkat -#define SYS_linkat __NR_linkat -#define SYS_renameat __NR_renameat -#define SYS_umount2 __NR_umount2 -#define SYS_mount __NR_mount -#define SYS_pivot_root __NR_pivot_root -#define SYS_nfsservctl __NR_nfsservctl -#define SYS_statfs64 __NR_statfs64 -#define SYS_fstatfs64 __NR_fstatfs64 -#define SYS_truncate64 __NR_truncate64 -#define SYS_ftruncate64 __NR_ftruncate64 -#define SYS_fallocate __NR_fallocate -#define SYS_faccessat __NR_faccessat -#define SYS_chdir __NR_chdir -#define SYS_fchdir __NR_fchdir -#define SYS_chroot __NR_chroot -#define SYS_fchmod __NR_fchmod -#define SYS_fchmodat __NR_fchmodat -#define SYS_fchownat __NR_fchownat -#define SYS_fchown __NR_fchown -#define SYS_openat __NR_openat -#define SYS_close __NR_close -#define SYS_vhangup __NR_vhangup -#define SYS_pipe2 __NR_pipe2 -#define SYS_quotactl __NR_quotactl -#define SYS_getdents64 __NR_getdents64 -#define SYS__llseek __NR__llseek -#define SYS_read __NR_read -#define SYS_write __NR_write -#define SYS_readv __NR_readv -#define SYS_writev __NR_writev -#define SYS_pread64 __NR_pread64 -#define SYS_pwrite64 __NR_pwrite64 -#define SYS_preadv __NR_preadv -#define SYS_pwritev __NR_pwritev -#define SYS_sendfile64 __NR_sendfile64 -#define SYS_pselect6 __NR_pselect6 -#define SYS_ppoll __NR_ppoll -#define SYS_signalfd4 __NR_signalfd4 -#define SYS_vmsplice __NR_vmsplice -#define SYS_splice __NR_splice -#define SYS_tee __NR_tee -#define SYS_readlinkat __NR_readlinkat -#define SYS_fstatat64 __NR_fstatat64 -#define SYS_fstat64 __NR_fstat64 -#define SYS_sync __NR_sync -#define SYS_fsync __NR_fsync -#define SYS_fdatasync __NR_fdatasync -#define SYS_sync_file_range __NR_sync_file_range -#define SYS_timerfd_create __NR_timerfd_create -#define SYS_timerfd_settime __NR_timerfd_settime -#define SYS_timerfd_gettime __NR_timerfd_gettime -#define SYS_utimensat __NR_utimensat -#define SYS_acct __NR_acct -#define SYS_capget __NR_capget -#define SYS_capset __NR_capset -#define SYS_personality __NR_personality -#define SYS_exit __NR_exit -#define SYS_exit_group __NR_exit_group -#define SYS_waitid __NR_waitid -#define SYS_set_tid_address __NR_set_tid_address -#define SYS_unshare __NR_unshare -#define SYS_futex __NR_futex -#define SYS_set_robust_list __NR_set_robust_list -#define SYS_get_robust_list __NR_get_robust_list -#define SYS_nanosleep __NR_nanosleep -#define SYS_getitimer __NR_getitimer -#define SYS_setitimer __NR_setitimer -#define SYS_kexec_load __NR_kexec_load -#define SYS_init_module __NR_init_module -#define SYS_delete_module __NR_delete_module -#define SYS_timer_create __NR_timer_create -#define SYS_timer_gettime __NR_timer_gettime -#define SYS_timer_getoverrun __NR_timer_getoverrun -#define SYS_timer_settime __NR_timer_settime -#define SYS_timer_delete __NR_timer_delete -#define SYS_clock_settime __NR_clock_settime -#define SYS_clock_gettime __NR_clock_gettime -#define SYS_clock_getres __NR_clock_getres -#define SYS_clock_nanosleep __NR_clock_nanosleep -#define SYS_syslog __NR_syslog -#define SYS_ptrace __NR_ptrace -#define SYS_sched_setparam __NR_sched_setparam -#define SYS_sched_setscheduler __NR_sched_setscheduler -#define SYS_sched_getscheduler __NR_sched_getscheduler -#define SYS_sched_getparam __NR_sched_getparam -#define SYS_sched_setaffinity __NR_sched_setaffinity -#define SYS_sched_getaffinity __NR_sched_getaffinity -#define SYS_sched_yield __NR_sched_yield -#define SYS_sched_get_priority_max __NR_sched_get_priority_max -#define SYS_sched_get_priority_min __NR_sched_get_priority_min -#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval -#define SYS_restart_syscall __NR_restart_syscall -#define SYS_kill __NR_kill -#define SYS_tkill __NR_tkill -#define SYS_tgkill __NR_tgkill -#define SYS_sigaltstack __NR_sigaltstack -#define SYS_rt_sigsuspend __NR_rt_sigsuspend -#define SYS_rt_sigaction __NR_rt_sigaction -#define SYS_rt_sigprocmask __NR_rt_sigprocmask -#define SYS_rt_sigpending __NR_rt_sigpending -#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait -#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo -#define SYS_rt_sigreturn __NR_rt_sigreturn -#define SYS_setpriority __NR_setpriority -#define SYS_getpriority __NR_getpriority -#define SYS_reboot __NR_reboot -#define SYS_setregid __NR_setregid -#define SYS_setgid __NR_setgid -#define SYS_setreuid __NR_setreuid -#define SYS_setuid __NR_setuid -#define SYS_setresuid __NR_setresuid -#define SYS_getresuid __NR_getresuid -#define SYS_setresgid __NR_setresgid -#define SYS_getresgid __NR_getresgid -#define SYS_setfsuid __NR_setfsuid -#define SYS_setfsgid __NR_setfsgid -#define SYS_times __NR_times -#define SYS_setpgid __NR_setpgid -#define SYS_getpgid __NR_getpgid -#define SYS_getsid __NR_getsid -#define SYS_setsid __NR_setsid -#define SYS_getgroups __NR_getgroups -#define SYS_setgroups __NR_setgroups -#define SYS_uname __NR_uname -#define SYS_sethostname __NR_sethostname -#define SYS_setdomainname __NR_setdomainname -#define SYS_getrlimit __NR_getrlimit -#define SYS_setrlimit __NR_setrlimit -#define SYS_getrusage __NR_getrusage -#define SYS_umask __NR_umask -#define SYS_prctl __NR_prctl -#define SYS_getcpu __NR_getcpu -#define SYS_gettimeofday __NR_gettimeofday -#define SYS_settimeofday __NR_settimeofday -#define SYS_adjtimex __NR_adjtimex -#define SYS_getpid __NR_getpid -#define SYS_getppid __NR_getppid -#define SYS_getuid __NR_getuid -#define SYS_geteuid __NR_geteuid -#define SYS_getgid __NR_getgid -#define SYS_getegid __NR_getegid -#define SYS_gettid __NR_gettid -#define SYS_sysinfo __NR_sysinfo -#define SYS_mq_open __NR_mq_open -#define SYS_mq_unlink __NR_mq_unlink -#define SYS_mq_timedsend __NR_mq_timedsend -#define SYS_mq_timedreceive __NR_mq_timedreceive -#define SYS_mq_notify __NR_mq_notify -#define SYS_mq_getsetattr __NR_mq_getsetattr -#define SYS_msgget __NR_msgget -#define SYS_msgctl __NR_msgctl -#define SYS_msgrcv __NR_msgrcv -#define SYS_msgsnd __NR_msgsnd -#define SYS_semget __NR_semget -#define SYS_semctl __NR_semctl -#define SYS_semtimedop __NR_semtimedop -#define SYS_semop __NR_semop -#define SYS_shmget __NR_shmget -#define SYS_shmctl __NR_shmctl -#define SYS_shmat __NR_shmat -#define SYS_shmdt __NR_shmdt -#define SYS_socket __NR_socket -#define SYS_socketpair __NR_socketpair -#define SYS_bind __NR_bind -#define SYS_listen __NR_listen -#define SYS_accept __NR_accept -#define SYS_connect __NR_connect -#define SYS_getsockname __NR_getsockname -#define SYS_getpeername __NR_getpeername -#define SYS_sendto __NR_sendto -#define SYS_recvfrom __NR_recvfrom -#define SYS_setsockopt __NR_setsockopt -#define SYS_getsockopt __NR_getsockopt -#define SYS_shutdown __NR_shutdown -#define SYS_sendmsg __NR_sendmsg -#define SYS_recvmsg __NR_recvmsg -#define SYS_readahead __NR_readahead -#define SYS_brk __NR_brk -#define SYS_munmap __NR_munmap -#define SYS_mremap __NR_mremap -#define SYS_add_key __NR_add_key -#define SYS_request_key __NR_request_key -#define SYS_keyctl __NR_keyctl -#define SYS_clone __NR_clone -#define SYS_execve __NR_execve -#define SYS_mmap2 __NR_mmap2 -#define SYS_fadvise64_64 __NR_fadvise64_64 -#define SYS_swapon __NR_swapon -#define SYS_swapoff __NR_swapoff -#define SYS_mprotect __NR_mprotect -#define SYS_msync __NR_msync -#define SYS_mlock __NR_mlock -#define SYS_munlock __NR_munlock -#define SYS_mlockall __NR_mlockall -#define SYS_munlockall __NR_munlockall -#define SYS_mincore __NR_mincore -#define SYS_madvise __NR_madvise -#define SYS_remap_file_pages __NR_remap_file_pages -#define SYS_mbind __NR_mbind -#define SYS_get_mempolicy __NR_get_mempolicy -#define SYS_set_mempolicy __NR_set_mempolicy -#define SYS_migrate_pages __NR_migrate_pages -#define SYS_move_pages __NR_move_pages -#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo -#define SYS_perf_event_open __NR_perf_event_open -#define SYS_accept4 __NR_accept4 -#define SYS_recvmmsg __NR_recvmmsg -#define SYS_or1k_atomic __NR_or1k_atomic -#define SYS_wait4 __NR_wait4 -#define SYS_prlimit64 __NR_prlimit64 -#define SYS_fanotify_init __NR_fanotify_init -#define SYS_fanotify_mark __NR_fanotify_mark -#define SYS_name_to_handle_at __NR_name_to_handle_at -#define SYS_open_by_handle_at __NR_open_by_handle_at -#define SYS_clock_adjtime __NR_clock_adjtime -#define SYS_syncfs __NR_syncfs -#define SYS_setns __NR_setns -#define SYS_sendmmsg __NR_sendmmsg -#define SYS_process_vm_readv __NR_process_vm_readv -#define SYS_process_vm_writev __NR_process_vm_writev -#define SYS_kcmp __NR_kcmp -#define SYS_finit_module __NR_finit_module -#define SYS_sched_setattr __NR_sched_setattr -#define SYS_sched_getattr __NR_sched_getattr -#define SYS_renameat2 __NR_renameat2 -#define SYS_seccomp __NR_seccomp -#define SYS_getrandom __NR_getrandom -#define SYS_memfd_create __NR_memfd_create -#define SYS_bpf __NR_bpf -#define SYS_execveat __NR_execveat -#define SYS_userfaultfd __NR_userfaultfd -#define SYS_membarrier __NR_membarrier -#define SYS_mlock2 __NR_mlock2 -#define SYS_copy_file_range __NR_copy_file_range diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in new file mode 100644 index 00000000..c6e55c6b --- /dev/null +++ b/arch/or1k/bits/syscall.h.in @@ -0,0 +1,272 @@ +#define __NR_io_setup 0 +#define __NR_io_destroy 1 +#define __NR_io_submit 2 +#define __NR_io_cancel 3 +#define __NR_io_getevents 4 +#define __NR_setxattr 5 +#define __NR_lsetxattr 6 +#define __NR_fsetxattr 7 +#define __NR_getxattr 8 +#define __NR_lgetxattr 9 +#define __NR_fgetxattr 10 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_flistxattr 13 +#define __NR_removexattr 14 +#define __NR_lremovexattr 15 +#define __NR_fremovexattr 16 +#define __NR_getcwd 17 +#define __NR_lookup_dcookie 18 +#define __NR_eventfd2 19 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_fcntl64 25 +#define __NR_inotify_init1 26 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_rm_watch 28 +#define __NR_ioctl 29 +#define __NR_ioprio_set 30 +#define __NR_ioprio_get 31 +#define __NR_flock 32 +#define __NR_mknodat 33 +#define __NR_mkdirat 34 +#define __NR_unlinkat 35 +#define __NR_symlinkat 36 +#define __NR_linkat 37 +#define __NR_renameat 38 +#define __NR_umount2 39 +#define __NR_mount 40 +#define __NR_pivot_root 41 +#define __NR_nfsservctl 42 +#define __NR_statfs64 43 +#define __NR_fstatfs64 44 +#define __NR_truncate64 45 +#define __NR_ftruncate64 46 +#define __NR_fallocate 47 +#define __NR_faccessat 48 +#define __NR_chdir 49 +#define __NR_fchdir 50 +#define __NR_chroot 51 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchownat 54 +#define __NR_fchown 55 +#define __NR_openat 56 +#define __NR_close 57 +#define __NR_vhangup 58 +#define __NR_pipe2 59 +#define __NR_quotactl 60 +#define __NR_getdents64 61 +#define __NR__llseek 62 +#define __NR_read 63 +#define __NR_write 64 +#define __NR_readv 65 +#define __NR_writev 66 +#define __NR_pread64 67 +#define __NR_pwrite64 68 +#define __NR_preadv 69 +#define __NR_pwritev 70 +#define __NR_sendfile64 71 +#define __NR_pselect6 72 +#define __NR_ppoll 73 +#define __NR_signalfd4 74 +#define __NR_vmsplice 75 +#define __NR_splice 76 +#define __NR_tee 77 +#define __NR_readlinkat 78 +#define __NR_fstatat64 79 +#define __NR_fstat64 80 +#define __NR_sync 81 +#define __NR_fsync 82 +#define __NR_fdatasync 83 +#define __NR_sync_file_range 84 +#define __NR_timerfd_create 85 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_gettime 87 +#define __NR_utimensat 88 +#define __NR_acct 89 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_personality 92 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_waitid 95 +#define __NR_set_tid_address 96 +#define __NR_unshare 97 +#define __NR_futex 98 +#define __NR_set_robust_list 99 +#define __NR_get_robust_list 100 +#define __NR_nanosleep 101 +#define __NR_getitimer 102 +#define __NR_setitimer 103 +#define __NR_kexec_load 104 +#define __NR_init_module 105 +#define __NR_delete_module 106 +#define __NR_timer_create 107 +#define __NR_timer_gettime 108 +#define __NR_timer_getoverrun 109 +#define __NR_timer_settime 110 +#define __NR_timer_delete 111 +#define __NR_clock_settime 112 +#define __NR_clock_gettime 113 +#define __NR_clock_getres 114 +#define __NR_clock_nanosleep 115 +#define __NR_syslog 116 +#define __NR_ptrace 117 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_getscheduler 120 +#define __NR_sched_getparam 121 +#define __NR_sched_setaffinity 122 +#define __NR_sched_getaffinity 123 +#define __NR_sched_yield 124 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_rr_get_interval 127 +#define __NR_restart_syscall 128 +#define __NR_kill 129 +#define __NR_tkill 130 +#define __NR_tgkill 131 +#define __NR_sigaltstack 132 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_setpriority 140 +#define __NR_getpriority 141 +#define __NR_reboot 142 +#define __NR_setregid 143 +#define __NR_setgid 144 +#define __NR_setreuid 145 +#define __NR_setuid 146 +#define __NR_setresuid 147 +#define __NR_getresuid 148 +#define __NR_setresgid 149 +#define __NR_getresgid 150 +#define __NR_setfsuid 151 +#define __NR_setfsgid 152 +#define __NR_times 153 +#define __NR_setpgid 154 +#define __NR_getpgid 155 +#define __NR_getsid 156 +#define __NR_setsid 157 +#define __NR_getgroups 158 +#define __NR_setgroups 159 +#define __NR_uname 160 +#define __NR_sethostname 161 +#define __NR_setdomainname 162 +#define __NR_getrlimit 163 +#define __NR_setrlimit 164 +#define __NR_getrusage 165 +#define __NR_umask 166 +#define __NR_prctl 167 +#define __NR_getcpu 168 +#define __NR_gettimeofday 169 +#define __NR_settimeofday 170 +#define __NR_adjtimex 171 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getuid 174 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getegid 177 +#define __NR_gettid 178 +#define __NR_sysinfo 179 +#define __NR_mq_open 180 +#define __NR_mq_unlink 181 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedreceive 183 +#define __NR_mq_notify 184 +#define __NR_mq_getsetattr 185 +#define __NR_msgget 186 +#define __NR_msgctl 187 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_semget 190 +#define __NR_semctl 191 +#define __NR_semtimedop 192 +#define __NR_semop 193 +#define __NR_shmget 194 +#define __NR_shmctl 195 +#define __NR_shmat 196 +#define __NR_shmdt 197 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_bind 200 +#define __NR_listen 201 +#define __NR_accept 202 +#define __NR_connect 203 +#define __NR_getsockname 204 +#define __NR_getpeername 205 +#define __NR_sendto 206 +#define __NR_recvfrom 207 +#define __NR_setsockopt 208 +#define __NR_getsockopt 209 +#define __NR_shutdown 210 +#define __NR_sendmsg 211 +#define __NR_recvmsg 212 +#define __NR_readahead 213 +#define __NR_brk 214 +#define __NR_munmap 215 +#define __NR_mremap 216 +#define __NR_add_key 217 +#define __NR_request_key 218 +#define __NR_keyctl 219 +#define __NR_clone 220 +#define __NR_execve 221 +#define __NR_mmap2 222 +#define __NR_fadvise64_64 223 +#define __NR_swapon 224 +#define __NR_swapoff 225 +#define __NR_mprotect 226 +#define __NR_msync 227 +#define __NR_mlock 228 +#define __NR_munlock 229 +#define __NR_mlockall 230 +#define __NR_munlockall 231 +#define __NR_mincore 232 +#define __NR_madvise 233 +#define __NR_remap_file_pages 234 +#define __NR_mbind 235 +#define __NR_get_mempolicy 236 +#define __NR_set_mempolicy 237 +#define __NR_migrate_pages 238 +#define __NR_move_pages 239 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_perf_event_open 241 +#define __NR_accept4 242 +#define __NR_recvmmsg 243 +#define __NR_or1k_atomic 244 +#define __NR_wait4 260 +#define __NR_prlimit64 261 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_name_to_handle_at 264 +#define __NR_open_by_handle_at 265 +#define __NR_clock_adjtime 266 +#define __NR_syncfs 267 +#define __NR_setns 268 +#define __NR_sendmmsg 269 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_kcmp 272 +#define __NR_finit_module 273 +#define __NR_sched_setattr 274 +#define __NR_sched_getattr 275 +#define __NR_renameat2 276 +#define __NR_seccomp 277 +#define __NR_getrandom 278 +#define __NR_memfd_create 279 +#define __NR_bpf 280 +#define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 +#define __NR_mlock2 284 +#define __NR_copy_file_range 285 + diff --git a/arch/powerpc/bits/syscall.h b/arch/powerpc/bits/syscall.h.in similarity index 50% rename from arch/powerpc/bits/syscall.h rename to arch/powerpc/bits/syscall.h.in index eb5295f6..f55e69c5 100644 --- a/arch/powerpc/bits/syscall.h +++ b/arch/powerpc/bits/syscall.h.in @@ -370,377 +370,3 @@ #define __NR_mlock2 378 #define __NR_copy_file_range 379 -/* - * repeated with SYS prefix - */ -#define SYS_restart_syscall 0 -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_waitpid 7 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execve 11 -#define SYS_chdir 12 -#define SYS_time 13 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_lchown 16 -#define SYS_break 17 -#define SYS_oldstat 18 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_mount 21 -#define SYS_umount 22 -#define SYS_setuid 23 -#define SYS_getuid 24 -#define SYS_stime 25 -#define SYS_ptrace 26 -#define SYS_alarm 27 -#define SYS_oldfstat 28 -#define SYS_pause 29 -#define SYS_utime 30 -#define SYS_stty 31 -#define SYS_gtty 32 -#define SYS_access 33 -#define SYS_nice 34 -#define SYS_ftime 35 -#define SYS_sync 36 -#define SYS_kill 37 -#define SYS_rename 38 -#define SYS_mkdir 39 -#define SYS_rmdir 40 -#define SYS_dup 41 -#define SYS_pipe 42 -#define SYS_times 43 -#define SYS_prof 44 -#define SYS_brk 45 -#define SYS_setgid 46 -#define SYS_getgid 47 -#define SYS_signal 48 -#define SYS_geteuid 49 -#define SYS_getegid 50 -#define SYS_acct 51 -#define SYS_umount2 52 -#define SYS_lock 53 -#define SYS_ioctl 54 -#define SYS_fcntl 55 -#define SYS_mpx 56 -#define SYS_setpgid 57 -#define SYS_ulimit 58 -#define SYS_oldolduname 59 -#define SYS_umask 60 -#define SYS_chroot 61 -#define SYS_ustat 62 -#define SYS_dup2 63 -#define SYS_getppid 64 -#define SYS_getpgrp 65 -#define SYS_setsid 66 -#define SYS_sigaction 67 -#define SYS_sgetmask 68 -#define SYS_ssetmask 69 -#define SYS_setreuid 70 -#define SYS_setregid 71 -#define SYS_sigsuspend 72 -#define SYS_sigpending 73 -#define SYS_sethostname 74 -#define SYS_setrlimit 75 -#define SYS_getrlimit 76 -#define SYS_getrusage 77 -#define SYS_gettimeofday 78 -#define SYS_settimeofday 79 -#define SYS_getgroups 80 -#define SYS_setgroups 81 -#define SYS_select 82 -#define SYS_symlink 83 -#define SYS_oldlstat 84 -#define SYS_readlink 85 -#define SYS_uselib 86 -#define SYS_swapon 87 -#define SYS_reboot 88 -#define SYS_readdir 89 -#define SYS_mmap 90 -#define SYS_munmap 91 -#define SYS_truncate 92 -#define SYS_ftruncate 93 -#define SYS_fchmod 94 -#define SYS_fchown 95 -#define SYS_getpriority 96 -#define SYS_setpriority 97 -#define SYS_profil 98 -#define SYS_statfs 99 -#define SYS_fstatfs 100 -#define SYS_ioperm 101 -#define SYS_socketcall 102 -#define SYS_syslog 103 -#define SYS_setitimer 104 -#define SYS_getitimer 105 -#define SYS_stat 106 -#define SYS_lstat 107 -#define SYS_fstat 108 -#define SYS_olduname 109 -#define SYS_iopl 110 -#define SYS_vhangup 111 -#define SYS_idle 112 -#define SYS_vm86 113 -#define SYS_wait4 114 -#define SYS_swapoff 115 -#define SYS_sysinfo 116 -#define SYS_ipc 117 -#define SYS_fsync 118 -#define SYS_sigreturn 119 -#define SYS_clone 120 -#define SYS_setdomainname 121 -#define SYS_uname 122 -#define SYS_modify_ldt 123 -#define SYS_adjtimex 124 -#define SYS_mprotect 125 -#define SYS_sigprocmask 126 -#define SYS_create_module 127 -#define SYS_init_module 128 -#define SYS_delete_module 129 -#define SYS_get_kernel_syms 130 -#define SYS_quotactl 131 -#define SYS_getpgid 132 -#define SYS_fchdir 133 -#define SYS_bdflush 134 -#define SYS_sysfs 135 -#define SYS_personality 136 -#define SYS_afs_syscall 137 -#define SYS_setfsuid 138 -#define SYS_setfsgid 139 -#define SYS__llseek 140 -#define SYS_getdents 141 -#define SYS__newselect 142 -#define SYS_flock 143 -#define SYS_msync 144 -#define SYS_readv 145 -#define SYS_writev 146 -#define SYS_getsid 147 -#define SYS_fdatasync 148 -#define SYS__sysctl 149 -#define SYS_mlock 150 -#define SYS_munlock 151 -#define SYS_mlockall 152 -#define SYS_munlockall 153 -#define SYS_sched_setparam 154 -#define SYS_sched_getparam 155 -#define SYS_sched_setscheduler 156 -#define SYS_sched_getscheduler 157 -#define SYS_sched_yield 158 -#define SYS_sched_get_priority_max 159 -#define SYS_sched_get_priority_min 160 -#define SYS_sched_rr_get_interval 161 -#define SYS_nanosleep 162 -#define SYS_mremap 163 -#define SYS_setresuid32 164 -#define SYS_setresuid 164 -#define SYS_getresuid32 165 -#define SYS_getresuid 165 -#define SYS_query_module 166 -#define SYS_poll 167 -#define SYS_nfsservctl 168 -#define SYS_setresgid32 169 -#define SYS_setresgid 169 -#define SYS_getresgid32 170 -#define SYS_getresgid 170 -#define SYS_prctl 171 -#define SYS_rt_sigreturn 172 -#define SYS_rt_sigaction 173 -#define SYS_rt_sigprocmask 174 -#define SYS_rt_sigpending 175 -#define SYS_rt_sigtimedwait 176 -#define SYS_rt_sigqueueinfo 177 -#define SYS_rt_sigsuspend 178 -#define SYS_pread64 179 -#define SYS_pwrite64 180 -#define SYS_chown 181 -#define SYS_getcwd 182 -#define SYS_capget 183 -#define SYS_capset 184 -#define SYS_sigaltstack 185 -#define SYS_sendfile 186 -#define SYS_getpmsg 187 -#define SYS_putpmsg 188 -#define SYS_vfork 189 -#define SYS_ugetrlimit 190 -#define SYS_readahead 191 -#define SYS_mmap2 192 -#define SYS_truncate64 193 -#define SYS_ftruncate64 194 -#define SYS_stat64 195 -#define SYS_lstat64 196 -#define SYS_fstat64 197 -#define SYS_pciconfig_read 198 -#define SYS_pciconfig_write 199 -#define SYS_pciconfig_iobase 200 -#define SYS_multiplexer 201 -#define SYS_getdents64 202 -#define SYS_pivot_root 203 -#define SYS_fcntl64 204 -#define SYS_madvise 205 -#define SYS_mincore 206 -#define SYS_gettid 207 -#define SYS_tkill 208 -#define SYS_setxattr 209 -#define SYS_lsetxattr 210 -#define SYS_fsetxattr 211 -#define SYS_getxattr 212 -#define SYS_lgetxattr 213 -#define SYS_fgetxattr 214 -#define SYS_listxattr 215 -#define SYS_llistxattr 216 -#define SYS_flistxattr 217 -#define SYS_removexattr 218 -#define SYS_lremovexattr 219 -#define SYS_fremovexattr 220 -#define SYS_futex 221 -#define SYS_sched_setaffinity 222 -#define SYS_sched_getaffinity 223 -#define SYS_tuxcall 225 -#define SYS_sendfile64 226 -#define SYS_io_setup 227 -#define SYS_io_destroy 228 -#define SYS_io_getevents 229 -#define SYS_io_submit 230 -#define SYS_io_cancel 231 -#define SYS_set_tid_address 232 -#define SYS_fadvise64 233 -#define SYS_exit_group 234 -#define SYS_lookup_dcookie 235 -#define SYS_epoll_create 236 -#define SYS_epoll_ctl 237 -#define SYS_epoll_wait 238 -#define SYS_remap_file_pages 239 -#define SYS_timer_create 240 -#define SYS_timer_settime 241 -#define SYS_timer_gettime 242 -#define SYS_timer_getoverrun 243 -#define SYS_timer_delete 244 -#define SYS_clock_settime 245 -#define SYS_clock_gettime 246 -#define SYS_clock_getres 247 -#define SYS_clock_nanosleep 248 -#define SYS_swapcontext 249 -#define SYS_tgkill 250 -#define SYS_utimes 251 -#define SYS_statfs64 252 -#define SYS_fstatfs64 253 -#define SYS_fadvise64_64 254 -#define SYS_rtas 255 -#define SYS_sys_debug_setcontext 256 -#define SYS_migrate_pages 258 -#define SYS_mbind 259 -#define SYS_get_mempolicy 260 -#define SYS_set_mempolicy 261 -#define SYS_mq_open 262 -#define SYS_mq_unlink 263 -#define SYS_mq_timedsend 264 -#define SYS_mq_timedreceive 265 -#define SYS_mq_notify 266 -#define SYS_mq_getsetattr 267 -#define SYS_kexec_load 268 -#define SYS_add_key 269 -#define SYS_request_key 270 -#define SYS_keyctl 271 -#define SYS_waitid 272 -#define SYS_ioprio_set 273 -#define SYS_ioprio_get 274 -#define SYS_inotify_init 275 -#define SYS_inotify_add_watch 276 -#define SYS_inotify_rm_watch 277 -#define SYS_spu_run 278 -#define SYS_spu_create 279 -#define SYS_pselect6 280 -#define SYS_ppoll 281 -#define SYS_unshare 282 -#define SYS_splice 283 -#define SYS_tee 284 -#define SYS_vmsplice 285 -#define SYS_openat 286 -#define SYS_mkdirat 287 -#define SYS_mknodat 288 -#define SYS_fchownat 289 -#define SYS_futimesat 290 -#define SYS_fstatat64 291 -#define SYS_unlinkat 292 -#define SYS_renameat 293 -#define SYS_linkat 294 -#define SYS_symlinkat 295 -#define SYS_readlinkat 296 -#define SYS_fchmodat 297 -#define SYS_faccessat 298 -#define SYS_get_robust_list 299 -#define SYS_set_robust_list 300 -#define SYS_move_pages 301 -#define SYS_getcpu 302 -#define SYS_epoll_pwait 303 -#define SYS_utimensat 304 -#define SYS_signalfd 305 -#define SYS_timerfd 306 -#define SYS_timerfd_create 306 -#define SYS_eventfd 307 -#define SYS_sync_file_range2 308 -#define SYS_fallocate 309 -#define SYS_subpage_prot 310 -#define SYS_timerfd_settime 311 -#define SYS_timerfd_gettime 312 -#define SYS_signalfd4 313 -#define SYS_eventfd2 314 -#define SYS_epoll_create1 315 -#define SYS_dup3 316 -#define SYS_pipe2 317 -#define SYS_inotify_init1 318 -#define SYS_perf_event_open 319 -#define SYS_preadv 320 -#define SYS_pwritev 321 -#define SYS_rt_tgsigqueueinfo 322 -#define SYS_fanotify_init 323 -#define SYS_fanotify_mark 324 -#define SYS_prlimit64 325 -#define SYS_socket 326 -#define SYS_bind 327 -#define SYS_connect 328 -#define SYS_listen 329 -#define SYS_accept 330 -#define SYS_getsockname 331 -#define SYS_getpeername 332 -#define SYS_socketpair 333 -#define SYS_send 334 -#define SYS_sendto 335 -#define SYS_recv 336 -#define SYS_recvfrom 337 -#define SYS_shutdown 338 -#define SYS_setsockopt 339 -#define SYS_getsockopt 340 -#define SYS_sendmsg 341 -#define SYS_recvmsg 342 -#define SYS_recvmmsg 343 -#define SYS_accept4 344 -#define SYS_name_to_handle_at 345 -#define SYS_open_by_handle_at 346 -#define SYS_clock_adjtime 347 -#define SYS_syncfs 348 -#define SYS_sendmmsg 349 -#define SYS_setns 350 -#define SYS_process_vm_readv 351 -#define SYS_process_vm_writev 352 -#define SYS_finit_module 353 -#define SYS_kcmp 354 -#define SYS_sched_setattr 355 -#define SYS_sched_getattr 356 -#define SYS_renameat2 357 -#define SYS_seccomp 358 -#define SYS_getrandom 359 -#define SYS_memfd_create 360 -#define SYS_bpf 361 -#define SYS_execveat 362 -#define SYS_switch_endian 363 -#define SYS_userfaultfd 364 -#define SYS_membarrier 365 -#define SYS_mlock2 378 -#define SYS_copy_file_range 379 diff --git a/arch/powerpc64/bits/syscall.h b/arch/powerpc64/bits/syscall.h.in similarity index 50% rename from arch/powerpc64/bits/syscall.h rename to arch/powerpc64/bits/syscall.h.in index 1c5c2ea8..ff375364 100644 --- a/arch/powerpc64/bits/syscall.h +++ b/arch/powerpc64/bits/syscall.h.in @@ -356,363 +356,3 @@ #define __NR_mlock2 378 #define __NR_copy_file_range 379 -/* - * repeated with SYS prefix - */ -#define SYS_restart_syscall 0 -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_waitpid 7 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execve 11 -#define SYS_chdir 12 -#define SYS_time 13 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_lchown 16 -#define SYS_break 17 -#define SYS_oldstat 18 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_mount 21 -#define SYS_umount 22 -#define SYS_setuid 23 -#define SYS_getuid 24 -#define SYS_stime 25 -#define SYS_ptrace 26 -#define SYS_alarm 27 -#define SYS_oldfstat 28 -#define SYS_pause 29 -#define SYS_utime 30 -#define SYS_stty 31 -#define SYS_gtty 32 -#define SYS_access 33 -#define SYS_nice 34 -#define SYS_ftime 35 -#define SYS_sync 36 -#define SYS_kill 37 -#define SYS_rename 38 -#define SYS_mkdir 39 -#define SYS_rmdir 40 -#define SYS_dup 41 -#define SYS_pipe 42 -#define SYS_times 43 -#define SYS_prof 44 -#define SYS_brk 45 -#define SYS_setgid 46 -#define SYS_getgid 47 -#define SYS_signal 48 -#define SYS_geteuid 49 -#define SYS_getegid 50 -#define SYS_acct 51 -#define SYS_umount2 52 -#define SYS_lock 53 -#define SYS_ioctl 54 -#define SYS_fcntl 55 -#define SYS_mpx 56 -#define SYS_setpgid 57 -#define SYS_ulimit 58 -#define SYS_oldolduname 59 -#define SYS_umask 60 -#define SYS_chroot 61 -#define SYS_ustat 62 -#define SYS_dup2 63 -#define SYS_getppid 64 -#define SYS_getpgrp 65 -#define SYS_setsid 66 -#define SYS_sigaction 67 -#define SYS_sgetmask 68 -#define SYS_ssetmask 69 -#define SYS_setreuid 70 -#define SYS_setregid 71 -#define SYS_sigsuspend 72 -#define SYS_sigpending 73 -#define SYS_sethostname 74 -#define SYS_setrlimit 75 -#define SYS_getrlimit 76 -#define SYS_getrusage 77 -#define SYS_gettimeofday 78 -#define SYS_settimeofday 79 -#define SYS_getgroups 80 -#define SYS_setgroups 81 -#define SYS_select 82 -#define SYS_symlink 83 -#define SYS_oldlstat 84 -#define SYS_readlink 85 -#define SYS_uselib 86 -#define SYS_swapon 87 -#define SYS_reboot 88 -#define SYS_readdir 89 -#define SYS_mmap 90 -#define SYS_munmap 91 -#define SYS_truncate 92 -#define SYS_ftruncate 93 -#define SYS_fchmod 94 -#define SYS_fchown 95 -#define SYS_getpriority 96 -#define SYS_setpriority 97 -#define SYS_profil 98 -#define SYS_statfs 99 -#define SYS_fstatfs 100 -#define SYS_ioperm 101 -#define SYS_socketcall 102 -#define SYS_syslog 103 -#define SYS_setitimer 104 -#define SYS_getitimer 105 -#define SYS_stat 106 -#define SYS_lstat 107 -#define SYS_fstat 108 -#define SYS_olduname 109 -#define SYS_iopl 110 -#define SYS_vhangup 111 -#define SYS_idle 112 -#define SYS_vm86 113 -#define SYS_wait4 114 -#define SYS_swapoff 115 -#define SYS_sysinfo 116 -#define SYS_ipc 117 -#define SYS_fsync 118 -#define SYS_sigreturn 119 -#define SYS_clone 120 -#define SYS_setdomainname 121 -#define SYS_uname 122 -#define SYS_modify_ldt 123 -#define SYS_adjtimex 124 -#define SYS_mprotect 125 -#define SYS_sigprocmask 126 -#define SYS_create_module 127 -#define SYS_init_module 128 -#define SYS_delete_module 129 -#define SYS_get_kernel_syms 130 -#define SYS_quotactl 131 -#define SYS_getpgid 132 -#define SYS_fchdir 133 -#define SYS_bdflush 134 -#define SYS_sysfs 135 -#define SYS_personality 136 -#define SYS_afs_syscall 137 -#define SYS_setfsuid 138 -#define SYS_setfsgid 139 -#define SYS__llseek 140 -#define SYS_getdents 141 -#define SYS__newselect 142 -#define SYS_flock 143 -#define SYS_msync 144 -#define SYS_readv 145 -#define SYS_writev 146 -#define SYS_getsid 147 -#define SYS_fdatasync 148 -#define SYS__sysctl 149 -#define SYS_mlock 150 -#define SYS_munlock 151 -#define SYS_mlockall 152 -#define SYS_munlockall 153 -#define SYS_sched_setparam 154 -#define SYS_sched_getparam 155 -#define SYS_sched_setscheduler 156 -#define SYS_sched_getscheduler 157 -#define SYS_sched_yield 158 -#define SYS_sched_get_priority_max 159 -#define SYS_sched_get_priority_min 160 -#define SYS_sched_rr_get_interval 161 -#define SYS_nanosleep 162 -#define SYS_mremap 163 -#define SYS_setresuid 164 -#define SYS_getresuid 165 -#define SYS_query_module 166 -#define SYS_poll 167 -#define SYS_nfsservctl 168 -#define SYS_setresgid 169 -#define SYS_getresgid 170 -#define SYS_prctl 171 -#define SYS_rt_sigreturn 172 -#define SYS_rt_sigaction 173 -#define SYS_rt_sigprocmask 174 -#define SYS_rt_sigpending 175 -#define SYS_rt_sigtimedwait 176 -#define SYS_rt_sigqueueinfo 177 -#define SYS_rt_sigsuspend 178 -#define SYS_pread64 179 -#define SYS_pwrite64 180 -#define SYS_chown 181 -#define SYS_getcwd 182 -#define SYS_capget 183 -#define SYS_capset 184 -#define SYS_sigaltstack 185 -#define SYS_sendfile 186 -#define SYS_getpmsg 187 -#define SYS_putpmsg 188 -#define SYS_vfork 189 -#define SYS_ugetrlimit 190 -#define SYS_readahead 191 -#define SYS_pciconfig_read 198 -#define SYS_pciconfig_write 199 -#define SYS_pciconfig_iobase 200 -#define SYS_multiplexer 201 -#define SYS_getdents64 202 -#define SYS_pivot_root 203 -#define SYS_madvise 205 -#define SYS_mincore 206 -#define SYS_gettid 207 -#define SYS_tkill 208 -#define SYS_setxattr 209 -#define SYS_lsetxattr 210 -#define SYS_fsetxattr 211 -#define SYS_getxattr 212 -#define SYS_lgetxattr 213 -#define SYS_fgetxattr 214 -#define SYS_listxattr 215 -#define SYS_llistxattr 216 -#define SYS_flistxattr 217 -#define SYS_removexattr 218 -#define SYS_lremovexattr 219 -#define SYS_fremovexattr 220 -#define SYS_futex 221 -#define SYS_sched_setaffinity 222 -#define SYS_sched_getaffinity 223 -#define SYS_tuxcall 225 -#define SYS_io_setup 227 -#define SYS_io_destroy 228 -#define SYS_io_getevents 229 -#define SYS_io_submit 230 -#define SYS_io_cancel 231 -#define SYS_set_tid_address 232 -#define SYS_fadvise64 233 -#define SYS_exit_group 234 -#define SYS_lookup_dcookie 235 -#define SYS_epoll_create 236 -#define SYS_epoll_ctl 237 -#define SYS_epoll_wait 238 -#define SYS_remap_file_pages 239 -#define SYS_timer_create 240 -#define SYS_timer_settime 241 -#define SYS_timer_gettime 242 -#define SYS_timer_getoverrun 243 -#define SYS_timer_delete 244 -#define SYS_clock_settime 245 -#define SYS_clock_gettime 246 -#define SYS_clock_getres 247 -#define SYS_clock_nanosleep 248 -#define SYS_swapcontext 249 -#define SYS_tgkill 250 -#define SYS_utimes 251 -#define SYS_statfs64 252 -#define SYS_fstatfs64 253 -#define SYS_rtas 255 -#define SYS_sys_debug_setcontext 256 -#define SYS_migrate_pages 258 -#define SYS_mbind 259 -#define SYS_get_mempolicy 260 -#define SYS_set_mempolicy 261 -#define SYS_mq_open 262 -#define SYS_mq_unlink 263 -#define SYS_mq_timedsend 264 -#define SYS_mq_timedreceive 265 -#define SYS_mq_notify 266 -#define SYS_mq_getsetattr 267 -#define SYS_kexec_load 268 -#define SYS_add_key 269 -#define SYS_request_key 270 -#define SYS_keyctl 271 -#define SYS_waitid 272 -#define SYS_ioprio_set 273 -#define SYS_ioprio_get 274 -#define SYS_inotify_init 275 -#define SYS_inotify_add_watch 276 -#define SYS_inotify_rm_watch 277 -#define SYS_spu_run 278 -#define SYS_spu_create 279 -#define SYS_pselect6 280 -#define SYS_ppoll 281 -#define SYS_unshare 282 -#define SYS_splice 283 -#define SYS_tee 284 -#define SYS_vmsplice 285 -#define SYS_openat 286 -#define SYS_mkdirat 287 -#define SYS_mknodat 288 -#define SYS_fchownat 289 -#define SYS_futimesat 290 -#define SYS_newfstatat 291 -#define SYS_unlinkat 292 -#define SYS_renameat 293 -#define SYS_linkat 294 -#define SYS_symlinkat 295 -#define SYS_readlinkat 296 -#define SYS_fchmodat 297 -#define SYS_faccessat 298 -#define SYS_get_robust_list 299 -#define SYS_set_robust_list 300 -#define SYS_move_pages 301 -#define SYS_getcpu 302 -#define SYS_epoll_pwait 303 -#define SYS_utimensat 304 -#define SYS_signalfd 305 -#define SYS_timerfd_create 306 -#define SYS_eventfd 307 -#define SYS_sync_file_range2 308 -#define SYS_fallocate 309 -#define SYS_subpage_prot 310 -#define SYS_timerfd_settime 311 -#define SYS_timerfd_gettime 312 -#define SYS_signalfd4 313 -#define SYS_eventfd2 314 -#define SYS_epoll_create1 315 -#define SYS_dup3 316 -#define SYS_pipe2 317 -#define SYS_inotify_init1 318 -#define SYS_perf_event_open 319 -#define SYS_preadv 320 -#define SYS_pwritev 321 -#define SYS_rt_tgsigqueueinfo 322 -#define SYS_fanotify_init 323 -#define SYS_fanotify_mark 324 -#define SYS_prlimit64 325 -#define SYS_socket 326 -#define SYS_bind 327 -#define SYS_connect 328 -#define SYS_listen 329 -#define SYS_accept 330 -#define SYS_getsockname 331 -#define SYS_getpeername 332 -#define SYS_socketpair 333 -#define SYS_send 334 -#define SYS_sendto 335 -#define SYS_recv 336 -#define SYS_recvfrom 337 -#define SYS_shutdown 338 -#define SYS_setsockopt 339 -#define SYS_getsockopt 340 -#define SYS_sendmsg 341 -#define SYS_recvmsg 342 -#define SYS_recvmmsg 343 -#define SYS_accept4 344 -#define SYS_name_to_handle_at 345 -#define SYS_open_by_handle_at 346 -#define SYS_clock_adjtime 347 -#define SYS_syncfs 348 -#define SYS_sendmmsg 349 -#define SYS_setns 350 -#define SYS_process_vm_readv 351 -#define SYS_process_vm_writev 352 -#define SYS_finit_module 353 -#define SYS_kcmp 354 -#define SYS_sched_setattr 355 -#define SYS_sched_getattr 356 -#define SYS_renameat2 357 -#define SYS_seccomp 358 -#define SYS_getrandom 359 -#define SYS_memfd_create 360 -#define SYS_bpf 361 -#define SYS_execveat 362 -#define SYS_switch_endian 363 -#define SYS_userfaultfd 364 -#define SYS_membarrier 365 -#define SYS_mlock2 378 -#define SYS_copy_file_range 379 diff --git a/arch/sh/bits/syscall.h b/arch/sh/bits/syscall.h deleted file mode 100644 index 4b363bf2..00000000 --- a/arch/sh/bits/syscall.h +++ /dev/null @@ -1,684 +0,0 @@ -#define __NR_restart_syscall 0 -#define __NR_exit 1 -#define __NR_fork 2 -#define __NR_read 3 -#define __NR_write 4 -#define __NR_open 5 -#define __NR_close 6 -#define __NR_waitpid 7 -#define __NR_creat 8 -#define __NR_link 9 -#define __NR_unlink 10 -#define __NR_execve 11 -#define __NR_chdir 12 -#define __NR_time 13 -#define __NR_mknod 14 -#define __NR_chmod 15 -#define __NR_lchown 16 -#define __NR_oldstat 18 -#define __NR_lseek 19 -#define __NR_getpid 20 -#define __NR_mount 21 -#define __NR_umount 22 -#define __NR_setuid 23 -#define __NR_getuid 24 -#define __NR_stime 25 -#define __NR_ptrace 26 -#define __NR_alarm 27 -#define __NR_oldfstat 28 -#define __NR_pause 29 -#define __NR_utime 30 -#define __NR_access 33 -#define __NR_nice 34 -#define __NR_sync 36 -#define __NR_kill 37 -#define __NR_rename 38 -#define __NR_mkdir 39 -#define __NR_rmdir 40 -#define __NR_dup 41 -#define __NR_pipe 42 -#define __NR_times 43 -#define __NR_brk 45 -#define __NR_setgid 46 -#define __NR_getgid 47 -#define __NR_signal 48 -#define __NR_geteuid 49 -#define __NR_getegid 50 -#define __NR_acct 51 -#define __NR_umount2 52 -#define __NR_ioctl 54 -#define __NR_fcntl 55 -#define __NR_setpgid 57 -#define __NR_umask 60 -#define __NR_chroot 61 -#define __NR_ustat 62 -#define __NR_dup2 63 -#define __NR_getppid 64 -#define __NR_getpgrp 65 -#define __NR_setsid 66 -#define __NR_sigaction 67 -#define __NR_sgetmask 68 -#define __NR_ssetmask 69 -#define __NR_setreuid 70 -#define __NR_setregid 71 -#define __NR_sigsuspend 72 -#define __NR_sigpending 73 -#define __NR_sethostname 74 -#define __NR_setrlimit 75 -#define __NR_getrlimit 76 -#define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 -#define __NR_getgroups 80 -#define __NR_setgroups 81 -#define __NR_symlink 83 -#define __NR_oldlstat 84 -#define __NR_readlink 85 -#define __NR_uselib 86 -#define __NR_swapon 87 -#define __NR_reboot 88 -#define __NR_readdir 89 -#define __NR_mmap 90 -#define __NR_munmap 91 -#define __NR_truncate 92 -#define __NR_ftruncate 93 -#define __NR_fchmod 94 -#define __NR_fchown 95 -#define __NR_getpriority 96 -#define __NR_setpriority 97 -#define __NR_statfs 99 -#define __NR_fstatfs 100 -#define __NR_socketcall 102 -#define __NR_syslog 103 -#define __NR_setitimer 104 -#define __NR_getitimer 105 -#define __NR_stat 106 -#define __NR_lstat 107 -#define __NR_fstat 108 -#define __NR_olduname 109 -#define __NR_vhangup 111 -#define __NR_wait4 114 -#define __NR_swapoff 115 -#define __NR_sysinfo 116 -#define __NR_ipc 117 -#define __NR_fsync 118 -#define __NR_sigreturn 119 -#define __NR_clone 120 -#define __NR_setdomainname 121 -#define __NR_uname 122 -#define __NR_cacheflush 123 -#define __NR_adjtimex 124 -#define __NR_mprotect 125 -#define __NR_sigprocmask 126 -#define __NR_init_module 128 -#define __NR_delete_module 129 -#define __NR_quotactl 131 -#define __NR_getpgid 132 -#define __NR_fchdir 133 -#define __NR_bdflush 134 -#define __NR_sysfs 135 -#define __NR_personality 136 -#define __NR_setfsuid 138 -#define __NR_setfsgid 139 -#define __NR__llseek 140 -#define __NR_getdents 141 -#define __NR__newselect 142 -#define __NR_flock 143 -#define __NR_msync 144 -#define __NR_readv 145 -#define __NR_writev 146 -#define __NR_getsid 147 -#define __NR_fdatasync 148 -#define __NR__sysctl 149 -#define __NR_mlock 150 -#define __NR_munlock 151 -#define __NR_mlockall 152 -#define __NR_munlockall 153 -#define __NR_sched_setparam 154 -#define __NR_sched_getparam 155 -#define __NR_sched_setscheduler 156 -#define __NR_sched_getscheduler 157 -#define __NR_sched_yield 158 -#define __NR_sched_get_priority_max 159 -#define __NR_sched_get_priority_min 160 -#define __NR_sched_rr_get_interval 161 -#define __NR_nanosleep 162 -#define __NR_mremap 163 -#define __NR_setresuid 164 -#define __NR_getresuid 165 -#define __NR_poll 168 -#define __NR_nfsservctl 169 -#define __NR_setresgid 170 -#define __NR_getresgid 171 -#define __NR_prctl 172 -#define __NR_rt_sigreturn 173 -#define __NR_rt_sigaction 174 -#define __NR_rt_sigprocmask 175 -#define __NR_rt_sigpending 176 -#define __NR_rt_sigtimedwait 177 -#define __NR_rt_sigqueueinfo 178 -#define __NR_rt_sigsuspend 179 -#define __NR_pread64 180 -#define __NR_pwrite64 181 -#define __NR_chown 182 -#define __NR_getcwd 183 -#define __NR_capget 184 -#define __NR_capset 185 -#define __NR_sigaltstack 186 -#define __NR_sendfile 187 -#define __NR_vfork 190 -#define __NR_ugetrlimit 191 -#define __NR_mmap2 192 -#define __NR_truncate64 193 -#define __NR_ftruncate64 194 -#define __NR_stat64 195 -#define __NR_lstat64 196 -#define __NR_fstat64 197 -#define __NR_lchown32 198 -#define __NR_getuid32 199 -#define __NR_getgid32 200 -#define __NR_geteuid32 201 -#define __NR_getegid32 202 -#define __NR_setreuid32 203 -#define __NR_setregid32 204 -#define __NR_getgroups32 205 -#define __NR_setgroups32 206 -#define __NR_fchown32 207 -#define __NR_setresuid32 208 -#define __NR_getresuid32 209 -#define __NR_setresgid32 210 -#define __NR_getresgid32 211 -#define __NR_chown32 212 -#define __NR_setuid32 213 -#define __NR_setgid32 214 -#define __NR_setfsuid32 215 -#define __NR_setfsgid32 216 -#define __NR_pivot_root 217 -#define __NR_mincore 218 -#define __NR_madvise 219 -#define __NR_getdents64 220 -#define __NR_fcntl64 221 -#define __NR_gettid 224 -#define __NR_readahead 225 -#define __NR_setxattr 226 -#define __NR_lsetxattr 227 -#define __NR_fsetxattr 228 -#define __NR_getxattr 229 -#define __NR_lgetxattr 230 -#define __NR_fgetxattr 231 -#define __NR_listxattr 232 -#define __NR_llistxattr 233 -#define __NR_flistxattr 234 -#define __NR_removexattr 235 -#define __NR_lremovexattr 236 -#define __NR_fremovexattr 237 -#define __NR_tkill 238 -#define __NR_sendfile64 239 -#define __NR_futex 240 -#define __NR_sched_setaffinity 241 -#define __NR_sched_getaffinity 242 -#define __NR_io_setup 245 -#define __NR_io_destroy 246 -#define __NR_io_getevents 247 -#define __NR_io_submit 248 -#define __NR_io_cancel 249 -#define __NR_fadvise64 250 -#define __NR_exit_group 252 -#define __NR_lookup_dcookie 253 -#define __NR_epoll_create 254 -#define __NR_epoll_ctl 255 -#define __NR_epoll_wait 256 -#define __NR_remap_file_pages 257 -#define __NR_set_tid_address 258 -#define __NR_timer_create 259 -#define __NR_timer_settime 260 -#define __NR_timer_gettime 261 -#define __NR_timer_getoverrun 262 -#define __NR_timer_delete 263 -#define __NR_clock_settime 264 -#define __NR_clock_gettime 265 -#define __NR_clock_getres 266 -#define __NR_clock_nanosleep 267 -#define __NR_statfs64 268 -#define __NR_fstatfs64 269 -#define __NR_tgkill 270 -#define __NR_utimes 271 -#define __NR_fadvise64_64 272 -#define __NR_mbind 274 -#define __NR_get_mempolicy 275 -#define __NR_set_mempolicy 276 -#define __NR_mq_open 277 -#define __NR_mq_unlink 278 -#define __NR_mq_timedsend 279 -#define __NR_mq_timedreceive 280 -#define __NR_mq_notify 281 -#define __NR_mq_getsetattr 282 -#define __NR_kexec_load 283 -#define __NR_waitid 284 -#define __NR_add_key 285 -#define __NR_request_key 286 -#define __NR_keyctl 287 -#define __NR_ioprio_set 288 -#define __NR_ioprio_get 289 -#define __NR_inotify_init 290 -#define __NR_inotify_add_watch 291 -#define __NR_inotify_rm_watch 292 -#define __NR_migrate_pages 294 -#define __NR_openat 295 -#define __NR_mkdirat 296 -#define __NR_mknodat 297 -#define __NR_fchownat 298 -#define __NR_futimesat 299 -#define __NR_fstatat64 300 -#define __NR_unlinkat 301 -#define __NR_renameat 302 -#define __NR_linkat 303 -#define __NR_symlinkat 304 -#define __NR_readlinkat 305 -#define __NR_fchmodat 306 -#define __NR_faccessat 307 -#define __NR_pselect6 308 -#define __NR_ppoll 309 -#define __NR_unshare 310 -#define __NR_set_robust_list 311 -#define __NR_get_robust_list 312 -#define __NR_splice 313 -#define __NR_sync_file_range 314 -#define __NR_tee 315 -#define __NR_vmsplice 316 -#define __NR_move_pages 317 -#define __NR_getcpu 318 -#define __NR_epoll_pwait 319 -#define __NR_utimensat 320 -#define __NR_signalfd 321 -#define __NR_timerfd_create 322 -#define __NR_eventfd 323 -#define __NR_fallocate 324 -#define __NR_timerfd_settime 325 -#define __NR_timerfd_gettime 326 -#define __NR_signalfd4 327 -#define __NR_eventfd2 328 -#define __NR_epoll_create1 329 -#define __NR_dup3 330 -#define __NR_pipe2 331 -#define __NR_inotify_init1 332 -#define __NR_preadv 333 -#define __NR_pwritev 334 -#define __NR_rt_tgsigqueueinfo 335 -#define __NR_perf_event_open 336 -#define __NR_fanotify_init 337 -#define __NR_fanotify_mark 338 -#define __NR_prlimit64 339 -#define __NR_socket 340 -#define __NR_bind 341 -#define __NR_connect 342 -#define __NR_listen 343 -#define __NR_accept 344 -#define __NR_getsockname 345 -#define __NR_getpeername 346 -#define __NR_socketpair 347 -#define __NR_send 348 -#define __NR_sendto 349 -#define __NR_recv 350 -#define __NR_recvfrom 351 -#define __NR_shutdown 352 -#define __NR_setsockopt 353 -#define __NR_getsockopt 354 -#define __NR_sendmsg 355 -#define __NR_recvmsg 356 -#define __NR_recvmmsg 357 -#define __NR_accept4 358 -#define __NR_name_to_handle_at 359 -#define __NR_open_by_handle_at 360 -#define __NR_clock_adjtime 361 -#define __NR_syncfs 362 -#define __NR_sendmmsg 363 -#define __NR_setns 364 -#define __NR_process_vm_readv 365 -#define __NR_process_vm_writev 366 -#define __NR_kcmp 367 -#define __NR_finit_module 368 - - -/* Repeated with SYS_ prefix */ - -#define SYS_restart_syscall 0 -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_waitpid 7 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execve 11 -#define SYS_chdir 12 -#define SYS_time 13 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_lchown 16 -#define SYS_oldstat 18 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_mount 21 -#define SYS_umount 22 -#define SYS_setuid 23 -#define SYS_getuid 24 -#define SYS_stime 25 -#define SYS_ptrace 26 -#define SYS_alarm 27 -#define SYS_oldfstat 28 -#define SYS_pause 29 -#define SYS_utime 30 -#define SYS_access 33 -#define SYS_nice 34 -#define SYS_sync 36 -#define SYS_kill 37 -#define SYS_rename 38 -#define SYS_mkdir 39 -#define SYS_rmdir 40 -#define SYS_dup 41 -#define SYS_pipe 42 -#define SYS_times 43 -#define SYS_brk 45 -#define SYS_setgid 46 -#define SYS_getgid 47 -#define SYS_signal 48 -#define SYS_geteuid 49 -#define SYS_getegid 50 -#define SYS_acct 51 -#define SYS_umount2 52 -#define SYS_ioctl 54 -#define SYS_fcntl 55 -#define SYS_setpgid 57 -#define SYS_umask 60 -#define SYS_chroot 61 -#define SYS_ustat 62 -#define SYS_dup2 63 -#define SYS_getppid 64 -#define SYS_getpgrp 65 -#define SYS_setsid 66 -#define SYS_sigaction 67 -#define SYS_sgetmask 68 -#define SYS_ssetmask 69 -#define SYS_setreuid 70 -#define SYS_setregid 71 -#define SYS_sigsuspend 72 -#define SYS_sigpending 73 -#define SYS_sethostname 74 -#define SYS_setrlimit 75 -#define SYS_getrlimit 76 -#define SYS_getrusage 77 -#define SYS_gettimeofday 78 -#define SYS_settimeofday 79 -#define SYS_getgroups 80 -#define SYS_setgroups 81 -#define SYS_symlink 83 -#define SYS_oldlstat 84 -#define SYS_readlink 85 -#define SYS_uselib 86 -#define SYS_swapon 87 -#define SYS_reboot 88 -#define SYS_readdir 89 -#define SYS_mmap 90 -#define SYS_munmap 91 -#define SYS_truncate 92 -#define SYS_ftruncate 93 -#define SYS_fchmod 94 -#define SYS_fchown 95 -#define SYS_getpriority 96 -#define SYS_setpriority 97 -#define SYS_statfs 99 -#define SYS_fstatfs 100 -#define SYS_socketcall 102 -#define SYS_syslog 103 -#define SYS_setitimer 104 -#define SYS_getitimer 105 -#define SYS_stat 106 -#define SYS_lstat 107 -#define SYS_fstat 108 -#define SYS_olduname 109 -#define SYS_vhangup 111 -#define SYS_wait4 114 -#define SYS_swapoff 115 -#define SYS_sysinfo 116 -#define SYS_ipc 117 -#define SYS_fsync 118 -#define SYS_sigreturn 119 -#define SYS_clone 120 -#define SYS_setdomainname 121 -#define SYS_uname 122 -#define SYS_cacheflush 123 -#define SYS_adjtimex 124 -#define SYS_mprotect 125 -#define SYS_sigprocmask 126 -#define SYS_init_module 128 -#define SYS_delete_module 129 -#define SYS_quotactl 131 -#define SYS_getpgid 132 -#define SYS_fchdir 133 -#define SYS_bdflush 134 -#define SYS_sysfs 135 -#define SYS_personality 136 -#define SYS_setfsuid 138 -#define SYS_setfsgid 139 -#define SYS__llseek 140 -#define SYS_getdents 141 -#define SYS__newselect 142 -#define SYS_flock 143 -#define SYS_msync 144 -#define SYS_readv 145 -#define SYS_writev 146 -#define SYS_getsid 147 -#define SYS_fdatasync 148 -#define SYS__sysctl 149 -#define SYS_mlock 150 -#define SYS_munlock 151 -#define SYS_mlockall 152 -#define SYS_munlockall 153 -#define SYS_sched_setparam 154 -#define SYS_sched_getparam 155 -#define SYS_sched_setscheduler 156 -#define SYS_sched_getscheduler 157 -#define SYS_sched_yield 158 -#define SYS_sched_get_priority_max 159 -#define SYS_sched_get_priority_min 160 -#define SYS_sched_rr_get_interval 161 -#define SYS_nanosleep 162 -#define SYS_mremap 163 -#define SYS_setresuid 164 -#define SYS_getresuid 165 -#define SYS_poll 168 -#define SYS_nfsservctl 169 -#define SYS_setresgid 170 -#define SYS_getresgid 171 -#define SYS_prctl 172 -#define SYS_rt_sigreturn 173 -#define SYS_rt_sigaction 174 -#define SYS_rt_sigprocmask 175 -#define SYS_rt_sigpending 176 -#define SYS_rt_sigtimedwait 177 -#define SYS_rt_sigqueueinfo 178 -#define SYS_rt_sigsuspend 179 -#define SYS_pread64 180 -#define SYS_pwrite64 181 -#define SYS_chown 182 -#define SYS_getcwd 183 -#define SYS_capget 184 -#define SYS_capset 185 -#define SYS_sigaltstack 186 -#define SYS_sendfile 187 -#define SYS_vfork 190 -#define SYS_ugetrlimit 191 -#define SYS_mmap2 192 -#define SYS_truncate64 193 -#define SYS_ftruncate64 194 -#define SYS_stat64 195 -#define SYS_lstat64 196 -#define SYS_fstat64 197 -#define SYS_lchown32 198 -#define SYS_getuid32 199 -#define SYS_getgid32 200 -#define SYS_geteuid32 201 -#define SYS_getegid32 202 -#define SYS_setreuid32 203 -#define SYS_setregid32 204 -#define SYS_getgroups32 205 -#define SYS_setgroups32 206 -#define SYS_fchown32 207 -#define SYS_setresuid32 208 -#define SYS_getresuid32 209 -#define SYS_setresgid32 210 -#define SYS_getresgid32 211 -#define SYS_chown32 212 -#define SYS_setuid32 213 -#define SYS_setgid32 214 -#define SYS_setfsuid32 215 -#define SYS_setfsgid32 216 -#define SYS_pivot_root 217 -#define SYS_mincore 218 -#define SYS_madvise 219 -#define SYS_getdents64 220 -#define SYS_fcntl64 221 -#define SYS_gettid 224 -#define SYS_readahead 225 -#define SYS_setxattr 226 -#define SYS_lsetxattr 227 -#define SYS_fsetxattr 228 -#define SYS_getxattr 229 -#define SYS_lgetxattr 230 -#define SYS_fgetxattr 231 -#define SYS_listxattr 232 -#define SYS_llistxattr 233 -#define SYS_flistxattr 234 -#define SYS_removexattr 235 -#define SYS_lremovexattr 236 -#define SYS_fremovexattr 237 -#define SYS_tkill 238 -#define SYS_sendfile64 239 -#define SYS_futex 240 -#define SYS_sched_setaffinity 241 -#define SYS_sched_getaffinity 242 -#define SYS_io_setup 245 -#define SYS_io_destroy 246 -#define SYS_io_getevents 247 -#define SYS_io_submit 248 -#define SYS_io_cancel 249 -#define SYS_fadvise64 250 -#define SYS_exit_group 252 -#define SYS_lookup_dcookie 253 -#define SYS_epoll_create 254 -#define SYS_epoll_ctl 255 -#define SYS_epoll_wait 256 -#define SYS_remap_file_pages 257 -#define SYS_set_tid_address 258 -#define SYS_timer_create 259 -#define SYS_timer_settime 260 -#define SYS_timer_gettime 261 -#define SYS_timer_getoverrun 262 -#define SYS_timer_delete 263 -#define SYS_clock_settime 264 -#define SYS_clock_gettime 265 -#define SYS_clock_getres 266 -#define SYS_clock_nanosleep 267 -#define SYS_statfs64 268 -#define SYS_fstatfs64 269 -#define SYS_tgkill 270 -#define SYS_utimes 271 -#define SYS_fadvise64_64 272 -#define SYS_mbind 274 -#define SYS_get_mempolicy 275 -#define SYS_set_mempolicy 276 -#define SYS_mq_open 277 -#define SYS_mq_unlink 278 -#define SYS_mq_timedsend 279 -#define SYS_mq_timedreceive 280 -#define SYS_mq_notify 281 -#define SYS_mq_getsetattr 282 -#define SYS_kexec_load 283 -#define SYS_waitid 284 -#define SYS_add_key 285 -#define SYS_request_key 286 -#define SYS_keyctl 287 -#define SYS_ioprio_set 288 -#define SYS_ioprio_get 289 -#define SYS_inotify_init 290 -#define SYS_inotify_add_watch 291 -#define SYS_inotify_rm_watch 292 -#define SYS_migrate_pages 294 -#define SYS_openat 295 -#define SYS_mkdirat 296 -#define SYS_mknodat 297 -#define SYS_fchownat 298 -#define SYS_futimesat 299 -#define SYS_fstatat64 300 -#define SYS_unlinkat 301 -#define SYS_renameat 302 -#define SYS_linkat 303 -#define SYS_symlinkat 304 -#define SYS_readlinkat 305 -#define SYS_fchmodat 306 -#define SYS_faccessat 307 -#define SYS_pselect6 308 -#define SYS_ppoll 309 -#define SYS_unshare 310 -#define SYS_set_robust_list 311 -#define SYS_get_robust_list 312 -#define SYS_splice 313 -#define SYS_sync_file_range 314 -#define SYS_tee 315 -#define SYS_vmsplice 316 -#define SYS_move_pages 317 -#define SYS_getcpu 318 -#define SYS_epoll_pwait 319 -#define SYS_utimensat 320 -#define SYS_signalfd 321 -#define SYS_timerfd_create 322 -#define SYS_eventfd 323 -#define SYS_fallocate 324 -#define SYS_timerfd_settime 325 -#define SYS_timerfd_gettime 326 -#define SYS_signalfd4 327 -#define SYS_eventfd2 328 -#define SYS_epoll_create1 329 -#define SYS_dup3 330 -#define SYS_pipe2 331 -#define SYS_inotify_init1 332 -#define SYS_preadv 333 -#define SYS_pwritev 334 -#define SYS_rt_tgsigqueueinfo 335 -#define SYS_perf_event_open 336 -#define SYS_fanotify_init 337 -#define SYS_fanotify_mark 338 -#define SYS_prlimit64 339 -#define SYS_socket 340 -#define SYS_bind 341 -#define SYS_connect 342 -#define SYS_listen 343 -#define SYS_accept 344 -#define SYS_getsockname 345 -#define SYS_getpeername 346 -#define SYS_socketpair 347 -#define SYS_send 348 -#define SYS_sendto 349 -#define SYS_recv 350 -#define SYS_recvfrom 351 -#define SYS_shutdown 352 -#define SYS_setsockopt 353 -#define SYS_getsockopt 354 -#define SYS_sendmsg 355 -#define SYS_recvmsg 356 -#define SYS_recvmmsg 357 -#define SYS_accept4 358 -#define SYS_name_to_handle_at 359 -#define SYS_open_by_handle_at 360 -#define SYS_clock_adjtime 361 -#define SYS_syncfs 362 -#define SYS_sendmmsg 363 -#define SYS_setns 364 -#define SYS_process_vm_readv 365 -#define SYS_process_vm_writev 366 -#define SYS_kcmp 367 -#define SYS_finit_module 368 diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in new file mode 100644 index 00000000..595fc4d2 --- /dev/null +++ b/arch/sh/bits/syscall.h.in @@ -0,0 +1,341 @@ +#define __NR_restart_syscall 0 +#define __NR_exit 1 +#define __NR_fork 2 +#define __NR_read 3 +#define __NR_write 4 +#define __NR_open 5 +#define __NR_close 6 +#define __NR_waitpid 7 +#define __NR_creat 8 +#define __NR_link 9 +#define __NR_unlink 10 +#define __NR_execve 11 +#define __NR_chdir 12 +#define __NR_time 13 +#define __NR_mknod 14 +#define __NR_chmod 15 +#define __NR_lchown 16 +#define __NR_oldstat 18 +#define __NR_lseek 19 +#define __NR_getpid 20 +#define __NR_mount 21 +#define __NR_umount 22 +#define __NR_setuid 23 +#define __NR_getuid 24 +#define __NR_stime 25 +#define __NR_ptrace 26 +#define __NR_alarm 27 +#define __NR_oldfstat 28 +#define __NR_pause 29 +#define __NR_utime 30 +#define __NR_access 33 +#define __NR_nice 34 +#define __NR_sync 36 +#define __NR_kill 37 +#define __NR_rename 38 +#define __NR_mkdir 39 +#define __NR_rmdir 40 +#define __NR_dup 41 +#define __NR_pipe 42 +#define __NR_times 43 +#define __NR_brk 45 +#define __NR_setgid 46 +#define __NR_getgid 47 +#define __NR_signal 48 +#define __NR_geteuid 49 +#define __NR_getegid 50 +#define __NR_acct 51 +#define __NR_umount2 52 +#define __NR_ioctl 54 +#define __NR_fcntl 55 +#define __NR_setpgid 57 +#define __NR_umask 60 +#define __NR_chroot 61 +#define __NR_ustat 62 +#define __NR_dup2 63 +#define __NR_getppid 64 +#define __NR_getpgrp 65 +#define __NR_setsid 66 +#define __NR_sigaction 67 +#define __NR_sgetmask 68 +#define __NR_ssetmask 69 +#define __NR_setreuid 70 +#define __NR_setregid 71 +#define __NR_sigsuspend 72 +#define __NR_sigpending 73 +#define __NR_sethostname 74 +#define __NR_setrlimit 75 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_gettimeofday 78 +#define __NR_settimeofday 79 +#define __NR_getgroups 80 +#define __NR_setgroups 81 +#define __NR_symlink 83 +#define __NR_oldlstat 84 +#define __NR_readlink 85 +#define __NR_uselib 86 +#define __NR_swapon 87 +#define __NR_reboot 88 +#define __NR_readdir 89 +#define __NR_mmap 90 +#define __NR_munmap 91 +#define __NR_truncate 92 +#define __NR_ftruncate 93 +#define __NR_fchmod 94 +#define __NR_fchown 95 +#define __NR_getpriority 96 +#define __NR_setpriority 97 +#define __NR_statfs 99 +#define __NR_fstatfs 100 +#define __NR_socketcall 102 +#define __NR_syslog 103 +#define __NR_setitimer 104 +#define __NR_getitimer 105 +#define __NR_stat 106 +#define __NR_lstat 107 +#define __NR_fstat 108 +#define __NR_olduname 109 +#define __NR_vhangup 111 +#define __NR_wait4 114 +#define __NR_swapoff 115 +#define __NR_sysinfo 116 +#define __NR_ipc 117 +#define __NR_fsync 118 +#define __NR_sigreturn 119 +#define __NR_clone 120 +#define __NR_setdomainname 121 +#define __NR_uname 122 +#define __NR_cacheflush 123 +#define __NR_adjtimex 124 +#define __NR_mprotect 125 +#define __NR_sigprocmask 126 +#define __NR_init_module 128 +#define __NR_delete_module 129 +#define __NR_quotactl 131 +#define __NR_getpgid 132 +#define __NR_fchdir 133 +#define __NR_bdflush 134 +#define __NR_sysfs 135 +#define __NR_personality 136 +#define __NR_setfsuid 138 +#define __NR_setfsgid 139 +#define __NR__llseek 140 +#define __NR_getdents 141 +#define __NR__newselect 142 +#define __NR_flock 143 +#define __NR_msync 144 +#define __NR_readv 145 +#define __NR_writev 146 +#define __NR_getsid 147 +#define __NR_fdatasync 148 +#define __NR__sysctl 149 +#define __NR_mlock 150 +#define __NR_munlock 151 +#define __NR_mlockall 152 +#define __NR_munlockall 153 +#define __NR_sched_setparam 154 +#define __NR_sched_getparam 155 +#define __NR_sched_setscheduler 156 +#define __NR_sched_getscheduler 157 +#define __NR_sched_yield 158 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_rr_get_interval 161 +#define __NR_nanosleep 162 +#define __NR_mremap 163 +#define __NR_setresuid 164 +#define __NR_getresuid 165 +#define __NR_poll 168 +#define __NR_nfsservctl 169 +#define __NR_setresgid 170 +#define __NR_getresgid 171 +#define __NR_prctl 172 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigsuspend 179 +#define __NR_pread64 180 +#define __NR_pwrite64 181 +#define __NR_chown 182 +#define __NR_getcwd 183 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_sigaltstack 186 +#define __NR_sendfile 187 +#define __NR_vfork 190 +#define __NR_ugetrlimit 191 +#define __NR_mmap2 192 +#define __NR_truncate64 193 +#define __NR_ftruncate64 194 +#define __NR_stat64 195 +#define __NR_lstat64 196 +#define __NR_fstat64 197 +#define __NR_lchown32 198 +#define __NR_getuid32 199 +#define __NR_getgid32 200 +#define __NR_geteuid32 201 +#define __NR_getegid32 202 +#define __NR_setreuid32 203 +#define __NR_setregid32 204 +#define __NR_getgroups32 205 +#define __NR_setgroups32 206 +#define __NR_fchown32 207 +#define __NR_setresuid32 208 +#define __NR_getresuid32 209 +#define __NR_setresgid32 210 +#define __NR_getresgid32 211 +#define __NR_chown32 212 +#define __NR_setuid32 213 +#define __NR_setgid32 214 +#define __NR_setfsuid32 215 +#define __NR_setfsgid32 216 +#define __NR_pivot_root 217 +#define __NR_mincore 218 +#define __NR_madvise 219 +#define __NR_getdents64 220 +#define __NR_fcntl64 221 +#define __NR_gettid 224 +#define __NR_readahead 225 +#define __NR_setxattr 226 +#define __NR_lsetxattr 227 +#define __NR_fsetxattr 228 +#define __NR_getxattr 229 +#define __NR_lgetxattr 230 +#define __NR_fgetxattr 231 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_flistxattr 234 +#define __NR_removexattr 235 +#define __NR_lremovexattr 236 +#define __NR_fremovexattr 237 +#define __NR_tkill 238 +#define __NR_sendfile64 239 +#define __NR_futex 240 +#define __NR_sched_setaffinity 241 +#define __NR_sched_getaffinity 242 +#define __NR_io_setup 245 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_submit 248 +#define __NR_io_cancel 249 +#define __NR_fadvise64 250 +#define __NR_exit_group 252 +#define __NR_lookup_dcookie 253 +#define __NR_epoll_create 254 +#define __NR_epoll_ctl 255 +#define __NR_epoll_wait 256 +#define __NR_remap_file_pages 257 +#define __NR_set_tid_address 258 +#define __NR_timer_create 259 +#define __NR_timer_settime 260 +#define __NR_timer_gettime 261 +#define __NR_timer_getoverrun 262 +#define __NR_timer_delete 263 +#define __NR_clock_settime 264 +#define __NR_clock_gettime 265 +#define __NR_clock_getres 266 +#define __NR_clock_nanosleep 267 +#define __NR_statfs64 268 +#define __NR_fstatfs64 269 +#define __NR_tgkill 270 +#define __NR_utimes 271 +#define __NR_fadvise64_64 272 +#define __NR_mbind 274 +#define __NR_get_mempolicy 275 +#define __NR_set_mempolicy 276 +#define __NR_mq_open 277 +#define __NR_mq_unlink 278 +#define __NR_mq_timedsend 279 +#define __NR_mq_timedreceive 280 +#define __NR_mq_notify 281 +#define __NR_mq_getsetattr 282 +#define __NR_kexec_load 283 +#define __NR_waitid 284 +#define __NR_add_key 285 +#define __NR_request_key 286 +#define __NR_keyctl 287 +#define __NR_ioprio_set 288 +#define __NR_ioprio_get 289 +#define __NR_inotify_init 290 +#define __NR_inotify_add_watch 291 +#define __NR_inotify_rm_watch 292 +#define __NR_migrate_pages 294 +#define __NR_openat 295 +#define __NR_mkdirat 296 +#define __NR_mknodat 297 +#define __NR_fchownat 298 +#define __NR_futimesat 299 +#define __NR_fstatat64 300 +#define __NR_unlinkat 301 +#define __NR_renameat 302 +#define __NR_linkat 303 +#define __NR_symlinkat 304 +#define __NR_readlinkat 305 +#define __NR_fchmodat 306 +#define __NR_faccessat 307 +#define __NR_pselect6 308 +#define __NR_ppoll 309 +#define __NR_unshare 310 +#define __NR_set_robust_list 311 +#define __NR_get_robust_list 312 +#define __NR_splice 313 +#define __NR_sync_file_range 314 +#define __NR_tee 315 +#define __NR_vmsplice 316 +#define __NR_move_pages 317 +#define __NR_getcpu 318 +#define __NR_epoll_pwait 319 +#define __NR_utimensat 320 +#define __NR_signalfd 321 +#define __NR_timerfd_create 322 +#define __NR_eventfd 323 +#define __NR_fallocate 324 +#define __NR_timerfd_settime 325 +#define __NR_timerfd_gettime 326 +#define __NR_signalfd4 327 +#define __NR_eventfd2 328 +#define __NR_epoll_create1 329 +#define __NR_dup3 330 +#define __NR_pipe2 331 +#define __NR_inotify_init1 332 +#define __NR_preadv 333 +#define __NR_pwritev 334 +#define __NR_rt_tgsigqueueinfo 335 +#define __NR_perf_event_open 336 +#define __NR_fanotify_init 337 +#define __NR_fanotify_mark 338 +#define __NR_prlimit64 339 +#define __NR_socket 340 +#define __NR_bind 341 +#define __NR_connect 342 +#define __NR_listen 343 +#define __NR_accept 344 +#define __NR_getsockname 345 +#define __NR_getpeername 346 +#define __NR_socketpair 347 +#define __NR_send 348 +#define __NR_sendto 349 +#define __NR_recv 350 +#define __NR_recvfrom 351 +#define __NR_shutdown 352 +#define __NR_setsockopt 353 +#define __NR_getsockopt 354 +#define __NR_sendmsg 355 +#define __NR_recvmsg 356 +#define __NR_recvmmsg 357 +#define __NR_accept4 358 +#define __NR_name_to_handle_at 359 +#define __NR_open_by_handle_at 360 +#define __NR_clock_adjtime 361 +#define __NR_syncfs 362 +#define __NR_sendmmsg 363 +#define __NR_setns 364 +#define __NR_process_vm_readv 365 +#define __NR_process_vm_writev 366 +#define __NR_kcmp 367 +#define __NR_finit_module 368 + diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h.in similarity index 53% rename from arch/x32/bits/syscall.h rename to arch/x32/bits/syscall.h.in index 9384bc11..0b9362a3 100644 --- a/arch/x32/bits/syscall.h +++ b/arch/x32/bits/syscall.h.in @@ -316,327 +316,3 @@ #define __NR_io_submit (0x40000000 + 544) #define __NR_execveat (0x40000000 + 545) - - -/* Repeat with SYS_ prefix */ - - - -#define SYS_read __NR_read -#define SYS_write __NR_write -#define SYS_open __NR_open -#define SYS_close __NR_close -#define SYS_stat __NR_stat -#define SYS_fstat __NR_fstat -#define SYS_lstat __NR_lstat -#define SYS_poll __NR_poll -#define SYS_lseek __NR_lseek -#define SYS_mmap __NR_mmap -#define SYS_mprotect __NR_mprotect -#define SYS_munmap __NR_munmap -#define SYS_brk __NR_brk -#define SYS_rt_sigprocmask __NR_rt_sigprocmask -#define SYS_pread64 __NR_pread64 -#define SYS_pwrite64 __NR_pwrite64 -#define SYS_access __NR_access -#define SYS_pipe __NR_pipe -#define SYS_select __NR_select -#define SYS_sched_yield __NR_sched_yield -#define SYS_mremap __NR_mremap -#define SYS_msync __NR_msync -#define SYS_mincore __NR_mincore -#define SYS_madvise __NR_madvise -#define SYS_shmget __NR_shmget -#define SYS_shmat __NR_shmat -#define SYS_shmctl __NR_shmctl -#define SYS_dup __NR_dup -#define SYS_dup2 __NR_dup2 -#define SYS_pause __NR_pause -#define SYS_nanosleep __NR_nanosleep -#define SYS_getitimer __NR_getitimer -#define SYS_alarm __NR_alarm -#define SYS_setitimer __NR_setitimer -#define SYS_getpid __NR_getpid -#define SYS_sendfile __NR_sendfile -#define SYS_socket __NR_socket -#define SYS_connect __NR_connect -#define SYS_accept __NR_accept -#define SYS_sendto __NR_sendto -#define SYS_shutdown __NR_shutdown -#define SYS_bind __NR_bind -#define SYS_listen __NR_listen -#define SYS_getsockname __NR_getsockname -#define SYS_getpeername __NR_getpeername -#define SYS_socketpair __NR_socketpair -#define SYS_clone __NR_clone -#define SYS_fork __NR_fork -#define SYS_vfork __NR_vfork -#define SYS_exit __NR_exit -#define SYS_wait4 __NR_wait4 -#define SYS_kill __NR_kill -#define SYS_uname __NR_uname -#define SYS_semget __NR_semget -#define SYS_semop __NR_semop -#define SYS_semctl __NR_semctl -#define SYS_shmdt __NR_shmdt -#define SYS_msgget __NR_msgget -#define SYS_msgsnd __NR_msgsnd -#define SYS_msgrcv __NR_msgrcv -#define SYS_msgctl __NR_msgctl -#define SYS_fcntl __NR_fcntl -#define SYS_flock __NR_flock -#define SYS_fsync __NR_fsync -#define SYS_fdatasync __NR_fdatasync -#define SYS_truncate __NR_truncate -#define SYS_ftruncate __NR_ftruncate -#define SYS_getdents __NR_getdents -#define SYS_getcwd __NR_getcwd -#define SYS_chdir __NR_chdir -#define SYS_fchdir __NR_fchdir -#define SYS_rename __NR_rename -#define SYS_mkdir __NR_mkdir -#define SYS_rmdir __NR_rmdir -#define SYS_creat __NR_creat -#define SYS_link __NR_link -#define SYS_unlink __NR_unlink -#define SYS_symlink __NR_symlink -#define SYS_readlink __NR_readlink -#define SYS_chmod __NR_chmod -#define SYS_fchmod __NR_fchmod -#define SYS_chown __NR_chown -#define SYS_fchown __NR_fchown -#define SYS_lchown __NR_lchown -#define SYS_umask __NR_umask -#define SYS_gettimeofday __NR_gettimeofday -#define SYS_getrlimit __NR_getrlimit -#define SYS_getrusage __NR_getrusage -#define SYS_sysinfo __NR_sysinfo -#define SYS_times __NR_times -#define SYS_getuid __NR_getuid -#define SYS_syslog __NR_syslog -#define SYS_getgid __NR_getgid -#define SYS_setuid __NR_setuid -#define SYS_setgid __NR_setgid -#define SYS_geteuid __NR_geteuid -#define SYS_getegid __NR_getegid -#define SYS_setpgid __NR_setpgid -#define SYS_getppid __NR_getppid -#define SYS_getpgrp __NR_getpgrp -#define SYS_setsid __NR_setsid -#define SYS_setreuid __NR_setreuid -#define SYS_setregid __NR_setregid -#define SYS_getgroups __NR_getgroups -#define SYS_setgroups __NR_setgroups -#define SYS_setresuid __NR_setresuid -#define SYS_getresuid __NR_getresuid -#define SYS_setresgid __NR_setresgid -#define SYS_getresgid __NR_getresgid -#define SYS_getpgid __NR_getpgid -#define SYS_setfsuid __NR_setfsuid -#define SYS_setfsgid __NR_setfsgid -#define SYS_getsid __NR_getsid -#define SYS_capget __NR_capget -#define SYS_capset __NR_capset -#define SYS_rt_sigsuspend __NR_rt_sigsuspend -#define SYS_utime __NR_utime -#define SYS_mknod __NR_mknod -#define SYS_personality __NR_personality -#define SYS_ustat __NR_ustat -#define SYS_statfs __NR_statfs -#define SYS_fstatfs __NR_fstatfs -#define SYS_sysfs __NR_sysfs -#define SYS_getpriority __NR_getpriority -#define SYS_setpriority __NR_setpriority -#define SYS_sched_setparam __NR_sched_setparam -#define SYS_sched_getparam __NR_sched_getparam -#define SYS_sched_setscheduler __NR_sched_setscheduler -#define SYS_sched_getscheduler __NR_sched_getscheduler -#define SYS_sched_get_priority_max __NR_sched_get_priority_max -#define SYS_sched_get_priority_min __NR_sched_get_priority_min -#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval -#define SYS_mlock __NR_mlock -#define SYS_munlock __NR_munlock -#define SYS_mlockall __NR_mlockall -#define SYS_munlockall __NR_munlockall -#define SYS_vhangup __NR_vhangup -#define SYS_modify_ldt __NR_modify_ldt -#define SYS_pivot_root __NR_pivot_root -#define SYS_prctl __NR_prctl -#define SYS_arch_prctl __NR_arch_prctl -#define SYS_adjtimex __NR_adjtimex -#define SYS_setrlimit __NR_setrlimit -#define SYS_chroot __NR_chroot -#define SYS_sync __NR_sync -#define SYS_acct __NR_acct -#define SYS_settimeofday __NR_settimeofday -#define SYS_mount __NR_mount -#define SYS_umount2 __NR_umount2 -#define SYS_swapon __NR_swapon -#define SYS_swapoff __NR_swapoff -#define SYS_reboot __NR_reboot -#define SYS_sethostname __NR_sethostname -#define SYS_setdomainname __NR_setdomainname -#define SYS_iopl __NR_iopl -#define SYS_ioperm __NR_ioperm -#define SYS_init_module __NR_init_module -#define SYS_delete_module __NR_delete_module -#define SYS_quotactl __NR_quotactl -#define SYS_getpmsg __NR_getpmsg -#define SYS_putpmsg __NR_putpmsg -#define SYS_afs_syscall __NR_afs_syscall -#define SYS_tuxcall __NR_tuxcall -#define SYS_security __NR_security -#define SYS_gettid __NR_gettid -#define SYS_readahead __NR_readahead -#define SYS_setxattr __NR_setxattr -#define SYS_lsetxattr __NR_lsetxattr -#define SYS_fsetxattr __NR_fsetxattr -#define SYS_getxattr __NR_getxattr -#define SYS_lgetxattr __NR_lgetxattr -#define SYS_fgetxattr __NR_fgetxattr -#define SYS_listxattr __NR_listxattr -#define SYS_llistxattr __NR_llistxattr -#define SYS_flistxattr __NR_flistxattr -#define SYS_removexattr __NR_removexattr -#define SYS_lremovexattr __NR_lremovexattr -#define SYS_fremovexattr __NR_fremovexattr -#define SYS_tkill __NR_tkill -#define SYS_time __NR_time -#define SYS_futex __NR_futex -#define SYS_sched_setaffinity __NR_sched_setaffinity -#define SYS_sched_getaffinity __NR_sched_getaffinity -#define SYS_io_destroy __NR_io_destroy -#define SYS_io_getevents __NR_io_getevents -#define SYS_io_cancel __NR_io_cancel -#define SYS_lookup_dcookie __NR_lookup_dcookie -#define SYS_epoll_create __NR_epoll_create -#define SYS_remap_file_pages __NR_remap_file_pages -#define SYS_getdents64 __NR_getdents64 -#define SYS_set_tid_address __NR_set_tid_address -#define SYS_restart_syscall __NR_restart_syscall -#define SYS_semtimedop __NR_semtimedop -#define SYS_fadvise64 __NR_fadvise64 -#define SYS_timer_settime __NR_timer_settime -#define SYS_timer_gettime __NR_timer_gettime -#define SYS_timer_getoverrun __NR_timer_getoverrun -#define SYS_timer_delete __NR_timer_delete -#define SYS_clock_settime __NR_clock_settime -#define SYS_clock_gettime __NR_clock_gettime -#define SYS_clock_getres __NR_clock_getres -#define SYS_clock_nanosleep __NR_clock_nanosleep -#define SYS_exit_group __NR_exit_group -#define SYS_epoll_wait __NR_epoll_wait -#define SYS_epoll_ctl __NR_epoll_ctl -#define SYS_tgkill __NR_tgkill -#define SYS_utimes __NR_utimes -#define SYS_mbind __NR_mbind -#define SYS_set_mempolicy __NR_set_mempolicy -#define SYS_get_mempolicy __NR_get_mempolicy -#define SYS_mq_open __NR_mq_open -#define SYS_mq_unlink __NR_mq_unlink -#define SYS_mq_timedsend __NR_mq_timedsend -#define SYS_mq_timedreceive __NR_mq_timedreceive -#define SYS_mq_getsetattr __NR_mq_getsetattr -#define SYS_add_key __NR_add_key -#define SYS_request_key __NR_request_key -#define SYS_keyctl __NR_keyctl -#define SYS_ioprio_set __NR_ioprio_set -#define SYS_ioprio_get __NR_ioprio_get -#define SYS_inotify_init __NR_inotify_init -#define SYS_inotify_add_watch __NR_inotify_add_watch -#define SYS_inotify_rm_watch __NR_inotify_rm_watch -#define SYS_migrate_pages __NR_migrate_pages -#define SYS_openat __NR_openat -#define SYS_mkdirat __NR_mkdirat -#define SYS_mknodat __NR_mknodat -#define SYS_fchownat __NR_fchownat -#define SYS_futimesat __NR_futimesat -#define SYS_newfstatat __NR_newfstatat -#define SYS_unlinkat __NR_unlinkat -#define SYS_renameat __NR_renameat -#define SYS_linkat __NR_linkat -#define SYS_symlinkat __NR_symlinkat -#define SYS_readlinkat __NR_readlinkat -#define SYS_fchmodat __NR_fchmodat -#define SYS_faccessat __NR_faccessat -#define SYS_pselect6 __NR_pselect6 -#define SYS_ppoll __NR_ppoll -#define SYS_unshare __NR_unshare -#define SYS_splice __NR_splice -#define SYS_tee __NR_tee -#define SYS_sync_file_range __NR_sync_file_range -#define SYS_utimensat __NR_utimensat -#define SYS_epoll_pwait __NR_epoll_pwait -#define SYS_signalfd __NR_signalfd -#define SYS_timerfd_create __NR_timerfd_create -#define SYS_eventfd __NR_eventfd -#define SYS_fallocate __NR_fallocate -#define SYS_timerfd_settime __NR_timerfd_settime -#define SYS_timerfd_gettime __NR_timerfd_gettime -#define SYS_accept4 __NR_accept4 -#define SYS_signalfd4 __NR_signalfd4 -#define SYS_eventfd2 __NR_eventfd2 -#define SYS_epoll_create1 __NR_epoll_create1 -#define SYS_dup3 __NR_dup3 -#define SYS_pipe2 __NR_pipe2 -#define SYS_inotify_init1 __NR_inotify_init1 -#define SYS_perf_event_open __NR_perf_event_open -#define SYS_fanotify_init __NR_fanotify_init -#define SYS_fanotify_mark __NR_fanotify_mark -#define SYS_prlimit64 __NR_prlimit64 -#define SYS_name_to_handle_at __NR_name_to_handle_at -#define SYS_open_by_handle_at __NR_open_by_handle_at -#define SYS_clock_adjtime __NR_clock_adjtime -#define SYS_syncfs __NR_syncfs -#define SYS_setns __NR_setns -#define SYS_getcpu __NR_getcpu -#define SYS_kcmp __NR_kcmp -#define SYS_finit_module __NR_finit_module -#define SYS_sched_setattr __NR_sched_setattr -#define SYS_sched_getattr __NR_sched_getattr -#define SYS_renameat2 __NR_renameat2 -#define SYS_seccomp __NR_seccomp -#define SYS_getrandom __NR_getrandom -#define SYS_memfd_create __NR_memfd_create -#define SYS_kexec_file_load __NR_kexec_file_load -#define SYS_bpf __NR_bpf -#define SYS_userfaultfd __NR_userfaultfd -#define SYS_membarrier __NR_membarrier -#define SYS_mlock2 __NR_mlock2 -#define SYS_copy_file_range __NR_copy_file_range - - -#define SYS_rt_sigaction __NR_rt_sigaction -#define SYS_rt_sigreturn __NR_rt_sigreturn -#define SYS_ioctl __NR_ioctl -#define SYS_readv __NR_readv -#define SYS_writev __NR_writev -#define SYS_recvfrom __NR_recvfrom -#define SYS_sendmsg __NR_sendmsg -#define SYS_recvmsg __NR_recvmsg -#define SYS_execve __NR_execve -#define SYS_ptrace __NR_ptrace -#define SYS_rt_sigpending __NR_rt_sigpending -#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait -#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo -#define SYS_sigaltstack __NR_sigaltstack -#define SYS_timer_create __NR_timer_create -#define SYS_mq_notify __NR_mq_notify -#define SYS_kexec_load __NR_kexec_load -#define SYS_waitid __NR_waitid -#define SYS_set_robust_list __NR_set_robust_list -#define SYS_get_robust_list __NR_get_robust_list -#define SYS_vmsplice __NR_vmsplice -#define SYS_move_pages __NR_move_pages -#define SYS_preadv __NR_preadv -#define SYS_pwritev __NR_pwritev -#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo -#define SYS_recvmmsg __NR_recvmmsg -#define SYS_sendmmsg __NR_sendmmsg -#define SYS_process_vm_readv __NR_process_vm_readv -#define SYS_process_vm_writev __NR_process_vm_writev -#define SYS_setsockopt __NR_setsockopt -#define SYS_getsockopt __NR_getsockopt -#define SYS_io_setup __NR_io_setup -#define SYS_io_submit __NR_io_submit -#define SYS_execveat __NR_execveat diff --git a/arch/x86_64/bits/syscall.h b/arch/x86_64/bits/syscall.h.in similarity index 50% rename from arch/x86_64/bits/syscall.h rename to arch/x86_64/bits/syscall.h.in index 1b02df9f..7e638a03 100644 --- a/arch/x86_64/bits/syscall.h +++ b/arch/x86_64/bits/syscall.h.in @@ -326,334 +326,3 @@ #define __NR_mlock2 325 #define __NR_copy_file_range 326 - - -/* Repeat with SYS_ prefix */ - -#define SYS_read 0 -#define SYS_write 1 -#define SYS_open 2 -#define SYS_close 3 -#define SYS_stat 4 -#define SYS_fstat 5 -#define SYS_lstat 6 -#define SYS_poll 7 -#define SYS_lseek 8 -#define SYS_mmap 9 -#define SYS_mprotect 10 -#define SYS_munmap 11 -#define SYS_brk 12 -#define SYS_rt_sigaction 13 -#define SYS_rt_sigprocmask 14 -#define SYS_rt_sigreturn 15 -#define SYS_ioctl 16 -#define SYS_pread64 17 -#define SYS_pwrite64 18 -#define SYS_readv 19 -#define SYS_writev 20 -#define SYS_access 21 -#define SYS_pipe 22 -#define SYS_select 23 -#define SYS_sched_yield 24 -#define SYS_mremap 25 -#define SYS_msync 26 -#define SYS_mincore 27 -#define SYS_madvise 28 -#define SYS_shmget 29 -#define SYS_shmat 30 -#define SYS_shmctl 31 -#define SYS_dup 32 -#define SYS_dup2 33 -#define SYS_pause 34 -#define SYS_nanosleep 35 -#define SYS_getitimer 36 -#define SYS_alarm 37 -#define SYS_setitimer 38 -#define SYS_getpid 39 -#define SYS_sendfile 40 -#define SYS_socket 41 -#define SYS_connect 42 -#define SYS_accept 43 -#define SYS_sendto 44 -#define SYS_recvfrom 45 -#define SYS_sendmsg 46 -#define SYS_recvmsg 47 -#define SYS_shutdown 48 -#define SYS_bind 49 -#define SYS_listen 50 -#define SYS_getsockname 51 -#define SYS_getpeername 52 -#define SYS_socketpair 53 -#define SYS_setsockopt 54 -#define SYS_getsockopt 55 -#define SYS_clone 56 -#define SYS_fork 57 -#define SYS_vfork 58 -#define SYS_execve 59 -#define SYS_exit 60 -#define SYS_wait4 61 -#define SYS_kill 62 -#define SYS_uname 63 -#define SYS_semget 64 -#define SYS_semop 65 -#define SYS_semctl 66 -#define SYS_shmdt 67 -#define SYS_msgget 68 -#define SYS_msgsnd 69 -#define SYS_msgrcv 70 -#define SYS_msgctl 71 -#define SYS_fcntl 72 -#define SYS_flock 73 -#define SYS_fsync 74 -#define SYS_fdatasync 75 -#define SYS_truncate 76 -#define SYS_ftruncate 77 -#define SYS_getdents 78 -#define SYS_getcwd 79 -#define SYS_chdir 80 -#define SYS_fchdir 81 -#define SYS_rename 82 -#define SYS_mkdir 83 -#define SYS_rmdir 84 -#define SYS_creat 85 -#define SYS_link 86 -#define SYS_unlink 87 -#define SYS_symlink 88 -#define SYS_readlink 89 -#define SYS_chmod 90 -#define SYS_fchmod 91 -#define SYS_chown 92 -#define SYS_fchown 93 -#define SYS_lchown 94 -#define SYS_umask 95 -#define SYS_gettimeofday 96 -#define SYS_getrlimit 97 -#define SYS_getrusage 98 -#define SYS_sysinfo 99 -#define SYS_times 100 -#define SYS_ptrace 101 -#define SYS_getuid 102 -#define SYS_syslog 103 -#define SYS_getgid 104 -#define SYS_setuid 105 -#define SYS_setgid 106 -#define SYS_geteuid 107 -#define SYS_getegid 108 -#define SYS_setpgid 109 -#define SYS_getppid 110 -#define SYS_getpgrp 111 -#define SYS_setsid 112 -#define SYS_setreuid 113 -#define SYS_setregid 114 -#define SYS_getgroups 115 -#define SYS_setgroups 116 -#define SYS_setresuid 117 -#define SYS_getresuid 118 -#define SYS_setresgid 119 -#define SYS_getresgid 120 -#define SYS_getpgid 121 -#define SYS_setfsuid 122 -#define SYS_setfsgid 123 -#define SYS_getsid 124 -#define SYS_capget 125 -#define SYS_capset 126 -#define SYS_rt_sigpending 127 -#define SYS_rt_sigtimedwait 128 -#define SYS_rt_sigqueueinfo 129 -#define SYS_rt_sigsuspend 130 -#define SYS_sigaltstack 131 -#define SYS_utime 132 -#define SYS_mknod 133 -#define SYS_uselib 134 -#define SYS_personality 135 -#define SYS_ustat 136 -#define SYS_statfs 137 -#define SYS_fstatfs 138 -#define SYS_sysfs 139 -#define SYS_getpriority 140 -#define SYS_setpriority 141 -#define SYS_sched_setparam 142 -#define SYS_sched_getparam 143 -#define SYS_sched_setscheduler 144 -#define SYS_sched_getscheduler 145 -#define SYS_sched_get_priority_max 146 -#define SYS_sched_get_priority_min 147 -#define SYS_sched_rr_get_interval 148 -#define SYS_mlock 149 -#define SYS_munlock 150 -#define SYS_mlockall 151 -#define SYS_munlockall 152 -#define SYS_vhangup 153 -#define SYS_modify_ldt 154 -#define SYS_pivot_root 155 -#define SYS__sysctl 156 -#define SYS_prctl 157 -#define SYS_arch_prctl 158 -#define SYS_adjtimex 159 -#define SYS_setrlimit 160 -#define SYS_chroot 161 -#define SYS_sync 162 -#define SYS_acct 163 -#define SYS_settimeofday 164 -#define SYS_mount 165 -#define SYS_umount2 166 -#define SYS_swapon 167 -#define SYS_swapoff 168 -#define SYS_reboot 169 -#define SYS_sethostname 170 -#define SYS_setdomainname 171 -#define SYS_iopl 172 -#define SYS_ioperm 173 -#define SYS_create_module 174 -#define SYS_init_module 175 -#define SYS_delete_module 176 -#define SYS_get_kernel_syms 177 -#define SYS_query_module 178 -#define SYS_quotactl 179 -#define SYS_nfsservctl 180 -#define SYS_getpmsg 181 -#define SYS_putpmsg 182 -#define SYS_afs_syscall 183 -#define SYS_tuxcall 184 -#define SYS_security 185 -#define SYS_gettid 186 -#define SYS_readahead 187 -#define SYS_setxattr 188 -#define SYS_lsetxattr 189 -#define SYS_fsetxattr 190 -#define SYS_getxattr 191 -#define SYS_lgetxattr 192 -#define SYS_fgetxattr 193 -#define SYS_listxattr 194 -#define SYS_llistxattr 195 -#define SYS_flistxattr 196 -#define SYS_removexattr 197 -#define SYS_lremovexattr 198 -#define SYS_fremovexattr 199 -#define SYS_tkill 200 -#define SYS_time 201 -#define SYS_futex 202 -#define SYS_sched_setaffinity 203 -#define SYS_sched_getaffinity 204 -#define SYS_set_thread_area 205 -#define SYS_io_setup 206 -#define SYS_io_destroy 207 -#define SYS_io_getevents 208 -#define SYS_io_submit 209 -#define SYS_io_cancel 210 -#define SYS_get_thread_area 211 -#define SYS_lookup_dcookie 212 -#define SYS_epoll_create 213 -#define SYS_epoll_ctl_old 214 -#define SYS_epoll_wait_old 215 -#define SYS_remap_file_pages 216 -#define SYS_getdents64 217 -#define SYS_set_tid_address 218 -#define SYS_restart_syscall 219 -#define SYS_semtimedop 220 -#define SYS_fadvise64 221 -#define SYS_timer_create 222 -#define SYS_timer_settime 223 -#define SYS_timer_gettime 224 -#define SYS_timer_getoverrun 225 -#define SYS_timer_delete 226 -#define SYS_clock_settime 227 -#define SYS_clock_gettime 228 -#define SYS_clock_getres 229 -#define SYS_clock_nanosleep 230 -#define SYS_exit_group 231 -#define SYS_epoll_wait 232 -#define SYS_epoll_ctl 233 -#define SYS_tgkill 234 -#define SYS_utimes 235 -#define SYS_vserver 236 -#define SYS_mbind 237 -#define SYS_set_mempolicy 238 -#define SYS_get_mempolicy 239 -#define SYS_mq_open 240 -#define SYS_mq_unlink 241 -#define SYS_mq_timedsend 242 -#define SYS_mq_timedreceive 243 -#define SYS_mq_notify 244 -#define SYS_mq_getsetattr 245 -#define SYS_kexec_load 246 -#define SYS_waitid 247 -#define SYS_add_key 248 -#define SYS_request_key 249 -#define SYS_keyctl 250 -#define SYS_ioprio_set 251 -#define SYS_ioprio_get 252 -#define SYS_inotify_init 253 -#define SYS_inotify_add_watch 254 -#define SYS_inotify_rm_watch 255 -#define SYS_migrate_pages 256 -#define SYS_openat 257 -#define SYS_mkdirat 258 -#define SYS_mknodat 259 -#define SYS_fchownat 260 -#define SYS_futimesat 261 -#define SYS_newfstatat 262 -#define SYS_unlinkat 263 -#define SYS_renameat 264 -#define SYS_linkat 265 -#define SYS_symlinkat 266 -#define SYS_readlinkat 267 -#define SYS_fchmodat 268 -#define SYS_faccessat 269 -#define SYS_pselect6 270 -#define SYS_ppoll 271 -#define SYS_unshare 272 -#define SYS_set_robust_list 273 -#define SYS_get_robust_list 274 -#define SYS_splice 275 -#define SYS_tee 276 -#define SYS_sync_file_range 277 -#define SYS_vmsplice 278 -#define SYS_move_pages 279 -#define SYS_utimensat 280 -#define SYS_epoll_pwait 281 -#define SYS_signalfd 282 -#define SYS_timerfd_create 283 -#define SYS_eventfd 284 -#define SYS_fallocate 285 -#define SYS_timerfd_settime 286 -#define SYS_timerfd_gettime 287 -#define SYS_accept4 288 -#define SYS_signalfd4 289 -#define SYS_eventfd2 290 -#define SYS_epoll_create1 291 -#define SYS_dup3 292 -#define SYS_pipe2 293 -#define SYS_inotify_init1 294 -#define SYS_preadv 295 -#define SYS_pwritev 296 -#define SYS_rt_tgsigqueueinfo 297 -#define SYS_perf_event_open 298 -#define SYS_recvmmsg 299 -#define SYS_fanotify_init 300 -#define SYS_fanotify_mark 301 -#define SYS_prlimit64 302 -#define SYS_name_to_handle_at 303 -#define SYS_open_by_handle_at 304 -#define SYS_clock_adjtime 305 -#define SYS_syncfs 306 -#define SYS_sendmmsg 307 -#define SYS_setns 308 -#define SYS_getcpu 309 -#define SYS_process_vm_readv 310 -#define SYS_process_vm_writev 311 -#define SYS_kcmp 312 -#define SYS_finit_module 313 -#define SYS_sched_setattr 314 -#define SYS_sched_getattr 315 -#define SYS_renameat2 316 -#define SYS_seccomp 317 -#define SYS_getrandom 318 -#define SYS_memfd_create 319 -#define SYS_kexec_file_load 320 -#define SYS_bpf 321 -#define SYS_execveat 322 -#define SYS_userfaultfd 323 -#define SYS_membarrier 324 -#define SYS_mlock2 325 -#define SYS_copy_file_range 326 From 51eeb6ebc94d965768143c45e9f39b0a7998bdbd Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 21 May 2016 15:21:38 +0200 Subject: [PATCH 107/412] fix the use of uninitialized value in regcomp the num_submatches field of some ast nodes was not initialized in tre_add_tag_{left,right}, but was accessed later. this was a benign bug since the uninitialized values were never used (these values are created during tre_add_tags and copied around during tre_expand_ast where they are also used in computations, but nothing in the final tnfa depends on them). --- src/regex/regcomp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 5fad98b3..65f2fd0b 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -1106,6 +1106,7 @@ tre_add_tag_left(tre_mem_t mem, tre_ast_node_t *node, int tag_id) c->right->firstpos = NULL; c->right->lastpos = NULL; c->right->num_tags = 0; + c->right->num_submatches = 0; node->obj = c; node->type = CATENATION; return REG_OK; @@ -1136,6 +1137,7 @@ tre_add_tag_right(tre_mem_t mem, tre_ast_node_t *node, int tag_id) c->left->firstpos = NULL; c->left->lastpos = NULL; c->left->num_tags = 0; + c->left->num_submatches = 0; node->obj = c; node->type = CATENATION; return REG_OK; From 81fb75a1d75c20d97292cbbe4cde6a1e65871abe Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 22 May 2016 18:49:59 -0400 Subject: [PATCH 108/412] fix undefined pointer arithmetic in CMSG_NXTHDR macro previously, the only way the stopping condition could be met with correct lengths in the headers invoked undefined behavior, adding sizeof(struct cmsghdr) beyond the end of the cmsg buffer. instead, compute and compare sizes rather than pointers. --- include/sys/socket.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index fd653490..67883750 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -266,9 +266,9 @@ struct linger #define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen) #define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1)) -#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) ? (struct cmsghdr *)0 : \ - (__CMSG_NEXT(cmsg) + sizeof (struct cmsghdr) >= __MHDR_END(mhdr) ? (struct cmsghdr *)0 : \ - ((struct cmsghdr *)__CMSG_NEXT(cmsg)))) +#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) || \ + __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \ + ? 0 : (struct cmsghdr *)__CMSG_NEXT(cmsg)) #define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) From 77baaa47e107f176fb2dc150dd6a9ad87f6cbe24 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 23 May 2016 18:19:11 -0400 Subject: [PATCH 109/412] fix a64l undefined behavior on ILP32 archs, wrong results on LP64 archs the difference of pointers is a signed type ptrdiff_t; if it is only 32-bit, left-shifting it by 30 bits produces undefined behavior. cast the difference to an appropriate unsigned type, uint32_t, before shifting to avoid this. the a64l function is specified to return a signed 32-bit result in type long. as noted in the bug report by Ed Schouten, converting implicitly from uint32_t only produces the desired result when long is a 32-bit type. since the computation has to be done in unsigned arithmetic to avoid overflow, simply cast the result to int32_t. further, POSIX leaves the behavior on invalid input unspecified but not undefined, so we should not take the difference between the potentially-null result of strchr and the base pointer without first checking the result. the simplest behavior is just returning the partial conversion already performed in this case, so do that. --- src/misc/a64l.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/misc/a64l.c b/src/misc/a64l.c index 86aeefe0..60557710 100644 --- a/src/misc/a64l.c +++ b/src/misc/a64l.c @@ -9,9 +9,12 @@ long a64l(const char *s) { int e; uint32_t x = 0; - for (e=0; e<36 && *s; e+=6, s++) - x |= (strchr(digits, *s)-digits)< Date: Thu, 26 May 2016 22:04:56 +0200 Subject: [PATCH 110/412] add preadv2 and pwritev2 syscall numbers for linux v4.6 the syscalls take an additional flag argument, they were added in commit f17d8b35452cab31a70d224964cd583fb2845449 and a RWF_HIPRI priority hint flag was added to linux/fs.h in 97be7ebe53915af504fb491fb99f064c7cf3cb09. the syscall is not allocated for microblaze and sh yet. --- arch/aarch64/bits/syscall.h.in | 2 ++ arch/arm/bits/syscall.h.in | 2 ++ arch/i386/bits/syscall.h.in | 2 ++ arch/mips/bits/syscall.h.in | 2 ++ arch/mips64/bits/syscall.h.in | 2 ++ arch/mipsn32/bits/syscall.h.in | 2 ++ arch/or1k/bits/syscall.h.in | 2 ++ arch/powerpc/bits/syscall.h.in | 2 ++ arch/powerpc64/bits/syscall.h.in | 2 ++ arch/x32/bits/syscall.h.in | 2 ++ arch/x86_64/bits/syscall.h.in | 2 ++ 11 files changed, 22 insertions(+) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index bcf69d20..332f437d 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -269,4 +269,6 @@ #define __NR_membarrier 283 #define __NR_mlock2 284 #define __NR_copy_file_range 285 +#define __NR_preadv2 286 +#define __NR_pwritev2 287 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index 143b0a8d..04c8b1cf 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -345,6 +345,8 @@ #define __NR_membarrier 389 #define __NR_mlock2 390 #define __NR_copy_file_range 391 +#define __NR_preadv2 392 +#define __NR_pwritev2 393 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index 108fbbce..5fe9c5c4 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -376,4 +376,6 @@ #define __NR_membarrier 375 #define __NR_mlock2 376 #define __NR_copy_file_range 377 +#define __NR_preadv2 378 +#define __NR_pwritev2 379 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index 61ff7a58..bcceaa2a 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -358,4 +358,6 @@ #define __NR_membarrier 4358 #define __NR_mlock2 4359 #define __NR_copy_file_range 4360 +#define __NR_preadv2 4361 +#define __NR_pwritev2 4362 diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in index 0e206830..eef85435 100644 --- a/arch/mips64/bits/syscall.h.in +++ b/arch/mips64/bits/syscall.h.in @@ -318,4 +318,6 @@ #define __NR_membarrier 5318 #define __NR_mlock2 5319 #define __NR_copy_file_range 5320 +#define __NR_preadv2 5321 +#define __NR_pwritev2 5322 diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index 6c38f68d..5fda0b57 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -322,4 +322,6 @@ #define __NR_membarrier 6322 #define __NR_mlock2 6323 #define __NR_copy_file_range 6324 +#define __NR_preadv2 6325 +#define __NR_pwritev2 6326 diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index c6e55c6b..c6b6cf2c 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -269,4 +269,6 @@ #define __NR_membarrier 283 #define __NR_mlock2 284 #define __NR_copy_file_range 285 +#define __NR_preadv2 286 +#define __NR_pwritev2 287 diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index f55e69c5..9d022321 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -369,4 +369,6 @@ #define __NR_membarrier 365 #define __NR_mlock2 378 #define __NR_copy_file_range 379 +#define __NR_preadv2 380 +#define __NR_pwritev2 381 diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in index ff375364..c9880fa2 100644 --- a/arch/powerpc64/bits/syscall.h.in +++ b/arch/powerpc64/bits/syscall.h.in @@ -355,4 +355,6 @@ #define __NR_membarrier 365 #define __NR_mlock2 378 #define __NR_copy_file_range 379 +#define __NR_preadv2 380 +#define __NR_pwritev2 381 diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index 0b9362a3..cf2b4f14 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -280,6 +280,8 @@ #define __NR_membarrier (0x40000000 + 324) #define __NR_mlock2 (0x40000000 + 325) #define __NR_copy_file_range (0x40000000 + 326) +#define __NR_preadv2 (0x40000000 + 327) +#define __NR_pwritev2 (0x40000000 + 328) #define __NR_rt_sigaction (0x40000000 + 512) #define __NR_rt_sigreturn (0x40000000 + 513) diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in index 7e638a03..d0c55185 100644 --- a/arch/x86_64/bits/syscall.h.in +++ b/arch/x86_64/bits/syscall.h.in @@ -325,4 +325,6 @@ #define __NR_membarrier 324 #define __NR_mlock2 325 #define __NR_copy_file_range 326 +#define __NR_preadv2 327 +#define __NR_pwritev2 328 From f6f4aa5ddb8b28f31d35131af78b7254c11445d4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 26 May 2016 22:05:25 +0200 Subject: [PATCH 111/412] add SO_CNX_ADVICE to sys/socket.h, new in linux v4.6 new socket option so application can give advice about routing path quality of connected udp sockets, added in linux commit a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 --- include/sys/socket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index 67883750..2f400acb 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -222,6 +222,7 @@ struct linger #define SO_DETACH_BPF SO_DETACH_FILTER #define SO_ATTACH_REUSEPORT_CBPF 51 #define SO_ATTACH_REUSEPORT_EBPF 52 +#define SO_CNX_ADVICE 53 #ifndef SOL_SOCKET #define SOL_SOCKET 1 From 7ea37c7aa40ba4d3d46a4427402dfef09ef0253b Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 26 May 2016 22:05:45 +0200 Subject: [PATCH 112/412] add ETH_P_MACSEC netinet/if_ether.h, new in linux v4.6 ethertype for macsec added in linux commit dece8d2b78d19df7fe5e4e965f1f0d1a3e188d1b --- include/netinet/if_ether.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 4802f09f..4c2322b3 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -51,6 +51,7 @@ #define ETH_P_8021AD 0x88A8 #define ETH_P_802_EX1 0x88B5 #define ETH_P_TIPC 0x88CA +#define ETH_P_MACSEC 0x88E5 #define ETH_P_8021AH 0x88E7 #define ETH_P_MVRP 0x88F5 #define ETH_P_1588 0x88F7 From 19f87240d5e1d198b4e1115ed8210ae29519f837 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 26 May 2016 22:06:10 +0200 Subject: [PATCH 113/412] update siginfo struct for linux v4.6 x86 protection key faults are reported in the si_pkey field, added in linux commit cd0ea35ff5511cde299a61c21a95889b4a71464e --- include/signal.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/signal.h b/include/signal.h index c6323c61..a16094c5 100644 --- a/include/signal.h +++ b/include/signal.h @@ -74,6 +74,7 @@ typedef struct sigaltstack stack_t; #define SEGV_MAPERR 1 #define SEGV_ACCERR 2 #define SEGV_BNDERR 3 +#define SEGV_PKUERR 4 #define BUS_ADRALN 1 #define BUS_ADRERR 2 @@ -123,10 +124,13 @@ typedef struct { struct { void *si_addr; short si_addr_lsb; - struct { - void *si_lower; - void *si_upper; - } __addr_bnd; + union { + struct { + void *si_lower; + void *si_upper; + } __addr_bnd; + unsigned si_pkey; + } __first; } __sigfault; struct { long si_band; @@ -147,8 +151,9 @@ typedef struct { #define si_value __si_fields.__si_common.__second.si_value #define si_addr __si_fields.__sigfault.si_addr #define si_addr_lsb __si_fields.__sigfault.si_addr_lsb -#define si_lower __si_fields.__sigfault.__addr_bnd.si_lower -#define si_upper __si_fields.__sigfault.__addr_bnd.si_upper +#define si_lower __si_fields.__sigfault.__first.__addr_bnd.si_lower +#define si_upper __si_fields.__sigfault.__first.__addr_bnd.si_upper +#define si_pkey __si_fields.__sigfault.__first.si_pkey #define si_band __si_fields.__sigpoll.si_band #define si_fd __si_fields.__sigpoll.si_fd #define si_timerid __si_fields.__si_common.__first.__timer.si_timerid From 1d561c2fa4eaf321022330eca0f6598feda62888 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 26 May 2016 22:06:44 +0200 Subject: [PATCH 114/412] add CLONE_NEWCGROUP clone flag, new in linux v4.6 flag for new cgroup namespace, added in linux commit 5e2bec7c2248ae27c5b16cd97215ae05c1d39179 --- include/sched.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sched.h b/include/sched.h index 7e88f097..af82d6c9 100644 --- a/include/sched.h +++ b/include/sched.h @@ -59,6 +59,7 @@ int sched_yield(void); #define CLONE_DETACHED 0x00400000 #define CLONE_UNTRACED 0x00800000 #define CLONE_CHILD_SETTID 0x01000000 +#define CLONE_NEWCGROUP 0x02000000 #define CLONE_NEWUTS 0x04000000 #define CLONE_NEWIPC 0x08000000 #define CLONE_NEWUSER 0x10000000 From 349877755d283533c19c86244d17801574a60b51 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 26 May 2016 22:07:09 +0200 Subject: [PATCH 115/412] add new tcp_info fields from linux v4.6 new fields and associated linux commit: tcpi_notsent_bytes, tcpi_min_rtt cd9b266095f422267bddbec88f9098b48ea548fc tcpi_data_segs_in, tcpi_data_segs_out a44d6eacdaf56f74fad699af7f4925a5f5ac0e7f --- include/netinet/tcp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 244a21ef..d6f41cab 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -184,6 +184,10 @@ struct tcp_info uint64_t tcpi_bytes_received; uint32_t tcpi_segs_out; uint32_t tcpi_segs_in; + uint32_t tcpi_notsent_bytes; + uint32_t tcpi_min_rtt; + uint32_t tcpi_data_segs_in; + uint32_t tcpi_data_segs_out; }; #define TCP_MD5SIG_MAXKEYLEN 80 From a0bb50a14216e7be7453abee2e7b5830e2a7c4c1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 26 May 2016 22:07:32 +0200 Subject: [PATCH 116/412] update sys/socket.h to linux v4.6 kernel connection multiplexor macros AF_KCM, PF_KCM, SOL_KCM were added in linux commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 MSG_BATCH sendmsg flag for performance optimization was added in linux commit f092276d85b82504e8a07498f4e9e0c51f06745c SOL_* macros are now synced with linux socket.h which is not a uapi header and glibc did not have the macros either, but that has changed http://sourceware.org/ml/libc-alpha/2016-05/msg00322.html --- include/sys/socket.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index 2f400acb..76fbde04 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -109,7 +109,8 @@ struct linger #define PF_ALG 38 #define PF_NFC 39 #define PF_VSOCK 40 -#define PF_MAX 41 +#define PF_KCM 41 +#define PF_MAX 42 #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL @@ -155,6 +156,7 @@ struct linger #define AF_ALG PF_ALG #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK +#define AF_KCM PF_KCM #define AF_MAX PF_MAX #ifndef SO_DEBUG @@ -239,6 +241,21 @@ struct linger #define SOL_ATM 264 #define SOL_AAL 265 #define SOL_IRDA 266 +#define SOL_NETBEUI 267 +#define SOL_LLC 268 +#define SOL_DCCP 269 +#define SOL_NETLINK 270 +#define SOL_TIPC 271 +#define SOL_RXRPC 272 +#define SOL_PPPOL2TP 273 +#define SOL_BLUETOOTH 274 +#define SOL_PNPIPE 275 +#define SOL_RDS 276 +#define SOL_IUCV 277 +#define SOL_CAIF 278 +#define SOL_ALG 279 +#define SOL_NFC 280 +#define SOL_KCM 281 #define SOMAXCONN 128 @@ -259,6 +276,7 @@ struct linger #define MSG_NOSIGNAL 0x4000 #define MSG_MORE 0x8000 #define MSG_WAITFORONE 0x10000 +#define MSG_BATCH 0x40000 #define MSG_FASTOPEN 0x20000000 #define MSG_CMSG_CLOEXEC 0x40000000 From 1e6fc0b690191005a49468c296ad49d0caacacf1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 9 Jun 2016 13:42:06 -0400 Subject: [PATCH 117/412] avoid padding gaps in struct sockaddr_storage compilers are free not to copy, or in some cases to clobber, padding bytes in a structure. while it's an aliasing violation, and thus undefined behavior, to copy or manipulate other sockaddr types using sockaddr_storage, it seems likely that traditional code attempts to do so, and the original intent of the sockaddr_storage structure was probably to allow such usage. in the interest of avoiding silent and potentially dangerous breakage, ensure that there are no actual padding bytes in sockaddr_storage by moving and adjusting the size of the __ss_padding member so that it fits exactly. this change also removes a silent assumption that the alignment of long is equal to its size. --- include/sys/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index 76fbde04..55e53d2a 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -306,8 +306,8 @@ struct sockaddr struct sockaddr_storage { sa_family_t ss_family; + char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)]; unsigned long __ss_align; - char __ss_padding[128-2*sizeof(unsigned long)]; }; int socket (int, int, int); From 6cec7bc57f599f43f4041cec2093e3c9231dbaab Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 21 Jun 2016 16:33:14 -0400 Subject: [PATCH 118/412] remove comments on copyright status from UTF-8 implementation files despite clarifications made to the COPYRIGHT file in commit f0a61399330bae42beeb27d6ecd05570b3382a60, there continues to be confusion about whether the permissions granted actually apply to all files. I am the sole author of these files and clearly intend, and have always intended, for the grant of permission to apply to them. --- src/multibyte/internal.c | 6 ------ src/multibyte/internal.h | 6 ------ src/multibyte/mblen.c | 6 ------ src/multibyte/mbrlen.c | 6 ------ src/multibyte/mbrtowc.c | 6 ------ src/multibyte/mbsinit.c | 6 ------ src/multibyte/mbsnrtowcs.c | 6 ------ src/multibyte/mbsrtowcs.c | 6 ------ src/multibyte/mbtowc.c | 6 ------ src/multibyte/wcrtomb.c | 6 ------ src/multibyte/wcsnrtombs.c | 6 ------ src/multibyte/wcsrtombs.c | 6 ------ src/multibyte/wctomb.c | 6 ------ 13 files changed, 78 deletions(-) diff --git a/src/multibyte/internal.c b/src/multibyte/internal.c index bbdc4159..7e1b1c03 100644 --- a/src/multibyte/internal.c +++ b/src/multibyte/internal.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include "internal.h" #define C(x) ( x<2 ? -1 : ( R(0x80,0xc0) | x ) ) diff --git a/src/multibyte/internal.h b/src/multibyte/internal.h index 51308f4f..421a3d4a 100644 --- a/src/multibyte/internal.h +++ b/src/multibyte/internal.h @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #define bittab __fsmu8 #include diff --git a/src/multibyte/mblen.c b/src/multibyte/mblen.c index 96b47b12..a4304bf5 100644 --- a/src/multibyte/mblen.c +++ b/src/multibyte/mblen.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include int mblen(const char *s, size_t n) diff --git a/src/multibyte/mbrlen.c b/src/multibyte/mbrlen.c index 3a5a7433..accf4b33 100644 --- a/src/multibyte/mbrlen.c +++ b/src/multibyte/mbrlen.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st) diff --git a/src/multibyte/mbrtowc.c b/src/multibyte/mbrtowc.c index ca7da700..c94819e7 100644 --- a/src/multibyte/mbrtowc.c +++ b/src/multibyte/mbrtowc.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include #include #include diff --git a/src/multibyte/mbsinit.c b/src/multibyte/mbsinit.c index e001d844..c608194a 100644 --- a/src/multibyte/mbsinit.c +++ b/src/multibyte/mbsinit.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include int mbsinit(const mbstate_t *st) diff --git a/src/multibyte/mbsnrtowcs.c b/src/multibyte/mbsnrtowcs.c index 68b9960f..cae4caa2 100644 --- a/src/multibyte/mbsnrtowcs.c +++ b/src/multibyte/mbsnrtowcs.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include size_t mbsnrtowcs(wchar_t *restrict wcs, const char **restrict src, size_t n, size_t wn, mbstate_t *restrict st) diff --git a/src/multibyte/mbsrtowcs.c b/src/multibyte/mbsrtowcs.c index e23083d2..0ee8b69c 100644 --- a/src/multibyte/mbsrtowcs.c +++ b/src/multibyte/mbsrtowcs.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include #include #include diff --git a/src/multibyte/mbtowc.c b/src/multibyte/mbtowc.c index 71a95066..c191bb03 100644 --- a/src/multibyte/mbtowc.c +++ b/src/multibyte/mbtowc.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include #include #include diff --git a/src/multibyte/wcrtomb.c b/src/multibyte/wcrtomb.c index ddc37a57..8e34926e 100644 --- a/src/multibyte/wcrtomb.c +++ b/src/multibyte/wcrtomb.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include #include #include diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c index ee4a534a..640cbbeb 100644 --- a/src/multibyte/wcsnrtombs.c +++ b/src/multibyte/wcsnrtombs.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st) diff --git a/src/multibyte/wcsrtombs.c b/src/multibyte/wcsrtombs.c index 30be415d..b5713aea 100644 --- a/src/multibyte/wcsrtombs.c +++ b/src/multibyte/wcsrtombs.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstate_t *restrict st) diff --git a/src/multibyte/wctomb.c b/src/multibyte/wctomb.c index de7ed84d..bad41c5e 100644 --- a/src/multibyte/wctomb.c +++ b/src/multibyte/wctomb.c @@ -1,9 +1,3 @@ -/* - * This code was written by Rich Felker in 2010; no copyright is claimed. - * This code is in the public domain. Attribution is appreciated but - * unnecessary. - */ - #include #include From 384d103d94dba0472a587861f67d7ed6e8955f86 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 27 Jun 2016 15:18:13 -0400 Subject: [PATCH 119/412] fix failure to obtain EOWNERDEAD status for process-shared robust mutexes Linux's documentation (robust-futex-ABI.txt) claims that, when a process dies with a futex on the robust list, bit 30 (0x40000000) is set to indicate the status. however, what actually happens is that bits 0-30 are replaced with the value 0x40000000, i.e. bits 0-29 (containing the old owner tid) are cleared at the same time bit 30 is set. our userspace-side code for robust mutexes was written based on that documentation, assuming that kernel would never produce a futex value of 0x40000000, since the low (owner) bits would always be non-zero. commit d338b506e39b1e2c68366b12be90704c635602ce introduced this assumption explicitly while fixing another bug in how non-recoverable status for robust mutexes was tracked. presumably the tests conducted at that time only checked non-process-shared robust mutexes, which are handled in pthread_exit (which implemented the documented kernel protocol, not the actual one) rather than by the kernel. change pthread_exit robust list processing to match the kernel behavior, clearing bits 0-29 while setting bit 30, and use the value 0x7fffffff instead of 0x40000000 to encode non-recoverable status. the choice of value here is arbitrary; any value with at least one of bits 0-29 set should work just as well, --- src/thread/pthread_create.c | 2 +- src/thread/pthread_mutex_trylock.c | 2 +- src/thread/pthread_mutex_unlock.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index e7df34a9..9f6b98e6 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -79,7 +79,7 @@ _Noreturn void __pthread_exit(void *result) int priv = (m->_m_type & 128) ^ 128; self->robust_list.pending = rp; self->robust_list.head = *rp; - int cont = a_swap(&m->_m_lock, self->tid|0x40000000); + int cont = a_swap(&m->_m_lock, 0x40000000); self->robust_list.pending = 0; if (cont < 0 || waiters) __wake(&m->_m_lock, 1, priv); diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c index 0df3ce29..54876a61 100644 --- a/src/thread/pthread_mutex_trylock.c +++ b/src/thread/pthread_mutex_trylock.c @@ -14,7 +14,7 @@ int __pthread_mutex_trylock_owner(pthread_mutex_t *m) m->_m_count++; return 0; } - if (own == 0x40000000) return ENOTRECOVERABLE; + if (own == 0x7fffffff) return ENOTRECOVERABLE; if (m->_m_type & 128) { if (!self->robust_list.off) { diff --git a/src/thread/pthread_mutex_unlock.c b/src/thread/pthread_mutex_unlock.c index 02da92a9..7dd00d27 100644 --- a/src/thread/pthread_mutex_unlock.c +++ b/src/thread/pthread_mutex_unlock.c @@ -24,7 +24,7 @@ int __pthread_mutex_unlock(pthread_mutex_t *m) if (next != &self->robust_list.head) *(volatile void *volatile *) ((char *)next - sizeof(void *)) = prev; } - cont = a_swap(&m->_m_lock, (type & 8) ? 0x40000000 : 0); + cont = a_swap(&m->_m_lock, (type & 8) ? 0x7fffffff : 0); if (type != PTHREAD_MUTEX_NORMAL && !priv) { self->robust_list.pending = 0; __vm_unlock(); From 4da0bc5ef8e0fdea65335599d947d74b7b321daa Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 27 Jun 2016 17:11:30 -0400 Subject: [PATCH 120/412] fix misaligned address buffers in gethostbyname[2][_r] results mistakenly ordering strings before addresses in the result buffer broke the alignment that the preceding code had set up. --- src/network/gethostbyname2_r.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c index 81f71d21..5c1cae98 100644 --- a/src/network/gethostbyname2_r.c +++ b/src/network/gethostbyname2_r.c @@ -58,6 +58,13 @@ int gethostbyname2_r(const char *name, int af, h->h_addr_list = (void *)buf; buf += (cnt+1)*sizeof(char *); + for (i=0; ih_addr_list[i] = (void *)buf; + buf += h->h_length; + memcpy(h->h_addr_list[i], addrs[i].addr, h->h_length); + } + h->h_addr_list[i] = 0; + h->h_name = h->h_aliases[0] = buf; strcpy(h->h_name, canon); buf += strlen(h->h_name)+1; @@ -70,13 +77,6 @@ int gethostbyname2_r(const char *name, int af, h->h_aliases[2] = 0; - for (i=0; ih_addr_list[i] = (void *)buf; - buf += h->h_length; - memcpy(h->h_addr_list[i], addrs[i].addr, h->h_length); - } - h->h_addr_list[i] = 0; - *res = h; return 0; } From b3bbc7b16067c82e528d3de580f807b8316f096e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 29 Jun 2016 11:54:03 -0400 Subject: [PATCH 121/412] fix incorrect definition of RUSAGE_CHILDREN in sys/resource.h the kernel ABI value for RUSAGE_CHILDREN is -1, not 1. the latter is actually interpreted as RUSAGE_THREAD, to obtain values for just the calling thread and not the whole process. --- include/sys/resource.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/resource.h b/include/sys/resource.h index cc33de74..ef02a391 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -68,7 +68,7 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); #define PRIO_USER 2 #define RUSAGE_SELF 0 -#define RUSAGE_CHILDREN 1 +#define RUSAGE_CHILDREN (-1) #define RLIM_INFINITY (~0ULL) #define RLIM_SAVED_CUR RLIM_INFINITY From 5c43e1dbc8716536551d392f834c6752a3e82cec Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 29 Jun 2016 11:55:41 -0400 Subject: [PATCH 122/412] add RUSAGE_THREAD (Linux extension) definition to sys/resource.h --- include/sys/resource.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/resource.h b/include/sys/resource.h index ef02a391..6f22a2e7 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -69,6 +69,7 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN (-1) +#define RUSAGE_THREAD 1 #define RLIM_INFINITY (~0ULL) #define RLIM_SAVED_CUR RLIM_INFINITY From 04bced403dead13d20a46a1bd00ab1eb2c50b882 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 25 May 2016 11:22:13 +0200 Subject: [PATCH 123/412] in performing dns lookups, check result from res_mkquery don't send a query that may be malformed. --- src/network/lookup_name.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index 86f90ac1..d3d97b48 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -145,11 +145,15 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static if (family != AF_INET6) { qlens[nq] = __res_mkquery(0, name, 1, RR_A, 0, 0, 0, qbuf[nq], sizeof *qbuf); + if (qlens[nq] == -1) + return EAI_NONAME; nq++; } if (family != AF_INET) { qlens[nq] = __res_mkquery(0, name, 1, RR_AAAA, 0, 0, 0, qbuf[nq], sizeof *qbuf); + if (qlens[nq] == -1) + return EAI_NONAME; nq++; } From 4adc6c33e769e647b6fe73752f727c58d09e4e53 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 15 Jun 2016 20:27:46 +0200 Subject: [PATCH 124/412] refactor name_from_dns in hostname lookup backend loop over an address family / resource record mapping to avoid repetitive code. --- src/network/lookup_name.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index d3d97b48..fb7303a3 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -141,20 +141,19 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static int qlens[2], alens[2]; int i, nq = 0; struct dpc_ctx ctx = { .addrs = buf, .canon = canon }; + static const struct { int af; int rr; } afrr[2] = { + { .af = AF_INET6, .rr = RR_A }, + { .af = AF_INET, .rr = RR_AAAA }, + }; - if (family != AF_INET6) { - qlens[nq] = __res_mkquery(0, name, 1, RR_A, 0, 0, 0, - qbuf[nq], sizeof *qbuf); - if (qlens[nq] == -1) - return EAI_NONAME; - nq++; - } - if (family != AF_INET) { - qlens[nq] = __res_mkquery(0, name, 1, RR_AAAA, 0, 0, 0, - qbuf[nq], sizeof *qbuf); - if (qlens[nq] == -1) - return EAI_NONAME; - nq++; + for (i=0; i<2; i++) { + if (family != afrr[i].af) { + qlens[nq] = __res_mkquery(0, name, 1, afrr[i].rr, + 0, 0, 0, qbuf[nq], sizeof *qbuf); + if (qlens[nq] == -1) + return EAI_NONAME; + nq++; + } } if (__res_msend_rc(nq, qp, qlens, ap, alens, sizeof *abuf, conf) < 0) From 804debee2b1550d10b5ea7290240860dca40ea72 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 29 Jun 2016 17:45:40 -0400 Subject: [PATCH 125/412] in posix_fadvise, don't bypass __syscall macro infrastructure when commit 0b6eb2dfb2e84a8a51906e7634f3d5edc230b058 added the parentheses around __syscall to invoke the function directly, there was no __syscall7 in the syscall macro infrastructure, so this hack was needed. commit 9a3bbce447403d735282586786dc436ec1ffbad4 fixed that but failed to remove the hack. --- src/fcntl/posix_fadvise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcntl/posix_fadvise.c b/src/fcntl/posix_fadvise.c index d5360e0f..fc1562e2 100644 --- a/src/fcntl/posix_fadvise.c +++ b/src/fcntl/posix_fadvise.c @@ -4,7 +4,7 @@ int posix_fadvise(int fd, off_t base, off_t len, int advice) { - return -(__syscall)(SYS_fadvise, fd, __SYSCALL_LL_O(base), + return -__syscall(SYS_fadvise, fd, __SYSCALL_LL_O(base), __SYSCALL_LL_E(len), advice); } From 6d38c9cf80f47623e5e48190046673bbd0dc410b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 29 Jun 2016 18:21:36 -0400 Subject: [PATCH 126/412] fix misordered syscall arguments for posix_fadvise on arm the arm version of the syscall has a custom argument ordering to avoid needing a 7-argument syscall due to 64-bit argument alignment. --- src/fcntl/arm/posix_fadvise.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/fcntl/arm/posix_fadvise.c diff --git a/src/fcntl/arm/posix_fadvise.c b/src/fcntl/arm/posix_fadvise.c new file mode 100644 index 00000000..5c52f6b8 --- /dev/null +++ b/src/fcntl/arm/posix_fadvise.c @@ -0,0 +1,12 @@ +#include +#include "syscall.h" +#include "libc.h" + +int posix_fadvise(int fd, off_t base, off_t len, int advice) +{ + /* ARM-specific syscall argument order */ + return -__syscall(SYS_fadvise, fd, advice, + __SYSCALL_LL_E(base), __SYSCALL_LL_E(len)); +} + +LFS64(posix_fadvise); From 3d98146146dbe138b380ea7d7f9b93139d768828 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sat, 7 May 2016 13:48:21 -0500 Subject: [PATCH 127/412] pthread: implement try/timed join variants --- include/pthread.h | 2 ++ src/thread/pthread_join.c | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/pthread.h b/include/pthread.h index af70b739..3d2e0c45 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -214,6 +214,8 @@ struct cpu_set_t; int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); int pthread_getattr_np(pthread_t, pthread_attr_t *); +int pthread_tryjoin_np(pthread_t, void **); +int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); #endif #ifdef __cplusplus diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c index 694d377a..52111489 100644 --- a/src/thread/pthread_join.c +++ b/src/thread/pthread_join.c @@ -5,18 +5,32 @@ int __munmap(void *, size_t); void __pthread_testcancel(void); int __pthread_setcancelstate(int, int *); -int __pthread_join(pthread_t t, void **res) +int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec *at) { - int tmp, cs; + int tmp, cs, r = 0; __pthread_testcancel(); __pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); if (cs == PTHREAD_CANCEL_ENABLE) __pthread_setcancelstate(cs, 0); - while ((tmp = t->tid)) __timedwait_cp(&t->tid, tmp, 0, 0, 0); + while ((tmp = t->tid) && r != ETIMEDOUT && r != EINVAL) + r = __timedwait_cp(&t->tid, tmp, CLOCK_REALTIME, at, 0); __pthread_setcancelstate(cs, 0); + if (r == ETIMEDOUT || r == EINVAL) return r; a_barrier(); if (res) *res = t->result; if (t->map_base) __munmap(t->map_base, t->map_size); return 0; } +int __pthread_join(pthread_t t, void **res) +{ + return __pthread_timedjoin_np(t, res, 0); +} + +int __pthread_tryjoin_np(pthread_t t, void **res) +{ + return t->tid ? EBUSY : __pthread_join(t, res); +} + +weak_alias(__pthread_tryjoin_np, pthread_tryjoin_np); +weak_alias(__pthread_timedjoin_np, pthread_timedjoin_np); weak_alias(__pthread_join, pthread_join); From 3dd27f3aabf03b109c30648c3f7a209302deee7f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 1 Jul 2016 13:32:35 -0400 Subject: [PATCH 128/412] fix posix_fadvise syscall args on powerpc, unify with arm fix commit 6d38c9cf80f47623e5e48190046673bbd0dc410b provided an arm-specific version of posix_fadvise to address the alternate argument order the kernel expects on arm, but neglected to address that powerpc (32-bit) has the same issue. instead of having arch variant files in duplicate, simply put the alternate version in the top-level file under the control of a macro defined in syscall_arch.h. --- arch/arm/syscall_arch.h | 2 ++ arch/powerpc/syscall_arch.h | 2 ++ src/fcntl/arm/posix_fadvise.c | 12 ------------ src/fcntl/posix_fadvise.c | 8 ++++++++ 4 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 src/fcntl/arm/posix_fadvise.c diff --git a/arch/arm/syscall_arch.h b/arch/arm/syscall_arch.h index 64461ec8..6023303b 100644 --- a/arch/arm/syscall_arch.h +++ b/arch/arm/syscall_arch.h @@ -76,3 +76,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo #define VDSO_USEFUL #define VDSO_CGT_SYM "__vdso_clock_gettime" #define VDSO_CGT_VER "LINUX_2.6" + +#define SYSCALL_FADVISE_6_ARG diff --git a/arch/powerpc/syscall_arch.h b/arch/powerpc/syscall_arch.h index e7cb1a26..004060e6 100644 --- a/arch/powerpc/syscall_arch.h +++ b/arch/powerpc/syscall_arch.h @@ -5,3 +5,5 @@ #undef SYSCALL_NO_INLINE #define SYSCALL_NO_INLINE + +#define SYSCALL_FADVISE_6_ARG diff --git a/src/fcntl/arm/posix_fadvise.c b/src/fcntl/arm/posix_fadvise.c deleted file mode 100644 index 5c52f6b8..00000000 --- a/src/fcntl/arm/posix_fadvise.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "syscall.h" -#include "libc.h" - -int posix_fadvise(int fd, off_t base, off_t len, int advice) -{ - /* ARM-specific syscall argument order */ - return -__syscall(SYS_fadvise, fd, advice, - __SYSCALL_LL_E(base), __SYSCALL_LL_E(len)); -} - -LFS64(posix_fadvise); diff --git a/src/fcntl/posix_fadvise.c b/src/fcntl/posix_fadvise.c index fc1562e2..c1a0ef5a 100644 --- a/src/fcntl/posix_fadvise.c +++ b/src/fcntl/posix_fadvise.c @@ -4,8 +4,16 @@ int posix_fadvise(int fd, off_t base, off_t len, int advice) { +#if defined(SYSCALL_FADVISE_6_ARG) + /* Some archs, at least arm and powerpc, have the syscall + * arguments reordered to avoid needing 7 argument registers + * due to 64-bit argument alignment. */ + return -__syscall(SYS_fadvise, fd, advice, + __SYSCALL_LL_E(base), __SYSCALL_LL_E(len)); +#else return -__syscall(SYS_fadvise, fd, __SYSCALL_LL_O(base), __SYSCALL_LL_E(len), advice); +#endif } LFS64(posix_fadvise); From 7158481d51960d4ff8fe2f113bcbfa7d5b862648 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 10:49:52 -0400 Subject: [PATCH 129/412] add consistent reserved fields in mips64/n32 termios structures the (unused) speed fields were omitted when these ports were first added (within this release cycle, so not present in any release yet) in accordance with how glibc defines the structure on mips archs. however their omission does not match existing musl practice/intent. glibc provides its own, mostly-unified termios structure definition and performs translation in userspace to match the kernel structure for the arch, but has gratuitous differences on a few archs like mips, presumably as a result of historical mistakes. some other libcs use the kernel definitions directly. musl essentially does that, by matching the kernel layout in the part of the structure the kernel will read/write, but leaves additional space at the end for extensibility. these are nominally the (nonstandard) speed fields and (on most archs) extra c_cc elements, but since they are not used they could be repurposed if there's ever a need. --- arch/mips64/bits/termios.h | 2 ++ arch/mipsn32/bits/termios.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h index 3a7d5a13..b19d4867 100644 --- a/arch/mips64/bits/termios.h +++ b/arch/mips64/bits/termios.h @@ -5,6 +5,8 @@ struct termios { tcflag_t c_lflag; cc_t c_line; cc_t c_cc[NCCS]; + speed_t __c_ispeed; + speed_t __c_ospeed; }; #define VINTR 0 diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h index 3a7d5a13..b19d4867 100644 --- a/arch/mipsn32/bits/termios.h +++ b/arch/mipsn32/bits/termios.h @@ -5,6 +5,8 @@ struct termios { tcflag_t c_lflag; cc_t c_line; cc_t c_cc[NCCS]; + speed_t __c_ispeed; + speed_t __c_ospeed; }; #define VINTR 0 From 76d7cfb7e677eb0fcacdabf67514b51e777269dd Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:02:23 +0200 Subject: [PATCH 130/412] use the generic ioctl.h for x86_64, x32 and aarch64 they were slightly different in musl, but should be the same: the linux uapi and glibc headers are not different. --- arch/aarch64/bits/ioctl.h | 213 -------------------------------------- arch/x32/bits/ioctl.h | 197 ----------------------------------- arch/x86_64/bits/ioctl.h | 197 ----------------------------------- 3 files changed, 607 deletions(-) delete mode 100644 arch/aarch64/bits/ioctl.h delete mode 100644 arch/x32/bits/ioctl.h delete mode 100644 arch/x86_64/bits/ioctl.h diff --git a/arch/aarch64/bits/ioctl.h b/arch/aarch64/bits/ioctl.h deleted file mode 100644 index 0345077f..00000000 --- a/arch/aarch64/bits/ioctl.h +++ /dev/null @@ -1,213 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGRS485 0x542E -#define TIOCSRS485 0x542F -#define TIOCGPTN _IOR('T', 0x30, unsigned int) -#define TIOCSPTLCK _IOW('T', 0x31, int) -#define TIOCGDEV _IOR('T', 0x32, unsigned int) -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 -#define TIOCSIG 0x40045436 -#define TIOCVHANGUP 0x5437 -#define TIOCGPKT 0x80045438 -#define TIOCGPTLCK 0x80045439 -#define TIOCGEXCL 0x80045440 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define FIOQSIZE 0x5460 - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 -#define N_GIGASET_M101 16 -#define N_SLCAN 17 -#define N_PPS 18 -#define N_V253 19 -#define N_CAIF 20 -#define N_GSM0710 21 -#define N_TI_WL 22 -#define N_TRACESINK 23 -#define N_TRACEROUTER 24 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/x32/bits/ioctl.h b/arch/x32/bits/ioctl.h deleted file mode 100644 index 77a94551..00000000 --- a/arch/x32/bits/ioctl.h +++ /dev/null @@ -1,197 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGPTN 0x80045430 -#define TIOCSPTLCK 0x40045431 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F -#define FIOQSIZE 0x5460 - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/x86_64/bits/ioctl.h b/arch/x86_64/bits/ioctl.h deleted file mode 100644 index 77a94551..00000000 --- a/arch/x86_64/bits/ioctl.h +++ /dev/null @@ -1,197 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGPTN 0x80045430 -#define TIOCSPTLCK 0x40045431 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F -#define FIOQSIZE 0x5460 - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 From 2df9ae916120212442201bbf30271a1170e508cf Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:03:19 +0200 Subject: [PATCH 131/412] remove ioctl macros that were removed from linux uapi TIOCTTYGSTRUCT, TIOCGHAYESESP, TIOCSHAYESESP and TIOCM_MODEM_BITS were removed from the linux uapi and not present in glibc ioctl.h --- arch/generic/bits/ioctl.h | 4 ---- arch/mips/bits/ioctl.h | 4 ---- arch/mips64/bits/ioctl.h | 4 ---- arch/mipsn32/bits/ioctl.h | 4 ---- arch/powerpc/bits/ioctl.h | 7 ------- arch/powerpc64/bits/ioctl.h | 7 ------- arch/sh/bits/ioctl.h | 2 -- 7 files changed, 32 deletions(-) diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index 9d75118e..ef44b15e 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -46,7 +46,6 @@ #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 #define TIOCSBRK 0x5427 #define TIOCCBRK 0x5428 #define TIOCGSID 0x5429 @@ -72,8 +71,6 @@ #define TIOCMIWAIT 0x545C #define TIOCGICOUNT 0x545D -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F #define FIOQSIZE 0x5460 #define TIOCPKT_DATA 0 @@ -108,7 +105,6 @@ struct winsize { #define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 #define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 #define N_TTY 0 #define N_SLIP 1 diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index 83fb1678..21390e44 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -80,10 +80,7 @@ #define TIOCSERSETMULTI 0x5490 #define TIOCMIWAIT 0x5491 #define TIOCGICOUNT 0x5492 -#define TIOCGHAYESESP 0x5493 -#define TIOCSHAYESESP 0x5494 -#define TIOCTTYGSTRUCT 0x5426 // RICH: Not sure about these. #define TCGETX 0x5432 // RICH: Not sure about these. #define TCSETX 0x5433 // RICH: Not sure about these. #define TCSETXF 0x5434 // RICH: Not sure about these. @@ -121,7 +118,6 @@ struct winsize { #define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 #define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 #define N_TTY 0 #define N_SLIP 1 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index 041be560..97f9b05e 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -80,10 +80,7 @@ #define TIOCSERSETMULTI 0x5490 #define TIOCMIWAIT 0x5491 #define TIOCGICOUNT 0x5492 -#define TIOCGHAYESESP 0x5493 -#define TIOCSHAYESESP 0x5494 -#define TIOCTTYGSTRUCT 0x5426 #define TCGETX 0x5432 #define TCSETX 0x5433 #define TCSETXF 0x5434 @@ -121,7 +118,6 @@ struct winsize { #define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 #define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 #define N_TTY 0 #define N_SLIP 1 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index 041be560..97f9b05e 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -80,10 +80,7 @@ #define TIOCSERSETMULTI 0x5490 #define TIOCMIWAIT 0x5491 #define TIOCGICOUNT 0x5492 -#define TIOCGHAYESESP 0x5493 -#define TIOCSHAYESESP 0x5494 -#define TIOCTTYGSTRUCT 0x5426 #define TCGETX 0x5432 #define TCSETX 0x5433 #define TCSETXF 0x5434 @@ -121,7 +118,6 @@ struct winsize { #define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 #define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 #define N_TTY 0 #define N_SLIP 1 diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index 0c903dcb..193ba6e4 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -120,16 +120,11 @@ /* end kernel header ioctls.h */ -#define TIOCTTYGSTRUCT 0x5426 - #define TCGETX 0x5432 #define TCSETX 0x5433 #define TCSETXF 0x5434 #define TCSETXW 0x5435 -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F - struct winsize { unsigned short ws_row; unsigned short ws_col; @@ -137,8 +132,6 @@ struct winsize { unsigned short ws_ypixel; }; -#define TIOCM_MODEM_BITS TIOCM_OUT2 - #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h index 44a6cb65..f26bb757 100644 --- a/arch/powerpc64/bits/ioctl.h +++ b/arch/powerpc64/bits/ioctl.h @@ -123,16 +123,11 @@ /* end kernel header ioctls.h */ -#define TIOCTTYGSTRUCT 0x5426 - #define TCGETX 0x5432 #define TCSETX 0x5433 #define TCSETXF 0x5434 #define TCSETXW 0x5435 -#define TIOCGHAYESESP 0x545E -#define TIOCSHAYESESP 0x545F - struct winsize { unsigned short ws_row; unsigned short ws_col; @@ -140,8 +135,6 @@ struct winsize { unsigned short ws_ypixel; }; -#define TIOCM_MODEM_BITS TIOCM_OUT2 - #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index 2f63d06f..8f01f4f6 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -119,8 +119,6 @@ struct winsize { unsigned short ws_ypixel; }; -#define TIOCM_MODEM_BITS TIOCM_OUT2 - #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 From 8735a921d0242be0d7e6dbe0f76f79e09d4f06dd Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:03:56 +0200 Subject: [PATCH 132/412] add missing SIOCSIFNAME from linux/sockios.h to ioctl.h glibc ioctl.h has it too. --- arch/generic/bits/ioctl.h | 1 + arch/mips/bits/ioctl.h | 1 + arch/mips64/bits/ioctl.h | 1 + arch/mipsn32/bits/ioctl.h | 1 + arch/powerpc/bits/ioctl.h | 1 + arch/powerpc64/bits/ioctl.h | 1 + arch/sh/bits/ioctl.h | 1 + 7 files changed, 7 insertions(+) diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index ef44b15e..14035a0f 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -153,6 +153,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index 21390e44..20635bb8 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -166,6 +166,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index 97f9b05e..841f9cad 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -166,6 +166,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index 97f9b05e..841f9cad 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -166,6 +166,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index 193ba6e4..f1f7eca1 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -179,6 +179,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h index f26bb757..43839946 100644 --- a/arch/powerpc64/bits/ioctl.h +++ b/arch/powerpc64/bits/ioctl.h @@ -182,6 +182,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index 8f01f4f6..e4587aaa 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -167,6 +167,7 @@ struct winsize { #define SIOCSIFMEM 0x8920 #define SIOCGIFMTU 0x8921 #define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 #define SIOCSIFHWADDR 0x8924 #define SIOCGIFENCAP 0x8925 #define SIOCSIFENCAP 0x8926 From 5ce901279ec8b51fd80fb33bdebbbe54553a6057 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:04:32 +0200 Subject: [PATCH 133/412] add missing TIOC* macros to ioctl.h these are defined in linux asm/ioctls.h. (powerpc64 and powerpc bits/ioctl.h are now identical) --- arch/generic/bits/ioctl.h | 8 ++++++++ arch/mips/bits/ioctl.h | 8 ++++++++ arch/mips64/bits/ioctl.h | 8 ++++++++ arch/mipsn32/bits/ioctl.h | 8 ++++++++ arch/powerpc/bits/ioctl.h | 3 +++ arch/powerpc64/bits/ioctl.h | 6 +++--- arch/sh/bits/ioctl.h | 2 ++ 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index 14035a0f..668d467e 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -49,12 +49,20 @@ #define TIOCSBRK 0x5427 #define TIOCCBRK 0x5428 #define TIOCGSID 0x5429 +#define TIOCGRS485 0x542E +#define TIOCSRS485 0x542F #define TIOCGPTN 0x80045430 #define TIOCSPTLCK 0x40045431 +#define TIOCGDEV 0x80045432 #define TCGETX 0x5432 #define TCSETX 0x5433 #define TCSETXF 0x5434 #define TCSETXW 0x5435 +#define TIOCSIG 0x40045436 +#define TIOCVHANGUP 0x5437 +#define TIOCGPKT 0x80045438 +#define TIOCGPTLCK 0x80045439 +#define TIOCGEXCL 0x80045440 #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index 20635bb8..02c60bdf 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -58,8 +58,16 @@ #define TIOCSBRK 0x5427 #define TIOCCBRK 0x5428 #define TIOCGSID 0x7416 +#define TIOCGRS485 _IOR('T', 0x2E, char[32]) +#define TIOCSRS485 _IOWR('T', 0x2F, char[32]) #define TIOCGPTN _IOR('T', 0x30, unsigned int) #define TIOCSPTLCK _IOW('T', 0x31, int) +#define TIOCGDEV _IOR('T', 0x32, unsigned int) +#define TIOCSIG _IOW('T', 0x36, int) +#define TIOCVHANGUP 0x5437 +#define TIOCGPKT _IOR('T', 0x38, int) +#define TIOCGPTLCK _IOR('T', 0x39, int) +#define TIOCGEXCL _IOR('T', 0x40, int) #define TIOCSCTTY 0x5480 #define TIOCGSOFTCAR 0x5481 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index 841f9cad..4de7d1a2 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -58,8 +58,16 @@ #define TIOCSBRK 0x5427 #define TIOCCBRK 0x5428 #define TIOCGSID 0x7416 +#define TIOCGRS485 _IOR('T', 0x2E, char[32]) +#define TIOCSRS485 _IOWR('T', 0x2F, char[32]) #define TIOCGPTN _IOR('T', 0x30, unsigned int) #define TIOCSPTLCK _IOW('T', 0x31, int) +#define TIOCGDEV _IOR('T', 0x32, unsigned int) +#define TIOCSIG _IOW('T', 0x36, int) +#define TIOCVHANGUP 0x5437 +#define TIOCGPKT _IOR('T', 0x38, int) +#define TIOCGPTLCK _IOR('T', 0x39, int) +#define TIOCGEXCL _IOR('T', 0x40, int) #define TIOCSCTTY 0x5480 #define TIOCGSOFTCAR 0x5481 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index 841f9cad..4de7d1a2 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -58,8 +58,16 @@ #define TIOCSBRK 0x5427 #define TIOCCBRK 0x5428 #define TIOCGSID 0x7416 +#define TIOCGRS485 _IOR('T', 0x2E, char[32]) +#define TIOCSRS485 _IOWR('T', 0x2F, char[32]) #define TIOCGPTN _IOR('T', 0x30, unsigned int) #define TIOCSPTLCK _IOW('T', 0x31, int) +#define TIOCGDEV _IOR('T', 0x32, unsigned int) +#define TIOCSIG _IOW('T', 0x36, int) +#define TIOCVHANGUP 0x5437 +#define TIOCGPKT _IOR('T', 0x38, int) +#define TIOCGPTLCK _IOR('T', 0x39, int) +#define TIOCGEXCL _IOR('T', 0x40, int) #define TIOCSCTTY 0x5480 #define TIOCGSOFTCAR 0x5481 diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index f1f7eca1..1424b2dc 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -101,6 +101,9 @@ #define TIOCGDEV _IOR('T',0x32, unsigned int) #define TIOCSIG _IOW('T',0x36, int) #define TIOCVHANGUP 0x5437 +#define TIOCGPKT _IOR('T', 0x38, int) +#define TIOCGPTLCK _IOR('T', 0x39, int) +#define TIOCGEXCL _IOR('T', 0x40, int) #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h index 43839946..1424b2dc 100644 --- a/arch/powerpc64/bits/ioctl.h +++ b/arch/powerpc64/bits/ioctl.h @@ -101,9 +101,9 @@ #define TIOCGDEV _IOR('T',0x32, unsigned int) #define TIOCSIG _IOW('T',0x36, int) #define TIOCVHANGUP 0x5437 -#define TIOCGPKT _IOR('T',0x38, int) -#define TIOCGPTLCK _IOR('T',0x39, int) -#define TIOCGEXCL _IOR('T',0x40, int) +#define TIOCGPKT _IOR('T', 0x38, int) +#define TIOCGPTLCK _IOR('T', 0x39, int) +#define TIOCGEXCL _IOR('T', 0x40, int) #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index e4587aaa..20fd17ce 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -89,6 +89,8 @@ #define TCSETS2 _IOW('T', 43, char[44]) #define TCSETSW2 _IOW('T', 44, char[44]) #define TCSETSF2 _IOW('T', 45, char[44]) +#define TIOCGRS485 _IOR('T', 46, char[32]) +#define TIOCSRS485 _IOWR('T', 47, char[32]) #define TIOCGPTN _IOR('T', 48, unsigned int) #define TIOCSPTLCK _IOW('T', 49, int) #define TIOCGDEV _IOR('T', 50, unsigned int) From 058c0b2d700b1092ad5967c742c790b9c807e6ae Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:05:08 +0200 Subject: [PATCH 134/412] remove mips and powerpc ioctls that are missing from linux uapi mips and powerpc use their own asm/ioctls.h, not the asm-generic/ioctls.h and they lack termiox macros that are available on other targets. see kernel commit 1d65b4a088de407e99714fdc27862449db04fb5c --- arch/mips/bits/ioctl.h | 5 ----- arch/mips64/bits/ioctl.h | 5 ----- arch/mipsn32/bits/ioctl.h | 5 ----- arch/powerpc/bits/ioctl.h | 8 -------- arch/powerpc64/bits/ioctl.h | 8 -------- 5 files changed, 31 deletions(-) diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index 02c60bdf..cf27733c 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -89,11 +89,6 @@ #define TIOCMIWAIT 0x5491 #define TIOCGICOUNT 0x5492 -#define TCGETX 0x5432 // RICH: Not sure about these. -#define TCSETX 0x5433 // RICH: Not sure about these. -#define TCSETXF 0x5434 // RICH: Not sure about these. -#define TCSETXW 0x5435 // RICH: Not sure about these. - #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index 4de7d1a2..cf27733c 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -89,11 +89,6 @@ #define TIOCMIWAIT 0x5491 #define TIOCGICOUNT 0x5492 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index 4de7d1a2..cf27733c 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -89,11 +89,6 @@ #define TIOCMIWAIT 0x5491 #define TIOCGICOUNT 0x5492 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index 1424b2dc..6d49cf4e 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -120,14 +120,6 @@ #define TIOCGICOUNT 0x545D -/* end kernel header ioctls.h */ - - -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - struct winsize { unsigned short ws_row; unsigned short ws_col; diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h index 1424b2dc..6d49cf4e 100644 --- a/arch/powerpc64/bits/ioctl.h +++ b/arch/powerpc64/bits/ioctl.h @@ -120,14 +120,6 @@ #define TIOCGICOUNT 0x545D -/* end kernel header ioctls.h */ - - -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - struct winsize { unsigned short ws_row; unsigned short ws_col; From b76d4e06f1686337713a31a9e7274e1321ae41b6 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:05:36 +0200 Subject: [PATCH 135/412] fix mips, mips64, mipsn32 TIOCM_* macros in ioctl.h TIOCM_ macros were wrongly using the asm-generic/termios.h definitions instead of the mips specific ones from asm/termios.h --- arch/mips/bits/ioctl.h | 28 ++++++++++++++-------------- arch/mips64/bits/ioctl.h | 28 ++++++++++++++-------------- arch/mipsn32/bits/ioctl.h | 28 ++++++++++++++-------------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index cf27733c..ce80eb6a 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -107,20 +107,20 @@ struct winsize { unsigned short ws_ypixel; }; -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x010 +#define TIOCM_SR 0x020 +#define TIOCM_CTS 0x040 +#define TIOCM_CAR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RNG 0x200 +#define TIOCM_RI TIOCM_RNG +#define TIOCM_DSR 0x400 +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 #define N_TTY 0 #define N_SLIP 1 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index cf27733c..ce80eb6a 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -107,20 +107,20 @@ struct winsize { unsigned short ws_ypixel; }; -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x010 +#define TIOCM_SR 0x020 +#define TIOCM_CTS 0x040 +#define TIOCM_CAR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RNG 0x200 +#define TIOCM_RI TIOCM_RNG +#define TIOCM_DSR 0x400 +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 #define N_TTY 0 #define N_SLIP 1 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index cf27733c..ce80eb6a 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -107,20 +107,20 @@ struct winsize { unsigned short ws_ypixel; }; -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x010 +#define TIOCM_SR 0x020 +#define TIOCM_CTS 0x040 +#define TIOCM_CAR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RNG 0x200 +#define TIOCM_RI TIOCM_RNG +#define TIOCM_DSR 0x400 +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 #define N_TTY 0 #define N_SLIP 1 From 809495f7b77abba57cd6da600d9dbcf6d2d8f73b Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:06:03 +0200 Subject: [PATCH 136/412] fix TIOCMSET in mips ioctl.h it seems it was a typo. --- arch/mips/bits/ioctl.h | 2 +- arch/mips64/bits/ioctl.h | 2 +- arch/mipsn32/bits/ioctl.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index ce80eb6a..accd7af2 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -27,7 +27,7 @@ #define TIOCMGET 0x741D #define TIOCMBIS 0x741B #define TIOCMBIC 0x741C -#define TIOCMSET 0x741D +#define TIOCMSET 0x741A #define TIOCPKT 0x5470 #define TIOCSWINSZ _IOW('t', 103, struct winsize) diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index ce80eb6a..accd7af2 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -27,7 +27,7 @@ #define TIOCMGET 0x741D #define TIOCMBIS 0x741B #define TIOCMBIC 0x741C -#define TIOCMSET 0x741D +#define TIOCMSET 0x741A #define TIOCPKT 0x5470 #define TIOCSWINSZ _IOW('t', 103, struct winsize) diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index ce80eb6a..accd7af2 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -27,7 +27,7 @@ #define TIOCMGET 0x741D #define TIOCMBIS 0x741B #define TIOCMBIC 0x741C -#define TIOCMSET 0x741D +#define TIOCMSET 0x741A #define TIOCPKT 0x5470 #define TIOCSWINSZ _IOW('t', 103, struct winsize) From 6fce6ca129c34d8975f777216d32cf92e77c18f2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:06:36 +0200 Subject: [PATCH 137/412] remove termios2 related ioctls from sh ioctl.h musl does not define these on other targets either. --- arch/sh/bits/ioctl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index 20fd17ce..e6e7d344 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -85,10 +85,6 @@ #define TCSETS _IO('T', 2) #define TCSETSW _IO('T', 3) #define TCSETSF _IO('T', 4) -#define TCGETS2 _IOR('T', 42, char[44]) -#define TCSETS2 _IOW('T', 43, char[44]) -#define TCSETSW2 _IOW('T', 44, char[44]) -#define TCSETSF2 _IOW('T', 45, char[44]) #define TIOCGRS485 _IOR('T', 46, char[32]) #define TIOCSRS485 _IOWR('T', 47, char[32]) #define TIOCGPTN _IOR('T', 48, unsigned int) From cd208b0037c60da625fdd1f6a1459bc37115aacd Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:07:30 +0200 Subject: [PATCH 138/412] fix FIOQSIZE in arm ioctl.h arm ioctl.h is the same as the generic one except this macro, so a workaround solution is used to avoid another ioctl.h copy. --- arch/arm/bits/ioctl_fix.h | 2 ++ arch/generic/bits/ioctl.h | 2 ++ arch/generic/bits/ioctl_fix.h | 0 3 files changed, 4 insertions(+) create mode 100644 arch/arm/bits/ioctl_fix.h create mode 100644 arch/generic/bits/ioctl_fix.h diff --git a/arch/arm/bits/ioctl_fix.h b/arch/arm/bits/ioctl_fix.h new file mode 100644 index 00000000..ebb383da --- /dev/null +++ b/arch/arm/bits/ioctl_fix.h @@ -0,0 +1,2 @@ +#undef FIOQSIZE +#define FIOQSIZE 0x545e diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index 668d467e..c2035fc5 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -200,3 +200,5 @@ struct winsize { #define SIOCDEVPRIVATE 0x89F0 #define SIOCPROTOPRIVATE 0x89E0 + +#include diff --git a/arch/generic/bits/ioctl_fix.h b/arch/generic/bits/ioctl_fix.h new file mode 100644 index 00000000..e69de29b From 126f58b2f44a0ba730831a6a4fef8daf85d9a601 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 15:01:04 -0400 Subject: [PATCH 139/412] define appropriate feature test macros to get CBAUD from termios.h --- src/termios/cfgetospeed.c | 1 + src/termios/cfsetospeed.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/termios/cfgetospeed.c b/src/termios/cfgetospeed.c index 0ebc198c..55fa6f55 100644 --- a/src/termios/cfgetospeed.c +++ b/src/termios/cfgetospeed.c @@ -1,3 +1,4 @@ +#define _BSD_SOURCE #include #include diff --git a/src/termios/cfsetospeed.c b/src/termios/cfsetospeed.c index 80c790f1..b571f62e 100644 --- a/src/termios/cfsetospeed.c +++ b/src/termios/cfsetospeed.c @@ -1,3 +1,4 @@ +#define _BSD_SOURCE #include #include #include From 2e128574c9c46b240a15c07058b772fb7e47a75e Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:07:56 +0200 Subject: [PATCH 140/412] fix generic termios.h macro exposure/namespace issues add EXTA, EXTB, CIBAUD, CMSPAR, XCASE macros and hide them as well as CBAUD, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, PENDIN in standard mode. the new macros are both in glibc termios.h and in linux asm/termbits.h, the later also contains IBSHIFT and BOTHER, those were not added. these are not standard macros, but some of them are in the reserved namespace so could be exposed, the ones which are not reserved are CIBAUD, CMSPAR and XCASE (which was removed in issue 6), the rest got hidden to be consistent with glibc. --- arch/generic/bits/termios.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/generic/bits/termios.h b/arch/generic/bits/termios.h index f0d81b13..941de7bd 100644 --- a/arch/generic/bits/termios.h +++ b/arch/generic/bits/termios.h @@ -109,8 +109,6 @@ struct termios #define B3500000 0010016 #define B4000000 0010017 -#define CBAUD 0010017 - #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 @@ -133,12 +131,6 @@ struct termios #define TOSTOP 0000400 #define IEXTEN 0100000 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 - #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 @@ -153,8 +145,21 @@ struct termios #define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define EXTA 0000016 +#define EXTB 0000017 +#define CBAUD 0010017 #define CBAUDEX 0010000 -#define CRTSCTS 020000000000 +#define CIBAUD 002003600000 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 + +#define XCASE 0000004 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0010000 +#define PENDIN 0040000 #define EXTPROC 0200000 + #define XTABS 0014000 #endif From 3bda42ac4bddc600bdae0f57c5b65c4482fbfefc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:08:24 +0200 Subject: [PATCH 141/412] fix powerpc termios.h macro exposure/namespace issues same changes as in the generic header. and BOTHER and IBSHIFT were removed (present in linux uapi but not in glibc) and TIOCSER_TEMT was added (present in glibc). --- arch/powerpc/bits/termios.h | 24 ++++++++++++------------ arch/powerpc64/bits/termios.h | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h index 7feaf493..d2fc297a 100644 --- a/arch/powerpc/bits/termios.h +++ b/arch/powerpc/bits/termios.h @@ -96,8 +96,6 @@ struct termios #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 -#define EXTA 0000016 -#define EXTB 0000017 #define B57600 00020 #define B115200 00021 @@ -114,9 +112,6 @@ struct termios #define B3000000 00034 #define B3500000 00035 #define B4000000 00036 -#define BOTHER 00037 - -#define CBAUD 00377 #define CSIZE 00001400 #define CS5 00000000 @@ -130,20 +125,14 @@ struct termios #define HUPCL 00040000 #define CLOCAL 00100000 -#define ECHOKE 0x00000001 #define ECHOE 0x00000002 #define ECHOK 0x00000004 #define ECHO 0x00000008 #define ECHONL 0x00000010 -#define ECHOPRT 0x00000020 -#define ECHOCTL 0x00000040 #define ISIG 0x00000080 #define ICANON 0x00000100 #define IEXTEN 0x00000400 -#define XCASE 0x00004000 #define TOSTOP 0x00400000 -#define FLUSHO 0x00800000 -#define PENDIN 0x20000000 #define NOFLSH 0x80000000 #define TCOOFF 0 @@ -160,11 +149,22 @@ struct termios #define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define EXTA 0000016 +#define EXTB 0000017 +#define CBAUD 00377 #define CBAUDEX 0000000 #define CIBAUD 077600000 -#define IBSHIFT 16 #define CMSPAR 010000000000 #define CRTSCTS 020000000000 + +#define XCASE 0x00004000 +#define ECHOCTL 0x00000040 +#define ECHOPRT 0x00000020 +#define ECHOKE 0x00000001 +#define FLUSHO 0x00800000 +#define PENDIN 0x20000000 #define EXTPROC 0x10000000 + #define XTABS 00006000 +#define TIOCSER_TEMT 1 #endif diff --git a/arch/powerpc64/bits/termios.h b/arch/powerpc64/bits/termios.h index 7feaf493..d2fc297a 100644 --- a/arch/powerpc64/bits/termios.h +++ b/arch/powerpc64/bits/termios.h @@ -96,8 +96,6 @@ struct termios #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 -#define EXTA 0000016 -#define EXTB 0000017 #define B57600 00020 #define B115200 00021 @@ -114,9 +112,6 @@ struct termios #define B3000000 00034 #define B3500000 00035 #define B4000000 00036 -#define BOTHER 00037 - -#define CBAUD 00377 #define CSIZE 00001400 #define CS5 00000000 @@ -130,20 +125,14 @@ struct termios #define HUPCL 00040000 #define CLOCAL 00100000 -#define ECHOKE 0x00000001 #define ECHOE 0x00000002 #define ECHOK 0x00000004 #define ECHO 0x00000008 #define ECHONL 0x00000010 -#define ECHOPRT 0x00000020 -#define ECHOCTL 0x00000040 #define ISIG 0x00000080 #define ICANON 0x00000100 #define IEXTEN 0x00000400 -#define XCASE 0x00004000 #define TOSTOP 0x00400000 -#define FLUSHO 0x00800000 -#define PENDIN 0x20000000 #define NOFLSH 0x80000000 #define TCOOFF 0 @@ -160,11 +149,22 @@ struct termios #define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define EXTA 0000016 +#define EXTB 0000017 +#define CBAUD 00377 #define CBAUDEX 0000000 #define CIBAUD 077600000 -#define IBSHIFT 16 #define CMSPAR 010000000000 #define CRTSCTS 020000000000 + +#define XCASE 0x00004000 +#define ECHOCTL 0x00000040 +#define ECHOPRT 0x00000020 +#define ECHOKE 0x00000001 +#define FLUSHO 0x00800000 +#define PENDIN 0x20000000 #define EXTPROC 0x10000000 + #define XTABS 00006000 +#define TIOCSER_TEMT 1 #endif From ee9b5900fb098edd3e8d3df375cac8b2cfe8551f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:08:54 +0200 Subject: [PATCH 142/412] fix mips termios.h macro exposure/namespace issues same changes to the defined macros as in powerpc and generic bits. --- arch/mips/bits/termios.h | 29 ++++++++++++++--------------- arch/mips64/bits/termios.h | 29 ++++++++++++++--------------- arch/mipsn32/bits/termios.h | 29 ++++++++++++++--------------- 3 files changed, 42 insertions(+), 45 deletions(-) diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h index 487c1d45..55ba1323 100644 --- a/arch/mips/bits/termios.h +++ b/arch/mips/bits/termios.h @@ -93,10 +93,7 @@ struct termios #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 -#define EXTA 0000016 -#define EXTB 0000017 -#define BOTHER 0010000 #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 @@ -113,8 +110,6 @@ struct termios #define B3500000 0010016 #define B4000000 0010017 -#define CBAUD 0010017 - #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 @@ -129,18 +124,12 @@ struct termios #define ISIG 0000001 #define ICANON 0000002 -#define XCASE 0000004 #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define IEXTEN 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0020000 -#define PENDIN 0040000 #define TOSTOP 0100000 #define ITOSTOP 0100000 @@ -158,12 +147,22 @@ struct termios #define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define EXTA 0000016 +#define EXTB 0000017 +#define CBAUD 0010017 #define CBAUDEX 0010000 -#define CIBAUD 002003600000 -#define IBSHIFT 16 -#define CMSPAR 010000000000 -#define CRTSCTS 020000000000 +#define CIBAUD 002003600000 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 + +#define XCASE 0000004 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0020000 +#define PENDIN 0040000 #define EXTPROC 0200000 + #define XTABS 0014000 #define TIOCSER_TEMT 1 #endif diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h index b19d4867..6a1205d7 100644 --- a/arch/mips64/bits/termios.h +++ b/arch/mips64/bits/termios.h @@ -92,10 +92,7 @@ struct termios { #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 -#define EXTA 0000016 -#define EXTB 0000017 -#define BOTHER 0010000 #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 @@ -112,8 +109,6 @@ struct termios { #define B3500000 0010016 #define B4000000 0010017 -#define CBAUD 0010017 - #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 @@ -128,18 +123,12 @@ struct termios { #define ISIG 0000001 #define ICANON 0000002 -#define XCASE 0000004 #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define IEXTEN 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0020000 -#define PENDIN 0040000 #define TOSTOP 0100000 #define ITOSTOP 0100000 @@ -157,12 +146,22 @@ struct termios { #define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define EXTA 0000016 +#define EXTB 0000017 +#define CBAUD 0010017 #define CBAUDEX 0010000 -#define CIBAUD 002003600000 -#define IBSHIFT 16 -#define CMSPAR 010000000000 -#define CRTSCTS 020000000000 +#define CIBAUD 002003600000 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 + +#define XCASE 0000004 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0020000 +#define PENDIN 0040000 #define EXTPROC 0200000 + #define XTABS 0014000 #define TIOCSER_TEMT 1 #endif diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h index b19d4867..6a1205d7 100644 --- a/arch/mipsn32/bits/termios.h +++ b/arch/mipsn32/bits/termios.h @@ -92,10 +92,7 @@ struct termios { #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 -#define EXTA 0000016 -#define EXTB 0000017 -#define BOTHER 0010000 #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 @@ -112,8 +109,6 @@ struct termios { #define B3500000 0010016 #define B4000000 0010017 -#define CBAUD 0010017 - #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 @@ -128,18 +123,12 @@ struct termios { #define ISIG 0000001 #define ICANON 0000002 -#define XCASE 0000004 #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define IEXTEN 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0020000 -#define PENDIN 0040000 #define TOSTOP 0100000 #define ITOSTOP 0100000 @@ -157,12 +146,22 @@ struct termios { #define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define EXTA 0000016 +#define EXTB 0000017 +#define CBAUD 0010017 #define CBAUDEX 0010000 -#define CIBAUD 002003600000 -#define IBSHIFT 16 -#define CMSPAR 010000000000 -#define CRTSCTS 020000000000 +#define CIBAUD 002003600000 +#define CMSPAR 010000000000 +#define CRTSCTS 020000000000 + +#define XCASE 0000004 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0020000 +#define PENDIN 0040000 #define EXTPROC 0200000 + #define XTABS 0014000 #define TIOCSER_TEMT 1 #endif From 8c316e9e49d37ad92c2e7493e16166a2afca419f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:09:29 +0200 Subject: [PATCH 143/412] fix TCS* definitions in mips termios.h these were incorrectly using the generic definitions. --- arch/mips/bits/termios.h | 6 +++--- arch/mips64/bits/termios.h | 6 +++--- arch/mipsn32/bits/termios.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h index 55ba1323..29b4b220 100644 --- a/arch/mips/bits/termios.h +++ b/arch/mips/bits/termios.h @@ -142,9 +142,9 @@ struct termios #define TCOFLUSH 1 #define TCIOFLUSH 2 -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 +#define TCSANOW 0x540e +#define TCSADRAIN 0x540f +#define TCSAFLUSH 0x5410 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define EXTA 0000016 diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h index 6a1205d7..f559f76f 100644 --- a/arch/mips64/bits/termios.h +++ b/arch/mips64/bits/termios.h @@ -141,9 +141,9 @@ struct termios { #define TCOFLUSH 1 #define TCIOFLUSH 2 -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 +#define TCSANOW 0x540e +#define TCSADRAIN 0x540f +#define TCSAFLUSH 0x5410 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define EXTA 0000016 diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h index 6a1205d7..f559f76f 100644 --- a/arch/mipsn32/bits/termios.h +++ b/arch/mipsn32/bits/termios.h @@ -141,9 +141,9 @@ struct termios { #define TCOFLUSH 1 #define TCIOFLUSH 2 -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 +#define TCSANOW 0x540e +#define TCSADRAIN 0x540f +#define TCSAFLUSH 0x5410 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define EXTA 0000016 From cae8ac485fdcf0227f7dcc5b5af93df72fb01a9e Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 17:09:51 +0200 Subject: [PATCH 144/412] fix CBAUDEX in powerpc termios.h it seems it was a typo. --- arch/powerpc/bits/termios.h | 2 +- arch/powerpc64/bits/termios.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h index d2fc297a..7f67baf4 100644 --- a/arch/powerpc/bits/termios.h +++ b/arch/powerpc/bits/termios.h @@ -152,7 +152,7 @@ struct termios #define EXTA 0000016 #define EXTB 0000017 #define CBAUD 00377 -#define CBAUDEX 0000000 +#define CBAUDEX 0000020 #define CIBAUD 077600000 #define CMSPAR 010000000000 #define CRTSCTS 020000000000 diff --git a/arch/powerpc64/bits/termios.h b/arch/powerpc64/bits/termios.h index d2fc297a..7f67baf4 100644 --- a/arch/powerpc64/bits/termios.h +++ b/arch/powerpc64/bits/termios.h @@ -152,7 +152,7 @@ struct termios #define EXTA 0000016 #define EXTB 0000017 #define CBAUD 00377 -#define CBAUDEX 0000000 +#define CBAUDEX 0000020 #define CIBAUD 077600000 #define CMSPAR 010000000000 #define CRTSCTS 020000000000 From 45ba07fded06005cddbf36b1a8f0c29c63724893 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 14:12:09 -0400 Subject: [PATCH 145/412] format mips bits/termios.h consistently mips64 and n32 versions with this change, all three files are identical. --- arch/mips/bits/termios.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h index 29b4b220..f559f76f 100644 --- a/arch/mips/bits/termios.h +++ b/arch/mips/bits/termios.h @@ -1,5 +1,4 @@ -struct termios -{ +struct termios { tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; From 093288dcb37a30c634b0a00eb7e2a0dbe72ebf95 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 14:38:53 -0400 Subject: [PATCH 146/412] fix misplaced indention in sys/procfs.h --- include/sys/procfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/procfs.h b/include/sys/procfs.h index f7936c43..2a928751 100644 --- a/include/sys/procfs.h +++ b/include/sys/procfs.h @@ -34,7 +34,7 @@ struct elf_prstatus { #define ELF_PRARGSZ 80 struct elf_prpsinfo - { +{ char pr_state; char pr_sname; char pr_zomb; From befa5866ee30d09c0c96e88af2eabff5911342ea Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 14:40:11 -0400 Subject: [PATCH 147/412] make brace placement in public header struct definitions consistent placing the opening brace on the same line as the struct keyword/tag is the style I prefer and seems to be the prevailing practice in more recent additions. these changes were generated by the command: find include/ arch/*/bits -name '*.h' \ -exec sed -i '/^struct [^;{]*$/{N;s/\n/ /;}' {} + and subsequently checked by hand to ensure that the regex did not pick up any false positives. --- arch/aarch64/bits/ipc.h | 3 +-- arch/aarch64/bits/msg.h | 3 +-- arch/aarch64/bits/shm.h | 3 +-- arch/aarch64/bits/socket.h | 6 ++---- arch/arm/bits/stat.h | 3 +-- arch/generic/bits/ipc.h | 3 +-- arch/generic/bits/msg.h | 3 +-- arch/generic/bits/shm.h | 3 +-- arch/generic/bits/socket.h | 6 ++---- arch/generic/bits/termios.h | 3 +-- arch/i386/bits/stat.h | 3 +-- arch/i386/bits/user.h | 6 ++---- arch/microblaze/bits/stat.h | 3 +-- arch/mips/bits/msg.h | 3 +-- arch/mips/bits/shm.h | 3 +-- arch/mips/bits/signal.h | 3 +-- arch/mips/bits/socket.h | 6 ++---- arch/mips/bits/stat.h | 3 +-- arch/mipsn32/bits/msg.h | 3 +-- arch/powerpc/bits/ipc.h | 3 +-- arch/powerpc/bits/msg.h | 3 +-- arch/powerpc/bits/shm.h | 3 +-- arch/powerpc/bits/signal.h | 3 +-- arch/powerpc/bits/socket.h | 6 ++---- arch/powerpc/bits/stat.h | 3 +-- arch/powerpc/bits/termios.h | 3 +-- arch/powerpc64/bits/ipc.h | 3 +-- arch/powerpc64/bits/msg.h | 3 +-- arch/powerpc64/bits/shm.h | 3 +-- arch/powerpc64/bits/socket.h | 6 ++---- arch/powerpc64/bits/stat.h | 3 +-- arch/powerpc64/bits/termios.h | 3 +-- arch/sh/bits/shm.h | 3 +-- arch/sh/bits/stat.h | 3 +-- arch/x32/bits/ipc.h | 3 +-- arch/x32/bits/msg.h | 3 +-- arch/x32/bits/shm.h | 3 +-- arch/x32/bits/socket.h | 6 ++---- arch/x32/bits/user.h | 6 ++---- arch/x86_64/bits/ipc.h | 3 +-- arch/x86_64/bits/msg.h | 3 +-- arch/x86_64/bits/shm.h | 3 +-- arch/x86_64/bits/socket.h | 6 ++---- arch/x86_64/bits/user.h | 6 ++---- include/dirent.h | 3 +-- include/fcntl.h | 3 +-- include/ftw.h | 3 +-- include/getopt.h | 3 +-- include/grp.h | 3 +-- include/mntent.h | 3 +-- include/net/if.h | 3 +-- include/netdb.h | 15 +++++---------- include/netinet/in.h | 30 ++++++++++-------------------- include/netinet/tcp.h | 6 ++---- include/poll.h | 3 +-- include/pwd.h | 3 +-- include/sys/acct.h | 6 ++---- include/sys/procfs.h | 3 +-- include/sys/quota.h | 6 ++---- include/sys/resource.h | 6 ++---- include/sys/socket.h | 15 +++++---------- include/sys/time.h | 3 +-- include/sys/times.h | 3 +-- include/sys/un.h | 3 +-- include/sys/utsname.h | 3 +-- include/time.h | 6 ++---- include/utime.h | 3 +-- include/utmpx.h | 3 +-- 68 files changed, 100 insertions(+), 200 deletions(-) diff --git a/arch/aarch64/bits/ipc.h b/arch/aarch64/bits/ipc.h index 9a47bc7a..6f3328a8 100644 --- a/arch/aarch64/bits/ipc.h +++ b/arch/aarch64/bits/ipc.h @@ -1,5 +1,4 @@ -struct ipc_perm -{ +struct ipc_perm { key_t __ipc_perm_key; uid_t uid; gid_t gid; diff --git a/arch/aarch64/bits/msg.h b/arch/aarch64/bits/msg.h index 0135a08d..641e1703 100644 --- a/arch/aarch64/bits/msg.h +++ b/arch/aarch64/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; time_t msg_stime; time_t msg_rtime; diff --git a/arch/aarch64/bits/shm.h b/arch/aarch64/bits/shm.h index 4c3c9fb7..8d193781 100644 --- a/arch/aarch64/bits/shm.h +++ b/arch/aarch64/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; time_t shm_atime; diff --git a/arch/aarch64/bits/socket.h b/arch/aarch64/bits/socket.h index b3fe643a..c11677e9 100644 --- a/arch/aarch64/bits/socket.h +++ b/arch/aarch64/bits/socket.h @@ -1,7 +1,6 @@ #include -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -21,8 +20,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { #if __BYTE_ORDER == __BIG_ENDIAN int __pad1; socklen_t cmsg_len; diff --git a/arch/arm/bits/stat.h b/arch/arm/bits/stat.h index bb9314a5..22b19bbf 100644 --- a/arch/arm/bits/stat.h +++ b/arch/arm/bits/stat.h @@ -1,8 +1,7 @@ /* copied from kernel definition, but with padding replaced * by the corresponding correctly-sized userspace types. */ -struct stat -{ +struct stat { dev_t st_dev; int __st_dev_padding; long __st_ino_truncated; diff --git a/arch/generic/bits/ipc.h b/arch/generic/bits/ipc.h index b748d3b7..779c42fd 100644 --- a/arch/generic/bits/ipc.h +++ b/arch/generic/bits/ipc.h @@ -1,5 +1,4 @@ -struct ipc_perm -{ +struct ipc_perm { key_t __ipc_perm_key; uid_t uid; gid_t gid; diff --git a/arch/generic/bits/msg.h b/arch/generic/bits/msg.h index 3db8576b..bc8436c4 100644 --- a/arch/generic/bits/msg.h +++ b/arch/generic/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; time_t msg_stime; int __unused1; diff --git a/arch/generic/bits/shm.h b/arch/generic/bits/shm.h index 547581f1..45d1d157 100644 --- a/arch/generic/bits/shm.h +++ b/arch/generic/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; time_t shm_atime; diff --git a/arch/generic/bits/socket.h b/arch/generic/bits/socket.h index 36febbc2..1f73b995 100644 --- a/arch/generic/bits/socket.h +++ b/arch/generic/bits/socket.h @@ -1,5 +1,4 @@ -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -9,8 +8,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { socklen_t cmsg_len; int cmsg_level; int cmsg_type; diff --git a/arch/generic/bits/termios.h b/arch/generic/bits/termios.h index 941de7bd..434c02c8 100644 --- a/arch/generic/bits/termios.h +++ b/arch/generic/bits/termios.h @@ -1,5 +1,4 @@ -struct termios -{ +struct termios { tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; diff --git a/arch/i386/bits/stat.h b/arch/i386/bits/stat.h index bb9314a5..22b19bbf 100644 --- a/arch/i386/bits/stat.h +++ b/arch/i386/bits/stat.h @@ -1,8 +1,7 @@ /* copied from kernel definition, but with padding replaced * by the corresponding correctly-sized userspace types. */ -struct stat -{ +struct stat { dev_t st_dev; int __st_dev_padding; long __st_ino_truncated; diff --git a/arch/i386/bits/user.h b/arch/i386/bits/user.h index fa623621..2c556dd2 100644 --- a/arch/i386/bits/user.h +++ b/arch/i386/bits/user.h @@ -13,8 +13,7 @@ typedef struct user_fpxregs_struct long st_space[32], xmm_space[32], padding[56]; } elf_fpxregset_t; -struct user_regs_struct -{ +struct user_regs_struct { long ebx, ecx, edx, esi, edi, ebp, eax, xds, xes, xfs, xgs; long orig_eax, eip, xcs, eflags, esp, xss; }; @@ -22,8 +21,7 @@ struct user_regs_struct #define ELF_NGREG 17 typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; -struct user -{ +struct user { struct user_regs_struct regs; int u_fpvalid; struct user_fpregs_struct i387; diff --git a/arch/microblaze/bits/stat.h b/arch/microblaze/bits/stat.h index a8c0283d..ce6a6bd0 100644 --- a/arch/microblaze/bits/stat.h +++ b/arch/microblaze/bits/stat.h @@ -1,8 +1,7 @@ /* copied from kernel definition, but with padding replaced * by the corresponding correctly-sized userspace types. */ -struct stat -{ +struct stat { dev_t st_dev; ino_t st_ino; mode_t st_mode; diff --git a/arch/mips/bits/msg.h b/arch/mips/bits/msg.h index bfe2b3a7..f28aece8 100644 --- a/arch/mips/bits/msg.h +++ b/arch/mips/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; #if _MIPSEL || __MIPSEL || __MIPSEL__ time_t msg_stime; diff --git a/arch/mips/bits/shm.h b/arch/mips/bits/shm.h index f4b87126..6652d659 100644 --- a/arch/mips/bits/shm.h +++ b/arch/mips/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; time_t shm_atime; diff --git a/arch/mips/bits/signal.h b/arch/mips/bits/signal.h index 889f77e8..db6f22d5 100644 --- a/arch/mips/bits/signal.h +++ b/arch/mips/bits/signal.h @@ -17,8 +17,7 @@ typedef struct { } fp_fregs[32]; } fp_r; } fpregset_t; -struct sigcontext -{ +struct sigcontext { unsigned sc_regmask, sc_status; unsigned long long sc_pc, sc_regs[32], sc_fpregs[32]; unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp; diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h index cc72dcf9..191ebdb5 100644 --- a/arch/mips/bits/socket.h +++ b/arch/mips/bits/socket.h @@ -1,5 +1,4 @@ -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -9,8 +8,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { socklen_t cmsg_len; int cmsg_level; int cmsg_type; diff --git a/arch/mips/bits/stat.h b/arch/mips/bits/stat.h index c8f9b469..3291a636 100644 --- a/arch/mips/bits/stat.h +++ b/arch/mips/bits/stat.h @@ -1,8 +1,7 @@ /* copied from kernel definition, but with padding replaced * by the corresponding correctly-sized userspace types. */ -struct stat -{ +struct stat { dev_t st_dev; long __st_padding1[2]; ino_t st_ino; diff --git a/arch/mipsn32/bits/msg.h b/arch/mipsn32/bits/msg.h index bfe2b3a7..f28aece8 100644 --- a/arch/mipsn32/bits/msg.h +++ b/arch/mipsn32/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; #if _MIPSEL || __MIPSEL || __MIPSEL__ time_t msg_stime; diff --git a/arch/powerpc/bits/ipc.h b/arch/powerpc/bits/ipc.h index e1bfe2f5..3f2ede07 100644 --- a/arch/powerpc/bits/ipc.h +++ b/arch/powerpc/bits/ipc.h @@ -1,5 +1,4 @@ -struct ipc_perm -{ +struct ipc_perm { key_t __ipc_perm_key; uid_t uid; gid_t gid; diff --git a/arch/powerpc/bits/msg.h b/arch/powerpc/bits/msg.h index a6b9ad5b..171c11a3 100644 --- a/arch/powerpc/bits/msg.h +++ b/arch/powerpc/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; int __unused1; time_t msg_stime; diff --git a/arch/powerpc/bits/shm.h b/arch/powerpc/bits/shm.h index c698ef34..40e5e8be 100644 --- a/arch/powerpc/bits/shm.h +++ b/arch/powerpc/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; int __unused1; time_t shm_atime; diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h index 17a7354f..06efb11c 100644 --- a/arch/powerpc/bits/signal.h +++ b/arch/powerpc/bits/signal.h @@ -23,8 +23,7 @@ typedef struct { unsigned vscr; } vrregset_t; -struct sigcontext -{ +struct sigcontext { unsigned long _unused[4]; int signal; unsigned long handler; diff --git a/arch/powerpc/bits/socket.h b/arch/powerpc/bits/socket.h index 18087919..2fee8777 100644 --- a/arch/powerpc/bits/socket.h +++ b/arch/powerpc/bits/socket.h @@ -1,5 +1,4 @@ -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -9,8 +8,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { socklen_t cmsg_len; int cmsg_level; int cmsg_type; diff --git a/arch/powerpc/bits/stat.h b/arch/powerpc/bits/stat.h index bd524a1a..dcb896fd 100644 --- a/arch/powerpc/bits/stat.h +++ b/arch/powerpc/bits/stat.h @@ -1,8 +1,7 @@ /* copied from kernel definition, but with padding replaced * by the corresponding correctly-sized userspace types. */ -struct stat -{ +struct stat { dev_t st_dev; ino_t st_ino; mode_t st_mode; diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h index 7f67baf4..0b09630c 100644 --- a/arch/powerpc/bits/termios.h +++ b/arch/powerpc/bits/termios.h @@ -1,7 +1,6 @@ #undef NCCS #define NCCS 19 -struct termios -{ +struct termios { tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; diff --git a/arch/powerpc64/bits/ipc.h b/arch/powerpc64/bits/ipc.h index e1bfe2f5..3f2ede07 100644 --- a/arch/powerpc64/bits/ipc.h +++ b/arch/powerpc64/bits/ipc.h @@ -1,5 +1,4 @@ -struct ipc_perm -{ +struct ipc_perm { key_t __ipc_perm_key; uid_t uid; gid_t gid; diff --git a/arch/powerpc64/bits/msg.h b/arch/powerpc64/bits/msg.h index badcf168..2e23ca27 100644 --- a/arch/powerpc64/bits/msg.h +++ b/arch/powerpc64/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; time_t msg_stime; time_t msg_rtime; diff --git a/arch/powerpc64/bits/shm.h b/arch/powerpc64/bits/shm.h index 91268516..8108c3a8 100644 --- a/arch/powerpc64/bits/shm.h +++ b/arch/powerpc64/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; time_t shm_atime; time_t shm_dtime; diff --git a/arch/powerpc64/bits/socket.h b/arch/powerpc64/bits/socket.h index ec3590c6..2f748ae8 100644 --- a/arch/powerpc64/bits/socket.h +++ b/arch/powerpc64/bits/socket.h @@ -1,7 +1,6 @@ #include -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -21,8 +20,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { #if __BYTE_ORDER == __BIG_ENDIAN int __pad1; socklen_t cmsg_len; diff --git a/arch/powerpc64/bits/stat.h b/arch/powerpc64/bits/stat.h index 8172cff7..320b49bb 100644 --- a/arch/powerpc64/bits/stat.h +++ b/arch/powerpc64/bits/stat.h @@ -1,5 +1,4 @@ -struct stat -{ +struct stat { dev_t st_dev; ino_t st_ino; nlink_t st_nlink; diff --git a/arch/powerpc64/bits/termios.h b/arch/powerpc64/bits/termios.h index 7f67baf4..0b09630c 100644 --- a/arch/powerpc64/bits/termios.h +++ b/arch/powerpc64/bits/termios.h @@ -1,7 +1,6 @@ #undef NCCS #define NCCS 19 -struct termios -{ +struct termios { tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; diff --git a/arch/sh/bits/shm.h b/arch/sh/bits/shm.h index a210fd4a..6cdac131 100644 --- a/arch/sh/bits/shm.h +++ b/arch/sh/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 16384 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; time_t shm_atime; diff --git a/arch/sh/bits/stat.h b/arch/sh/bits/stat.h index bb9314a5..22b19bbf 100644 --- a/arch/sh/bits/stat.h +++ b/arch/sh/bits/stat.h @@ -1,8 +1,7 @@ /* copied from kernel definition, but with padding replaced * by the corresponding correctly-sized userspace types. */ -struct stat -{ +struct stat { dev_t st_dev; int __st_dev_padding; long __st_ino_truncated; diff --git a/arch/x32/bits/ipc.h b/arch/x32/bits/ipc.h index 6e604cef..55d2e41a 100644 --- a/arch/x32/bits/ipc.h +++ b/arch/x32/bits/ipc.h @@ -1,5 +1,4 @@ -struct ipc_perm -{ +struct ipc_perm { key_t __ipc_perm_key; uid_t uid; gid_t gid; diff --git a/arch/x32/bits/msg.h b/arch/x32/bits/msg.h index c3b4eae0..63ae9877 100644 --- a/arch/x32/bits/msg.h +++ b/arch/x32/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; time_t msg_stime; time_t msg_rtime; diff --git a/arch/x32/bits/shm.h b/arch/x32/bits/shm.h index 8fa9e73d..fa88c1e9 100644 --- a/arch/x32/bits/shm.h +++ b/arch/x32/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; time_t shm_atime; diff --git a/arch/x32/bits/socket.h b/arch/x32/bits/socket.h index a90c4cae..a4c89f3d 100644 --- a/arch/x32/bits/socket.h +++ b/arch/x32/bits/socket.h @@ -1,5 +1,4 @@ -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -9,8 +8,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { socklen_t cmsg_len; int __pad1; int cmsg_level; diff --git a/arch/x32/bits/user.h b/arch/x32/bits/user.h index 1bd2d709..a6edcd1a 100644 --- a/arch/x32/bits/user.h +++ b/arch/x32/bits/user.h @@ -9,8 +9,7 @@ typedef struct user_fpregs_struct uint32_t st_space[32], xmm_space[64], padding[24]; } elf_fpregset_t; -struct user_regs_struct -{ +struct user_regs_struct { unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8; unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip; unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs; @@ -18,8 +17,7 @@ struct user_regs_struct #define ELF_NGREG 27 typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG]; -struct user -{ +struct user { struct user_regs_struct regs; int u_fpvalid; struct user_fpregs_struct i387; diff --git a/arch/x86_64/bits/ipc.h b/arch/x86_64/bits/ipc.h index ac5d0979..3d894e30 100644 --- a/arch/x86_64/bits/ipc.h +++ b/arch/x86_64/bits/ipc.h @@ -1,5 +1,4 @@ -struct ipc_perm -{ +struct ipc_perm { key_t __ipc_perm_key; uid_t uid; gid_t gid; diff --git a/arch/x86_64/bits/msg.h b/arch/x86_64/bits/msg.h index badcf168..2e23ca27 100644 --- a/arch/x86_64/bits/msg.h +++ b/arch/x86_64/bits/msg.h @@ -1,5 +1,4 @@ -struct msqid_ds -{ +struct msqid_ds { struct ipc_perm msg_perm; time_t msg_stime; time_t msg_rtime; diff --git a/arch/x86_64/bits/shm.h b/arch/x86_64/bits/shm.h index f4b87126..6652d659 100644 --- a/arch/x86_64/bits/shm.h +++ b/arch/x86_64/bits/shm.h @@ -1,7 +1,6 @@ #define SHMLBA 4096 -struct shmid_ds -{ +struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; time_t shm_atime; diff --git a/arch/x86_64/bits/socket.h b/arch/x86_64/bits/socket.h index a90c4cae..a4c89f3d 100644 --- a/arch/x86_64/bits/socket.h +++ b/arch/x86_64/bits/socket.h @@ -1,5 +1,4 @@ -struct msghdr -{ +struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; @@ -9,8 +8,7 @@ struct msghdr int msg_flags; }; -struct cmsghdr -{ +struct cmsghdr { socklen_t cmsg_len; int __pad1; int cmsg_level; diff --git a/arch/x86_64/bits/user.h b/arch/x86_64/bits/user.h index 1bd2d709..a6edcd1a 100644 --- a/arch/x86_64/bits/user.h +++ b/arch/x86_64/bits/user.h @@ -9,8 +9,7 @@ typedef struct user_fpregs_struct uint32_t st_space[32], xmm_space[64], padding[24]; } elf_fpregset_t; -struct user_regs_struct -{ +struct user_regs_struct { unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8; unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip; unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs; @@ -18,8 +17,7 @@ struct user_regs_struct #define ELF_NGREG 27 typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG]; -struct user -{ +struct user { struct user_regs_struct regs; int u_fpvalid; struct user_fpregs_struct i387; diff --git a/include/dirent.h b/include/dirent.h index 5aa8510b..006a360e 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -17,8 +17,7 @@ extern "C" { typedef struct __dirstream DIR; -struct dirent -{ +struct dirent { ino_t d_ino; off_t d_off; unsigned short d_reclen; diff --git a/include/fcntl.h b/include/fcntl.h index ebd5c304..e683e4dc 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -21,8 +21,7 @@ extern "C" { #include -struct flock -{ +struct flock { short l_type; short l_whence; off_t l_start; diff --git a/include/ftw.h b/include/ftw.h index c8eadbc9..b15c062a 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -21,8 +21,7 @@ extern "C" { #define FTW_CHDIR 4 #define FTW_DEPTH 8 -struct FTW -{ +struct FTW { int base; int level; }; diff --git a/include/getopt.h b/include/getopt.h index c1d0df92..35cbd358 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -9,8 +9,7 @@ int getopt(int, char * const [], const char *); extern char *optarg; extern int optind, opterr, optopt, optreset; -struct option -{ +struct option { const char *name; int has_arg; int *flag; diff --git a/include/grp.h b/include/grp.h index b331d326..358181bf 100644 --- a/include/grp.h +++ b/include/grp.h @@ -16,8 +16,7 @@ extern "C" { #include -struct group -{ +struct group { char *gr_name; char *gr_passwd; gid_t gr_gid; diff --git a/include/mntent.h b/include/mntent.h index d03c414a..3492a1d6 100644 --- a/include/mntent.h +++ b/include/mntent.h @@ -20,8 +20,7 @@ extern "C" { #define MNTOPT_NOSUID "nosuid" #define MNTOPT_NOAUTO "noauto" -struct mntent -{ +struct mntent { char *mnt_fsname; char *mnt_dir; char *mnt_type; diff --git a/include/net/if.h b/include/net/if.h index 3f4fc092..1a4059d6 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -9,8 +9,7 @@ extern "C" { #define IF_NAMESIZE 16 -struct if_nameindex -{ +struct if_nameindex { unsigned int if_index; char *if_name; }; diff --git a/include/netdb.h b/include/netdb.h index 47940684..967ca211 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -13,8 +13,7 @@ extern "C" { #include #endif -struct addrinfo -{ +struct addrinfo { int ai_flags; int ai_family; int ai_socktype; @@ -62,16 +61,14 @@ const char *gai_strerror(int); /* Legacy functions follow (marked OBsolete in SUS) */ -struct netent -{ +struct netent { char *n_name; char **n_aliases; int n_addrtype; uint32_t n_net; }; -struct hostent -{ +struct hostent { char *h_name; char **h_aliases; int h_addrtype; @@ -80,16 +77,14 @@ struct hostent }; #define h_addr h_addr_list[0] -struct servent -{ +struct servent { char *s_name; char **s_aliases; int s_port; char *s_proto; }; -struct protoent -{ +struct protoent { char *p_name; char **p_aliases; int p_proto; diff --git a/include/netinet/in.h b/include/netinet/in.h index 04cc81cd..f6bb77b1 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -13,16 +13,14 @@ typedef uint16_t in_port_t; typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; -struct sockaddr_in -{ +struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; uint8_t sin_zero[8]; }; -struct in6_addr -{ +struct in6_addr { union { uint8_t __s6_addr[16]; uint16_t __s6_addr16[8]; @@ -33,8 +31,7 @@ struct in6_addr #define s6_addr16 __in6_union.__s6_addr16 #define s6_addr32 __in6_union.__s6_addr32 -struct sockaddr_in6 -{ +struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; @@ -42,8 +39,7 @@ struct sockaddr_in6 uint32_t sin6_scope_id; }; -struct ipv6_mreq -{ +struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned ipv6mr_interface; }; @@ -228,8 +224,7 @@ uint16_t ntohs(uint16_t); #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 -struct ip_opts -{ +struct ip_opts { struct in_addr ip_dst; char ip_opts[40]; }; @@ -247,14 +242,12 @@ struct ip_opts #define MCAST_EXCLUDE 0 #define MCAST_INCLUDE 1 -struct ip_mreq -{ +struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; -struct ip_mreqn -{ +struct ip_mreqn { struct in_addr imr_multiaddr; struct in_addr imr_address; int imr_ifindex; @@ -299,21 +292,18 @@ struct group_filter { (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \ + (numsrc) * sizeof(struct sockaddr_storage)) -struct in_pktinfo -{ +struct in_pktinfo { int ipi_ifindex; struct in_addr ipi_spec_dst; struct in_addr ipi_addr; }; -struct in6_pktinfo -{ +struct in6_pktinfo { struct in6_addr ipi6_addr; unsigned ipi6_ifindex; }; -struct ip6_mtuinfo -{ +struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; uint32_t ip6m_mtu; }; diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index d6f41cab..9ea64c45 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -145,8 +145,7 @@ struct tcphdr { #define TCP_CA_Recovery 3 #define TCP_CA_Loss 4 -struct tcp_info -{ +struct tcp_info { uint8_t tcpi_state; uint8_t tcpi_ca_state; uint8_t tcpi_retransmits; @@ -192,8 +191,7 @@ struct tcp_info #define TCP_MD5SIG_MAXKEYLEN 80 -struct tcp_md5sig -{ +struct tcp_md5sig { struct sockaddr_storage tcpm_addr; uint16_t __tcpm_pad1; uint16_t tcpm_keylen; diff --git a/include/poll.h b/include/poll.h index 7af73722..daccc760 100644 --- a/include/poll.h +++ b/include/poll.h @@ -28,8 +28,7 @@ extern "C" { typedef unsigned long nfds_t; -struct pollfd -{ +struct pollfd { int fd; short events; short revents; diff --git a/include/pwd.h b/include/pwd.h index 55d9d42d..07a5871d 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -17,8 +17,7 @@ extern "C" { #include -struct passwd -{ +struct passwd { char *pw_name; char *pw_passwd; uid_t pw_uid; diff --git a/include/sys/acct.h b/include/sys/acct.h index ee576c4a..9b0ba36f 100644 --- a/include/sys/acct.h +++ b/include/sys/acct.h @@ -14,8 +14,7 @@ extern "C" { typedef uint16_t comp_t; -struct acct -{ +struct acct { char ac_flag; uint16_t ac_uid; uint16_t ac_gid; @@ -36,8 +35,7 @@ struct acct }; -struct acct_v3 -{ +struct acct_v3 { char ac_flag; char ac_version; uint16_t ac_tty; diff --git a/include/sys/procfs.h b/include/sys/procfs.h index 2a928751..e23bf1ad 100644 --- a/include/sys/procfs.h +++ b/include/sys/procfs.h @@ -33,8 +33,7 @@ struct elf_prstatus { #define ELF_PRARGSZ 80 -struct elf_prpsinfo -{ +struct elf_prpsinfo { char pr_state; char pr_sname; char pr_zomb; diff --git a/include/sys/quota.h b/include/sys/quota.h index a06f335a..3ed73785 100644 --- a/include/sys/quota.h +++ b/include/sys/quota.h @@ -57,8 +57,7 @@ extern "C" { #define QIF_TIMES (QIF_BTIME | QIF_ITIME) #define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES) -struct dqblk -{ +struct dqblk { uint64_t dqb_bhardlimit; uint64_t dqb_bsoftlimit; uint64_t dqb_curspace; @@ -87,8 +86,7 @@ struct dqblk #define IIF_FLAGS 4 #define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS) -struct dqinfo -{ +struct dqinfo { uint64_t dqi_bgrace; uint64_t dqi_igrace; uint32_t dqi_flags; diff --git a/include/sys/resource.h b/include/sys/resource.h index 6f22a2e7..70d793d5 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -19,14 +19,12 @@ extern "C" { typedef unsigned long long rlim_t; -struct rlimit -{ +struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; -struct rusage -{ +struct rusage { struct timeval ru_utime; struct timeval ru_stime; /* linux extentions, but useful */ diff --git a/include/sys/socket.h b/include/sys/socket.h index 55e53d2a..59ab1e2f 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -20,15 +20,13 @@ extern "C" { #include #ifdef _GNU_SOURCE -struct ucred -{ +struct ucred { pid_t pid; uid_t uid; gid_t gid; }; -struct mmsghdr -{ +struct mmsghdr { struct msghdr msg_hdr; unsigned int msg_len; }; @@ -39,8 +37,7 @@ int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int); int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); #endif -struct linger -{ +struct linger { int l_onoff; int l_linger; }; @@ -297,14 +294,12 @@ struct linger #define SCM_RIGHTS 0x01 #define SCM_CREDENTIALS 0x02 -struct sockaddr -{ +struct sockaddr { sa_family_t sa_family; char sa_data[14]; }; -struct sockaddr_storage -{ +struct sockaddr_storage { sa_family_t ss_family; char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)]; unsigned long __ss_align; diff --git a/include/sys/time.h b/include/sys/time.h index bfe1414e..e4b379ae 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -17,8 +17,7 @@ int gettimeofday (struct timeval *__restrict, void *__restrict); #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 -struct itimerval -{ +struct itimerval { struct timeval it_interval; struct timeval it_value; }; diff --git a/include/sys/times.h b/include/sys/times.h index cc55e573..80a50522 100644 --- a/include/sys/times.h +++ b/include/sys/times.h @@ -8,8 +8,7 @@ extern "C" { #define __NEED_clock_t #include -struct tms -{ +struct tms { clock_t tms_utime; clock_t tms_stime; clock_t tms_cutime; diff --git a/include/sys/un.h b/include/sys/un.h index 7494f1a3..1a3193ad 100644 --- a/include/sys/un.h +++ b/include/sys/un.h @@ -14,8 +14,7 @@ extern "C" { #include -struct sockaddr_un -{ +struct sockaddr_un { sa_family_t sun_family; char sun_path[108]; }; diff --git a/include/sys/utsname.h b/include/sys/utsname.h index 6b9ea970..2c80fb5a 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -7,8 +7,7 @@ extern "C" { #include -struct utsname -{ +struct utsname { char sysname[65]; char nodename[65]; char release[65]; diff --git a/include/time.h b/include/time.h index 16ec08ae..a408679c 100644 --- a/include/time.h +++ b/include/time.h @@ -35,8 +35,7 @@ extern "C" { #define __tm_zone tm_zone #endif -struct tm -{ +struct tm { int tm_sec; int tm_min; int tm_hour; @@ -78,8 +77,7 @@ char *ctime_r (const time_t *, char *); void tzset (void); -struct itimerspec -{ +struct itimerspec { struct timespec it_interval; struct timespec it_value; }; diff --git a/include/utime.h b/include/utime.h index ec82e0f3..dd5ff927 100644 --- a/include/utime.h +++ b/include/utime.h @@ -9,8 +9,7 @@ extern "C" { #include -struct utimbuf -{ +struct utimbuf { time_t actime; time_t modtime; }; diff --git a/include/utmpx.h b/include/utmpx.h index 44b501d3..9e5cc955 100644 --- a/include/utmpx.h +++ b/include/utmpx.h @@ -14,8 +14,7 @@ extern "C" { #include -struct utmpx -{ +struct utmpx { short ut_type; pid_t ut_pid; char ut_line[32]; From 308e4bc61883c82aeda70e20367b656cd35899f1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:14:13 +0200 Subject: [PATCH 148/412] add EM_OPENRISC again to elf.h it was changed to EM_OR1K in 200d15479c0bc48471ee7b8e538ce33af990f82e as that was meant to be the official name, but glibc and the latest gabi spec still uses the EM_OPENRISC name: http://www.sco.com/developers/gabi/latest/ch4.eheader.html binutils defines both macros so we should do the same for backward compatibility. --- include/elf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/elf.h b/include/elf.h index 8b3cd3ed..745d8998 100644 --- a/include/elf.h +++ b/include/elf.h @@ -210,6 +210,7 @@ typedef struct { #define EM_MN10200 90 #define EM_PJ 91 #define EM_OR1K 92 +#define EM_OPENRISC 92 #define EM_ARC_A5 93 #define EM_XTENSA 94 #define EM_AARCH64 183 From 35b58194dc065dd7daec815ba74372a71f9654a4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:14:53 +0200 Subject: [PATCH 149/412] add new powerpc64 relocations to elf.h following the corresponding binutils and glibc changes https://sourceware.org/ml/binutils/2013-10/msg00372.html --- include/elf.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/elf.h b/include/elf.h index 745d8998..55d8cb28 100644 --- a/include/elf.h +++ b/include/elf.h @@ -2014,6 +2014,15 @@ typedef Elf32_Addr Elf32_Conflict; #define R_PPC64_DTPREL16_HIGHERA 104 #define R_PPC64_DTPREL16_HIGHEST 105 #define R_PPC64_DTPREL16_HIGHESTA 106 +#define R_PPC64_TLSGD 107 +#define R_PPC64_TLSLD 108 +#define R_PPC64_TOCSAVE 109 +#define R_PPC64_ADDR16_HIGH 110 +#define R_PPC64_ADDR16_HIGHA 111 +#define R_PPC64_TPREL16_HIGH 112 +#define R_PPC64_TPREL16_HIGHA 113 +#define R_PPC64_DTPREL16_HIGH 114 +#define R_PPC64_DTPREL16_HIGHA 115 #define R_PPC64_JMP_IREL 247 From b921e0fd1fc9840fdfc6dde27dc7453047437f0f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:15:16 +0200 Subject: [PATCH 150/412] update elf.h with powerpc64 elfv2 abi related macros see https://sourceware.org/ml/libc-alpha/2013-11/msg00315.html https://sourceware.org/ml/libc-alpha/2013-11/msg00314.html --- include/elf.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/elf.h b/include/elf.h index 55d8cb28..1bfe0168 100644 --- a/include/elf.h +++ b/include/elf.h @@ -2032,14 +2032,20 @@ typedef Elf32_Addr Elf32_Conflict; #define R_PPC64_REL16_HI 251 #define R_PPC64_REL16_HA 252 +#define EF_PPC64_ABI 3 #define DT_PPC64_GLINK (DT_LOPROC + 0) #define DT_PPC64_OPD (DT_LOPROC + 1) #define DT_PPC64_OPDSZ (DT_LOPROC + 2) -#define DT_PPC64_NUM 3 - +#define DT_PPC64_OPT (DT_LOPROC + 3) +#define DT_PPC64_NUM 4 +#define PPC64_OPT_TLS 1 +#define PPC64_OPT_MULTI_TOC 2 +#define STO_PPC64_LOCAL_BIT 5 +#define STO_PPC64_LOCAL_MASK 0xe0 +#define PPC64_LOCAL_ENTRY_OFFSET(x) (1 << (((x)&0xe0)>>5) & 0xfc) #define EF_ARM_RELEXEC 0x01 From 49eb322425bb990ec4cf57578a730fc0d2b8afee Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 3 Jul 2016 22:13:44 +0200 Subject: [PATCH 151/412] update elf.h with new aarch64 relocs add ilp32 related relocs and alternative names for a few macros following https://sourceware.org/ml/libc-alpha/2014-11/msg00455.html --- include/elf.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/include/elf.h index 1bfe0168..795b71df 100644 --- a/include/elf.h +++ b/include/elf.h @@ -2105,8 +2105,17 @@ typedef Elf32_Addr Elf32_Conflict; #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) - #define R_AARCH64_NONE 0 +#define R_AARCH64_P32_ABS32 1 +#define R_AARCH64_P32_COPY 180 +#define R_AARCH64_P32_GLOB_DAT 181 +#define R_AARCH64_P32_JUMP_SLOT 182 +#define R_AARCH64_P32_RELATIVE 183 +#define R_AARCH64_P32_TLS_DTPMOD 184 +#define R_AARCH64_P32_TLS_DTPREL 185 +#define R_AARCH64_P32_TLS_TPREL 186 +#define R_AARCH64_P32_TLSDESC 187 +#define R_AARCH64_P32_IRELATIVE 188 #define R_AARCH64_ABS64 257 #define R_AARCH64_ABS32 258 #define R_AARCH64_ABS16 259 @@ -2224,8 +2233,11 @@ typedef Elf32_Addr Elf32_Conflict; #define R_AARCH64_GLOB_DAT 1025 #define R_AARCH64_JUMP_SLOT 1026 #define R_AARCH64_RELATIVE 1027 +#define R_AARCH64_TLS_DTPMOD 1028 #define R_AARCH64_TLS_DTPMOD64 1028 +#define R_AARCH64_TLS_DTPREL 1029 #define R_AARCH64_TLS_DTPREL64 1029 +#define R_AARCH64_TLS_TPREL 1030 #define R_AARCH64_TLS_TPREL64 1030 #define R_AARCH64_TLSDESC 1031 From abbdf0f51d975a1120483a7bdaf92d65663a4f37 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:17:11 +0200 Subject: [PATCH 152/412] update elf.h with mips abi flags support following https://sourceware.org/ml/libc-alpha/2014-05/msg00332.html --- include/elf.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/include/elf.h b/include/elf.h index 795b71df..3a68b527 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1154,6 +1154,7 @@ typedef struct { #define EF_MIPS_64BIT_WHIRL 16 #define EF_MIPS_ABI2 32 #define EF_MIPS_ABI_ON32 64 +#define EF_MIPS_FP64 512 #define EF_MIPS_NAN2008 1024 #define EF_MIPS_ARCH 0xf0000000 @@ -1398,6 +1399,7 @@ typedef struct { #define PT_MIPS_REGINFO 0x70000000 #define PT_MIPS_RTPROC 0x70000001 #define PT_MIPS_OPTIONS 0x70000002 +#define PT_MIPS_ABIFLAGS 0x70000003 @@ -1517,7 +1519,74 @@ typedef struct typedef Elf32_Addr Elf32_Conflict; +typedef struct +{ + Elf32_Half version; + unsigned char isa_level; + unsigned char isa_rev; + unsigned char gpr_size; + unsigned char cpr1_size; + unsigned char cpr2_size; + unsigned char fp_abi; + Elf32_Word isa_ext; + Elf32_Word ases; + Elf32_Word flags1; + Elf32_Word flags2; +} Elf_MIPS_ABIFlags_v0; +#define MIPS_AFL_REG_NONE 0x00 +#define MIPS_AFL_REG_32 0x01 +#define MIPS_AFL_REG_64 0x02 +#define MIPS_AFL_REG_128 0x03 + +#define MIPS_AFL_ASE_DSP 0x00000001 +#define MIPS_AFL_ASE_DSPR2 0x00000002 +#define MIPS_AFL_ASE_EVA 0x00000004 +#define MIPS_AFL_ASE_MCU 0x00000008 +#define MIPS_AFL_ASE_MDMX 0x00000010 +#define MIPS_AFL_ASE_MIPS3D 0x00000020 +#define MIPS_AFL_ASE_MT 0x00000040 +#define MIPS_AFL_ASE_SMARTMIPS 0x00000080 +#define MIPS_AFL_ASE_VIRT 0x00000100 +#define MIPS_AFL_ASE_MSA 0x00000200 +#define MIPS_AFL_ASE_MIPS16 0x00000400 +#define MIPS_AFL_ASE_MICROMIPS 0x00000800 +#define MIPS_AFL_ASE_XPA 0x00001000 +#define MIPS_AFL_ASE_MASK 0x00001fff + +#define MIPS_AFL_EXT_XLR 1 +#define MIPS_AFL_EXT_OCTEON2 2 +#define MIPS_AFL_EXT_OCTEONP 3 +#define MIPS_AFL_EXT_LOONGSON_3A 4 +#define MIPS_AFL_EXT_OCTEON 5 +#define MIPS_AFL_EXT_5900 6 +#define MIPS_AFL_EXT_4650 7 +#define MIPS_AFL_EXT_4010 8 +#define MIPS_AFL_EXT_4100 9 +#define MIPS_AFL_EXT_3900 10 +#define MIPS_AFL_EXT_10000 11 +#define MIPS_AFL_EXT_SB1 12 +#define MIPS_AFL_EXT_4111 13 +#define MIPS_AFL_EXT_4120 14 +#define MIPS_AFL_EXT_5400 15 +#define MIPS_AFL_EXT_5500 16 +#define MIPS_AFL_EXT_LOONGSON_2E 17 +#define MIPS_AFL_EXT_LOONGSON_2F 18 + +#define MIPS_AFL_FLAGS1_ODDSPREG 1 + +enum +{ + Val_GNU_MIPS_ABI_FP_ANY = 0, + Val_GNU_MIPS_ABI_FP_DOUBLE = 1, + Val_GNU_MIPS_ABI_FP_SINGLE = 2, + Val_GNU_MIPS_ABI_FP_SOFT = 3, + Val_GNU_MIPS_ABI_FP_OLD_64 = 4, + Val_GNU_MIPS_ABI_FP_XX = 5, + Val_GNU_MIPS_ABI_FP_64 = 6, + Val_GNU_MIPS_ABI_FP_64A = 7, + Val_GNU_MIPS_ABI_FP_MAX = 7 +}; From 347d0617d11c0ae4c5e501d4232d2b4a5cfc207a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:17:31 +0200 Subject: [PATCH 153/412] add nios2 definitions to elf.h --- include/elf.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/include/elf.h b/include/elf.h index 3a68b527..94f2cd9a 100644 --- a/include/elf.h +++ b/include/elf.h @@ -213,6 +213,7 @@ typedef struct { #define EM_OPENRISC 92 #define EM_ARC_A5 93 #define EM_XTENSA 94 +#define EM_ALTERA_NIOS2 113 #define EM_AARCH64 183 #define EM_TILEPRO 188 #define EM_MICROBLAZE 189 @@ -2880,6 +2881,55 @@ enum #define R_MICROBLAZE_TLSGOTTPREL32 28 #define R_MICROBLAZE_TLSTPREL32 29 +#define DT_NIOS2_GP 0x70000002 + +#define R_NIOS2_NONE 0 +#define R_NIOS2_S16 1 +#define R_NIOS2_U16 2 +#define R_NIOS2_PCREL16 3 +#define R_NIOS2_CALL26 4 +#define R_NIOS2_IMM5 5 +#define R_NIOS2_CACHE_OPX 6 +#define R_NIOS2_IMM6 7 +#define R_NIOS2_IMM8 8 +#define R_NIOS2_HI16 9 +#define R_NIOS2_LO16 10 +#define R_NIOS2_HIADJ16 11 +#define R_NIOS2_BFD_RELOC_32 12 +#define R_NIOS2_BFD_RELOC_16 13 +#define R_NIOS2_BFD_RELOC_8 14 +#define R_NIOS2_GPREL 15 +#define R_NIOS2_GNU_VTINHERIT 16 +#define R_NIOS2_GNU_VTENTRY 17 +#define R_NIOS2_UJMP 18 +#define R_NIOS2_CJMP 19 +#define R_NIOS2_CALLR 20 +#define R_NIOS2_ALIGN 21 +#define R_NIOS2_GOT16 22 +#define R_NIOS2_CALL16 23 +#define R_NIOS2_GOTOFF_LO 24 +#define R_NIOS2_GOTOFF_HA 25 +#define R_NIOS2_PCREL_LO 26 +#define R_NIOS2_PCREL_HA 27 +#define R_NIOS2_TLS_GD16 28 +#define R_NIOS2_TLS_LDM16 29 +#define R_NIOS2_TLS_LDO16 30 +#define R_NIOS2_TLS_IE16 31 +#define R_NIOS2_TLS_LE16 32 +#define R_NIOS2_TLS_DTPMOD 33 +#define R_NIOS2_TLS_DTPREL 34 +#define R_NIOS2_TLS_TPREL 35 +#define R_NIOS2_COPY 36 +#define R_NIOS2_GLOB_DAT 37 +#define R_NIOS2_JUMP_SLOT 38 +#define R_NIOS2_RELATIVE 39 +#define R_NIOS2_GOTOFF 40 +#define R_NIOS2_CALL26_NOAT 41 +#define R_NIOS2_GOT_LO 42 +#define R_NIOS2_GOT_HA 43 +#define R_NIOS2_CALL_LO 44 +#define R_NIOS2_CALL_HA 45 + #define R_OR1K_NONE 0 #define R_OR1K_32 1 #define R_OR1K_16 2 From 29a96c1980db9c6eee70e8935a9a4cb3a0ac954d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:17:54 +0200 Subject: [PATCH 154/412] add powerpc tls optimization related definitions to elf.h see https://sourceware.org/ml/libc-alpha/2015-03/msg00580.html --- include/elf.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/elf.h b/include/elf.h index 94f2cd9a..eefcbc11 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1928,7 +1928,8 @@ enum #define R_PPC_GOT_DTPREL16_LO 92 #define R_PPC_GOT_DTPREL16_HI 93 #define R_PPC_GOT_DTPREL16_HA 94 - +#define R_PPC_TLSGD 95 +#define R_PPC_TLSLD 96 #define R_PPC_EMB_NADDR32 101 @@ -1971,7 +1972,10 @@ enum #define DT_PPC_GOT (DT_LOPROC + 0) -#define DT_PPC_NUM 1 +#define DT_PPC_OPT (DT_LOPROC + 1) +#define DT_PPC_NUM 2 + +#define PPC_OPT_TLS 1 #define R_PPC64_NONE R_PPC_NONE From af17dc40dd91fbfc5a0ca487c52f6c419567f967 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:19:08 +0200 Subject: [PATCH 155/412] add SHF_COMPRESSED section flag to elf.h following http://www.sco.com/developers/gabi/latest/ch4.sheader.html --- include/elf.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/elf.h b/include/elf.h index eefcbc11..223a3431 100644 --- a/include/elf.h +++ b/include/elf.h @@ -318,11 +318,34 @@ typedef struct { #define SHF_GROUP (1 << 9) #define SHF_TLS (1 << 10) +#define SHF_COMPRESSED (1 << 11) #define SHF_MASKOS 0x0ff00000 #define SHF_MASKPROC 0xf0000000 #define SHF_ORDERED (1 << 30) #define SHF_EXCLUDE (1U << 31) +typedef struct +{ + Elf32_Word ch_type; + Elf32_Word ch_size; + Elf32_Word ch_addralign; +} Elf32_Chdr; + +typedef struct +{ + Elf64_Word ch_type; + Elf64_Word ch_reserved; + Elf64_Xword ch_size; + Elf64_Xword ch_addralign; +} Elf64_Chdr; + +#define ELFCOMPRESS_ZLIB 1 +#define ELFCOMPRESS_LOOS 0x60000000 +#define ELFCOMPRESS_HIOS 0x6fffffff +#define ELFCOMPRESS_LOPROC 0x70000000 +#define ELFCOMPRESS_HIPROC 0x7fffffff + + #define GRP_COMDAT 0x1 typedef struct { From 7c3b67234c859f98a6365d215c5362c73eed5765 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:19:27 +0200 Subject: [PATCH 156/412] add DT_MIPS_RLD_MAP_REL to elf.h marks different RLD_MAP for debugging PIE binaries. --- include/elf.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/include/elf.h index 223a3431..2d57dfe6 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1487,7 +1487,8 @@ typedef struct { #define DT_MIPS_PLTGOT 0x70000032 #define DT_MIPS_RWPLT 0x70000034 -#define DT_MIPS_NUM 0x35 +#define DT_MIPS_RLD_MAP_REL 0x70000035 +#define DT_MIPS_NUM 0x36 From c3be411df7387a8c516b169baf91cf1cccef99b3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:19:45 +0200 Subject: [PATCH 157/412] add missing x86 relocs to elf.h see https://sourceware.org/ml/libc-alpha/2016-01/msg00822.html --- include/elf.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/elf.h b/include/elf.h index 2d57dfe6..e3edbccc 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1045,7 +1045,8 @@ typedef struct { #define R_386_TLS_DESC_CALL 40 #define R_386_TLS_DESC 41 #define R_386_IRELATIVE 42 -#define R_386_NUM 43 +#define R_386_GOT32X 43 +#define R_386_NUM 44 @@ -2791,7 +2792,9 @@ enum #define R_X86_64_TLSDESC 36 #define R_X86_64_IRELATIVE 37 #define R_X86_64_RELATIVE64 38 -#define R_X86_64_NUM 39 +#define R_X86_64_GOTPCRELX 41 +#define R_X86_64_REX_GOTPCRELX 42 +#define R_X86_64_NUM 43 From 84fd4e4ffdefeec296a56b1f307413a5171eb9e1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:20:36 +0200 Subject: [PATCH 158/412] add NT_ARM_SYSTEM_CALL to elf.h new regset in linux v3.18 for ptrace. --- include/elf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/elf.h b/include/elf.h index e3edbccc..a24ea9b7 100644 --- a/include/elf.h +++ b/include/elf.h @@ -566,6 +566,7 @@ typedef struct { #define NT_ARM_TLS 0x401 #define NT_ARM_HW_BREAK 0x402 #define NT_ARM_HW_WATCH 0x403 +#define NT_ARM_SYSTEM_CALL 0x404 #define NT_METAG_CBUF 0x500 #define NT_METAG_RPIPE 0x501 #define NT_METAG_TLS 0x502 From 3c3b09980d792ea8393f0a3865735b2ff5ecc765 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 20 Apr 2016 13:20:50 +0200 Subject: [PATCH 159/412] add EF_SH_ sh specific macros to elf.h last time elf.h was thoroughly updated sh was not yet supported so these processor specific e_flags were missing. --- include/elf.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/include/elf.h index a24ea9b7..8ecf965a 100644 --- a/include/elf.h +++ b/include/elf.h @@ -2587,7 +2587,28 @@ enum #define R_IA64_LTOFF_DTPREL22 0xba - +#define EF_SH_MACH_MASK 0x1f +#define EF_SH_UNKNOWN 0x0 +#define EF_SH1 0x1 +#define EF_SH2 0x2 +#define EF_SH3 0x3 +#define EF_SH_DSP 0x4 +#define EF_SH3_DSP 0x5 +#define EF_SH4AL_DSP 0x6 +#define EF_SH3E 0x8 +#define EF_SH4 0x9 +#define EF_SH2E 0xb +#define EF_SH4A 0xc +#define EF_SH2A 0xd +#define EF_SH4_NOFPU 0x10 +#define EF_SH4A_NOFPU 0x11 +#define EF_SH4_NOMMU_NOFPU 0x12 +#define EF_SH2A_NOFPU 0x13 +#define EF_SH3_NOMMU 0x14 +#define EF_SH2A_SH4_NOFPU 0x15 +#define EF_SH2A_SH3_NOFPU 0x16 +#define EF_SH2A_SH4 0x17 +#define EF_SH2A_SH3E 0x18 #define R_SH_NONE 0 #define R_SH_DIR32 1 From ee3f0c551669ca1c61abac0888f93a27b0b17856 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 16:19:28 -0400 Subject: [PATCH 160/412] make brace placement in public header typedef'd structs consistent commit befa5866ee30d09c0c96e88af2eabff5911342ea performed this change for struct definitions that did not also involve typedef, but omitted the latter. --- arch/aarch64/bits/signal.h | 3 +-- arch/arm/bits/signal.h | 3 +-- arch/i386/bits/user.h | 6 ++---- arch/microblaze/bits/signal.h | 3 +-- arch/mips/bits/signal.h | 3 +-- arch/powerpc64/bits/signal.h | 3 +-- arch/x32/bits/user.h | 3 +-- arch/x86_64/bits/user.h | 3 +-- include/elf.h | 18 ++++++------------ include/sys/select.h | 3 +-- include/wordexp.h | 3 +-- 11 files changed, 17 insertions(+), 34 deletions(-) diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h index ef07cc9f..00fb5f33 100644 --- a/arch/aarch64/bits/signal.h +++ b/arch/aarch64/bits/signal.h @@ -15,8 +15,7 @@ typedef struct { unsigned int fpsr; unsigned int fpcr; } fpregset_t; -typedef struct sigcontext -{ +typedef struct sigcontext { unsigned long fault_address; unsigned long regs[31]; unsigned long sp, pc, pstate; diff --git a/arch/arm/bits/signal.h b/arch/arm/bits/signal.h index 9d19eeb2..3c789856 100644 --- a/arch/arm/bits/signal.h +++ b/arch/arm/bits/signal.h @@ -8,8 +8,7 @@ #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) typedef int greg_t, gregset_t[18]; -typedef struct sigcontext -{ +typedef struct sigcontext { unsigned long trap_no, error_code, oldmask; unsigned long arm_r0, arm_r1, arm_r2, arm_r3; unsigned long arm_r4, arm_r5, arm_r6, arm_r7; diff --git a/arch/i386/bits/user.h b/arch/i386/bits/user.h index 2c556dd2..0e343930 100644 --- a/arch/i386/bits/user.h +++ b/arch/i386/bits/user.h @@ -1,13 +1,11 @@ #undef __WORDSIZE #define __WORDSIZE 32 -typedef struct user_fpregs_struct -{ +typedef struct user_fpregs_struct { long cwd, swd, twd, fip, fcs, foo, fos, st_space[20]; } elf_fpregset_t; -typedef struct user_fpxregs_struct -{ +typedef struct user_fpxregs_struct { unsigned short cwd, swd, twd, fop; long fip, fcs, foo, fos, mxcsr, reserved; long st_space[32], xmm_space[32], padding[56]; diff --git a/arch/microblaze/bits/signal.h b/arch/microblaze/bits/signal.h index 4aa231a2..490f83bf 100644 --- a/arch/microblaze/bits/signal.h +++ b/arch/microblaze/bits/signal.h @@ -8,8 +8,7 @@ #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) typedef unsigned long greg_t, gregset_t[38]; -typedef struct sigcontext -{ +typedef struct sigcontext { struct { unsigned long r0, r1, r2, r3, r4, r5, r6, r7; unsigned long r8, r9, r10, r11, r12, r13, r14, r15; diff --git a/arch/mips/bits/signal.h b/arch/mips/bits/signal.h index db6f22d5..1a84de59 100644 --- a/arch/mips/bits/signal.h +++ b/arch/mips/bits/signal.h @@ -24,8 +24,7 @@ struct sigcontext { unsigned long long sc_mdhi, sc_mdlo; unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3; }; -typedef struct -{ +typedef struct { unsigned regmask, status; unsigned long long pc, gregs[32], fpregs[32]; unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp; diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h index 45aeea0d..34693a68 100644 --- a/arch/powerpc64/bits/signal.h +++ b/arch/powerpc64/bits/signal.h @@ -23,8 +23,7 @@ typedef struct { unsigned _pad2[3]; } vrregset_t; -typedef struct sigcontext -{ +typedef struct sigcontext { unsigned long _unused[4]; int signal; int _pad0; diff --git a/arch/x32/bits/user.h b/arch/x32/bits/user.h index a6edcd1a..471bb19d 100644 --- a/arch/x32/bits/user.h +++ b/arch/x32/bits/user.h @@ -1,8 +1,7 @@ #undef __WORDSIZE #define __WORDSIZE 64 -typedef struct user_fpregs_struct -{ +typedef struct user_fpregs_struct { uint16_t cwd, swd, ftw, fop; uint64_t rip, rdp; uint32_t mxcsr, mxcr_mask; diff --git a/arch/x86_64/bits/user.h b/arch/x86_64/bits/user.h index a6edcd1a..471bb19d 100644 --- a/arch/x86_64/bits/user.h +++ b/arch/x86_64/bits/user.h @@ -1,8 +1,7 @@ #undef __WORDSIZE #define __WORDSIZE 64 -typedef struct user_fpregs_struct -{ +typedef struct user_fpregs_struct { uint16_t cwd, swd, ftw, fop; uint64_t rip, rdp; uint32_t mxcsr, mxcr_mask; diff --git a/include/elf.h b/include/elf.h index 8ecf965a..0721d63f 100644 --- a/include/elf.h +++ b/include/elf.h @@ -324,15 +324,13 @@ typedef struct { #define SHF_ORDERED (1 << 30) #define SHF_EXCLUDE (1U << 31) -typedef struct -{ +typedef struct { Elf32_Word ch_type; Elf32_Word ch_size; Elf32_Word ch_addralign; } Elf32_Chdr; -typedef struct -{ +typedef struct { Elf64_Word ch_type; Elf64_Word ch_reserved; Elf64_Xword ch_size; @@ -434,8 +432,7 @@ typedef struct { -typedef struct -{ +typedef struct { Elf32_Addr r_offset; Elf32_Word r_info; } Elf32_Rel; @@ -1513,8 +1510,7 @@ typedef struct { -typedef struct -{ +typedef struct { Elf32_Word l_name; Elf32_Word l_time_stamp; Elf32_Word l_checksum; @@ -1522,8 +1518,7 @@ typedef struct Elf32_Word l_flags; } Elf32_Lib; -typedef struct -{ +typedef struct { Elf64_Word l_name; Elf64_Word l_time_stamp; Elf64_Word l_checksum; @@ -1546,8 +1541,7 @@ typedef struct typedef Elf32_Addr Elf32_Conflict; -typedef struct -{ +typedef struct { Elf32_Half version; unsigned char isa_level; unsigned char isa_rev; diff --git a/include/sys/select.h b/include/sys/select.h index e25257d2..d34cbf10 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -19,8 +19,7 @@ extern "C" { typedef unsigned long fd_mask; -typedef struct -{ +typedef struct { unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)]; } fd_set; diff --git a/include/wordexp.h b/include/wordexp.h index d12081e8..5460002d 100644 --- a/include/wordexp.h +++ b/include/wordexp.h @@ -18,8 +18,7 @@ extern "C" { #define WRDE_SHOWERR 16 #define WRDE_UNDEF 32 -typedef struct -{ +typedef struct { size_t we_wordc; char **we_wordv; size_t we_offs; From 0c8bc102f287d3993751d80ba2dffb01e0c8bc7f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 17:42:05 -0400 Subject: [PATCH 161/412] improve abort fallback behavior when raising SIGABRT fails to terminate these changes still do not yield a fully-conforming abort, but they fix two known issues: - per POSIX, termination via SIGKILL is not "abnormal", but both ISO C and POSIX require abort to yield abnormal termination. - raising SIGKILL fails to do anything to pid 1 in some containers. now, the trapping instruction produced by a_crash() is expected to produce abnormal termination, without the risk of invoking a signal handler since SIGILL and SIGSEGV are blocked, and _Exit, which contains an infinite loop analogous to the one being removed from abort itself, is used as a last resort. this implementation still fails to produce an exit status as if the process terminated via SIGABRT in cases where SIGABRT is blocked or ignored, but fixing that is not easy; the obvious pseudo-solutions all have subtle race conditions where a concurrent fork or exec can expose incorrect signal state. --- src/exit/abort.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/exit/abort.c b/src/exit/abort.c index 203dd35c..ecc0f735 100644 --- a/src/exit/abort.c +++ b/src/exit/abort.c @@ -1,10 +1,14 @@ #include #include #include "syscall.h" +#include "pthread_impl.h" +#include "atomic.h" _Noreturn void abort(void) { raise(SIGABRT); + __block_all_sigs(0); + a_crash(); raise(SIGKILL); - for (;;); + _Exit(127); } From 0f47367751a4baca80ef4f5ab11dbb9b6d7e8bdd Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 3 Jul 2016 20:03:30 -0400 Subject: [PATCH 162/412] add stdc-predef.h for library-level predefined macros modern compilers (for gcc, versions 4.8 and later) automatically pre-include to obtain the values of certain predefined macros specified by ISO C but which reflect properties of the library implementation, not just the compiler. provide values indicating that wchar_t is Unicode-encoded and that Annex F (IEEE floating point) is supported unless the compiler indicates otherwise. based on patch by Masanori Ogino. --- include/stdc-predef.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 include/stdc-predef.h diff --git a/include/stdc-predef.h b/include/stdc-predef.h new file mode 100644 index 00000000..f8cd4b89 --- /dev/null +++ b/include/stdc-predef.h @@ -0,0 +1,10 @@ +#ifndef _STDC_PREDEF_H +#define _STDC_PREDEF_H + +#define __STDC_ISO_10646__ 201206L + +#if !defined(__GCC_IEC_559) || __GCC_IEC_559 > 0 +#define __STDC_IEC_559__ 1 +#endif + +#endif From faf69b9a73d09fafcbe4fd3007b8d8724293d8e1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 5 Jul 2016 17:58:46 -0400 Subject: [PATCH 163/412] release 1.1.15 --- VERSION | 2 +- WHATSNEW | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e9bc1499..645377ee 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.14 +1.1.15 diff --git a/WHATSNEW b/WHATSNEW index 62daa1c9..be688cbb 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1691,3 +1691,42 @@ regressions fixed: other bugs fixed: - wrongly clamping (rather than failing) excessive rounds in crypt-sha* + + + +1.1.15 release notes + +new features: +- mips64 (full 64-bit and n32) port +- mips r6 isa support (subarch for mips, mips64, and mipsn32 archs) +- powerpc64 port +- powerpc (32-bit) soft-float ABI support (subarch) +- pthread_tryjoin_np and pthread_timedjoin_np (nonstandard extensions) +- header-level support for linux 4.5 and 4.6 features +- sched_getcpu (nonstandard extension) support, including vdso version +- __STDC_ISO_10646__, __STDC_IEC_559__ macros predefined via stdc-predef.h +- support for new elf/arch features in elf.h + +compatibility: +- configure now correctly chooses cross-prefix based on build/host/target +- abort now successfully terminates pid 1 in a container (or top-level) + +bugs fixed: +- memmem read past end of haystack, possible false positives or crashes +- buffer underflow (reverse-overflow) in ungetwc +- double-free under certain usage of putenv +- incorrect treatment by regcomp of * at start of BRE subexpression +- gethostbyname[2][_r] produced ip addresses in misaligned buffers +- looking up some invalid hostnames caused malformed dns queries +- lookups from hosts file were inconsistent with non-matching family +- missing h_length value in gethostbyaddr results +- a64l function produced wrong-signed results on 64-bit archs +- broken padding of string formats to width in wide printf variants +- wrong results for expf(-NAN) and exp2f(-NAN) +- wrong value for RUSAGE_CHILDREN prevented it from working +- abort failed to provide abnormal termination with SIGABRT blocked + +arch-specific bugs fixed: +- broken posix_fadvise on arm and powerpc (32-bit) +- thread structure/dtv corruption on powerpc at thread startup +- various wrong mips and powerpc ioctl and termios constant values From e1679ef1a1b7658dc7f8c9c97aeac7c7597c66a0 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Tue, 5 Jul 2016 22:53:32 -0500 Subject: [PATCH 164/412] remove or1k version of sem.h It's identical to the generic version, after evaluating the endian preprocessor checks in the generic version. --- arch/or1k/bits/sem.h | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 arch/or1k/bits/sem.h diff --git a/arch/or1k/bits/sem.h b/arch/or1k/bits/sem.h deleted file mode 100644 index 0d916484..00000000 --- a/arch/or1k/bits/sem.h +++ /dev/null @@ -1,11 +0,0 @@ -struct semid_ds { - struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; - char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; - unsigned short sem_nsems; - time_t __unused3; - time_t __unused4; -}; From 5ab0b20ea6fc5a5609825a874bf7d79c4f987792 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Tue, 5 Jul 2016 22:53:58 -0500 Subject: [PATCH 165/412] remove obsolete gitignore rules Since commit 2f853dd6b9a95d5b13ee8f9df762125e0588df5d, all generated headers are generated under the obj directory, which is already ignored. --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2cb88d4c..8043b6b6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ *.a *.so *.so.1 -arch/*/bits/alltypes.h config.mak lib/musl-gcc.specs -src/internal/version.h /obj/ From 7c82870d4543f0eeb0e3a2638b083ff97b41a0fb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 6 Jul 2016 21:15:00 -0400 Subject: [PATCH 166/412] remove obsolete and unused gethostbyaddr implementation this code was already under #if 0, but could be confusing if a reader didn't notice that, and it's almost surely full of bugs and/or inconsistencies with the current code that uses the gethostbyname2_r backend. --- src/network/gethostbyname.c | 52 ------------------------------------- 1 file changed, 52 deletions(-) diff --git a/src/network/gethostbyname.c b/src/network/gethostbyname.c index 5088a51e..bfedf52a 100644 --- a/src/network/gethostbyname.c +++ b/src/network/gethostbyname.c @@ -9,55 +9,3 @@ struct hostent *gethostbyname(const char *name) { return gethostbyname2(name, AF_INET); } - -#if 0 -struct hostent *gethostbyname(const char *name) -{ - static struct hostent h; - static char *h_aliases[3]; - static char h_canon[256]; - static char *h_addr_list[10]; - static char h_addr_data[10][4]; - static const struct addrinfo hint = { - .ai_family = AF_INET, .ai_flags = AI_CANONNAME - }; - struct addrinfo *ai, *p; - int i; - - switch (getaddrinfo(name, 0, &hint, &ai)) { - case EAI_NONAME: - h_errno = HOST_NOT_FOUND; - break; - case EAI_AGAIN: - h_errno = TRY_AGAIN; - break; - case EAI_FAIL: - h_errno = NO_RECOVERY; - break; - default: - case EAI_MEMORY: - case EAI_SYSTEM: - h_errno = NO_DATA; - break; - case 0: - break; - } - - strcpy(h_canon, ai->ai_canonname); - h.h_name = h_canon; - h.h_aliases = h_aliases; - h.h_aliases[0] = h_canon; - h.h_aliases[1] = strcmp(h_canon, name) ? (char *)name : 0; - h.h_length = 4; - h.h_addr_list = h_addr_list; - for (i=0, p=ai; iai_next) { - h.h_addr_list[i] = h_addr_data[i]; - memcpy(h.h_addr_list[i], - &((struct sockaddr_in *)p->ai_addr)->sin_addr, 4); - } - h.h_addr_list[i] = 0; - h.h_addrtype = AF_INET; - freeaddrinfo(ai); - return &h; -} -#endif From 6399fa9d29ea83de4735680b77d457bd59606532 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 7 Jul 2016 16:51:37 -0400 Subject: [PATCH 167/412] fix asctime day/month names not to vary by locale the FIXME comment here was overlooked at the time locale support was added. --- src/time/__asctime.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/time/__asctime.c b/src/time/__asctime.c index e7e7f07e..f114dfe7 100644 --- a/src/time/__asctime.c +++ b/src/time/__asctime.c @@ -1,17 +1,16 @@ #include #include #include +#include "locale_impl.h" #include "atomic.h" -const char *__nl_langinfo(nl_item); +const char *__nl_langinfo_l(nl_item, locale_t); char *__asctime(const struct tm *restrict tm, char *restrict buf) { - /* FIXME: change __nl_langinfo to __nl_langinfo_l with explicit C - * locale once we have locales */ if (snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", - __nl_langinfo(ABDAY_1+tm->tm_wday), - __nl_langinfo(ABMON_1+tm->tm_mon), + __nl_langinfo_l(ABDAY_1+tm->tm_wday, C_LOCALE), + __nl_langinfo_l(ABMON_1+tm->tm_mon, C_LOCALE), tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, 1900 + tm->tm_year) >= 26) From cff5747c74c41b22f1ce1340978b1c226a8cdf32 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 13 Jul 2016 15:04:30 -0400 Subject: [PATCH 168/412] fix regression in tcsetattr on all mips archs revert commit 8c316e9e49d37ad92c2e7493e16166a2afca419f. it was wrong and does not match how the kernel API works. --- arch/mips/bits/termios.h | 6 +++--- arch/mips64/bits/termios.h | 6 +++--- arch/mipsn32/bits/termios.h | 6 +++--- src/passwd/nscd_query.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h index f559f76f..6a1205d7 100644 --- a/arch/mips/bits/termios.h +++ b/arch/mips/bits/termios.h @@ -141,9 +141,9 @@ struct termios { #define TCOFLUSH 1 #define TCIOFLUSH 2 -#define TCSANOW 0x540e -#define TCSADRAIN 0x540f -#define TCSAFLUSH 0x5410 +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define EXTA 0000016 diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h index f559f76f..6a1205d7 100644 --- a/arch/mips64/bits/termios.h +++ b/arch/mips64/bits/termios.h @@ -141,9 +141,9 @@ struct termios { #define TCOFLUSH 1 #define TCIOFLUSH 2 -#define TCSANOW 0x540e -#define TCSADRAIN 0x540f -#define TCSAFLUSH 0x5410 +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define EXTA 0000016 diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h index f559f76f..6a1205d7 100644 --- a/arch/mipsn32/bits/termios.h +++ b/arch/mipsn32/bits/termios.h @@ -141,9 +141,9 @@ struct termios { #define TCOFLUSH 1 #define TCIOFLUSH 2 -#define TCSANOW 0x540e -#define TCSADRAIN 0x540f -#define TCSAFLUSH 0x5410 +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define EXTA 0000016 diff --git a/src/passwd/nscd_query.c b/src/passwd/nscd_query.c index d38e371b..1897edc8 100644 --- a/src/passwd/nscd_query.c +++ b/src/passwd/nscd_query.c @@ -40,7 +40,7 @@ retry: buf[0] = NSCDVERSION; fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); - if (fd < 0) return NULL; + if (fd < 0 && errno != EAFNOSUPPORT) return NULL; if(!(f = fdopen(fd, "r"))) { close(fd); From 39494a273eaa6b714e0fa0c59ce7a1f5fbc80a1e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 13 Jul 2016 15:23:01 -0400 Subject: [PATCH 169/412] revert unrelated change that slipped into last commit --- src/passwd/nscd_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passwd/nscd_query.c b/src/passwd/nscd_query.c index 1897edc8..d38e371b 100644 --- a/src/passwd/nscd_query.c +++ b/src/passwd/nscd_query.c @@ -40,7 +40,7 @@ retry: buf[0] = NSCDVERSION; fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); - if (fd < 0 && errno != EAFNOSUPPORT) return NULL; + if (fd < 0) return NULL; if(!(f = fdopen(fd, "r"))) { close(fd); From 7cc3a28eed7e3b72a1ce4568fb55154bb0540726 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 11 Aug 2016 18:36:46 -0400 Subject: [PATCH 170/412] fix pread/pwrite syscall calling convention on sh despite sh not generally using register-pair alignment for 64-bit syscall arguments, there are arch-specific versions of the syscall entry points for pread and pwrite which include a dummy argument for alignment before the 64-bit offset argument. --- arch/sh/syscall_arch.h | 1 + src/internal/syscall.h | 4 ++++ src/unistd/pread.c | 2 +- src/unistd/pwrite.c | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/sh/syscall_arch.h b/arch/sh/syscall_arch.h index f63675a8..84758fe0 100644 --- a/arch/sh/syscall_arch.h +++ b/arch/sh/syscall_arch.h @@ -2,6 +2,7 @@ ((union { long long ll; long l[2]; }){ .ll = x }).l[0], \ ((union { long long ll; long l[2]; }){ .ll = x }).l[1] #define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x)) +#define __SYSCALL_LL_PRW(x) 0, __SYSCALL_LL_E((x)) /* The extra OR instructions are to work around a hardware bug: * http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf diff --git a/src/internal/syscall.h b/src/internal/syscall.h index ff3cf53a..6d378a81 100644 --- a/src/internal/syscall.h +++ b/src/internal/syscall.h @@ -12,6 +12,10 @@ #define SYSCALL_MMAP2_UNIT 4096ULL #endif +#ifndef __SYSCALL_LL_PRW +#define __SYSCALL_LL_PRW(x) __SYSCALL_LL_O(x) +#endif + #ifndef __scc #define __scc(X) ((long) (X)) typedef long syscall_arg_t; diff --git a/src/unistd/pread.c b/src/unistd/pread.c index 3d2799fd..5483eb9d 100644 --- a/src/unistd/pread.c +++ b/src/unistd/pread.c @@ -4,7 +4,7 @@ ssize_t pread(int fd, void *buf, size_t size, off_t ofs) { - return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_O(ofs)); + return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_PRW(ofs)); } LFS64(pread); diff --git a/src/unistd/pwrite.c b/src/unistd/pwrite.c index bbe4c345..4bf3d7df 100644 --- a/src/unistd/pwrite.c +++ b/src/unistd/pwrite.c @@ -4,7 +4,7 @@ ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs) { - return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_O(ofs)); + return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_PRW(ofs)); } LFS64(pwrite); From 0f8ad40be0586907f12a72be1985df68e411b093 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 20 Aug 2016 17:04:05 +0200 Subject: [PATCH 171/412] add PF_QIPCRTR, AF_QIPCRTR from linux v4.7 to sys/socket.h macros for qualcom ip router protocol, new in linux commit bdabad3e363d825ddf9679dd431cca0b2c30f881 --- include/sys/socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index 59ab1e2f..8664779a 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -107,7 +107,8 @@ struct linger { #define PF_NFC 39 #define PF_VSOCK 40 #define PF_KCM 41 -#define PF_MAX 42 +#define PF_QIPCRTR 42 +#define PF_MAX 43 #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL @@ -154,6 +155,7 @@ struct linger { #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM +#define AF_QIPCRTR PF_QIPCRTR #define AF_MAX PF_MAX #ifndef SO_DEBUG From c6519d4a71a7579fec4b8a72635c2cf3732f8d5d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 20 Aug 2016 17:04:25 +0200 Subject: [PATCH 172/412] add UDP_ENCAP_GTP0, UDP_ENCAP_GTP1U from linux v4.7 to netinet/udp.h for GPRS tunneling protocol, new in linux commit 459aa660eb1d8ce67080da1983bb81d716aa5a69 --- include/netinet/udp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/netinet/udp.h b/include/netinet/udp.h index b1b0eb81..030e8fb2 100644 --- a/include/netinet/udp.h +++ b/include/netinet/udp.h @@ -28,6 +28,8 @@ struct udphdr { #define UDP_ENCAP_ESPINUDP_NON_IKE 1 #define UDP_ENCAP_ESPINUDP 2 #define UDP_ENCAP_L2TPINUDP 3 +#define UDP_ENCAP_GTP0 4 +#define UDP_ENCAP_GTP1U 5 #define SOL_UDP 17 From 9680e1d03a794b0e0d5815c749478228ed40a36d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 20 Aug 2016 17:04:44 +0200 Subject: [PATCH 173/412] add SS_AUTODISARM sigaltstack ss_flags from linux v4.7 to signal.h only matters if swapcontext is used in a signal handler running on an altstack, new in linux commit 2a74213838104a41588d86fd5e8d344972891ace --- include/signal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/signal.h b/include/signal.h index a16094c5..2c8b3d55 100644 --- a/include/signal.h +++ b/include/signal.h @@ -239,6 +239,8 @@ void (*sigset(int, void (*)(int)))(int); #define POLL_HUP 6 #define SS_ONSTACK 1 #define SS_DISABLE 2 +#define SS_AUTODISARM (1U << 31) +#define SS_FLAG_BITS SS_AUTODISARM #endif #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) From 2b41959b59e3dfd70cb4b592ffb2d97b47584aaa Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 20 Aug 2016 17:05:06 +0200 Subject: [PATCH 174/412] microblaze: add syscall numbers from linux v4.7 userfaultfd, membarrier and mlock2 syscalls got wired up in linux commit fbce3befd60d40639bf3c6b60f7477b2f988f92d --- arch/microblaze/bits/syscall.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index 0f67f1d9..109fcdeb 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -383,4 +383,7 @@ #define __NR_memfd_create 386 #define __NR_bpf 387 #define __NR_execveat 388 +#define __NR_userfaultfd 389 +#define __NR_membarrier 390 +#define __NR_mlock2 391 From 0a950dcf15bb9f7274c804dca490e9e20e475f3e Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 20 Aug 2016 21:04:31 +0200 Subject: [PATCH 175/412] verify that ttyname refers to the same file as the fd linux containers use separate mount namespace so the /proc symlink might not point to the right device if the fd was opened in the parent namespace, in this case return ENOENT. --- src/unistd/ttyname_r.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/unistd/ttyname_r.c b/src/unistd/ttyname_r.c index 8bac7b2f..a38ba4f2 100644 --- a/src/unistd/ttyname_r.c +++ b/src/unistd/ttyname_r.c @@ -1,10 +1,12 @@ #include #include +#include void __procfdname(char *, unsigned); int ttyname_r(int fd, char *name, size_t size) { + struct stat st1, st2; char procname[sizeof "/proc/self/fd/" + 3*sizeof(int) + 2]; ssize_t l; @@ -15,8 +17,13 @@ int ttyname_r(int fd, char *name, size_t size) if (l < 0) return errno; else if (l == size) return ERANGE; - else { - name[l] = 0; - return 0; - } + + name[l] = 0; + + if (stat(name, &st1) || fstat(fd, &st2)) + return errno; + if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) + return ENOENT; + + return 0; } From 5b5db97f7e80bde2678aed72336a28375e800354 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 23 Aug 2016 21:47:53 +0200 Subject: [PATCH 176/412] math: fix 128bit long double inverse trigonometric functions there was a copy paste error that could cause large ulp errors in atan2l, atanl, asinl and acosl on aarch64, mips64 and mipsn32. (the implementation is from freebsd fdlibm, but the tail end of the polynomial was wrong. 128 bit long double functions are not yet tested so this went undetected.) --- src/math/__invtrigl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/__invtrigl.c b/src/math/__invtrigl.c index ef7f4e1b..48f83aaf 100644 --- a/src/math/__invtrigl.c +++ b/src/math/__invtrigl.c @@ -57,7 +57,7 @@ long double __invtrigl_R(long double z) { long double p, q; p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*(pS5+z*(pS6+z*(pS7+z*(pS8+z*pS9))))))))); - q = 1.0+z*(qS1+z*(qS2+z*(qS3+z*(qS4+z*(qS5+z*(pS6+z*(pS7+z*(pS8+z*pS9)))))))); + q = 1.0+z*(qS1+z*(qS2+z*(qS3+z*(qS4+z*(qS5+z*(qS6+z*(qS7+z*(qS8+z*qS9)))))))); return p/q; } #endif From fff880185bb3624acfbd2c6a75a1655bcd782c51 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 24 Aug 2016 12:40:10 +0200 Subject: [PATCH 177/412] configure: handle mipsisa64* triplet as a mips64 target the gnu config.sub script recognizes several mipsisa64* cpu types that musl supports as mips64 targets. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index af8b45f0..707eb125 100755 --- a/configure +++ b/configure @@ -318,7 +318,7 @@ i?86*) ARCH=i386 ;; x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; x86_64-nt64*) ARCH=nt64 ;; x86_64*) ARCH=x86_64 ;; -mips64*) ARCH=mips64 ;; +mips64*|mipsisa64*) ARCH=mips64 ;; mips*) ARCH=mips ;; microblaze*) ARCH=microblaze ;; or1k*) ARCH=or1k ;; From c1f4ed150137d793c9d07356305a89e8785e7e02 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Thu, 18 Aug 2016 17:06:16 +0200 Subject: [PATCH 178/412] fix FFSYNC by changing it to O_SYNC O_FSYNC was never defined and is legacy/wrong, nothing seems to use it. --- include/fcntl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fcntl.h b/include/fcntl.h index e683e4dc..0e165ca3 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -99,7 +99,7 @@ int posix_fallocate(int, off_t, off_t); #define AT_EMPTY_PATH 0x1000 #define FAPPEND O_APPEND -#define FFSYNC O_FSYNC +#define FFSYNC O_SYNC #define FASYNC O_ASYNC #define FNONBLOCK O_NONBLOCK #define FNDELAY O_NDELAY From 397586625e71d166f493f16bfe04f3005ae464c3 Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Sat, 13 Aug 2016 20:31:49 +0200 Subject: [PATCH 179/412] getdtablesize: fix returning hard instead of soft rlimit This makes the result consistent with sysconf(_SC_OPEN_MAX). --- src/legacy/getdtablesize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacy/getdtablesize.c b/src/legacy/getdtablesize.c index 682da6d0..b30c1933 100644 --- a/src/legacy/getdtablesize.c +++ b/src/legacy/getdtablesize.c @@ -7,5 +7,5 @@ int getdtablesize(void) { struct rlimit rl; getrlimit(RLIMIT_NOFILE, &rl); - return rl.rlim_max < INT_MAX ? rl.rlim_max : INT_MAX; + return rl.rlim_cur < INT_MAX ? rl.rlim_cur : INT_MAX; } From e738b8cbe64b6dd3ed9f47b6d4cd7eb2c422b38d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 30 Aug 2016 16:39:54 -0400 Subject: [PATCH 180/412] restore _Noreturn to __assert_fail this reverts commit 2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4. without the _Noreturn attribute, the compiler cannot use asserts to perform reachability/range analysis. this leads to missed optimizations and spurious warnings. the original backtrace problem that prompted the removal of _Noreturn was not clearly documented at the time, but it seems to happen only when libc was built without -g, which also breaks many other backtracing cases. --- include/assert.h | 2 +- src/exit/assert.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/assert.h b/include/assert.h index e679adbf..d14ec94e 100644 --- a/include/assert.h +++ b/include/assert.h @@ -16,7 +16,7 @@ extern "C" { #endif -void __assert_fail (const char *, const char *, int, const char *); +_Noreturn void __assert_fail (const char *, const char *, int, const char *); #ifdef __cplusplus } diff --git a/src/exit/assert.c b/src/exit/assert.c index e87442a7..49b0dc3e 100644 --- a/src/exit/assert.c +++ b/src/exit/assert.c @@ -1,7 +1,7 @@ #include #include -void __assert_fail(const char *expr, const char *file, int line, const char *func) +_Noreturn void __assert_fail(const char *expr, const char *file, int line, const char *func) { fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line); fflush(NULL); From 78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 16 Sep 2016 17:40:08 -0400 Subject: [PATCH 181/412] fix printf regression with alt-form octal, zero flag, and field width commit b91cdbe2bc8b626aa04dc6e3e84345accf34e4b1, in fixing another issue, changed the logic for how alt-form octal adds the leading zero to adjust the precision rather than using a prefix character. this wrongly suppressed the zero flag by mimicing an explicit precision given by the format string. switch back to using a prefix character. based on bug report and patch by Dmitry V. Levin, but simplified. --- src/stdio/vfprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 2ecf7692..e439a07a 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -570,7 +570,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, if (0) { case 'o': a = fmt_o(arg.i, z); - if ((fl&ALT_FORM) && p Date: Fri, 16 Sep 2016 13:34:24 -0400 Subject: [PATCH 182/412] fix ifru_data and ifcu_buf types in net/if.h glibc, freebsd, and openbsd use character pointers (caddr_t) for these fields. only linux uses void pointer for the ifru_data type. --- include/net/if.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/if.h b/include/net/if.h index 1a4059d6..2f2fcc10 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -89,7 +89,7 @@ struct ifreq { struct ifmap ifru_map; char ifru_slave[IFNAMSIZ]; char ifru_newname[IFNAMSIZ]; - void *ifru_data; + char *ifru_data; } ifr_ifru; }; @@ -116,7 +116,7 @@ struct ifreq { struct ifconf { int ifc_len; union { - void *ifcu_buf; + char *ifcu_buf; struct ifreq *ifcu_req; } ifc_ifcu; }; From 32055d52ca43d867d6dbb763dc5213a8d3536a23 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Thu, 15 Sep 2016 11:27:30 -0400 Subject: [PATCH 183/412] fix if_indextoname error case posix requires errno to be set to ENXIO if the interface does not exist. linux returns ENODEV instead so we handle this. --- src/network/if_indextoname.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/if_indextoname.c b/src/network/if_indextoname.c index 6ee7f13c..3b368bf0 100644 --- a/src/network/if_indextoname.c +++ b/src/network/if_indextoname.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "syscall.h" char *if_indextoname(unsigned index, char *name) @@ -14,5 +15,9 @@ char *if_indextoname(unsigned index, char *name) ifr.ifr_ifindex = index; r = ioctl(fd, SIOCGIFNAME, &ifr); __syscall(SYS_close, fd); - return r < 0 ? 0 : strncpy(name, ifr.ifr_name, IF_NAMESIZE); + if (r < 0) { + if (errno == ENODEV) errno = ENXIO; + return 0; + } + return strncpy(name, ifr.ifr_name, IF_NAMESIZE); } From 5505f6afae9acf37ef565c68a07ca3df7b1ae2cb Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Fri, 9 Sep 2016 21:23:17 -0400 Subject: [PATCH 184/412] add missing *_unlocked and wcsftime_l prototypes to wchar.h these functions had been implemented, but prototypes were not made available --- include/wchar.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/wchar.h b/include/wchar.h index 0167dce6..3e6db5fc 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -136,6 +136,21 @@ size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const s #undef iswdigit +#if defined(_GNU_SOURCE) +wint_t fgetwc_unlocked (FILE *); +wint_t getwc_unlocked (FILE *); +wint_t getwchar_unlocked (void); +wint_t fputwc_unlocked (wchar_t, FILE *); +wint_t putwc_unlocked (wchar_t, FILE *); +wint_t putwchar_unlocked (wchar_t); +wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict); +int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict); +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t); +#endif + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) FILE *open_wmemstream(wchar_t **, size_t *); From c002668eb0352e619ea7064e4940b397b4a6e68d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 18 Sep 2016 21:45:47 -0400 Subject: [PATCH 185/412] simplify/refactor fflush and make fflush_unlocked an alias for fflush previously, fflush_unlocked was an alias for an internal backend that was called by fflush, either for its argument or in a loop for each file if a null pointer was passed. since the logic for the latter was in the main fflush function, fflush_unlocked crashed when passed a null pointer, rather than flushing all open files. since fflush_unlocked is not a standard function and has no specification, it's not clear whether it should be expected to accept null pointers like fflush does, but a reasonable argument could be made that it should. this patch eliminates the helper function, simplifying fflush, and makes fflush_unlocked an alias for fflush, which is valid because the two functions agree in their behavior in all cases where their behavior is defined (the unlocked version has undefined behavior if another thread could hold locks). --- src/stdio/fflush.c | 53 ++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/src/stdio/fflush.c b/src/stdio/fflush.c index 3f462c80..c2881065 100644 --- a/src/stdio/fflush.c +++ b/src/stdio/fflush.c @@ -1,11 +1,30 @@ #include "stdio_impl.h" -static int __fflush_unlocked(FILE *f) +/* stdout.c will override this if linked */ +static FILE *volatile dummy = 0; +weak_alias(dummy, __stdout_used); + +int fflush(FILE *f) { + if (!f) { + int r = __stdout_used ? fflush(__stdout_used) : 0; + + for (f=*__ofl_lock(); f; f=f->next) + if (f->wpos > f->wbase) r |= fflush(f); + __ofl_unlock(); + + return r; + } + + FLOCK(f); + /* If writing, flush output */ if (f->wpos > f->wbase) { f->write(f, 0, 0); - if (!f->wpos) return EOF; + if (!f->wpos) { + FUNLOCK(f); + return EOF; + } } /* If reading, sync position, per POSIX */ @@ -15,34 +34,8 @@ static int __fflush_unlocked(FILE *f) f->wpos = f->wbase = f->wend = 0; f->rpos = f->rend = 0; + FUNLOCK(f); return 0; } -/* stdout.c will override this if linked */ -static FILE *volatile dummy = 0; -weak_alias(dummy, __stdout_used); - -int fflush(FILE *f) -{ - int r; - - if (f) { - FLOCK(f); - r = __fflush_unlocked(f); - FUNLOCK(f); - return r; - } - - r = __stdout_used ? fflush(__stdout_used) : 0; - - for (f=*__ofl_lock(); f; f=f->next) { - FLOCK(f); - if (f->wpos > f->wbase) r |= __fflush_unlocked(f); - FUNLOCK(f); - } - __ofl_unlock(); - - return r; -} - -weak_alias(__fflush_unlocked, fflush_unlocked); +weak_alias(fflush, fflush_unlocked); From 66570ec9c465e3c6c5d6dbd7dd42e45041a39288 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 19 Sep 2016 11:15:51 -0400 Subject: [PATCH 186/412] fix undefined behavior in sched.h cpu_set_t usage since cpu sets can be dynamically allocated and have variable size, accessing their contents via ->__bits is not valid; performing pointer arithmetic outside the range of the size of the declared __bits array results in undefined beahavior. instead, only use cpu_set_t for fixed-size cpu set objects (instantiated by the caller) and as an abstract pointer type for dynamically allocated ones. perform all accesses simply by casting the abstract pointer type cpuset_t * back to unsigned long *. --- include/sched.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sched.h b/include/sched.h index af82d6c9..d1cccb70 100644 --- a/include/sched.h +++ b/include/sched.h @@ -82,7 +82,7 @@ int sched_getaffinity(pid_t, size_t, cpu_set_t *); int sched_setaffinity(pid_t, size_t, const cpu_set_t *); #define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \ - ((set)->__bits[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) ) + (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) ) #define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=) #define CPU_CLR_S(i, size, set) __CPU_op_S(i, size, set, &=~) @@ -94,8 +94,8 @@ static __inline void __CPU_##func##_S(size_t __size, cpu_set_t *__dest, \ { \ size_t __i; \ for (__i=0; __i<__size/sizeof(long); __i++) \ - __dest->__bits[__i] = __src1->__bits[__i] \ - op __src2->__bits[__i] ; \ + ((unsigned long *)__dest)[__i] = ((unsigned long *)__src1)[__i] \ + op ((unsigned long *)__src2)[__i] ; \ } __CPU_op_func_S(AND, &) From d917ef0b8468f77634df59a1a6650aff5adb6b6a Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Sat, 24 Sep 2016 00:38:06 -0400 Subject: [PATCH 187/412] remove dead case in gethostbyname2_r this case statement was accidently left behind when this function was refactored in commit e8f39ca4898237cf71657500f0b11534c47a0521. --- src/network/gethostbyname2_r.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c index 5c1cae98..fc894877 100644 --- a/src/network/gethostbyname2_r.c +++ b/src/network/gethostbyname2_r.c @@ -34,8 +34,6 @@ int gethostbyname2_r(const char *name, int af, case EAI_SYSTEM: *err = NO_RECOVERY; return errno; - case 0: - break; } h->h_addrtype = af; From 8d7a3f40c8de414122eb8eb2131291782ee8ed15 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Fri, 23 Sep 2016 21:10:07 -0400 Subject: [PATCH 188/412] fix getservby*_r result pointer value on error this is a clone of the fix to the gethostby*_r functions in commit fe82bb9b921be34370e6b71a1c6f062c20999ae0. the man pages document that the getservby*_r functions set this pointer to NULL if there was an error or if no record was found. --- src/network/getservbyname_r.c | 2 ++ src/network/getservbyport_r.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/network/getservbyname_r.c b/src/network/getservbyname_r.c index 056c2f33..ad3d6164 100644 --- a/src/network/getservbyname_r.c +++ b/src/network/getservbyname_r.c @@ -15,6 +15,8 @@ int getservbyname_r(const char *name, const char *prots, struct service servs[MAXSERVS]; int cnt, proto, align; + *res = 0; + /* Align buffer */ align = -(uintptr_t)buf & ALIGN-1; if (buflen < 2*sizeof(char *)+align) diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c index a0a7caec..0ae0e415 100644 --- a/src/network/getservbyport_r.c +++ b/src/network/getservbyport_r.c @@ -20,6 +20,7 @@ int getservbyport_r(int port, const char *prots, if (r) r = getservbyport_r(port, "udp", se, buf, buflen, res); return r; } + *res = 0; /* Align buffer */ i = (uintptr_t)buf & sizeof(char *)-1; From 583ea83541dcc6481c7a1bd1a9b485526bad84a1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 4 Oct 2016 17:14:57 +0000 Subject: [PATCH 189/412] fix strftime %y for negative tm_year --- src/time/strftime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/time/strftime.c b/src/time/strftime.c index f1ccc4dd..e103e02b 100644 --- a/src/time/strftime.c +++ b/src/time/strftime.c @@ -167,6 +167,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm * goto nl_strftime; case 'y': val = tm->tm_year % 100; + if (val<0) val += 100; goto number; case 'Y': val = tm->tm_year + 1900LL; From c3edc06d1e1360f3570db9155d6b318ae0d0f0f7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 6 Oct 2016 18:34:58 -0400 Subject: [PATCH 190/412] fix missing integer overflow checks in regexec buffer size computations most of the possible overflows were already ruled out in practice by regcomp having already succeeded performing larger allocations. however at least the num_states*num_tags multiplication can clearly overflow in practice. for safety, check them all, and use the proper type, size_t, rather than int. also improve comments, use calloc in place of malloc+memset, and remove bogus casts. --- src/regex/regexec.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/regex/regexec.c b/src/regex/regexec.c index 16c5d0ac..dd523195 100644 --- a/src/regex/regexec.c +++ b/src/regex/regexec.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -206,11 +207,24 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, /* Allocate memory for temporary data required for matching. This needs to be done for every matching operation to be thread safe. This allocates - everything in a single large block from the stack frame using alloca() - or with malloc() if alloca is unavailable. */ + everything in a single large block with calloc(). */ { - int tbytes, rbytes, pbytes, xbytes, total_bytes; + size_t tbytes, rbytes, pbytes, xbytes, total_bytes; char *tmp_buf; + + /* Ensure that tbytes and xbytes*num_states cannot overflow, and that + * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */ + if (num_tags > SIZE_MAX/(8 * sizeof(int) * tnfa->num_states)) + goto error_exit; + + /* Likewise check rbytes. */ + if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next))) + goto error_exit; + + /* Likewise check pbytes. */ + if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos))) + goto error_exit; + /* Compute the length of the block we need. */ tbytes = sizeof(*tmp_tags) * num_tags; rbytes = sizeof(*reach_next) * (tnfa->num_states + 1); @@ -221,10 +235,9 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes; /* Allocate the memory. */ - buf = xmalloc((unsigned)total_bytes); + buf = calloc(total_bytes, 1); if (buf == NULL) return REG_ESPACE; - memset(buf, 0, (size_t)total_bytes); /* Get the various pointers within tmp_buf (properly aligned). */ tmp_tags = (void *)buf; From aee6abb2400b9a955c2b41166db1c22f63ad42ef Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 6 Oct 2016 12:15:47 -0400 Subject: [PATCH 191/412] fix regexec with haystack strings longer than INT_MAX we inherited from TRE regexec code that's utterly wrong with respect to the integer types it's using. while it doesn't appear that compilers are producing unsafe output, signed integer overflows seem to happen, and regexec fails to find matches past offset INT_MAX. this patch fixes the type of all variables/fields used to store offsets in the string from int to regoff_t. after the changes, basic testing showed that regexec can now find matches past 2GB (INT_MAX) and past 4GB on x86_64, and code generation is unchanged on i386. --- src/regex/regexec.c | 54 +++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/regex/regexec.c b/src/regex/regexec.c index dd523195..5c4cb922 100644 --- a/src/regex/regexec.c +++ b/src/regex/regexec.c @@ -44,7 +44,7 @@ static void tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, - const tre_tnfa_t *tnfa, int *tags, int match_eo); + const tre_tnfa_t *tnfa, regoff_t *tags, regoff_t match_eo); /*********************************************************************** from tre-match-utils.h @@ -97,7 +97,7 @@ tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, /* Returns 1 if `t1' wins `t2', 0 otherwise. */ static int tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions, - int *t1, int *t2) + regoff_t *t1, regoff_t *t2) { int i; for (i = 0; i < num_tags; i++) @@ -157,25 +157,25 @@ tre_neg_char_classes_match(tre_ctype_t *classes, tre_cint_t wc, int icase) typedef struct { tre_tnfa_transition_t *state; - int *tags; + regoff_t *tags; } tre_tnfa_reach_t; typedef struct { - int pos; - int **tags; + regoff_t pos; + regoff_t **tags; } tre_reach_pos_t; static reg_errcode_t tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, - int *match_tags, int eflags, - int *match_end_ofs) + regoff_t *match_tags, int eflags, + regoff_t *match_end_ofs) { /* State variables required by GET_NEXT_WCHAR. */ tre_char_t prev_c = 0, next_c = 0; const char *str_byte = string; - int pos = -1; - int pos_add_next = 1; + regoff_t pos = -1; + regoff_t pos_add_next = 1; #ifdef TRE_MBSTATE mbstate_t mbstate; #endif /* TRE_MBSTATE */ @@ -191,10 +191,10 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int *tag_i; int num_tags, i; - int match_eo = -1; /* end offset of match (-1 if no match found yet) */ + regoff_t match_eo = -1; /* end offset of match (-1 if no match found yet) */ int new_match = 0; - int *tmp_tags = NULL; - int *tmp_iptr; + regoff_t *tmp_tags = NULL; + regoff_t *tmp_iptr; #ifdef TRE_MBSTATE memset(&mbstate, '\0', sizeof(mbstate)); @@ -214,7 +214,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, /* Ensure that tbytes and xbytes*num_states cannot overflow, and that * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */ - if (num_tags > SIZE_MAX/(8 * sizeof(int) * tnfa->num_states)) + if (num_tags > SIZE_MAX/(8 * sizeof(regoff_t) * tnfa->num_states)) goto error_exit; /* Likewise check rbytes. */ @@ -229,7 +229,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, tbytes = sizeof(*tmp_tags) * num_tags; rbytes = sizeof(*reach_next) * (tnfa->num_states + 1); pbytes = sizeof(*reach_pos) * tnfa->num_states; - xbytes = sizeof(int) * num_tags; + xbytes = sizeof(regoff_t) * num_tags; total_bytes = (sizeof(long) - 1) * 4 /* for alignment paddings */ + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes; @@ -490,12 +490,12 @@ error_exit: */ typedef struct { - int pos; + regoff_t pos; const char *str_byte; tre_tnfa_transition_t *state; int state_id; int next_c; - int *tags; + regoff_t *tags; #ifdef TRE_MBSTATE mbstate_t mbstate; #endif /* TRE_MBSTATE */ @@ -591,13 +591,13 @@ typedef struct tre_backtrack_struct { static reg_errcode_t tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, - int *match_tags, int eflags, int *match_end_ofs) + regoff_t *match_tags, int eflags, regoff_t *match_end_ofs) { /* State variables required by GET_NEXT_WCHAR. */ tre_char_t prev_c = 0, next_c = 0; const char *str_byte = string; - int pos = 0; - int pos_add_next = 1; + regoff_t pos = 0; + regoff_t pos_add_next = 1; #ifdef TRE_MBSTATE mbstate_t mbstate; #endif /* TRE_MBSTATE */ @@ -610,15 +610,16 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, started from. */ int next_c_start; const char *str_byte_start; - int pos_start = -1; + regoff_t pos_start = -1; #ifdef TRE_MBSTATE mbstate_t mbstate_start; #endif /* TRE_MBSTATE */ /* End offset of best match so far, or -1 if no match found yet. */ - int match_eo = -1; + regoff_t match_eo = -1; /* Tag arrays. */ - int *next_tags, *tags = NULL; + int *next_tags; + regoff_t *tags = NULL; /* Current TNFA state. */ tre_tnfa_transition_t *state; int *states_seen = NULL; @@ -768,8 +769,9 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, /* This is a back reference state. All transitions leaving from this state have the same back reference "assertion". Instead of reading the next character, we match the back reference. */ - int so, eo, bt = trans_i->u.backref; - int bt_len; + regoff_t so, eo; + int bt = trans_i->u.backref; + regoff_t bt_len; int result; /* Get the substring we need to match against. Remember to @@ -926,7 +928,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, endpoint values. */ static void tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, - const tre_tnfa_t *tnfa, int *tags, int match_eo) + const tre_tnfa_t *tnfa, regoff_t *tags, regoff_t match_eo) { tre_submatch_data_t *submatch_data; unsigned int i, j; @@ -996,7 +998,7 @@ regexec(const regex_t *restrict preg, const char *restrict string, { tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; reg_errcode_t status; - int *tags = NULL, eo; + regoff_t *tags = NULL, eo; if (tnfa->cflags & REG_NOSUB) nmatch = 0; if (tnfa->num_tags > 0 && nmatch > 0) { From 70d2687d85c314963cf280759b23fd4573ff0d82 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 19 Oct 2016 20:17:16 -0400 Subject: [PATCH 192/412] fix integer overflow in float printf needed-precision computation if the requested precision is close to INT_MAX, adding LDBL_MANT_DIG/3+8 overflows. in practice the resulting undefined behavior manifests as a large negative result, which is then used to compute the new end pointer (z) with a wildly out-of-bounds value (more overflow, more undefined behavior). the end result is at least incorrect output and character count (return value); worse things do not seem to happen, but detailed analysis has not been done. this patch fixes the overflow by performing the intermediate computation as unsigned; after division by 9, the final result necessarily fits in int. --- src/stdio/vfprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index e439a07a..cd17ad70 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -312,7 +312,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) } while (e2<0) { uint32_t carry=0, *b; - int sh=MIN(9,-e2), need=1+(p+LDBL_MANT_DIG/3+8)/9; + int sh=MIN(9,-e2), need=1+(p+LDBL_MANT_DIG/3U+8)/9; for (d=a; d>sh) + carry; From 167dfe9672c116b315e72e57a55c7769f180dffa Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 20 Oct 2016 00:22:09 -0400 Subject: [PATCH 193/412] fix integer overflows and uncaught EOVERFLOW in printf core this patch fixes a large number of missed internal signed-overflow checks and errors in determining when the return value (output length) would exceed INT_MAX, which should result in EOVERFLOW. some of the issues fixed were reported by Alexander Cherepanov; others were found in subsequent review of the code. aside from the signed overflows being undefined behavior, the following specific bugs were found to exist in practice: - overflows computing length of floating point formats with huge explicit precisions, integer formats with prefix characters and huge explicit precisions, or string arguments or format strings longer than INT_MAX, resulted in wrong return value and wrong %n results. - literal width and precision values outside the range of int were misinterpreted, yielding wrong behavior in at least one well-defined case: string formats with precision greater than INT_MAX were sometimes truncated. - in cases where EOVERFLOW is produced, incorrect values could be written for %n specifiers past the point of exceeding INT_MAX. in addition to fixing these bugs, we now stop producing output immediately when output length would exceed INT_MAX, rather than continuing and returning an error only at the end. --- src/stdio/vfprintf.c | 72 ++++++++++++++++++++++++++++++------------- src/stdio/vfwprintf.c | 63 ++++++++++++++++++++++--------------- 2 files changed, 89 insertions(+), 46 deletions(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index cd17ad70..e2ab2dc6 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -272,6 +272,8 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) if (s-buf==1 && (y||p>0||(fl&ALT_FORM))) *s++='.'; } while (y); + if (p > INT_MAX-2-(ebuf-estr)-pl) + return -1; if (p && s-buf-2 < p) l = (p+2) + (ebuf-estr); else @@ -383,17 +385,22 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) p = MIN(p,MAX(0,9*(z-r-1)+e-j)); } } + if (p > INT_MAX-1-(p || (fl&ALT_FORM))) + return -1; l = 1 + p + (p || (fl&ALT_FORM)); if ((t|32)=='f') { + if (e > INT_MAX-l) return -1; if (e>0) l+=e; } else { estr=fmt_u(e<0 ? -e : e, ebuf); while(ebuf-estr<2) *--estr='0'; *--estr = (e<0 ? '-' : '+'); *--estr = t; + if (ebuf-estr > INT_MAX-l) return -1; l += ebuf-estr; } + if (l > INT_MAX-pl) return -1; pad(f, ' ', w, pl+l, fl); out(f, prefix, pl); pad(f, '0', w, pl+l, fl^ZERO_PAD); @@ -437,8 +444,10 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) static int getint(char **s) { int i; - for (i=0; isdigit(**s); (*s)++) - i = 10*i + (**s-'0'); + for (i=0; isdigit(**s); (*s)++) { + if (i > INT_MAX/10U || **s-'0' > INT_MAX-10*i) i = -1; + else i = 10*i + (**s-'0'); + } return i; } @@ -446,12 +455,12 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, { char *a, *z, *s=(char *)fmt; unsigned l10n=0, fl; - int w, p; + int w, p, xp; union arg arg; int argpos; unsigned st, ps; int cnt=0, l=0; - int i; + size_t i; char buf[sizeof(uintmax_t)*3+3+LDBL_MANT_DIG/4]; const char *prefix; int t, pl; @@ -459,18 +468,19 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, char mb[4]; for (;;) { + /* This error is only specified for snprintf, but since it's + * unspecified for other forms, do the same. Stop immediately + * on overflow; otherwise %n could produce wrong results. */ + if (l > INT_MAX - cnt) goto overflow; + /* Update output count, end loop when fmt is exhausted */ - if (cnt >= 0) { - if (l > INT_MAX - cnt) { - errno = EOVERFLOW; - cnt = -1; - } else cnt += l; - } + cnt += l; if (!*s) break; /* Handle literal text and %% format specifiers */ for (a=s; *s && *s!='%'; s++); for (z=s; s[0]=='%' && s[1]=='%'; z++, s+=2); + if (z-a > INT_MAX-cnt) goto overflow; l = z-a; if (f) out(f, a, l); if (l) continue; @@ -498,9 +508,9 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, } else if (!l10n) { w = f ? va_arg(*ap, int) : 0; s++; - } else return -1; + } else goto inval; if (w<0) fl|=LEFT_ADJ, w=-w; - } else if ((w=getint(&s))<0) return -1; + } else if ((w=getint(&s))<0) goto overflow; /* Read precision */ if (*s=='.' && s[1]=='*') { @@ -511,24 +521,29 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, } else if (!l10n) { p = f ? va_arg(*ap, int) : 0; s+=2; - } else return -1; + } else goto inval; + xp = (p>=0); } else if (*s=='.') { s++; p = getint(&s); - } else p = -1; + xp = 1; + } else { + p = -1; + xp = 0; + } /* Format specifier state machine */ st=0; do { - if (OOB(*s)) return -1; + if (OOB(*s)) goto inval; ps=st; st=states[st]S(*s++); } while (st-1=0) return -1; + if (argpos>=0) goto inval; } else { if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos]; else if (f) pop_arg(&arg, st, ap); @@ -584,6 +599,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, case 'u': a = fmt_u(arg.i, z); } + if (xp && p<0) goto overflow; if (p>=0) fl &= ~ZERO_PAD; if (!arg.i && !p) { a=z; @@ -599,9 +615,9 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, if (1) a = strerror(errno); else case 's': a = arg.p ? arg.p : "(null)"; - z = memchr(a, 0, p); - if (!z) z=a+p; - else p=z-a; + z = a + strnlen(a, p<0 ? INT_MAX : p); + if (p<0 && *z) goto overflow; + p = z-a; fl &= ~ZERO_PAD; break; case 'C': @@ -611,8 +627,9 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, p = -1; case 'S': ws = arg.p; - for (i=l=0; i<0U+p && *ws && (l=wctomb(mb, *ws++))>=0 && l<=0U+p-i; i+=l); + for (i=l=0; i

=0 && l<=p-i; i+=l); if (l<0) return -1; + if (i > INT_MAX) goto overflow; p = i; pad(f, ' ', w, p, fl); ws = arg.p; @@ -623,12 +640,16 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, continue; case 'e': case 'f': case 'g': case 'a': case 'E': case 'F': case 'G': case 'A': + if (xp && p<0) goto overflow; l = fmt_fp(f, arg.f, w, p, fl, t); + if (l<0) goto overflow; continue; } if (p < z-a) p = z-a; + if (p > INT_MAX-pl) goto overflow; if (w < pl+p) w = pl+p; + if (w > INT_MAX-cnt) goto overflow; pad(f, ' ', w, pl+p, fl); out(f, prefix, pl); @@ -646,8 +667,15 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, for (i=1; i<=NL_ARGMAX && nl_type[i]; i++) pop_arg(nl_arg+i, nl_type[i], ap); for (; i<=NL_ARGMAX && !nl_type[i]; i++); - if (i<=NL_ARGMAX) return -1; + if (i<=NL_ARGMAX) goto inval; return 1; + +inval: + errno = EINVAL; + return -1; +overflow: + errno = EOVERFLOW; + return -1; } int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap) diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index f9f1ecfd..b8fff208 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -154,8 +154,10 @@ static void out(FILE *f, const wchar_t *s, size_t l) static int getint(wchar_t **s) { int i; - for (i=0; iswdigit(**s); (*s)++) - i = 10*i + (**s-'0'); + for (i=0; iswdigit(**s); (*s)++) { + if (i > INT_MAX/10U || **s-'0' > INT_MAX-10*i) i = -1; + else i = 10*i + (**s-'0'); + } return i; } @@ -168,8 +170,8 @@ static const char sizeprefix['y'-'a'] = { static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_arg, int *nl_type) { wchar_t *a, *z, *s=(wchar_t *)fmt; - unsigned l10n=0, litpct, fl; - int w, p; + unsigned l10n=0, fl; + int w, p, xp; union arg arg; int argpos; unsigned st, ps; @@ -181,20 +183,19 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ wchar_t wc; for (;;) { + /* This error is only specified for snprintf, but since it's + * unspecified for other forms, do the same. Stop immediately + * on overflow; otherwise %n could produce wrong results. */ + if (l > INT_MAX - cnt) goto overflow; + /* Update output count, end loop when fmt is exhausted */ - if (cnt >= 0) { - if (l > INT_MAX - cnt) { - if (!ferror(f)) errno = EOVERFLOW; - cnt = -1; - } else cnt += l; - } + cnt += l; if (!*s) break; /* Handle literal text and %% format specifiers */ for (a=s; *s && *s!='%'; s++); - litpct = wcsspn(s, L"%")/2; /* Optimize %%%% runs */ - z = s+litpct; - s += 2*litpct; + for (z=s; s[0]=='%' && s[1]=='%'; z++, s+=2); + if (z-a > INT_MAX-cnt) goto overflow; l = z-a; if (f) out(f, a, l); if (l) continue; @@ -222,9 +223,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ } else if (!l10n) { w = f ? va_arg(*ap, int) : 0; s++; - } else return -1; + } else goto inval; if (w<0) fl|=LEFT_ADJ, w=-w; - } else if ((w=getint(&s))<0) return -1; + } else if ((w=getint(&s))<0) goto overflow; /* Read precision */ if (*s=='.' && s[1]=='*') { @@ -235,24 +236,29 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ } else if (!l10n) { p = f ? va_arg(*ap, int) : 0; s+=2; - } else return -1; + } else goto inval; + xp = (p>=0); } else if (*s=='.') { s++; p = getint(&s); - } else p = -1; + xp = 1; + } else { + p = -1; + xp = 0; + } /* Format specifier state machine */ st=0; do { - if (OOB(*s)) return -1; + if (OOB(*s)) goto inval; ps=st; st=states[st]S(*s++); } while (st-1=0) return -1; + if (argpos>=0) goto inval; } else { if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos]; else if (f) pop_arg(&arg, st, ap); @@ -285,8 +291,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ continue; case 'S': a = arg.p; - z = wmemchr(a, 0, p); - if (z) p=z-a; + z = a + wcsnlen(a, p<0 ? INT_MAX : p); + if (p<0 && *z) goto overflow; + p = z-a; if (w0; bs+=i, l++); + for (i=l=0; l<(p<0?INT_MAX:p) && (i=mbtowc(&wc, bs, MB_LEN_MAX))>0; bs+=i, l++); if (i<0) return -1; + if (p<0 && *bs) goto overflow; p=l; if (w Date: Thu, 8 Sep 2016 19:07:31 +0200 Subject: [PATCH 194/412] use dynamic buffer for getmntent overlayfs may have fairly long lines so we use getline to allocate a buffer dynamically. The buffer will be allocated on first use, expand as needed, but will never be free'ed. Downstream bug: http://bugs.alpinelinux.org/issues/5703 Signed-off-by: Natanael Copa --- src/misc/mntent.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/misc/mntent.c b/src/misc/mntent.c index a16d6525..eabb8200 100644 --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -3,6 +3,11 @@ #include #include +static char *internal_buf; +static size_t internal_bufsize; + +#define SENTINEL (char *)&internal_buf + FILE *setmntent(const char *name, const char *mode) { return fopen(name, mode); @@ -16,13 +21,18 @@ int endmntent(FILE *f) struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int buflen) { - int cnt, n[8]; + int cnt, n[8], use_internal = (linebuf == SENTINEL); mnt->mnt_freq = 0; mnt->mnt_passno = 0; do { - fgets(linebuf, buflen, f); + if (use_internal) { + getline(&internal_buf, &internal_bufsize, f); + linebuf = internal_buf; + } else { + fgets(linebuf, buflen, f); + } if (feof(f) || ferror(f)) return 0; if (!strchr(linebuf, '\n')) { fscanf(f, "%*[^\n]%*[\n]"); @@ -49,9 +59,8 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle struct mntent *getmntent(FILE *f) { - static char linebuf[256]; static struct mntent mnt; - return getmntent_r(f, &mnt, linebuf, sizeof linebuf); + return getmntent_r(f, &mnt, SENTINEL, 0); } int addmntent(FILE *f, const struct mntent *mnt) From 2ed811a38a92e3710e0eba98b85ccd880ceb703d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 18:58:10 +0200 Subject: [PATCH 195/412] fix preadv2 and pwritev2 syscall numbers on x32 for linux v4.8 the numbers were wrong in musl, but they were also wrong in the kernel and got fixed in v4.8 commit 3ebfd81f7fb3e81a754e37283b7f38c62244641a --- arch/x32/bits/syscall.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index cf2b4f14..e94dcb2f 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -280,8 +280,6 @@ #define __NR_membarrier (0x40000000 + 324) #define __NR_mlock2 (0x40000000 + 325) #define __NR_copy_file_range (0x40000000 + 326) -#define __NR_preadv2 (0x40000000 + 327) -#define __NR_pwritev2 (0x40000000 + 328) #define __NR_rt_sigaction (0x40000000 + 512) #define __NR_rt_sigreturn (0x40000000 + 513) @@ -317,4 +315,6 @@ #define __NR_io_setup (0x40000000 + 543) #define __NR_io_submit (0x40000000 + 544) #define __NR_execveat (0x40000000 + 545) +#define __NR_preadv2 (0x40000000 + 546) +#define __NR_pwritev2 (0x40000000 + 547) From 189acc705ef8d9a0ae06152898fbb16fd6a2491a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 19:00:07 +0200 Subject: [PATCH 196/412] add sh syscall numbers from linux v4.8 sh was updated in linux commit 74bdaa611fa69368fb4032ad437af073d31116bd to have numbers for new syscalls. --- arch/sh/bits/syscall.h.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in index 595fc4d2..420f4a0f 100644 --- a/arch/sh/bits/syscall.h.in +++ b/arch/sh/bits/syscall.h.in @@ -338,4 +338,18 @@ #define __NR_process_vm_writev 366 #define __NR_kcmp 367 #define __NR_finit_module 368 +#define __NR_sched_getattr 369 +#define __NR_sched_setattr 370 +#define __NR_renameat2 371 +#define __NR_seccomp 372 +#define __NR_getrandom 373 +#define __NR_memfd_create 374 +#define __NR_bpf 375 +#define __NR_execveat 376 +#define __NR_userfaultfd 377 +#define __NR_membarrier 378 +#define __NR_mlock2 379 +#define __NR_copy_file_range 380 +#define __NR_preadv2 381 +#define __NR_pwritev2 382 From 9487cc5f2253b2fc82a3e19f3aaa0ade2a630de5 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 19:00:39 +0200 Subject: [PATCH 197/412] add ETH_P_NCSI to netinet/if_ether.h from linux v4.8 see linux commit 6389eaa7fa9c3ee6c7d39f6087b86660d17236ac --- include/netinet/if_ether.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 4c2322b3..05462c44 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -55,6 +55,7 @@ #define ETH_P_8021AH 0x88E7 #define ETH_P_MVRP 0x88F5 #define ETH_P_1588 0x88F7 +#define ETH_P_NCSI 0x88F8 #define ETH_P_PRP 0x88FB #define ETH_P_FCOE 0x8906 #define ETH_P_TDLS 0x890D From 5a05f67599ff06f9255aa4119cfecb85575d6e20 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 19:01:09 +0200 Subject: [PATCH 198/412] elf.h: update EM_ elf machine defines and add R_BPF_ defines sync with gabi: http://www.sco.com/developers/gabi/latest/ch4.eheader.html EM_BPF is new in linux v4.8 and officially assigned: https://lists.iovisor.org/pipermail/iovisor-dev/2016-June/000266.html added related relocs too. --- include/elf.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/include/elf.h index 0721d63f..e79915fe 100644 --- a/include/elf.h +++ b/include/elf.h @@ -212,13 +212,110 @@ typedef struct { #define EM_OR1K 92 #define EM_OPENRISC 92 #define EM_ARC_A5 93 +#define EM_ARC_COMPACT 93 #define EM_XTENSA 94 +#define EM_VIDEOCORE 95 +#define EM_TMM_GPP 96 +#define EM_NS32K 97 +#define EM_TPC 98 +#define EM_SNP1K 99 +#define EM_ST200 100 +#define EM_IP2K 101 +#define EM_MAX 102 +#define EM_CR 103 +#define EM_F2MC16 104 +#define EM_MSP430 105 +#define EM_BLACKFIN 106 +#define EM_SE_C33 107 +#define EM_SEP 108 +#define EM_ARCA 109 +#define EM_UNICORE 110 +#define EM_EXCESS 111 +#define EM_DXP 112 #define EM_ALTERA_NIOS2 113 +#define EM_CRX 114 +#define EM_XGATE 115 +#define EM_C166 116 +#define EM_M16C 117 +#define EM_DSPIC30F 118 +#define EM_CE 119 +#define EM_M32C 120 +#define EM_TSK3000 131 +#define EM_RS08 132 +#define EM_SHARC 133 +#define EM_ECOG2 134 +#define EM_SCORE7 135 +#define EM_DSP24 136 +#define EM_VIDEOCORE3 137 +#define EM_LATTICEMICO32 138 +#define EM_SE_C17 139 +#define EM_TI_C6000 140 +#define EM_TI_C2000 141 +#define EM_TI_C5500 142 +#define EM_TI_ARP32 143 +#define EM_TI_PRU 144 +#define EM_MMDSP_PLUS 160 +#define EM_CYPRESS_M8C 161 +#define EM_R32C 162 +#define EM_TRIMEDIA 163 +#define EM_QDSP6 164 +#define EM_8051 165 +#define EM_STXP7X 166 +#define EM_NDS32 167 +#define EM_ECOG1X 168 +#define EM_MAXQ30 169 +#define EM_XIMO16 170 +#define EM_MANIK 171 +#define EM_CRAYNV2 172 +#define EM_RX 173 +#define EM_METAG 174 +#define EM_MCST_ELBRUS 175 +#define EM_ECOG16 176 +#define EM_CR16 177 +#define EM_ETPU 178 +#define EM_SLE9X 179 +#define EM_L10M 180 +#define EM_K10M 181 #define EM_AARCH64 183 +#define EM_AVR32 185 +#define EM_STM8 186 +#define EM_TILE64 187 #define EM_TILEPRO 188 #define EM_MICROBLAZE 189 +#define EM_CUDA 190 #define EM_TILEGX 191 -#define EM_NUM 192 +#define EM_CLOUDSHIELD 192 +#define EM_COREA_1ST 193 +#define EM_COREA_2ND 194 +#define EM_ARC_COMPACT2 195 +#define EM_OPEN8 196 +#define EM_RL78 197 +#define EM_VIDEOCORE5 198 +#define EM_78KOR 199 +#define EM_56800EX 200 +#define EM_BA1 201 +#define EM_BA2 202 +#define EM_XCORE 203 +#define EM_MCHP_PIC 204 +#define EM_KM32 210 +#define EM_KMX32 211 +#define EM_EMX16 212 +#define EM_EMX8 213 +#define EM_KVARC 214 +#define EM_CDP 215 +#define EM_COGE 216 +#define EM_COOL 217 +#define EM_NORC 218 +#define EM_CSR_KALIMBA 219 +#define EM_Z80 220 +#define EM_VISIUM 221 +#define EM_FT32 222 +#define EM_MOXIE 223 +#define EM_AMDGPU 224 +#define EM_RISCV 243 +#define EM_BPF 247 +#define EM_NUM 248 + #define EM_ALPHA 0x9026 #define EV_NONE 0 @@ -3013,6 +3110,9 @@ enum #define R_OR1K_TLS_DTPOFF 33 #define R_OR1K_TLS_DTPMOD 34 +#define R_BPF_NONE 0 +#define R_BPF_MAP_FD 1 + #ifdef __cplusplus } #endif From fe39aaae0eafdab3340ea9a4c4b275c3528b4d75 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 20:42:02 +0200 Subject: [PATCH 199/412] add bits/hwcap.h and include it in sys/auxv.h aarch64, arm, mips, mips64, mipsn32, powerpc, powerpc64 and sh have cpu feature bits defined in linux for AT_HWCAP auxv entry, so expose those in sys/auxv.h it seems the mips hwcaps were never exposed to userspace neither by linux nor by glibc, but that's most likely an oversight. --- arch/aarch64/bits/hwcap.h | 11 ++++++++++ arch/arm/bits/hwcap.h | 29 +++++++++++++++++++++++++++ arch/generic/bits/hwcap.h | 0 arch/mips/bits/hwcap.h | 2 ++ arch/mips64/bits/hwcap.h | 2 ++ arch/mipsn32/bits/hwcap.h | 2 ++ arch/powerpc/bits/hwcap.h | 40 +++++++++++++++++++++++++++++++++++++ arch/powerpc64/bits/hwcap.h | 40 +++++++++++++++++++++++++++++++++++++ arch/sh/bits/hwcap.h | 11 ++++++++++ include/sys/auxv.h | 1 + 10 files changed, 138 insertions(+) create mode 100644 arch/aarch64/bits/hwcap.h create mode 100644 arch/arm/bits/hwcap.h create mode 100644 arch/generic/bits/hwcap.h create mode 100644 arch/mips/bits/hwcap.h create mode 100644 arch/mips64/bits/hwcap.h create mode 100644 arch/mipsn32/bits/hwcap.h create mode 100644 arch/powerpc/bits/hwcap.h create mode 100644 arch/powerpc64/bits/hwcap.h create mode 100644 arch/sh/bits/hwcap.h diff --git a/arch/aarch64/bits/hwcap.h b/arch/aarch64/bits/hwcap.h new file mode 100644 index 00000000..2b923f71 --- /dev/null +++ b/arch/aarch64/bits/hwcap.h @@ -0,0 +1,11 @@ +#define HWCAP_FP (1 << 0) +#define HWCAP_ASIMD (1 << 1) +#define HWCAP_EVTSTRM (1 << 2) +#define HWCAP_AES (1 << 3) +#define HWCAP_PMULL (1 << 4) +#define HWCAP_SHA1 (1 << 5) +#define HWCAP_SHA2 (1 << 6) +#define HWCAP_CRC32 (1 << 7) +#define HWCAP_ATOMICS (1 << 8) +#define HWCAP_FPHP (1 << 9) +#define HWCAP_ASIMDHP (1 << 10) diff --git a/arch/arm/bits/hwcap.h b/arch/arm/bits/hwcap.h new file mode 100644 index 00000000..ac4edeac --- /dev/null +++ b/arch/arm/bits/hwcap.h @@ -0,0 +1,29 @@ +#define HWCAP_SWP (1 << 0) +#define HWCAP_HALF (1 << 1) +#define HWCAP_THUMB (1 << 2) +#define HWCAP_26BIT (1 << 3) +#define HWCAP_FAST_MULT (1 << 4) +#define HWCAP_FPA (1 << 5) +#define HWCAP_VFP (1 << 6) +#define HWCAP_EDSP (1 << 7) +#define HWCAP_JAVA (1 << 8) +#define HWCAP_IWMMXT (1 << 9) +#define HWCAP_CRUNCH (1 << 10) +#define HWCAP_THUMBEE (1 << 11) +#define HWCAP_NEON (1 << 12) +#define HWCAP_VFPv3 (1 << 13) +#define HWCAP_VFPv3D16 (1 << 14) +#define HWCAP_TLS (1 << 15) +#define HWCAP_VFPv4 (1 << 16) +#define HWCAP_IDIVA (1 << 17) +#define HWCAP_IDIVT (1 << 18) +#define HWCAP_VFPD32 (1 << 19) +#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) +#define HWCAP_LPAE (1 << 20) +#define HWCAP_EVTSTRM (1 << 21) + +#define HWCAP2_AES (1 << 0) +#define HWCAP2_PMULL (1 << 1) +#define HWCAP2_SHA1 (1 << 2) +#define HWCAP2_SHA2 (1 << 3) +#define HWCAP2_CRC32 (1 << 4) diff --git a/arch/generic/bits/hwcap.h b/arch/generic/bits/hwcap.h new file mode 100644 index 00000000..e69de29b diff --git a/arch/mips/bits/hwcap.h b/arch/mips/bits/hwcap.h new file mode 100644 index 00000000..05cffba4 --- /dev/null +++ b/arch/mips/bits/hwcap.h @@ -0,0 +1,2 @@ +#define HWCAP_MIPS_R6 (1 << 0) +#define HWCAP_MIPS_MSA (1 << 1) diff --git a/arch/mips64/bits/hwcap.h b/arch/mips64/bits/hwcap.h new file mode 100644 index 00000000..05cffba4 --- /dev/null +++ b/arch/mips64/bits/hwcap.h @@ -0,0 +1,2 @@ +#define HWCAP_MIPS_R6 (1 << 0) +#define HWCAP_MIPS_MSA (1 << 1) diff --git a/arch/mipsn32/bits/hwcap.h b/arch/mipsn32/bits/hwcap.h new file mode 100644 index 00000000..05cffba4 --- /dev/null +++ b/arch/mipsn32/bits/hwcap.h @@ -0,0 +1,2 @@ +#define HWCAP_MIPS_R6 (1 << 0) +#define HWCAP_MIPS_MSA (1 << 1) diff --git a/arch/powerpc/bits/hwcap.h b/arch/powerpc/bits/hwcap.h new file mode 100644 index 00000000..82c92a93 --- /dev/null +++ b/arch/powerpc/bits/hwcap.h @@ -0,0 +1,40 @@ +#define PPC_FEATURE_32 0x80000000 +#define PPC_FEATURE_64 0x40000000 +#define PPC_FEATURE_601_INSTR 0x20000000 +#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 +#define PPC_FEATURE_HAS_FPU 0x08000000 +#define PPC_FEATURE_HAS_MMU 0x04000000 +#define PPC_FEATURE_HAS_4xxMAC 0x02000000 +#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 +#define PPC_FEATURE_HAS_SPE 0x00800000 +#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 +#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 +#define PPC_FEATURE_NO_TB 0x00100000 +#define PPC_FEATURE_POWER4 0x00080000 +#define PPC_FEATURE_POWER5 0x00040000 +#define PPC_FEATURE_POWER5_PLUS 0x00020000 +#define PPC_FEATURE_CELL 0x00010000 +#define PPC_FEATURE_BOOKE 0x00008000 +#define PPC_FEATURE_SMT 0x00004000 +#define PPC_FEATURE_ICACHE_SNOOP 0x00002000 +#define PPC_FEATURE_ARCH_2_05 0x00001000 +#define PPC_FEATURE_PA6T 0x00000800 +#define PPC_FEATURE_HAS_DFP 0x00000400 +#define PPC_FEATURE_POWER6_EXT 0x00000200 +#define PPC_FEATURE_ARCH_2_06 0x00000100 +#define PPC_FEATURE_HAS_VSX 0x00000080 +#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040 + +#define PPC_FEATURE_TRUE_LE 0x00000002 +#define PPC_FEATURE_PPC_LE 0x00000001 + +#define PPC_FEATURE2_ARCH_2_07 0x80000000 +#define PPC_FEATURE2_HTM 0x40000000 +#define PPC_FEATURE2_DSCR 0x20000000 +#define PPC_FEATURE2_EBB 0x10000000 +#define PPC_FEATURE2_ISEL 0x08000000 +#define PPC_FEATURE2_TAR 0x04000000 +#define PPC_FEATURE2_VEC_CRYPTO 0x02000000 +#define PPC_FEATURE2_HTM_NOSC 0x01000000 +#define PPC_FEATURE2_ARCH_3_00 0x00800000 +#define PPC_FEATURE2_HAS_IEEE128 0x00400000 diff --git a/arch/powerpc64/bits/hwcap.h b/arch/powerpc64/bits/hwcap.h new file mode 100644 index 00000000..82c92a93 --- /dev/null +++ b/arch/powerpc64/bits/hwcap.h @@ -0,0 +1,40 @@ +#define PPC_FEATURE_32 0x80000000 +#define PPC_FEATURE_64 0x40000000 +#define PPC_FEATURE_601_INSTR 0x20000000 +#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 +#define PPC_FEATURE_HAS_FPU 0x08000000 +#define PPC_FEATURE_HAS_MMU 0x04000000 +#define PPC_FEATURE_HAS_4xxMAC 0x02000000 +#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 +#define PPC_FEATURE_HAS_SPE 0x00800000 +#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 +#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 +#define PPC_FEATURE_NO_TB 0x00100000 +#define PPC_FEATURE_POWER4 0x00080000 +#define PPC_FEATURE_POWER5 0x00040000 +#define PPC_FEATURE_POWER5_PLUS 0x00020000 +#define PPC_FEATURE_CELL 0x00010000 +#define PPC_FEATURE_BOOKE 0x00008000 +#define PPC_FEATURE_SMT 0x00004000 +#define PPC_FEATURE_ICACHE_SNOOP 0x00002000 +#define PPC_FEATURE_ARCH_2_05 0x00001000 +#define PPC_FEATURE_PA6T 0x00000800 +#define PPC_FEATURE_HAS_DFP 0x00000400 +#define PPC_FEATURE_POWER6_EXT 0x00000200 +#define PPC_FEATURE_ARCH_2_06 0x00000100 +#define PPC_FEATURE_HAS_VSX 0x00000080 +#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040 + +#define PPC_FEATURE_TRUE_LE 0x00000002 +#define PPC_FEATURE_PPC_LE 0x00000001 + +#define PPC_FEATURE2_ARCH_2_07 0x80000000 +#define PPC_FEATURE2_HTM 0x40000000 +#define PPC_FEATURE2_DSCR 0x20000000 +#define PPC_FEATURE2_EBB 0x10000000 +#define PPC_FEATURE2_ISEL 0x08000000 +#define PPC_FEATURE2_TAR 0x04000000 +#define PPC_FEATURE2_VEC_CRYPTO 0x02000000 +#define PPC_FEATURE2_HTM_NOSC 0x01000000 +#define PPC_FEATURE2_ARCH_3_00 0x00800000 +#define PPC_FEATURE2_HAS_IEEE128 0x00400000 diff --git a/arch/sh/bits/hwcap.h b/arch/sh/bits/hwcap.h new file mode 100644 index 00000000..f85121d0 --- /dev/null +++ b/arch/sh/bits/hwcap.h @@ -0,0 +1,11 @@ +#define CPU_HAS_FPU 0x0001 +#define CPU_HAS_P2_FLUSH_BUG 0x0002 +#define CPU_HAS_MMU_PAGE_ASSOC 0x0004 +#define CPU_HAS_DSP 0x0008 +#define CPU_HAS_PERF_COUNTER 0x0010 +#define CPU_HAS_PTEA 0x0020 +#define CPU_HAS_LLSC 0x0040 +#define CPU_HAS_L2_CACHE 0x0080 +#define CPU_HAS_OP32 0x0100 +#define CPU_HAS_PTEAEX 0x0200 +#define CPU_HAS_CAS_L 0x0400 diff --git a/include/sys/auxv.h b/include/sys/auxv.h index 6dcf9adc..ddccf57f 100644 --- a/include/sys/auxv.h +++ b/include/sys/auxv.h @@ -6,6 +6,7 @@ extern "C" { #endif #include +#include unsigned long getauxval(unsigned long); From cc7c95e98e4822f165835aa956adad33d3c1fbd0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 19:02:08 +0200 Subject: [PATCH 200/412] add TCP_REPAIR_WINDOW to netinet/tcp.h from linux v4.8 another kernel internal state exposure for checkpoint-restore. see linux commit b1ed4c4fa9a5ccf325184fd90edc50978ef6e33a --- include/netinet/tcp.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 9ea64c45..b9b8a7fa 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -30,6 +30,7 @@ #define TCP_CC_INFO 26 #define TCP_SAVE_SYN 27 #define TCP_SAVED_SYN 28 +#define TCP_REPAIR_WINDOW 29 #define TCP_ESTABLISHED 1 #define TCP_SYN_SENT 2 @@ -199,6 +200,14 @@ struct tcp_md5sig { uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; }; +struct tcp_repair_window { + uint32_t snd_wl1; + uint32_t snd_wnd; + uint32_t max_window; + uint32_t rcv_wnd; + uint32_t rcv_wup; +}; + #endif #endif From 87643335ac699b14527bbf807956cf8911b86bfa Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Oct 2016 19:02:30 +0200 Subject: [PATCH 201/412] update icmphdr struct following linux v4.8 add union field that is used in the kernel for SIT/GRE tunneling ICMPv4 messages. see linux commit 20e1954fe238dbe5f8d3a979e593fe352bd703cf --- include/netinet/ip_icmp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/ip_icmp.h b/include/netinet/ip_icmp.h index 2f4a86dd..b9e0df89 100644 --- a/include/netinet/ip_icmp.h +++ b/include/netinet/ip_icmp.h @@ -23,6 +23,7 @@ struct icmphdr { uint16_t __unused; uint16_t mtu; } frag; + uint8_t reserved[4]; } un; }; From 688d3da0f1730daddbc954bbc2d27cc96ceee04c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 4 Oct 2016 03:58:56 +0200 Subject: [PATCH 202/412] math: fix pow signed shift ub j is int32_t and thus j<<31 is undefined if j==1, so j is changed to uint32_t locally as a quick fix, the generated code is not affected. (this is a strict conformance fix, future c standard may allow 1<<31, see DR 463. the bug was inherited from freebsd fdlibm, the proper fix is to use uint32_t for all bit hacks, but that requires more intrusive changes.) reported by Daniel Sabogal --- src/math/pow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/pow.c b/src/math/pow.c index b66f632d..3ddc1b6f 100644 --- a/src/math/pow.c +++ b/src/math/pow.c @@ -125,11 +125,11 @@ double pow(double x, double y) else if (iy >= 0x3ff00000) { k = (iy>>20) - 0x3ff; /* exponent */ if (k > 20) { - j = ly>>(52-k); + uint32_t j = ly>>(52-k); if ((j<<(52-k)) == ly) yisint = 2 - (j&1); } else if (ly == 0) { - j = iy>>(20-k); + uint32_t j = iy>>(20-k); if ((j<<(20-k)) == iy) yisint = 2 - (j&1); } From 3ca2d2d4aef910663785fe232d7d2127a22d8a84 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Sat, 17 Sep 2016 12:05:45 -0400 Subject: [PATCH 203/412] fix clock_nanosleep error case posix requires that EINVAL be returned if the first parameter specifies the cpu-time clock of the calling thread (CLOCK_THREAD_CPUTIME_ID). linux returns ENOTSUP instead so we handle this. --- src/time/clock_nanosleep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/time/clock_nanosleep.c b/src/time/clock_nanosleep.c index ec87b9e3..9e4d9f1f 100644 --- a/src/time/clock_nanosleep.c +++ b/src/time/clock_nanosleep.c @@ -1,8 +1,10 @@ #include +#include #include "syscall.h" #include "libc.h" int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem) { - return -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem); + int r = -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem); + return clk == CLOCK_THREAD_CPUTIME_ID ? EINVAL : r; } From 8fb28b0b3e7a5e958fb844722a4b2ef9bc244af1 Mon Sep 17 00:00:00 2001 From: Felix Janda Date: Fri, 16 Sep 2016 20:54:00 -0400 Subject: [PATCH 204/412] add pthread_setname_np the thread name is displayed by gdb's "info threads". --- include/pthread.h | 1 + src/thread/pthread_setname_np.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/thread/pthread_setname_np.c diff --git a/include/pthread.h b/include/pthread.h index 3d2e0c45..94ef919c 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -214,6 +214,7 @@ struct cpu_set_t; int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); int pthread_getattr_np(pthread_t, pthread_attr_t *); +int pthread_setname_np(pthread_t, const char *); int pthread_tryjoin_np(pthread_t, void **); int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); #endif diff --git a/src/thread/pthread_setname_np.c b/src/thread/pthread_setname_np.c new file mode 100644 index 00000000..82d35e17 --- /dev/null +++ b/src/thread/pthread_setname_np.c @@ -0,0 +1,26 @@ +#define _GNU_SOURCE +#include +#include +#include +#include + +#include "pthread_impl.h" + +int pthread_setname_np(pthread_t thread, const char *name) +{ + int fd, cs, status = 0; + char f[sizeof "/proc/self/task//comm" + 3*sizeof(int)]; + size_t len; + + if ((len = strnlen(name, 16)) > 15) return ERANGE; + + if (thread == pthread_self()) + return prctl(PR_SET_NAME, (unsigned long)name, 0UL, 0UL, 0UL) ? errno : 0; + + snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); + if ((fd = open(f, O_WRONLY)) < 0 || write(fd, name, len) < 0) status = errno; + if (fd >= 0) close(fd); + pthread_setcancelstate(cs, 0); + return status; +} From 51ab6db4ed115d079d7131975e4adb074ba9ef9d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 12 Oct 2016 00:49:59 +0200 Subject: [PATCH 205/412] fix float formatting of some exact halfway cases in nearest rounding mode exact halfway cases were not following the round to even rule if the rounding happened at a base 1000000000 digit boundary of the internal representation and the previous digit was odd. e.g. printf("%.0f", 1.5) printed 1 instead of 2. --- src/stdio/vfprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index e2ab2dc6..60da14d8 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -345,7 +345,8 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) if (x || d+1!=z) { long double round = 2/LDBL_EPSILON; long double small; - if (*d/i & 1) round += 2; + if ((*d/i & 1) || (i==1000000000 && d>a && (d[-1]&1))) + round += 2; if (x Date: Thu, 20 Oct 2016 12:13:33 -0400 Subject: [PATCH 206/412] fix getopt_long_only misinterpreting "--" as an option --- src/misc/getopt_long.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c index 480c0013..c6e14625 100644 --- a/src/misc/getopt_long.c +++ b/src/misc/getopt_long.c @@ -53,7 +53,7 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring { optarg = 0; if (longopts && argv[optind][0] == '-' && - ((longonly && argv[optind][1]) || + ((longonly && argv[optind][1] && argv[optind][1] != '-') || (argv[optind][1] == '-' && argv[optind][2]))) { int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':'; From f33b17585058381491e6fda08f491b8e48c7980c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 20 Oct 2016 13:22:20 -0400 Subject: [PATCH 207/412] fix gratuitous undefined behavior in strptime accessing an object of type const char *restrict as if it had type char * is not defined. --- src/time/strptime.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/time/strptime.c b/src/time/strptime.c index f41f55f2..55c7ed1b 100644 --- a/src/time/strptime.c +++ b/src/time/strptime.c @@ -22,8 +22,13 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri } f++; if (*f == '+') f++; - if (isdigit(*f)) w=strtoul(f, (void *)&f, 10); - else w=-1; + if (isdigit(*f)) { + char *new_f; + w=strtoul(f, &new_f, 10); + f = new_f; + } else { + w=-1; + } adj=0; switch (*f++) { case 'a': case 'A': From d184a09e0529f33d8ddddb8825039133483a2c41 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 4 Sep 2016 04:46:00 +0200 Subject: [PATCH 208/412] fix strtod and strtof rounding with many trailing zeros in certain cases excessive trailing zeros could cause incorrect rounding from long double to double or float in decfloat. e.g. in strtof("9444733528689243848704.000000", 0) the argument is 0x1.000001p+73, exactly halfway between two representible floats, this incorrectly got rounded to 0x1.000002p+73 instead of 0x1p+73, but with less trailing 0 the rounding was fine. the fix makes sure that the z index always points one past the last non-zero digit in the base 10^9 representation, this way trailing zeros don't affect the rounding logic. --- src/internal/floatscan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c index eef70df9..80305ee6 100644 --- a/src/internal/floatscan.c +++ b/src/internal/floatscan.c @@ -172,6 +172,9 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po return sign * (long double)x[0] * p10s[rp-10]; } + /* Drop trailing zeros */ + for (; !x[z-1]; z--); + /* Align radix point to B1B digit boundary */ if (rp % 9) { int rpm9 = rp>=0 ? rp%9 : rp%9+9; From 6ffdc4579ffb34f4aab69ab4c081badabc7c0a9a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 4 Sep 2016 04:51:03 +0200 Subject: [PATCH 209/412] fix strtod int optimization in non-nearest rounding mode the mid-sized integer optimization relies on lnz set up properly to mark the last non-zero decimal digit, but this was not done if the non-zero digit lied outside the KMAX digits of the base 10^9 number representation. so if the fractional part was a very long list of zeros (>2048*9 on x86) followed by non-zero digits then the integer optimization could kick in discarding the tiny non-zero fraction which can mean wrong result on non-nearest rounding mode. strtof, strtod and strtold were all affected. --- src/internal/floatscan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c index 80305ee6..ae098526 100644 --- a/src/internal/floatscan.c +++ b/src/internal/floatscan.c @@ -110,7 +110,10 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po gotdig=1; } else { dc++; - if (c!='0') x[KMAX-4] |= 1; + if (c!='0') { + lnz = dc; + x[KMAX-4] |= 1; + } } } if (!gotrad) lrp=dc; From e314258e2fe75b7443db84d2927315dea0f337c8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 20 Oct 2016 14:40:59 -0400 Subject: [PATCH 210/412] fix minor problem in previous strtod non-nearest rounding bug fix commit 6ffdc4579ffb34f4aab69ab4c081badabc7c0a9a set lnz in the code path for non-zero digits after a huge string of zeros, but the assignment of dc to lnz truncates if the value of dc does not fit in int; this is possible for some pathologically long inputs, either via strings on 64-bit systems or via scanf-family functions. instead, simply set lnz to match the point at which we add the artificial trailing 1 bit to simulate nonzero digits after a huge run of zeros. --- src/internal/floatscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c index ae098526..278bf250 100644 --- a/src/internal/floatscan.c +++ b/src/internal/floatscan.c @@ -111,7 +111,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po } else { dc++; if (c!='0') { - lnz = dc; + lnz = (KMAX-4)*9; x[KMAX-4] |= 1; } } From 104e8a0e3b30f6dda6ce9c1b901a6bb8ee046616 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Sun, 4 Sep 2016 10:42:47 -0400 Subject: [PATCH 211/412] add missing confstr constants the _CS_V6_ENV and _CS_V7_ENV constants are required to be available for use with confstr. glibc defines these constants with values 1148 and 1149, respectively. the only missing (and required) confstr constants are _CS_POSIX_V7_THREADS_CFLAGS and _CS_POSIX_V7_THREADS_LDFLAGS which remain unavailable in glibc. --- include/unistd.h | 2 ++ src/conf/confstr.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/unistd.h b/include/unistd.h index 760a1652..2c355880 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -457,6 +457,8 @@ int eaccess(const char *, int); #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 1145 #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 1146 #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147 +#define _CS_V6_ENV 1148 +#define _CS_V7_ENV 1149 #ifdef __cplusplus } diff --git a/src/conf/confstr.c b/src/conf/confstr.c index 6e9c23a0..02cb1aa2 100644 --- a/src/conf/confstr.c +++ b/src/conf/confstr.c @@ -7,7 +7,7 @@ size_t confstr(int name, char *buf, size_t len) const char *s = ""; if (!name) { s = "/bin:/usr/bin"; - } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>31U) { + } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) { errno = EINVAL; return 0; } From 1fa2a32d1e2d25f493058812008face73d411b2b Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Sun, 4 Sep 2016 10:42:48 -0400 Subject: [PATCH 212/412] fix typo in utmpx.h --- include/utmpx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/utmpx.h b/include/utmpx.h index 9e5cc955..0429014d 100644 --- a/include/utmpx.h +++ b/include/utmpx.h @@ -38,7 +38,7 @@ struct utmpx *getutxline(const struct utmpx *); struct utmpx *pututxline(const struct utmpx *); void setutxent(void); -#if defined(_BSD_SOURCE) | defined(_GNU_SOURCE) +#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define e_exit __e_exit #define e_termination __e_termination void updwtmpx(const char *, const struct utmpx *); From 79c7ded0edaa0b3ab3fc95bf3b76a9e67683454a Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Sun, 4 Sep 2016 22:30:42 -0400 Subject: [PATCH 213/412] add missing if_arp.h constant ARPHRD_6LOWPAN (IPv6 over LoWPAN) added in linux 3.14 commit 0abc652c796dab74d34d60473ec5594cd21620be --- include/net/if_arp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/if_arp.h b/include/net/if_arp.h index 18d5dcf9..361ecfc9 100644 --- a/include/net/if_arp.h +++ b/include/net/if_arp.h @@ -91,6 +91,7 @@ struct arphdr { #define ARPHRD_CAIF 822 #define ARPHRD_IP6GRE 823 #define ARPHRD_NETLINK 824 +#define ARPHRD_6LOWPAN 825 #define ARPHRD_VOID 0xFFFF #define ARPHRD_NONE 0xFFFE From 71e83927654d1df0afa0d8f4f69391659321ddb0 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Sun, 4 Sep 2016 22:30:43 -0400 Subject: [PATCH 214/412] add missing if_ether.h constants ETH_P_HSR (IEC 62439-3 HSRv1) added in linux 4.7 commit ee1c27977284907d40f7f72c2d078d709f15811f ETH_P_TSN (IEEE 1722) added in linux 4.3 commit 1ab1e895492d8084dfc1c854efacde219e56b8c1 this constant breaks the ascending order to match the kernel header ETH_P_XDSA (Multiplexed DSA protocol) added in linux 3.18 commit 3e8a72d1dae374cf6fc1dba97cec663585845ff9 --- include/netinet/if_ether.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 05462c44..11ee6582 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -14,6 +14,7 @@ #define ETH_P_LOOP 0x0060 #define ETH_P_PUP 0x0200 #define ETH_P_PUPAT 0x0201 +#define ETH_P_TSN 0x22F0 #define ETH_P_IP 0x0800 #define ETH_P_X25 0x0805 #define ETH_P_ARP 0x0806 @@ -61,6 +62,7 @@ #define ETH_P_TDLS 0x890D #define ETH_P_FIP 0x8914 #define ETH_P_80221 0x8917 +#define ETH_P_HSR 0x892F #define ETH_P_LOOPBACK 0x9000 #define ETH_P_QINQ1 0x9100 #define ETH_P_QINQ2 0x9200 @@ -94,6 +96,7 @@ #define ETH_P_PHONET 0x00F5 #define ETH_P_IEEE802154 0x00F6 #define ETH_P_CAIF 0x00F7 +#define ETH_P_XDSA 0x00F8 struct ethhdr { uint8_t h_dest[ETH_ALEN]; From 4b8f94c2501e6fea3db631b73b0c91e34e2134cf Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 20 Oct 2016 17:01:56 -0400 Subject: [PATCH 215/412] fix misspelling of a legacy macro name in sys/param.h --- include/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/param.h b/include/sys/param.h index 344c0d23..ce6b8019 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -7,7 +7,7 @@ #define MAXPATHLEN 4096 #define NBBY 8 #define NGROUPS 32 -#define CANBSIZE 255 +#define CANBSIZ 255 #define NOFILE 256 #define NCARGS 131072 #define DEV_BSIZE 512 From 2ed4e9d9279117ffa50294095e172804cd1b68e5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 20 Oct 2016 17:04:37 -0400 Subject: [PATCH 216/412] remove parameter names from public headers inclusion of these names was unintentional and in most cases is a namespace violation. Daniel Sabogal tracked down and reported these. --- include/grp.h | 2 +- include/ifaddrs.h | 4 ++-- include/stdlib.h | 2 +- include/sys/xattr.h | 4 ++-- include/threads.h | 2 +- include/wchar.h | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/grp.h b/include/grp.h index 358181bf..d8581409 100644 --- a/include/grp.h +++ b/include/grp.h @@ -34,7 +34,7 @@ void endgrent(void); void setgrent(void); #ifdef _GNU_SOURCE -struct group *fgetgrent(FILE *stream); +struct group *fgetgrent(FILE *); int putgrent(const struct group *, FILE *); #endif diff --git a/include/ifaddrs.h b/include/ifaddrs.h index 4726db6e..c0328a8e 100644 --- a/include/ifaddrs.h +++ b/include/ifaddrs.h @@ -24,8 +24,8 @@ struct ifaddrs { #define ifa_broadaddr ifa_ifu.ifu_broadaddr #define ifa_dstaddr ifa_ifu.ifu_dstaddr -void freeifaddrs(struct ifaddrs *ifp); -int getifaddrs(struct ifaddrs **ifap); +void freeifaddrs(struct ifaddrs *); +int getifaddrs(struct ifaddrs **); #ifdef __cplusplus } diff --git a/include/stdlib.h b/include/stdlib.h index d2c911fc..42ca8336 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -39,7 +39,7 @@ void *malloc (size_t); void *calloc (size_t, size_t); void *realloc (void *, size_t); void free (void *); -void *aligned_alloc(size_t alignment, size_t size); +void *aligned_alloc(size_t, size_t); _Noreturn void abort (void); int atexit (void (*) (void)); diff --git a/include/sys/xattr.h b/include/sys/xattr.h index f926493c..6479fcc6 100644 --- a/include/sys/xattr.h +++ b/include/sys/xattr.h @@ -13,10 +13,10 @@ extern "C" { ssize_t getxattr(const char *, const char *, void *, size_t); ssize_t lgetxattr(const char *, const char *, void *, size_t); -ssize_t fgetxattr(int filedes, const char *, void *, size_t); +ssize_t fgetxattr(int, const char *, void *, size_t); ssize_t listxattr(const char *, char *, size_t); ssize_t llistxattr(const char *, char *, size_t); -ssize_t flistxattr(int filedes, char *, size_t); +ssize_t flistxattr(int, char *, size_t); int setxattr(const char *, const char *, const void *, size_t, int); int lsetxattr(const char *, const char *, const void *, size_t, int); int fsetxattr(int, const char *, const void *, size_t, int); diff --git a/include/threads.h b/include/threads.h index 01794826..8122b3b1 100644 --- a/include/threads.h +++ b/include/threads.h @@ -75,7 +75,7 @@ int cnd_timedwait(cnd_t *__restrict, mtx_t *__restrict, const struct timespec *_ int cnd_wait(cnd_t *, mtx_t *); int tss_create(tss_t *, tss_dtor_t); -void tss_delete(tss_t key); +void tss_delete(tss_t); int tss_set(tss_t, void *); void *tss_get(tss_t); diff --git a/include/wchar.h b/include/wchar.h index 3e6db5fc..369b1e9f 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -53,7 +53,7 @@ int wcscmp (const wchar_t *, const wchar_t *); int wcsncmp (const wchar_t *, const wchar_t *, size_t); int wcscoll(const wchar_t *, const wchar_t *); -size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t n); +size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t); wchar_t *wcschr (const wchar_t *, wchar_t); wchar_t *wcsrchr (const wchar_t *, wchar_t); @@ -165,7 +165,7 @@ int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); -size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t n, locale_t); +size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t, locale_t); #endif #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) From 7597fc25a2743d49500926a286da71f8e033936c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 20 Oct 2016 17:20:01 -0400 Subject: [PATCH 217/412] fix various header namespace issues under feature-test-macro control reported and changes suggested by Daniel Sabogal. --- include/dirent.h | 7 +++++-- include/grp.h | 2 ++ include/pwd.h | 2 ++ include/sys/stat.h | 7 +++++-- include/time.h | 3 ++- include/unistd.h | 4 ++-- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/include/dirent.h b/include/dirent.h index 006a360e..88d3c3cf 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -33,13 +33,16 @@ DIR *opendir(const char *); struct dirent *readdir(DIR *); int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict); void rewinddir(DIR *); -void seekdir(DIR *, long); -long telldir(DIR *); int dirfd(DIR *); int alphasort(const struct dirent **, const struct dirent **); int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +void seekdir(DIR *, long); +long telldir(DIR *); +#endif + #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define DT_UNKNOWN 0 #define DT_FIFO 1 diff --git a/include/grp.h b/include/grp.h index d8581409..27e8c5e6 100644 --- a/include/grp.h +++ b/include/grp.h @@ -29,9 +29,11 @@ struct group *getgrnam(const char *); int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) struct group *getgrent(void); void endgrent(void); void setgrent(void); +#endif #ifdef _GNU_SOURCE struct group *fgetgrent(FILE *); diff --git a/include/pwd.h b/include/pwd.h index 07a5871d..4f470b55 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -27,9 +27,11 @@ struct passwd { char *pw_shell; }; +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) void setpwent (void); void endpwent (void); struct passwd *getpwent (void); +#endif struct passwd *getpwuid (uid_t); struct passwd *getpwnam (const char *); diff --git a/include/sys/stat.h b/include/sys/stat.h index 82a64904..9d096624 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -79,12 +79,15 @@ int fchmod(int, mode_t); int fchmodat(int, const char *, mode_t, int); mode_t umask(mode_t); int mkdir(const char *, mode_t); -int mknod(const char *, mode_t, dev_t); int mkfifo(const char *, mode_t); int mkdirat(int, const char *, mode_t); -int mknodat(int, const char *, mode_t, dev_t); int mkfifoat(int, const char *, mode_t); +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +int mknod(const char *, mode_t, dev_t); +int mknodat(int, const char *, mode_t, dev_t); +#endif + int futimens(int, const struct timespec [2]); int utimensat(int, const char *, const struct timespec [2], int); diff --git a/include/time.h b/include/time.h index a408679c..672b3fc3 100644 --- a/include/time.h +++ b/include/time.h @@ -111,6 +111,8 @@ int timer_settime (timer_t, int, const struct itimerspec *__restrict, struct iti int timer_gettime (timer_t, struct itimerspec *); int timer_getoverrun (timer_t); +extern char *tzname[2]; + #endif @@ -118,7 +120,6 @@ int timer_getoverrun (timer_t); char *strptime (const char *__restrict, const char *__restrict, struct tm *__restrict); extern int daylight; extern long timezone; -extern char *tzname[2]; extern int getdate_err; struct tm *getdate (const char *); #endif diff --git a/include/unistd.h b/include/unistd.h index 2c355880..09190af4 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -110,10 +110,8 @@ gid_t getgid(void); gid_t getegid(void); int getgroups(int, gid_t []); int setuid(uid_t); -int setreuid(uid_t, uid_t); int seteuid(uid_t); int setgid(gid_t); -int setregid(gid_t, gid_t); int setegid(gid_t); char *getlogin(void); @@ -136,6 +134,8 @@ size_t confstr(int, char *, size_t); #define F_TEST 3 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +int setreuid(uid_t, uid_t); +int setregid(gid_t, gid_t); int lockf(int, int, off_t); long gethostid(void); int nice(int); From ed8696742504b6182954254e78ec123c8bcd8d3b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 21 Oct 2016 20:57:15 -0400 Subject: [PATCH 218/412] redesign snprintf without undefined behavior the old snprintf design setup the FILE buffer pointers to point directly into the destination buffer; if n was actually larger than the buffer size, the pointer arithmetic to compute the buffer end pointer was undefined. this affected sprintf, which is implemented in terms of snprintf, as well as some unusual but valid direct uses of snprintf. instead, setup the FILE as unbuffered and have its write function memcpy to the destination. the printf core sets up its own temporary buffer for unbuffered streams. --- src/stdio/vsnprintf.c | 63 ++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/src/stdio/vsnprintf.c b/src/stdio/vsnprintf.c index be2c44eb..b3510a63 100644 --- a/src/stdio/vsnprintf.c +++ b/src/stdio/vsnprintf.c @@ -4,39 +4,52 @@ #include #include +struct cookie { + char *s; + size_t n; +}; + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + static size_t sn_write(FILE *f, const unsigned char *s, size_t l) { - size_t k = f->wend - f->wpos; - if (k > l) k = l; - memcpy(f->wpos, s, k); - f->wpos += k; - /* pretend to succeed, but discard extra data */ + struct cookie *c = f->cookie; + size_t k = MIN(c->n, f->wpos - f->wbase); + if (k) { + memcpy(c->s, f->wbase, k); + c->s += k; + c->n -= k; + } + k = MIN(c->n, l); + if (k) { + memcpy(c->s, s, k); + c->s += k; + c->n -= k; + } + *c->s = 0; + f->wpos = f->wbase = f->buf; + /* pretend to succeed, even if we discarded extra data */ return l; } int vsnprintf(char *restrict s, size_t n, const char *restrict fmt, va_list ap) { - int r; - char b; - FILE f = { .lbf = EOF, .write = sn_write, .lock = -1 }; + unsigned char buf[1]; + char dummy[1]; + struct cookie c = { .s = n ? s : dummy, .n = n ? n-1 : 0 }; + FILE f = { + .lbf = EOF, + .write = sn_write, + .lock = -1, + .buf = buf, + .cookie = &c, + }; - if (n-1 > INT_MAX-1) { - if (n) { - errno = EOVERFLOW; - return -1; - } - s = &b; - n = 1; + if (n > INT_MAX) { + errno = EOVERFLOW; + return -1; } - /* Ensure pointers don't wrap if "infinite" n is passed in */ - if (n > (char *)0+SIZE_MAX-s-1) n = (char *)0+SIZE_MAX-s-1; - f.buf_size = n; - f.buf = f.wpos = (void *)s; - f.wbase = f.wend = (void *)(s+n); - r = vfprintf(&f, fmt, ap); - - /* Null-terminate, overwriting last char if dest buffer is full */ - if (n) f.wpos[-(f.wpos == f.wend)] = 0; - return r; + *c.s = 0; + return vfprintf(&f, fmt, ap); } From 7352b59d68aa6d931f9f882b2e0f9de6314d733f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 7 Nov 2016 11:49:22 -0500 Subject: [PATCH 219/412] remove redundant feature test macro checks in sys/time.h this header is XSI-shaded itself and thus does not need to limit specific content to _XOPEN_SOURCE. --- include/sys/time.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/sys/time.h b/include/sys/time.h index e4b379ae..c5cab814 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -10,9 +10,6 @@ extern "C" { int gettimeofday (struct timeval *__restrict, void *__restrict); -#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ - || defined(_BSD_SOURCE) - #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 @@ -26,8 +23,6 @@ int getitimer (int, struct itimerval *); int setitimer (int, const struct itimerval *__restrict, struct itimerval *__restrict); int utimes (const char *, const struct timeval [2]); -#endif - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) struct timezone { int tz_minuteswest; From 8ca27ac4bfe73bff785d0c26c1de0da92b55e5c6 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Mon, 24 Oct 2016 13:12:24 +0300 Subject: [PATCH 220/412] fix parsing of quoted time zone names Fix parsing of the < > quoted time zone names. Compare the correct character instead of repeatedly comparing the first character. --- src/time/__tz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/time/__tz.c b/src/time/__tz.c index 8b84b9bd..0e0c4ea2 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -84,7 +84,7 @@ static void getname(char *d, const char **p) int i; if (**p == '<') { ++*p; - for (i=0; **p!='>' && i Date: Mon, 7 Nov 2016 11:55:53 -0500 Subject: [PATCH 221/412] don't claim support for resolv.h APIs that aren't supported the value 19991006 for __RES implies availability of res_ninit and related functions that take a resolver state argument; these are not supported since our resolver is stateless. instead claim support for just the older API by defining __RES to 19960801. based on patch by Dmitrij D. Czarkoff. --- include/resolv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/resolv.h b/include/resolv.h index e12cb3c7..8b23ad66 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -61,7 +61,7 @@ typedef struct __res_state { } _u; } *res_state; -#define __RES 19991006 +#define __RES 19960801 #ifndef _PATH_RESCONF #define _PATH_RESCONF "/etc/resolv.conf" From 86e8cc0fd46f5789e80a16d68ae86f7358f64705 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 1 Nov 2016 02:44:56 +0100 Subject: [PATCH 222/412] fix accidental global static pointer in ldso this was harmless as load_library is not called concurrently, but it used one word of bss. --- ldso/dynlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index e458f386..d11776dc 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -905,8 +905,9 @@ static struct dso *load_library(const char *name, struct dso *needed_by) /* Catch and block attempts to reload the implementation itself */ if (name[0]=='l' && name[1]=='i' && name[2]=='b') { - static const char *rp, reserved[] = + static const char reserved[] = "c\0pthread\0rt\0m\0dl\0util\0xnet\0"; + const char *rp; char *z = strchr(name, '.'); if (z) { size_t l = z-name; From 5ffe515ca485c8e6e57cd5acda6bc6008f85660c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 1 Nov 2016 02:49:09 +0100 Subject: [PATCH 223/412] fix ldso reserved library name handling If a DT_NEEDED entry was the prefix of a reserved library name (up to the first dot) then it was incorrectly treated as a libc reserved name. e.g. libp.so dependency was not loaded as it matched libpthread reserved name. --- ldso/dynlink.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index d11776dc..acb73bc2 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -906,27 +906,27 @@ static struct dso *load_library(const char *name, struct dso *needed_by) /* Catch and block attempts to reload the implementation itself */ if (name[0]=='l' && name[1]=='i' && name[2]=='b') { static const char reserved[] = - "c\0pthread\0rt\0m\0dl\0util\0xnet\0"; - const char *rp; - char *z = strchr(name, '.'); - if (z) { - size_t l = z-name; - for (rp=reserved; *rp && strncmp(name+3, rp, l-3); rp+=strlen(rp)+1); - if (*rp) { - if (ldd_mode) { - /* Track which names have been resolved - * and only report each one once. */ - static unsigned reported; - unsigned mask = 1U<<(rp-reserved); - if (!(reported & mask)) { - reported |= mask; - dprintf(1, "\t%s => %s (%p)\n", - name, ldso.name, - ldso.base); - } + "c.pthread.rt.m.dl.util.xnet."; + const char *rp, *next; + for (rp=reserved; *rp; rp=next) { + next = strchr(rp, '.') + 1; + if (strncmp(name+3, rp, next-rp) == 0) + break; + } + if (*rp) { + if (ldd_mode) { + /* Track which names have been resolved + * and only report each one once. */ + static unsigned reported; + unsigned mask = 1U<<(rp-reserved); + if (!(reported & mask)) { + reported |= mask; + dprintf(1, "\t%s => %s (%p)\n", + name, ldso.name, + ldso.base); } - is_self = 1; } + is_self = 1; } } if (!strcmp(name, ldso.name)) is_self = 1; From bc1e7731cee963e422575f81048792f4d5db9641 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Wed, 2 Nov 2016 22:29:36 -0400 Subject: [PATCH 224/412] fix integer overflow of tm_year in __secs_to_tm the overflow check for years+100 did not account for the extra year computed from the remaining months. instead, perform this check after obtaining the final number of years. --- src/time/__secs_to_tm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/time/__secs_to_tm.c b/src/time/__secs_to_tm.c index 3a3123a1..093d9021 100644 --- a/src/time/__secs_to_tm.c +++ b/src/time/__secs_to_tm.c @@ -60,15 +60,16 @@ int __secs_to_tm(long long t, struct tm *tm) for (months=0; days_in_month[months] <= remdays; months++) remdays -= days_in_month[months]; + if (months >= 10) { + months -= 12; + years++; + } + if (years+100 > INT_MAX || years+100 < INT_MIN) return -1; tm->tm_year = years + 100; tm->tm_mon = months + 2; - if (tm->tm_mon >= 12) { - tm->tm_mon -=12; - tm->tm_year++; - } tm->tm_mday = remdays + 1; tm->tm_wday = wday; tm->tm_yday = yday; From 7442442ccc665641a8827177e8e7ed45bbbd6584 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 7 Nov 2016 20:39:59 -0500 Subject: [PATCH 225/412] fix swprintf internal buffer state and error handling the swprintf write callback never reset its buffer pointers, so after its 256-byte buffer filled up, it would keep repeating those bytes over and over in the output until the destination buffer filled up. it also failed to set the error indicator for the stream on EILSEQ, potentially allowing output to continue after the error. --- src/stdio/vswprintf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/stdio/vswprintf.c b/src/stdio/vswprintf.c index 7d237bae..6eb2f6ac 100644 --- a/src/stdio/vswprintf.c +++ b/src/stdio/vswprintf.c @@ -24,7 +24,14 @@ static size_t sw_write(FILE *f, const unsigned char *s, size_t l) c->ws++; } *c->ws = 0; - return i<0 ? i : l0; + if (i < 0) { + f->wpos = f->wbase = f->wend = 0; + f->flags |= F_ERR; + return i; + } + f->wend = f->buf + f->buf_size; + f->wpos = f->wbase = f->buf; + return l0; } int vswprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict fmt, va_list ap) From 33ce920857405d4f4b342c85b74588a15e2702e5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 7 Nov 2016 20:47:24 -0500 Subject: [PATCH 226/412] simplify pthread_attr_t stack/guard size representation previously, the pthread_attr_t object was always initialized all-zero, and stack/guard size were represented as differences versus their defaults. this required lots of confusing offset arithmetic everywhere they were used. instead, have pthread_attr_init fill in the default values, and work with absolute sizes everywhere. --- src/thread/pthread_attr_get.c | 6 +++--- src/thread/pthread_attr_init.c | 2 ++ src/thread/pthread_attr_setguardsize.c | 2 +- src/thread/pthread_attr_setstack.c | 2 +- src/thread/pthread_attr_setstacksize.c | 2 +- src/thread/pthread_create.c | 6 +++--- src/thread/pthread_getattr_np.c | 4 ++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/thread/pthread_attr_get.c b/src/thread/pthread_attr_get.c index 3d296bf3..4aa5afdb 100644 --- a/src/thread/pthread_attr_get.c +++ b/src/thread/pthread_attr_get.c @@ -7,7 +7,7 @@ int pthread_attr_getdetachstate(const pthread_attr_t *a, int *state) } int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict size) { - *size = a->_a_guardsize + DEFAULT_GUARD_SIZE; + *size = a->_a_guardsize; return 0; } @@ -39,14 +39,14 @@ int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr { if (!a->_a_stackaddr) return EINVAL; - *size = a->_a_stacksize + DEFAULT_STACK_SIZE; + *size = a->_a_stacksize; *addr = (void *)(a->_a_stackaddr - *size); return 0; } int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict size) { - *size = a->_a_stacksize + DEFAULT_STACK_SIZE; + *size = a->_a_stacksize; return 0; } diff --git a/src/thread/pthread_attr_init.c b/src/thread/pthread_attr_init.c index 969e0a38..8f6e3374 100644 --- a/src/thread/pthread_attr_init.c +++ b/src/thread/pthread_attr_init.c @@ -3,5 +3,7 @@ int pthread_attr_init(pthread_attr_t *a) { *a = (pthread_attr_t){0}; + a->_a_stacksize = DEFAULT_STACK_SIZE; + a->_a_guardsize = DEFAULT_GUARD_SIZE; return 0; } diff --git a/src/thread/pthread_attr_setguardsize.c b/src/thread/pthread_attr_setguardsize.c index 9f21d247..1c5c60ac 100644 --- a/src/thread/pthread_attr_setguardsize.c +++ b/src/thread/pthread_attr_setguardsize.c @@ -3,6 +3,6 @@ int pthread_attr_setguardsize(pthread_attr_t *a, size_t size) { if (size > SIZE_MAX/8) return EINVAL; - a->_a_guardsize = size - DEFAULT_GUARD_SIZE; + a->_a_guardsize = size; return 0; } diff --git a/src/thread/pthread_attr_setstack.c b/src/thread/pthread_attr_setstack.c index 61707a31..1eddcbd6 100644 --- a/src/thread/pthread_attr_setstack.c +++ b/src/thread/pthread_attr_setstack.c @@ -4,6 +4,6 @@ int pthread_attr_setstack(pthread_attr_t *a, void *addr, size_t size) { if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL; a->_a_stackaddr = (size_t)addr + size; - a->_a_stacksize = size - DEFAULT_STACK_SIZE; + a->_a_stacksize = size; return 0; } diff --git a/src/thread/pthread_attr_setstacksize.c b/src/thread/pthread_attr_setstacksize.c index 09d3fda7..9c6a8806 100644 --- a/src/thread/pthread_attr_setstacksize.c +++ b/src/thread/pthread_attr_setstacksize.c @@ -4,6 +4,6 @@ int pthread_attr_setstacksize(pthread_attr_t *a, size_t size) { if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL; a->_a_stackaddr = 0; - a->_a_stacksize = size - DEFAULT_STACK_SIZE; + a->_a_stacksize = size; return 0; } diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 9f6b98e6..db9e575e 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -208,7 +208,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att if (attr._a_stackaddr) { size_t need = libc.tls_size + __pthread_tsd_size; - size = attr._a_stacksize + DEFAULT_STACK_SIZE; + size = attr._a_stacksize; stack = (void *)(attr._a_stackaddr & -16); stack_limit = (void *)(attr._a_stackaddr - size); /* Use application-provided stack for TLS only when @@ -223,8 +223,8 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att guard = 0; } } else { - guard = ROUND(DEFAULT_GUARD_SIZE + attr._a_guardsize); - size = guard + ROUND(DEFAULT_STACK_SIZE + attr._a_stacksize + guard = ROUND(attr._a_guardsize); + size = guard + ROUND(attr._a_stacksize + libc.tls_size + __pthread_tsd_size); } diff --git a/src/thread/pthread_getattr_np.c b/src/thread/pthread_getattr_np.c index 10ea5127..ae26a5ab 100644 --- a/src/thread/pthread_getattr_np.c +++ b/src/thread/pthread_getattr_np.c @@ -9,7 +9,7 @@ int pthread_getattr_np(pthread_t t, pthread_attr_t *a) a->_a_detach = !!t->detached; if (t->stack) { a->_a_stackaddr = (uintptr_t)t->stack; - a->_a_stacksize = t->stack_size - DEFAULT_STACK_SIZE; + a->_a_stacksize = t->stack_size; } else { char *p = (void *)libc.auxv; size_t l = PAGE_SIZE; @@ -17,7 +17,7 @@ int pthread_getattr_np(pthread_t t, pthread_attr_t *a) a->_a_stackaddr = (uintptr_t)p; while (mremap(p-l-PAGE_SIZE, PAGE_SIZE, 2*PAGE_SIZE, 0)==MAP_FAILED && errno==ENOMEM) l += PAGE_SIZE; - a->_a_stacksize = l - DEFAULT_STACK_SIZE; + a->_a_stacksize = l; } return 0; } From 04983f2272382af92eb8f8838964ff944fbb8258 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 7 Nov 2016 23:19:19 -0500 Subject: [PATCH 227/412] make netinet/in.h suppress clashing definitions from kernel headers the linux kernel uapi headers provide their own definitions of the structures from netinet/in.h, resulting in errors when a program includes both the standard libc header and one or more of the networking-related kernel headers that pull in the kernel definitions. as before, we do not attempt to support the case where kernel headers are included before the libc ones, since the kernel definitions may have subtly incorrect types, namespace violations, etc. however, we can easily support the inclusion of the kernel headers after the libc ones, since the kernel headers provide a public interface for suppressing their definitions. this patch adds the necessary macro definitions for such suppression. --- include/netinet/in.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/netinet/in.h b/include/netinet/in.h index f6bb77b1..0d4d04aa 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -385,6 +385,21 @@ struct ip6_mtuinfo { #define IPV6_RTHDR_TYPE_0 0 +#define __UAPI_DEF_IN_ADDR 0 +#define __UAPI_DEF_IN_IPPROTO 0 +#define __UAPI_DEF_IN_PKTINFO 0 +#define __UAPI_DEF_IP_MREQ 0 +#define __UAPI_DEF_SOCKADDR_IN 0 +#define __UAPI_DEF_IN_CLASS 0 +#define __UAPI_DEF_IN6_ADDR 0 +#define __UAPI_DEF_IN6_ADDR_ALT 0 +#define __UAPI_DEF_SOCKADDR_IN6 0 +#define __UAPI_DEF_IPV6_MREQ 0 +#define __UAPI_DEF_IPPROTO_V6 0 +#define __UAPI_DEF_IPV6_OPTIONS 0 +#define __UAPI_DEF_IN6_PKTINFO 0 +#define __UAPI_DEF_IP6_MTUINFO 0 + #ifdef __cplusplus } #endif From ea7891a651dc4abc1305438470f1e4cc3b64ece2 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 8 Nov 2016 11:51:57 -0500 Subject: [PATCH 228/412] fix pthread_create regression from stack/guard size simplification commit 33ce920857405d4f4b342c85b74588a15e2702e5 broke pthread_create in the case where a null attribute pointer is passed; rather than using the default sizes, sizes of 0 (plus the remainder of one page after TLS/TCB use) were used. --- src/thread/pthread_create.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index db9e575e..e8d4a635 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -186,7 +186,10 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att | CLONE_THREAD | CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | CLONE_DETACHED; int do_sched = 0; - pthread_attr_t attr = {0}; + pthread_attr_t attr = { + ._a_stacksize = DEFAULT_STACK_SIZE, + ._a_guardsize = DEFAULT_GUARD_SIZE, + }; if (!libc.can_do_threads) return ENOSYS; self = __pthread_self(); From 31fb174dd295e50f7c5cf18d31fcfd5fe5a063b7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 8 Nov 2016 12:09:05 -0500 Subject: [PATCH 229/412] add limited pthread_setattr_default_np API to set stack size defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit based on patch by Timo Teräs: While generally this is a bad API, it is the only existing API to affect c++ (std::thread) and c11 (thrd_create) thread stack size. This patch allows applications only to increate stack and guard page sizes. --- include/pthread.h | 2 ++ src/thread/pthread_create.c | 12 ++++++--- src/thread/pthread_setattr_default_np.c | 35 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 src/thread/pthread_setattr_default_np.c diff --git a/include/pthread.h b/include/pthread.h index 94ef919c..bba9587e 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -215,6 +215,8 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); int pthread_getattr_np(pthread_t, pthread_attr_t *); int pthread_setname_np(pthread_t, const char *); +int pthread_getattr_default_np(pthread_attr_t *); +int pthread_setattr_default_np(const pthread_attr_t *); int pthread_tryjoin_np(pthread_t, void **); int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); #endif diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index e8d4a635..49f2f729 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -163,6 +163,8 @@ static void *dummy_tsd[1] = { 0 }; weak_alias(dummy_tsd, __pthread_tsd_main); volatile int __block_new_threads = 0; +size_t __default_stacksize = DEFAULT_STACK_SIZE; +size_t __default_guardsize = DEFAULT_GUARD_SIZE; static FILE *volatile dummy_file = 0; weak_alias(dummy_file, __stdin_used); @@ -186,10 +188,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att | CLONE_THREAD | CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | CLONE_DETACHED; int do_sched = 0; - pthread_attr_t attr = { - ._a_stacksize = DEFAULT_STACK_SIZE, - ._a_guardsize = DEFAULT_GUARD_SIZE, - }; + pthread_attr_t attr = { 0 }; if (!libc.can_do_threads) return ENOSYS; self = __pthread_self(); @@ -207,6 +206,11 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att if (attrp && !c11) attr = *attrp; __acquire_ptc(); + if (!attrp || c11) { + attr._a_stacksize = __default_stacksize; + attr._a_guardsize = __default_guardsize; + } + if (__block_new_threads) __wait(&__block_new_threads, 0, 1, 1); if (attr._a_stackaddr) { diff --git a/src/thread/pthread_setattr_default_np.c b/src/thread/pthread_setattr_default_np.c new file mode 100644 index 00000000..ffd2712b --- /dev/null +++ b/src/thread/pthread_setattr_default_np.c @@ -0,0 +1,35 @@ +#include "pthread_impl.h" +#include + +extern size_t __default_stacksize; +extern size_t __default_guardsize; + +int pthread_setattr_default_np(const pthread_attr_t *attrp) +{ + /* Reject anything in the attr object other than stack/guard size. */ + pthread_attr_t tmp = *attrp, zero = { 0 }; + tmp._a_stacksize = 0; + tmp._a_guardsize = 0; + if (memcmp(&tmp, &zero, sizeof tmp)) + return EINVAL; + + __inhibit_ptc(); + if (attrp->_a_stacksize >= __default_stacksize) + __default_stacksize = attrp->_a_stacksize; + if (attrp->_a_guardsize >= __default_guardsize) + __default_guardsize = attrp->_a_guardsize; + __release_ptc(); + + return 0; +} + +int pthread_getattr_default_np(pthread_attr_t *attrp) +{ + __acquire_ptc(); + *attrp = (pthread_attr_t) { + ._a_stacksize = __default_stacksize, + ._a_guardsize = __default_guardsize, + }; + __release_ptc(); + return 0; +} From 4078a5c31fa67987051c2180db7a07702534032f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 8 Nov 2016 18:03:42 -0500 Subject: [PATCH 230/412] fix build regression on archs with variable page size commit 31fb174dd295e50f7c5cf18d31fcfd5fe5a063b7 used DEFAULT_GUARD_SIZE from pthread_impl.h in a static initializer, breaking build on archs where its definition, PAGE_SIZE, is not a constant. instead, just define DEFAULT_GUARD_SIZE as 4096, the minimal page size on any arch we support. pthread_create rounds up to whole pages anyway, so defining it to 1 would also work, but a moderately meaningful value is nicer to programs that use pthread_attr_getguardsize on default-initialized attribute objects. --- src/internal/pthread_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h index 3890bb56..7a679dbf 100644 --- a/src/internal/pthread_impl.h +++ b/src/internal/pthread_impl.h @@ -143,7 +143,7 @@ void __block_app_sigs(void *); void __restore_sigs(void *); #define DEFAULT_STACK_SIZE 81920 -#define DEFAULT_GUARD_SIZE PAGE_SIZE +#define DEFAULT_GUARD_SIZE 4096 #define __ATTRP_C11_THREAD ((void*)(uintptr_t)-1) From b418ea1b66d0d5a08640d4edf3b65d4619c6ef7f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 11 Nov 2016 12:30:24 -0500 Subject: [PATCH 231/412] generalize ELF hash table types not to assume 32-bit entries alpha and s390x gratuitously use 64-bit entries (wasting 2x space and cache utilization) despite the values always being 32-bit. based on patch by Bobby Bingham, with changes suggested by Alexander Monakov to use the public Elf_Symndx type from link.h (and make it properly variable by arch) rather than adding new internal infrastructure for handling the type. --- arch/generic/bits/link.h | 1 + include/link.h | 3 +-- ldso/dynlink.c | 4 ++-- src/internal/vdso.c | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 arch/generic/bits/link.h diff --git a/arch/generic/bits/link.h b/arch/generic/bits/link.h new file mode 100644 index 00000000..4a94d8f8 --- /dev/null +++ b/arch/generic/bits/link.h @@ -0,0 +1 @@ +typedef uint32_t Elf_Symndx; diff --git a/include/link.h b/include/link.h index 9349cddd..81501859 100644 --- a/include/link.h +++ b/include/link.h @@ -16,8 +16,7 @@ extern "C" { #define ElfW(type) Elf32_ ## type #endif -/* this is the same everywhere except alpha and s390 */ -typedef uint32_t Elf_Symndx; +#include struct dl_phdr_info { ElfW(Addr) dlpi_addr; diff --git a/ldso/dynlink.c b/ldso/dynlink.c index acb73bc2..ad49cac2 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -54,7 +54,7 @@ struct dso { size_t phentsize; int refcnt; Sym *syms; - uint32_t *hashtab; + Elf_Symndx *hashtab; uint32_t *ghashtab; int16_t *versym; char *strings; @@ -206,7 +206,7 @@ static Sym *sysv_lookup(const char *s, uint32_t h, struct dso *dso) { size_t i; Sym *syms = dso->syms; - uint32_t *hashtab = dso->hashtab; + Elf_Symndx *hashtab = dso->hashtab; char *strings = dso->strings; for (i=hashtab[2+h%hashtab[0]]; i; i=hashtab[2+hashtab[0]+i]) { if ((!dso->versym || dso->versym[i] >= 0) diff --git a/src/internal/vdso.c b/src/internal/vdso.c index 6ae0212e..a4862171 100644 --- a/src/internal/vdso.c +++ b/src/internal/vdso.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -57,7 +58,7 @@ void *__vdsosym(const char *vername, const char *name) char *strings = 0; Sym *syms = 0; - uint32_t *hashtab = 0; + Elf_Symndx *hashtab = 0; uint16_t *versym = 0; Verdef *verdef = 0; From 54482898abe8d6d937ee67ea5974cd8eae859c37 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Mon, 25 Jul 2016 22:52:58 -0500 Subject: [PATCH 232/412] treat null vdso base same as missing On s390x, the kernel provides AT_SYSINFO_EHDR, but sets it to zero, if the program being run does not have a program interpreter. This causes problems when running the dynamic linker directly. --- ldso/dynlink.c | 2 +- src/internal/vdso.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index ad49cac2..c6890845 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1550,7 +1550,7 @@ _Noreturn void __dls3(size_t *sp) } /* Attach to vdso, if provided by the kernel */ - if (search_vec(auxv, &vdso_base, AT_SYSINFO_EHDR)) { + if (search_vec(auxv, &vdso_base, AT_SYSINFO_EHDR) && vdso_base) { Ehdr *ehdr = (void *)vdso_base; Phdr *phdr = vdso.phdr = (void *)(vdso_base + ehdr->e_phoff); vdso.phnum = ehdr->e_phnum; diff --git a/src/internal/vdso.c b/src/internal/vdso.c index a4862171..d46d3228 100644 --- a/src/internal/vdso.c +++ b/src/internal/vdso.c @@ -45,6 +45,7 @@ void *__vdsosym(const char *vername, const char *name) size_t i; for (i=0; libc.auxv[i] != AT_SYSINFO_EHDR; i+=2) if (!libc.auxv[i]) return 0; + if (!libc.auxv[i+1]) return 0; Ehdr *eh = (void *)libc.auxv[i+1]; Phdr *ph = (void *)((char *)eh + eh->e_phoff); size_t *dynv=0, base=-1; From 15094943050eb9a564f409323070e50b40f78816 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Fri, 11 Nov 2016 21:52:05 -0600 Subject: [PATCH 233/412] add s390x port --- arch/s390x/atomic_arch.h | 30 +++ arch/s390x/bits/alltypes.h.in | 26 +++ arch/s390x/bits/endian.h | 1 + arch/s390x/bits/fcntl.h | 40 ++++ arch/s390x/bits/fenv.h | 17 ++ arch/s390x/bits/float.h | 16 ++ arch/s390x/bits/ioctl.h | 195 ++++++++++++++++ arch/s390x/bits/ipc.h | 14 ++ arch/s390x/bits/limits.h | 8 + arch/s390x/bits/link.h | 1 + arch/s390x/bits/msg.h | 12 + arch/s390x/bits/posix.h | 2 + arch/s390x/bits/reg.h | 2 + arch/s390x/bits/sem.h | 7 + arch/s390x/bits/setjmp.h | 1 + arch/s390x/bits/shm.h | 25 +++ arch/s390x/bits/signal.h | 106 +++++++++ arch/s390x/bits/socket.h | 44 ++++ arch/s390x/bits/stat.h | 16 ++ arch/s390x/bits/statfs.h | 7 + arch/s390x/bits/stdint.h | 20 ++ arch/s390x/bits/syscall.h.in | 323 +++++++++++++++++++++++++++ arch/s390x/bits/user.h | 62 +++++ arch/s390x/crt_arch.h | 17 ++ arch/s390x/pthread_arch.h | 14 ++ arch/s390x/reloc.h | 15 ++ arch/s390x/syscall_arch.h | 76 +++++++ configure | 1 + crt/s390x/crti.s | 17 ++ crt/s390x/crtn.s | 9 + src/fenv/s390x/fenv.c | 55 +++++ src/internal/s390x/syscall.s | 15 ++ src/process/s390x/vfork.s | 8 + src/setjmp/s390x/longjmp.s | 23 ++ src/setjmp/s390x/setjmp.s | 25 +++ src/signal/s390x/restore.s | 9 + src/signal/s390x/sigsetjmp.s | 23 ++ src/thread/s390x/__set_thread_area.s | 9 + src/thread/s390x/__tls_get_offset.s | 17 ++ src/thread/s390x/__unmapself.s | 6 + src/thread/s390x/clone.s | 47 ++++ src/thread/s390x/syscall_cp.s | 32 +++ 42 files changed, 1393 insertions(+) create mode 100644 arch/s390x/atomic_arch.h create mode 100644 arch/s390x/bits/alltypes.h.in create mode 100644 arch/s390x/bits/endian.h create mode 100644 arch/s390x/bits/fcntl.h create mode 100644 arch/s390x/bits/fenv.h create mode 100644 arch/s390x/bits/float.h create mode 100644 arch/s390x/bits/ioctl.h create mode 100644 arch/s390x/bits/ipc.h create mode 100644 arch/s390x/bits/limits.h create mode 100644 arch/s390x/bits/link.h create mode 100644 arch/s390x/bits/msg.h create mode 100644 arch/s390x/bits/posix.h create mode 100644 arch/s390x/bits/reg.h create mode 100644 arch/s390x/bits/sem.h create mode 100644 arch/s390x/bits/setjmp.h create mode 100644 arch/s390x/bits/shm.h create mode 100644 arch/s390x/bits/signal.h create mode 100644 arch/s390x/bits/socket.h create mode 100644 arch/s390x/bits/stat.h create mode 100644 arch/s390x/bits/statfs.h create mode 100644 arch/s390x/bits/stdint.h create mode 100644 arch/s390x/bits/syscall.h.in create mode 100644 arch/s390x/bits/user.h create mode 100644 arch/s390x/crt_arch.h create mode 100644 arch/s390x/pthread_arch.h create mode 100644 arch/s390x/reloc.h create mode 100644 arch/s390x/syscall_arch.h create mode 100644 crt/s390x/crti.s create mode 100644 crt/s390x/crtn.s create mode 100644 src/fenv/s390x/fenv.c create mode 100644 src/internal/s390x/syscall.s create mode 100644 src/process/s390x/vfork.s create mode 100644 src/setjmp/s390x/longjmp.s create mode 100644 src/setjmp/s390x/setjmp.s create mode 100644 src/signal/s390x/restore.s create mode 100644 src/signal/s390x/sigsetjmp.s create mode 100644 src/thread/s390x/__set_thread_area.s create mode 100644 src/thread/s390x/__tls_get_offset.s create mode 100644 src/thread/s390x/__unmapself.s create mode 100644 src/thread/s390x/clone.s create mode 100644 src/thread/s390x/syscall_cp.s diff --git a/arch/s390x/atomic_arch.h b/arch/s390x/atomic_arch.h new file mode 100644 index 00000000..9b0e1df9 --- /dev/null +++ b/arch/s390x/atomic_arch.h @@ -0,0 +1,30 @@ +#define a_cas a_cas +static inline int a_cas(volatile int *p, int t, int s) +{ + __asm__ __volatile__ ( + "cs %0, %2, %1" + : "+d"(t), "+Q"(*p) : "d"(s) : "memory", "cc"); + return t; +} + +#define a_cas_p a_cas_p +static inline void *a_cas_p(volatile void *p, void *t, void *s) +{ + __asm__ __volatile__ ( + "csg %0, %2, %1" + : "+d"(t), "+Q"(*(void *volatile *)p) : "d"(s) + : "memory", "cc"); + return t; +} + +#define a_barrier a_barrier +static inline void a_barrier() +{ + __asm__ __volatile__ ("bcr 15,0" : : : "memory"); +} + +#define a_crash a_crash +static inline void a_crash() +{ + __asm__ __volatile__ (".insn e,0"); +} diff --git a/arch/s390x/bits/alltypes.h.in b/arch/s390x/bits/alltypes.h.in new file mode 100644 index 00000000..1a838462 --- /dev/null +++ b/arch/s390x/bits/alltypes.h.in @@ -0,0 +1,26 @@ +#define _Addr long +#define _Int64 long +#define _Reg long + +TYPEDEF __builtin_va_list va_list; +TYPEDEF __builtin_va_list __isoc_va_list; + +#ifndef __cplusplus +TYPEDEF int wchar_t; +#endif + +TYPEDEF double float_t; +TYPEDEF double double_t; + +TYPEDEF struct { long long __ll; long double __ld; } max_align_t; + +TYPEDEF long time_t; +TYPEDEF long suseconds_t; + +TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; +TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; +TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; +TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/arch/s390x/bits/endian.h b/arch/s390x/bits/endian.h new file mode 100644 index 00000000..ef074b77 --- /dev/null +++ b/arch/s390x/bits/endian.h @@ -0,0 +1 @@ +#define __BYTE_ORDER __BIG_ENDIAN diff --git a/arch/s390x/bits/fcntl.h b/arch/s390x/bits/fcntl.h new file mode 100644 index 00000000..1eca6ba5 --- /dev/null +++ b/arch/s390x/bits/fcntl.h @@ -0,0 +1,40 @@ +#define O_CREAT 0100 +#define O_EXCL 0200 +#define O_NOCTTY 0400 +#define O_TRUNC 01000 +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_DSYNC 010000 +#define O_SYNC 04010000 +#define O_RSYNC 04010000 +#define O_DIRECTORY 0200000 +#define O_NOFOLLOW 0400000 +#define O_CLOEXEC 02000000 + +#define O_ASYNC 020000 +#define O_DIRECT 040000 +#define O_LARGEFILE 0100000 +#define O_NOATIME 01000000 +#define O_PATH 010000000 +#define O_TMPFILE 020200000 +#define O_NDELAY O_NONBLOCK + +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_SETFD 2 +#define F_GETFL 3 +#define F_SETFL 4 + +#define F_GETLK 5 +#define F_SETLK 6 +#define F_SETLKW 7 + +#define F_SETOWN 8 +#define F_GETOWN 9 +#define F_SETSIG 10 +#define F_GETSIG 11 + +#define F_SETOWN_EX 15 +#define F_GETOWN_EX 16 + +#define F_GETOWNER_UIDS 17 diff --git a/arch/s390x/bits/fenv.h b/arch/s390x/bits/fenv.h new file mode 100644 index 00000000..773dad91 --- /dev/null +++ b/arch/s390x/bits/fenv.h @@ -0,0 +1,17 @@ +#define FE_TONEAREST 0 +#define FE_TOWARDZERO 1 +#define FE_UPWARD 2 +#define FE_DOWNWARD 3 + +#define FE_INEXACT 0x00080000 +#define FE_UNDERFLOW 0x00100000 +#define FE_OVERFLOW 0x00200000 +#define FE_DIVBYZERO 0x00400000 +#define FE_INVALID 0x00800000 + +#define FE_ALL_EXCEPT 0x00f80000 + +typedef unsigned fexcept_t; +typedef unsigned fenv_t; + +#define FE_DFL_ENV ((const fenv_t *)-1) diff --git a/arch/s390x/bits/float.h b/arch/s390x/bits/float.h new file mode 100644 index 00000000..90b73bee --- /dev/null +++ b/arch/s390x/bits/float.h @@ -0,0 +1,16 @@ +#define FLT_EVAL_METHOD 1 + +#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L +#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L +#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L +#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L + +#define LDBL_MANT_DIG 113 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MAX_EXP 16384 + +#define LDBL_DIG 33 +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_10_EXP 4932 + +#define DECIMAL_DIG 36 diff --git a/arch/s390x/bits/ioctl.h b/arch/s390x/bits/ioctl.h new file mode 100644 index 00000000..11196e15 --- /dev/null +++ b/arch/s390x/bits/ioctl.h @@ -0,0 +1,195 @@ +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) +#define _IOC_NONE 0U +#define _IOC_WRITE 1U +#define _IOC_READ 2U + +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) + +#define TCGETS 0x5401 +#define TCSETS 0x5402 +#define TCSETSW 0x5403 +#define TCSETSF 0x5404 +#define TCGETA 0x5405 +#define TCSETA 0x5406 +#define TCSETAW 0x5407 +#define TCSETAF 0x5408 +#define TCSBRK 0x5409 +#define TCXONC 0x540A +#define TCFLSH 0x540B +#define TIOCEXCL 0x540C +#define TIOCNXCL 0x540D +#define TIOCSCTTY 0x540E +#define TIOCGPGRP 0x540F +#define TIOCSPGRP 0x5410 +#define TIOCOUTQ 0x5411 +#define TIOCSTI 0x5412 +#define TIOCGWINSZ 0x5413 +#define TIOCSWINSZ 0x5414 +#define TIOCMGET 0x5415 +#define TIOCMBIS 0x5416 +#define TIOCMBIC 0x5417 +#define TIOCMSET 0x5418 +#define TIOCGSOFTCAR 0x5419 +#define TIOCSSOFTCAR 0x541A +#define FIONREAD 0x541B +#define TIOCINQ FIONREAD +#define TIOCLINUX 0x541C +#define TIOCCONS 0x541D +#define TIOCGSERIAL 0x541E +#define TIOCSSERIAL 0x541F +#define TIOCPKT 0x5420 +#define FIONBIO 0x5421 +#define TIOCNOTTY 0x5422 +#define TIOCSETD 0x5423 +#define TIOCGETD 0x5424 +#define TCSBRKP 0x5425 +#define TIOCTTYGSTRUCT 0x5426 +#define TIOCSBRK 0x5427 +#define TIOCCBRK 0x5428 +#define TIOCGSID 0x5429 +#define TIOCGPTN 0x80045430 +#define TIOCSPTLCK 0x40045431 +#define TCGETX 0x5432 +#define TCSETX 0x5433 +#define TCSETXF 0x5434 +#define TCSETXW 0x5435 + +#define FIONCLEX 0x5450 +#define FIOCLEX 0x5451 +#define FIOASYNC 0x5452 +#define TIOCSERCONFIG 0x5453 +#define TIOCSERGWILD 0x5454 +#define TIOCSERSWILD 0x5455 +#define TIOCGLCKTRMIOS 0x5456 +#define TIOCSLCKTRMIOS 0x5457 +#define TIOCSERGSTRUCT 0x5458 +#define TIOCSERGETLSR 0x5459 +#define TIOCSERGETMULTI 0x545A +#define TIOCSERSETMULTI 0x545B + +#define TIOCMIWAIT 0x545C +#define TIOCGICOUNT 0x545D +#define FIOQSIZE 0x545E + +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 +#define TIOCPKT_IOCTL 64 + +#define TIOCSER_TEMT 0x01 + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 +#define TIOCM_MODEM_BITS TIOCM_OUT2 + +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 +#define N_6PACK 7 +#define N_MASC 8 +#define N_R3964 9 +#define N_PROFIBUS_FDL 10 +#define N_IRDA 11 +#define N_SMSBLOCK 12 +#define N_HDLC 13 +#define N_SYNC_PPP 14 +#define N_HCI 15 + +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 + +#define SIOCADDRT 0x890B +#define SIOCDELRT 0x890C +#define SIOCRTMSG 0x890D + +#define SIOCGIFNAME 0x8910 +#define SIOCSIFLINK 0x8911 +#define SIOCGIFCONF 0x8912 +#define SIOCGIFFLAGS 0x8913 +#define SIOCSIFFLAGS 0x8914 +#define SIOCGIFADDR 0x8915 +#define SIOCSIFADDR 0x8916 +#define SIOCGIFDSTADDR 0x8917 +#define SIOCSIFDSTADDR 0x8918 +#define SIOCGIFBRDADDR 0x8919 +#define SIOCSIFBRDADDR 0x891a +#define SIOCGIFNETMASK 0x891b +#define SIOCSIFNETMASK 0x891c +#define SIOCGIFMETRIC 0x891d +#define SIOCSIFMETRIC 0x891e +#define SIOCGIFMEM 0x891f +#define SIOCSIFMEM 0x8920 +#define SIOCGIFMTU 0x8921 +#define SIOCSIFMTU 0x8922 +#define SIOCSIFHWADDR 0x8924 +#define SIOCGIFENCAP 0x8925 +#define SIOCSIFENCAP 0x8926 +#define SIOCGIFHWADDR 0x8927 +#define SIOCGIFSLAVE 0x8929 +#define SIOCSIFSLAVE 0x8930 +#define SIOCADDMULTI 0x8931 +#define SIOCDELMULTI 0x8932 +#define SIOCGIFINDEX 0x8933 +#define SIOGIFINDEX SIOCGIFINDEX +#define SIOCSIFPFLAGS 0x8934 +#define SIOCGIFPFLAGS 0x8935 +#define SIOCDIFADDR 0x8936 +#define SIOCSIFHWBROADCAST 0x8937 +#define SIOCGIFCOUNT 0x8938 + +#define SIOCGIFBR 0x8940 +#define SIOCSIFBR 0x8941 + +#define SIOCGIFTXQLEN 0x8942 +#define SIOCSIFTXQLEN 0x8943 + +#define SIOCDARP 0x8953 +#define SIOCGARP 0x8954 +#define SIOCSARP 0x8955 + +#define SIOCDRARP 0x8960 +#define SIOCGRARP 0x8961 +#define SIOCSRARP 0x8962 + +#define SIOCGIFMAP 0x8970 +#define SIOCSIFMAP 0x8971 + +#define SIOCADDDLCI 0x8980 +#define SIOCDELDLCI 0x8981 + +#define SIOCDEVPRIVATE 0x89F0 +#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/s390x/bits/ipc.h b/arch/s390x/bits/ipc.h new file mode 100644 index 00000000..4710c12b --- /dev/null +++ b/arch/s390x/bits/ipc.h @@ -0,0 +1,14 @@ +struct ipc_perm { + key_t __ipc_perm_key; + uid_t uid; + gid_t gid; + uid_t cuid; + gid_t cgid; + mode_t mode; + unsigned short __pad1; + unsigned short __ipc_perm_seq; + unsigned long __pad2; + unsigned long __pad3; +}; + +#define IPC_64 0x100 diff --git a/arch/s390x/bits/limits.h b/arch/s390x/bits/limits.h new file mode 100644 index 00000000..792a30b9 --- /dev/null +++ b/arch/s390x/bits/limits.h @@ -0,0 +1,8 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define PAGE_SIZE 4096 +#define LONG_BIT 64 +#endif + +#define LONG_MAX 0x7fffffffffffffffL +#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/arch/s390x/bits/link.h b/arch/s390x/bits/link.h new file mode 100644 index 00000000..923aac57 --- /dev/null +++ b/arch/s390x/bits/link.h @@ -0,0 +1 @@ +typedef uint64_t Elf_Symndx; diff --git a/arch/s390x/bits/msg.h b/arch/s390x/bits/msg.h new file mode 100644 index 00000000..2e23ca27 --- /dev/null +++ b/arch/s390x/bits/msg.h @@ -0,0 +1,12 @@ +struct msqid_ds { + struct ipc_perm msg_perm; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; + unsigned long msg_cbytes; + msgqnum_t msg_qnum; + msglen_t msg_qbytes; + pid_t msg_lspid; + pid_t msg_lrpid; + unsigned long __unused[2]; +}; diff --git a/arch/s390x/bits/posix.h b/arch/s390x/bits/posix.h new file mode 100644 index 00000000..c37b94c1 --- /dev/null +++ b/arch/s390x/bits/posix.h @@ -0,0 +1,2 @@ +#define _POSIX_V6_LP64_OFF64 1 +#define _POSIX_V7_LP64_OFF64 1 diff --git a/arch/s390x/bits/reg.h b/arch/s390x/bits/reg.h new file mode 100644 index 00000000..2633f39d --- /dev/null +++ b/arch/s390x/bits/reg.h @@ -0,0 +1,2 @@ +#undef __WORDSIZE +#define __WORDSIZE 64 diff --git a/arch/s390x/bits/sem.h b/arch/s390x/bits/sem.h new file mode 100644 index 00000000..644f68a0 --- /dev/null +++ b/arch/s390x/bits/sem.h @@ -0,0 +1,7 @@ +struct semid_ds { + struct ipc_perm sem_perm; + time_t sem_otime; + time_t sem_ctime; + unsigned short __pad[3], sem_nsems; + unsigned long __unused[2]; +}; diff --git a/arch/s390x/bits/setjmp.h b/arch/s390x/bits/setjmp.h new file mode 100644 index 00000000..b2bd9748 --- /dev/null +++ b/arch/s390x/bits/setjmp.h @@ -0,0 +1 @@ +typedef unsigned long __jmp_buf[18]; diff --git a/arch/s390x/bits/shm.h b/arch/s390x/bits/shm.h new file mode 100644 index 00000000..6652d659 --- /dev/null +++ b/arch/s390x/bits/shm.h @@ -0,0 +1,25 @@ +#define SHMLBA 4096 + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; + pid_t shm_cpid; + pid_t shm_lpid; + unsigned long shm_nattch; + unsigned long __pad1; + unsigned long __pad2; +}; + +struct shminfo { + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; +}; + +struct shm_info { + int __used_ids; + unsigned long shm_tot, shm_rss, shm_swp; + unsigned long __swap_attempts, __swap_successes; +}; + diff --git a/arch/s390x/bits/signal.h b/arch/s390x/bits/signal.h new file mode 100644 index 00000000..c8665832 --- /dev/null +++ b/arch/s390x/bits/signal.h @@ -0,0 +1,106 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MINSIGSTKSZ 4096 +#define SIGSTKSZ 10240 +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +typedef unsigned long greg_t, gregset_t[27]; + +typedef struct { + unsigned long mask; + unsigned long addr; +} __psw_t; + +typedef union { + double d; + float f; +} fpreg_t; + +typedef struct { + unsigned fpc; + fpreg_t fprs[16]; +} fpregset_t; + +typedef struct +{ + __psw_t psw; + unsigned long gregs[16]; + unsigned aregs[16]; + fpregset_t fpregs; +} mcontext_t; + +#else + +typedef struct { + unsigned long __regs1[18]; + unsigned __regs2[18]; + double __regs3[16]; +} mcontext_t; + +#endif + +struct sigaltstack { + void *ss_sp; + int ss_flags; + size_t ss_size; +}; + +typedef struct __ucontext { + unsigned long uc_flags; + struct __ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; +} ucontext_t; + +#define SA_NOCLDSTOP 1U +#define SA_NOCLDWAIT 2U +#define SA_SIGINFO 4U +#define SA_ONSTACK 0x08000000U +#define SA_RESTART 0x10000000U +#define SA_NODEFER 0x40000000U +#define SA_RESETHAND 0x80000000U +#define SA_RESTORER 0x04000000U + +#endif + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT SIGABRT +#define SIGBUS 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGUSR1 10 +#define SIGSEGV 11 +#define SIGUSR2 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGSTKFLT 16 +#define SIGCHLD 17 +#define SIGCONT 18 +#define SIGSTOP 19 +#define SIGTSTP 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGURG 23 +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGIO 29 +#define SIGPOLL SIGIO +#define SIGPWR 30 +#define SIGSYS 31 +#define SIGUNUSED SIGSYS + +#define _NSIG 65 diff --git a/arch/s390x/bits/socket.h b/arch/s390x/bits/socket.h new file mode 100644 index 00000000..2b81bfec --- /dev/null +++ b/arch/s390x/bits/socket.h @@ -0,0 +1,44 @@ +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int __pad1, msg_iovlen; + void *msg_control; + int __pad2; + socklen_t msg_controllen; + int msg_flags; +}; + +struct cmsghdr { + int __pad1; + socklen_t cmsg_len; + int cmsg_level; + int cmsg_type; +}; + +#define SO_DEBUG 1 +#define SO_REUSEADDR 2 +#define SO_TYPE 3 +#define SO_ERROR 4 +#define SO_DONTROUTE 5 +#define SO_BROADCAST 6 +#define SO_SNDBUF 7 +#define SO_RCVBUF 8 +#define SO_KEEPALIVE 9 +#define SO_OOBINLINE 10 +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_LINGER 13 +#define SO_BSDCOMPAT 14 +#define SO_REUSEPORT 15 +#define SO_PASSCRED 16 +#define SO_PEERCRED 17 +#define SO_RCVLOWAT 18 +#define SO_SNDLOWAT 19 +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 +#define SO_ACCEPTCONN 30 +#define SO_SNDBUFFORCE 32 +#define SO_RCVBUFFORCE 33 +#define SO_PROTOCOL 38 +#define SO_DOMAIN 39 diff --git a/arch/s390x/bits/stat.h b/arch/s390x/bits/stat.h new file mode 100644 index 00000000..2db4ad02 --- /dev/null +++ b/arch/s390x/bits/stat.h @@ -0,0 +1,16 @@ +struct stat { + dev_t st_dev; + ino_t st_ino; + nlink_t st_nlink; + mode_t st_mode; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + off_t st_size; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + blksize_t st_blksize; + blkcnt_t st_blocks; + unsigned long __unused[3]; +}; diff --git a/arch/s390x/bits/statfs.h b/arch/s390x/bits/statfs.h new file mode 100644 index 00000000..6617358a --- /dev/null +++ b/arch/s390x/bits/statfs.h @@ -0,0 +1,7 @@ +struct statfs { + unsigned f_type, f_bsize; + fsblkcnt_t f_blocks, f_bfree, f_bavail; + fsfilcnt_t f_files, f_ffree; + fsid_t f_fsid; + unsigned f_namelen, f_frsize, f_flags, f_spare[4]; +}; diff --git a/arch/s390x/bits/stdint.h b/arch/s390x/bits/stdint.h new file mode 100644 index 00000000..1bb147f2 --- /dev/null +++ b/arch/s390x/bits/stdint.h @@ -0,0 +1,20 @@ +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; + +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN + +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX + +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX + +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#define SIZE_MAX UINT64_MAX diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in new file mode 100644 index 00000000..1b8fdf0c --- /dev/null +++ b/arch/s390x/bits/syscall.h.in @@ -0,0 +1,323 @@ +#define __NR_exit 1 +#define __NR_fork 2 +#define __NR_read 3 +#define __NR_write 4 +#define __NR_open 5 +#define __NR_close 6 +#define __NR_restart_syscall 7 +#define __NR_creat 8 +#define __NR_link 9 +#define __NR_unlink 10 +#define __NR_execve 11 +#define __NR_chdir 12 +#define __NR_mknod 14 +#define __NR_chmod 15 +#define __NR_lseek 19 +#define __NR_getpid 20 +#define __NR_mount 21 +#define __NR_umount 22 +#define __NR_ptrace 26 +#define __NR_alarm 27 +#define __NR_pause 29 +#define __NR_utime 30 +#define __NR_access 33 +#define __NR_nice 34 +#define __NR_sync 36 +#define __NR_kill 37 +#define __NR_rename 38 +#define __NR_mkdir 39 +#define __NR_rmdir 40 +#define __NR_dup 41 +#define __NR_pipe 42 +#define __NR_times 43 +#define __NR_brk 45 +#define __NR_signal 48 +#define __NR_acct 51 +#define __NR_umount2 52 +#define __NR_ioctl 54 +#define __NR_fcntl 55 +#define __NR_setpgid 57 +#define __NR_umask 60 +#define __NR_chroot 61 +#define __NR_ustat 62 +#define __NR_dup2 63 +#define __NR_getppid 64 +#define __NR_getpgrp 65 +#define __NR_setsid 66 +#define __NR_sigaction 67 +#define __NR_sigsuspend 72 +#define __NR_sigpending 73 +#define __NR_sethostname 74 +#define __NR_setrlimit 75 +#define __NR_getrusage 77 +#define __NR_gettimeofday 78 +#define __NR_settimeofday 79 +#define __NR_symlink 83 +#define __NR_readlink 85 +#define __NR_uselib 86 +#define __NR_swapon 87 +#define __NR_reboot 88 +#define __NR_readdir 89 +#define __NR_mmap 90 +#define __NR_munmap 91 +#define __NR_truncate 92 +#define __NR_ftruncate 93 +#define __NR_fchmod 94 +#define __NR_getpriority 96 +#define __NR_setpriority 97 +#define __NR_statfs 99 +#define __NR_fstatfs 100 +#define __NR_socketcall 102 +#define __NR_syslog 103 +#define __NR_setitimer 104 +#define __NR_getitimer 105 +#define __NR_stat 106 +#define __NR_lstat 107 +#define __NR_fstat 108 +#define __NR_lookup_dcookie 110 +#define __NR_vhangup 111 +#define __NR_idle 112 +#define __NR_wait4 114 +#define __NR_swapoff 115 +#define __NR_sysinfo 116 +#define __NR_ipc 117 +#define __NR_fsync 118 +#define __NR_sigreturn 119 +#define __NR_clone 120 +#define __NR_setdomainname 121 +#define __NR_uname 122 +#define __NR_adjtimex 124 +#define __NR_mprotect 125 +#define __NR_sigprocmask 126 +#define __NR_create_module 127 +#define __NR_init_module 128 +#define __NR_delete_module 129 +#define __NR_get_kernel_syms 130 +#define __NR_quotactl 131 +#define __NR_getpgid 132 +#define __NR_fchdir 133 +#define __NR_bdflush 134 +#define __NR_sysfs 135 +#define __NR_personality 136 +#define __NR_afs_syscall 137 +#define __NR_getdents 141 +#define __NR_select 142 +#define __NR_flock 143 +#define __NR_msync 144 +#define __NR_readv 145 +#define __NR_writev 146 +#define __NR_getsid 147 +#define __NR_fdatasync 148 +#define __NR__sysctl 149 +#define __NR_mlock 150 +#define __NR_munlock 151 +#define __NR_mlockall 152 +#define __NR_munlockall 153 +#define __NR_sched_setparam 154 +#define __NR_sched_getparam 155 +#define __NR_sched_setscheduler 156 +#define __NR_sched_getscheduler 157 +#define __NR_sched_yield 158 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_rr_get_interval 161 +#define __NR_nanosleep 162 +#define __NR_mremap 163 +#define __NR_query_module 167 +#define __NR_poll 168 +#define __NR_nfsservctl 169 +#define __NR_prctl 172 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigsuspend 179 +#define __NR_pread64 180 +#define __NR_pwrite64 181 +#define __NR_getcwd 183 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_sigaltstack 186 +#define __NR_sendfile 187 +#define __NR_getpmsg 188 +#define __NR_putpmsg 189 +#define __NR_vfork 190 +#define __NR_getrlimit 191 +#define __NR_lchown 198 +#define __NR_getuid 199 +#define __NR_getgid 200 +#define __NR_geteuid 201 +#define __NR_getegid 202 +#define __NR_setreuid 203 +#define __NR_setregid 204 +#define __NR_getgroups 205 +#define __NR_setgroups 206 +#define __NR_fchown 207 +#define __NR_setresuid 208 +#define __NR_getresuid 209 +#define __NR_setresgid 210 +#define __NR_getresgid 211 +#define __NR_chown 212 +#define __NR_setuid 213 +#define __NR_setgid 214 +#define __NR_setfsuid 215 +#define __NR_setfsgid 216 +#define __NR_pivot_root 217 +#define __NR_mincore 218 +#define __NR_madvise 219 +#define __NR_getdents64 220 +#define __NR_readahead 222 +#define __NR_setxattr 224 +#define __NR_lsetxattr 225 +#define __NR_fsetxattr 226 +#define __NR_getxattr 227 +#define __NR_lgetxattr 228 +#define __NR_fgetxattr 229 +#define __NR_listxattr 230 +#define __NR_llistxattr 231 +#define __NR_flistxattr 232 +#define __NR_removexattr 233 +#define __NR_lremovexattr 234 +#define __NR_fremovexattr 235 +#define __NR_gettid 236 +#define __NR_tkill 237 +#define __NR_futex 238 +#define __NR_sched_setaffinity 239 +#define __NR_sched_getaffinity 240 +#define __NR_tgkill 241 +#define __NR_io_setup 243 +#define __NR_io_destroy 244 +#define __NR_io_getevents 245 +#define __NR_io_submit 246 +#define __NR_io_cancel 247 +#define __NR_exit_group 248 +#define __NR_epoll_create 249 +#define __NR_epoll_ctl 250 +#define __NR_epoll_wait 251 +#define __NR_set_tid_address 252 +#define __NR_fadvise64 253 +#define __NR_timer_create 254 +#define __NR_timer_settime 255 +#define __NR_timer_gettime 256 +#define __NR_timer_getoverrun 257 +#define __NR_timer_delete 258 +#define __NR_clock_settime 259 +#define __NR_clock_gettime 260 +#define __NR_clock_getres 261 +#define __NR_clock_nanosleep 262 +#define __NR_statfs64 265 +#define __NR_fstatfs64 266 +#define __NR_remap_file_pages 267 +#define __NR_mbind 268 +#define __NR_get_mempolicy 269 +#define __NR_set_mempolicy 270 +#define __NR_mq_open 271 +#define __NR_mq_unlink 272 +#define __NR_mq_timedsend 273 +#define __NR_mq_timedreceive 274 +#define __NR_mq_notify 275 +#define __NR_mq_getsetattr 276 +#define __NR_kexec_load 277 +#define __NR_add_key 278 +#define __NR_request_key 279 +#define __NR_keyctl 280 +#define __NR_waitid 281 +#define __NR_ioprio_set 282 +#define __NR_ioprio_get 283 +#define __NR_inotify_init 284 +#define __NR_inotify_add_watch 285 +#define __NR_inotify_rm_watch 286 +#define __NR_migrate_pages 287 +#define __NR_openat 288 +#define __NR_mkdirat 289 +#define __NR_mknodat 290 +#define __NR_fchownat 291 +#define __NR_futimesat 292 +#define __NR_newfstatat 293 +#define __NR_unlinkat 294 +#define __NR_renameat 295 +#define __NR_linkat 296 +#define __NR_symlinkat 297 +#define __NR_readlinkat 298 +#define __NR_fchmodat 299 +#define __NR_faccessat 300 +#define __NR_pselect6 301 +#define __NR_ppoll 302 +#define __NR_unshare 303 +#define __NR_set_robust_list 304 +#define __NR_get_robust_list 305 +#define __NR_splice 306 +#define __NR_sync_file_range 307 +#define __NR_tee 308 +#define __NR_vmsplice 309 +#define __NR_move_pages 310 +#define __NR_getcpu 311 +#define __NR_epoll_pwait 312 +#define __NR_utimes 313 +#define __NR_fallocate 314 +#define __NR_utimensat 315 +#define __NR_signalfd 316 +#define __NR_timerfd 317 +#define __NR_eventfd 318 +#define __NR_timerfd_create 319 +#define __NR_timerfd_settime 320 +#define __NR_timerfd_gettime 321 +#define __NR_signalfd4 322 +#define __NR_eventfd2 323 +#define __NR_inotify_init1 324 +#define __NR_pipe2 325 +#define __NR_dup3 326 +#define __NR_epoll_create1 327 +#define __NR_preadv 328 +#define __NR_pwritev 329 +#define __NR_rt_tgsigqueueinfo 330 +#define __NR_perf_event_open 331 +#define __NR_fanotify_init 332 +#define __NR_fanotify_mark 333 +#define __NR_prlimit64 334 +#define __NR_name_to_handle_at 335 +#define __NR_open_by_handle_at 336 +#define __NR_clock_adjtime 337 +#define __NR_syncfs 338 +#define __NR_setns 339 +#define __NR_process_vm_readv 340 +#define __NR_process_vm_writev 341 +#define __NR_s390_runtime_instr 342 +#define __NR_kcmp 343 +#define __NR_finit_module 344 +#define __NR_sched_setattr 345 +#define __NR_sched_getattr 346 +#define __NR_renameat2 347 +#define __NR_seccomp 348 +#define __NR_getrandom 349 +#define __NR_memfd_create 350 +#define __NR_bpf 351 +#define __NR_s390_pci_mmio_write 352 +#define __NR_s390_pci_mmio_read 353 +#define __NR_execveat 354 +#define __NR_userfaultfd 355 +#define __NR_membarrier 356 +#define __NR_recvmmsg 357 +#define __NR_sendmmsg 358 +#define __NR_socket 359 +#define __NR_socketpair 360 +#define __NR_bind 361 +#define __NR_connect 362 +#define __NR_listen 363 +#define __NR_accept4 364 +#define __NR_getsockopt 365 +#define __NR_setsockopt 366 +#define __NR_getsockname 367 +#define __NR_getpeername 368 +#define __NR_sendto 369 +#define __NR_sendmsg 370 +#define __NR_recvfrom 371 +#define __NR_recvmsg 372 +#define __NR_shutdown 373 +#define __NR_mlock2 374 +#define __NR_copy_file_range 375 +#define __NR_preadv2 376 +#define __NR_pwritev2 377 + diff --git a/arch/s390x/bits/user.h b/arch/s390x/bits/user.h new file mode 100644 index 00000000..d2065b5e --- /dev/null +++ b/arch/s390x/bits/user.h @@ -0,0 +1,62 @@ +#undef __WORDSIZE +#define __WORDSIZE 64 + +typedef union { + double d; + float f; +} elf_fpreg_t; + +typedef struct { + unsigned fpc; + fpreg_t fprs[16]; +} elf_fpregset_t; + +#define ELF_NGREG 27 +typedef unsigned long elf_greg_t, elf_gregset_t[ELG_NGREG]; + +struct _user_psw_struct { + unsigned long mask, addr; +}; + +struct _user_fpregs_struct { + unsigned fpc; + double fprs[16]; +}; + +struct _user_regs_struct { + struct _user_psw_struct psw; + unsigned long gprs[16]; + unsigned acrs[16]; + unsigned long orig_gpr2; + struct _user_fpregs_struct fp_regs; + struct _user_per_struct per_info; + unsigned long ieee_instruction_pointer; +}; + +struct _user_per_struct { + unsigned long control_regs[3]; + unsigned single_step : 1; + unsigned instruction_fetch : 1; + unsigned : 30; + unsigned long starting_addr, ending_addr; + unsigned short perc_atmid; + unsigned long address; + unsigned char access_id; +} per_struct; + +struct user { + struct _user_regs_struct regs; + unsigned long u_tsize, u_dsize, u_ssize; + unsigned long start_code, start_stack; + long signal; + struct _user_regs_struct *u_ar0; + unsigned long magic; + char u_comm[32]; +}; + +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + diff --git a/arch/s390x/crt_arch.h b/arch/s390x/crt_arch.h new file mode 100644 index 00000000..92091a10 --- /dev/null +++ b/arch/s390x/crt_arch.h @@ -0,0 +1,17 @@ +__asm__( +".text\n" +".global " START "\n" +".type " START ", %function\n" +START ":\n" +" lgr %r2, %r15\n" +" larl %r3, 1f\n" +" agf %r3, 0(%r3)\n" +" aghi %r15, -160\n" +" lghi %r0, 0\n" +" stg %r0, 0(%r15)\n" +" jg " START "_c\n" +" .align 8\n" +".weak _DYNAMIC\n" +".hidden _DYNAMIC\n" +"1: .long _DYNAMIC-.\n" +); diff --git a/arch/s390x/pthread_arch.h b/arch/s390x/pthread_arch.h new file mode 100644 index 00000000..bd90016d --- /dev/null +++ b/arch/s390x/pthread_arch.h @@ -0,0 +1,14 @@ +static inline struct pthread *__pthread_self() +{ + struct pthread *self; + __asm__ __volatile__ ( + "ear %0, %%a0\n" + "sllg %0, %0, 32\n" + "ear %0, %%a1\n" + : "=r"(self)); + return self; +} + +#define TP_ADJ(p) (p) + +#define MC_PC psw.addr diff --git a/arch/s390x/reloc.h b/arch/s390x/reloc.h new file mode 100644 index 00000000..a238dc65 --- /dev/null +++ b/arch/s390x/reloc.h @@ -0,0 +1,15 @@ +#include + +#define LDSO_ARCH "s390x" + +#define REL_SYMBOLIC R_390_64 +#define REL_GOT R_390_GLOB_DAT +#define REL_PLT R_390_JMP_SLOT +#define REL_RELATIVE R_390_RELATIVE +#define REL_COPY R_390_COPY +#define REL_DTPMOD R_390_TLS_DTPMOD +#define REL_DTPOFF R_390_TLS_DTPOFF +#define REL_TPOFF R_390_TLS_TPOFF + +#define CRTJMP(pc,sp) __asm__ __volatile__( \ + "lgr %%r15,%1; br %0" : : "r"(pc), "r"(sp) : "memory" ) diff --git a/arch/s390x/syscall_arch.h b/arch/s390x/syscall_arch.h new file mode 100644 index 00000000..afb99852 --- /dev/null +++ b/arch/s390x/syscall_arch.h @@ -0,0 +1,76 @@ +#define __SYSCALL_LL_E(x) (x) +#define __SYSCALL_LL_O(x) (x) + +#define __asm_syscall(ret, ...) do { \ + __asm__ __volatile__ ("svc 0\n" \ + : ret : __VA_ARGS__ : "memory"); \ + return r2; \ + } while (0) + +static inline long __syscall0(long n) +{ + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2"); + __asm_syscall("=r"(r2), "r"(r1)); +} + +static inline long __syscall1(long n, long a) +{ + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2") = a; + __asm_syscall("+r"(r2), "r"(r1)); +} + +static inline long __syscall2(long n, long a, long b) +{ + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2") = a; + register long r3 __asm__("r3") = b; + __asm_syscall("+r"(r2), "r"(r1), "r"(r3)); +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2") = a; + register long r3 __asm__("r3") = b; + register long r4 __asm__("r4") = c; + __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4)); +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2") = a; + register long r3 __asm__("r3") = b; + register long r4 __asm__("r4") = c; + register long r5 __asm__("r5") = d; + __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5)); +} + +static inline long __syscall5(long n, long a, long b, long c, long d, long e) +{ + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2") = a; + register long r3 __asm__("r3") = b; + register long r4 __asm__("r4") = c; + register long r5 __asm__("r5") = d; + register long r6 __asm__("r6") = e; + __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5), "r"(r6)); +} + +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) +{ + if (n == SYS_mmap) return __syscall1(n, (long)(long[]){a,b,c,d,e,f}); + + register long r1 __asm__("r1") = n; + register long r2 __asm__("r2") = a; + register long r3 __asm__("r3") = b; + register long r4 __asm__("r4") = c; + register long r5 __asm__("r5") = d; + register long r6 __asm__("r6") = e; + register long r7 __asm__("r7") = f; + __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7)); +} + +#define SYSCALL_USE_SOCKETCALL diff --git a/configure b/configure index 707eb125..81e90f79 100755 --- a/configure +++ b/configure @@ -325,6 +325,7 @@ or1k*) ARCH=or1k ;; powerpc64*) ARCH=powerpc64 ;; powerpc*) ARCH=powerpc ;; sh[1-9bel-]*|sh|superh*) ARCH=sh ;; +s390x*) ARCH=s390x ;; unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; *) fail "$0: unknown or unsupported target \"$target\"" ;; esac diff --git a/crt/s390x/crti.s b/crt/s390x/crti.s new file mode 100644 index 00000000..f453205b --- /dev/null +++ b/crt/s390x/crti.s @@ -0,0 +1,17 @@ +.section .init +.align 2 +.global _init +_init: + stmg %r14, %r15, 112(%r15) + lgr %r0, %r15 + aghi %r15, -160 + stg %r0, 0(%r15) + +.section .fini +.align 2 +.global _fini +_fini: + stmg %r14, %r15, 112(%r15) + lgr %r0, %r15 + aghi %r15, -160 + stg %r0, 0(%r15) diff --git a/crt/s390x/crtn.s b/crt/s390x/crtn.s new file mode 100644 index 00000000..06066dc9 --- /dev/null +++ b/crt/s390x/crtn.s @@ -0,0 +1,9 @@ +.section .init +.align 2 + lmg %r14, %r15, 272(%r15) + br %r14 + +.section .fini +.align 2 + lmg %r14, %r15, 272(%r15) + br %r14 diff --git a/src/fenv/s390x/fenv.c b/src/fenv/s390x/fenv.c new file mode 100644 index 00000000..9a3488d7 --- /dev/null +++ b/src/fenv/s390x/fenv.c @@ -0,0 +1,55 @@ +#include + +static inline unsigned get_fpc(void) +{ + unsigned fpc; + __asm__ __volatile__("efpc %0" : "=r"(fpc)); + return fpc; +} + +static inline void set_fpc(unsigned fpc) +{ + __asm__ __volatile__("sfpc %0" :: "r"(fpc)); +} + +int feclearexcept(int mask) +{ + mask &= FE_ALL_EXCEPT; + set_fpc(get_fpc() & ~mask); + return 0; +} + +int feraiseexcept(int mask) +{ + mask &= FE_ALL_EXCEPT; + set_fpc(get_fpc() | mask); + return 0; +} + +int fetestexcept(int mask) +{ + return get_fpc() & mask & FE_ALL_EXCEPT; +} + +int fegetround(void) +{ + return get_fpc() & 3; +} + +int __fesetround(int r) +{ + set_fpc(get_fpc() & ~3L | r); + return 0; +} + +int fegetenv(fenv_t *envp) +{ + *envp = get_fpc(); + return 0; +} + +int fesetenv(const fenv_t *envp) +{ + set_fpc(envp != FE_DFL_ENV ? *envp : 0); + return 0; +} diff --git a/src/internal/s390x/syscall.s b/src/internal/s390x/syscall.s new file mode 100644 index 00000000..2322bc36 --- /dev/null +++ b/src/internal/s390x/syscall.s @@ -0,0 +1,15 @@ +.global __syscall +.hidden __syscall +.type __syscall, %function +__syscall: + stg %r7, 56(%r15) + lgr %r1, %r2 + lgr %r2, %r3 + lgr %r3, %r4 + lgr %r4, %r5 + lgr %r5, %r6 + lg %r6, 160(%r15) + lg %r7, 168(%r15) + svc 0 + lg %r7, 56(%r15) + br %r14 diff --git a/src/process/s390x/vfork.s b/src/process/s390x/vfork.s new file mode 100644 index 00000000..05956e81 --- /dev/null +++ b/src/process/s390x/vfork.s @@ -0,0 +1,8 @@ + .global __vfork + .weak vfork + .type __vfork,%function + .type vfork,%function +__vfork: +vfork: + svc 190 + jg __syscall_ret diff --git a/src/setjmp/s390x/longjmp.s b/src/setjmp/s390x/longjmp.s new file mode 100644 index 00000000..b2310f8a --- /dev/null +++ b/src/setjmp/s390x/longjmp.s @@ -0,0 +1,23 @@ + .global _longjmp + .global longjmp + .type _longjmp,@function + .type longjmp,@function +_longjmp: +longjmp: + +1: + lmg %r6, %r15, 0(%r2) + + ld %f8, 10*8(%r2) + ld %f9, 11*8(%r2) + ld %f10, 12*8(%r2) + ld %f11, 13*8(%r2) + ld %f12, 14*8(%r2) + ld %f13, 15*8(%r2) + ld %f14, 16*8(%r2) + ld %f15, 17*8(%r2) + + ltgr %r2, %r3 + bnzr %r14 + lhi %r2, 1 + br %r14 diff --git a/src/setjmp/s390x/setjmp.s b/src/setjmp/s390x/setjmp.s new file mode 100644 index 00000000..afae1b67 --- /dev/null +++ b/src/setjmp/s390x/setjmp.s @@ -0,0 +1,25 @@ + .global ___setjmp + .hidden ___setjmp + .global __setjmp + .global _setjmp + .global setjmp + .type __setjmp,@function + .type _setjmp,@function + .type setjmp,@function +___setjmp: +__setjmp: +_setjmp: +setjmp: + stmg %r6, %r15, 0(%r2) + + std %f8, 10*8(%r2) + std %f9, 11*8(%r2) + std %f10, 12*8(%r2) + std %f11, 13*8(%r2) + std %f12, 14*8(%r2) + std %f13, 15*8(%r2) + std %f14, 16*8(%r2) + std %f15, 17*8(%r2) + + lghi %r2, 0 + br %r14 diff --git a/src/signal/s390x/restore.s b/src/signal/s390x/restore.s new file mode 100644 index 00000000..79beb68f --- /dev/null +++ b/src/signal/s390x/restore.s @@ -0,0 +1,9 @@ + .global __restore + .type __restore,%function +__restore: + svc 119 #__NR_sigreturn + + .global __restore_rt + .type __restore_rt,%function +__restore_rt: + svc 173 # __NR_rt_sigreturn diff --git a/src/signal/s390x/sigsetjmp.s b/src/signal/s390x/sigsetjmp.s new file mode 100644 index 00000000..72dfc25d --- /dev/null +++ b/src/signal/s390x/sigsetjmp.s @@ -0,0 +1,23 @@ + .global sigsetjmp + .global __sigsetjmp + .type sigsetjmp,%function + .type __sigsetjmp,%function + .hidden ___setjmp +sigsetjmp: +__sigsetjmp: + ltgr %r3, %r3 + bz ___setjmp + + stg %r14, 18*8(%r2) + stg %r6, 20*8(%r2) + lgr %r6, %r2 + + brasl %r14, ___setjmp + + lgr %r3, %r2 + lgr %r2, %r6 + lg %r14, 18*8(%r2) + lg %r6, 20*8(%r2) + +.hidden __sigsetjmp_tail + jg __sigsetjmp_tail diff --git a/src/thread/s390x/__set_thread_area.s b/src/thread/s390x/__set_thread_area.s new file mode 100644 index 00000000..fd412913 --- /dev/null +++ b/src/thread/s390x/__set_thread_area.s @@ -0,0 +1,9 @@ +.text +.global __set_thread_area +.type __set_thread_area, %function +__set_thread_area: + sar %a1, %r2 + srlg %r2, %r2, 32 + sar %a0, %r2 + lghi %r2, 0 + br %r14 diff --git a/src/thread/s390x/__tls_get_offset.s b/src/thread/s390x/__tls_get_offset.s new file mode 100644 index 00000000..8ee92de8 --- /dev/null +++ b/src/thread/s390x/__tls_get_offset.s @@ -0,0 +1,17 @@ + .global __tls_get_offset + .type __tls_get_offset,%function +__tls_get_offset: + stmg %r14, %r15, 112(%r15) + aghi %r15, -160 + + la %r2, 0(%r2, %r12) + brasl %r14, __tls_get_addr + + ear %r1, %a0 + sllg %r1, %r1, 32 + ear %r1, %a1 + + sgr %r2, %r1 + + lmg %r14, %r15, 272(%r15) + br %r14 diff --git a/src/thread/s390x/__unmapself.s b/src/thread/s390x/__unmapself.s new file mode 100644 index 00000000..48b312cd --- /dev/null +++ b/src/thread/s390x/__unmapself.s @@ -0,0 +1,6 @@ +.text +.global __unmapself +.type __unmapself, @function +__unmapself: + svc 91 # SYS_munmap + svc 1 # SYS_exit diff --git a/src/thread/s390x/clone.s b/src/thread/s390x/clone.s new file mode 100644 index 00000000..3e08c213 --- /dev/null +++ b/src/thread/s390x/clone.s @@ -0,0 +1,47 @@ +.text +.global __clone +.type __clone, %function +__clone: + # int clone( + # fn, a = r2 + # stack, b = r3 + # flags, c = r4 + # arg, d = r5 + # ptid, e = r6 + # tls, f = *(r15+160) + # ctid) g = *(r15+168) + # + # pseudo C code: + # tid = syscall(SYS_clone,b,c,e,g,f); + # if (!tid) syscall(SYS_exit, a(d)); + # return tid; + + # create initial stack frame for new thread + nill %r3, 0xfff8 + aghi %r3, -160 + lghi %r0, 0 + stg %r0, 0(%r3) + + # save fn and arg to child stack + stg %r2, 8(%r3) + stg %r5, 16(%r3) + + # shuffle args into correct registers and call SYS_clone + lgr %r2, %r3 + lgr %r3, %r4 + lgr %r4, %r6 + lg %r5, 168(%r15) + lg %r6, 160(%r15) + svc 120 + + # if error or if we're the parent, return + ltgr %r2, %r2 + bnzr %r14 + + # we're the child. call fn(arg) + lg %r1, 8(%r15) + lg %r2, 16(%r15) + basr %r14, %r1 + + # call SYS_exit. exit code is already in r2 from fn return value + svc 1 diff --git a/src/thread/s390x/syscall_cp.s b/src/thread/s390x/syscall_cp.s new file mode 100644 index 00000000..c1da40de --- /dev/null +++ b/src/thread/s390x/syscall_cp.s @@ -0,0 +1,32 @@ + .global __cp_begin + .hidden __cp_begin + .global __cp_end + .hidden __cp_end + .global __cp_cancel + .hidden __cp_cancel + .hidden __cancel + .global __syscall_cp_asm + .hidden __syscall_cp_asm + .text + .type __syscall_cp_asm,%function +__syscall_cp_asm: +__cp_begin: + icm %r2, 15, 0(%r2) + jne __cp_cancel + + stg %r7, 56(%r15) + lgr %r1, %r3 + lgr %r2, %r4 + lgr %r3, %r5 + lgr %r4, %r6 + lg %r5, 160(%r15) + lg %r6, 168(%r15) + lg %r7, 176(%r15) + svc 0 + +__cp_end: + lg %r7, 56(%r15) + br %r14 + +__cp_cancel: + jg __cancel From 54991729fd1e3d3a0cb71884d758d86afe6da9e0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 12 Nov 2016 19:43:37 -0500 Subject: [PATCH 234/412] work around gdb issues recognizing sigreturn trampoline on x86_64 gdb can only backtrace/unwind across signal handlers if it recognizes the sa_restorer trampoline. for x86_64, gdb first attempts to determine the symbol name for the function in which the program counter resides and match it against "__restore_rt". if no name can be found (e.g. in the case of a stripped binary), the exact instruction sequence is matched instead. when matching the function name, however, gdb's unwind code wrongly considers the interval [sym,sym+size] rather than [sym,sym+size). thus, if __restore_rt begins immediately after another function, gdb wrongly identifies pc as lying within the previous adjacent function. this patch adds a nop before __restore_rt to preclude that possibility. it also removes the symbol name __restore and replaces it with a macro since the stability of whether gdb identifies the function as __restore_rt or __restore is not clear. for the no-symbols case, the instruction sequence is changed to use %rax rather than %eax to match what gdb expects. based on patch by Szabolcs Nagy, with extended description and corresponding x32 changes added. --- arch/x32/ksigaction.h | 9 +++++++++ arch/x86_64/ksigaction.h | 9 +++++++++ src/signal/x32/restore.s | 7 +++---- src/signal/x86_64/restore.s | 7 +++---- 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 arch/x32/ksigaction.h create mode 100644 arch/x86_64/ksigaction.h diff --git a/arch/x32/ksigaction.h b/arch/x32/ksigaction.h new file mode 100644 index 00000000..7743c5c6 --- /dev/null +++ b/arch/x32/ksigaction.h @@ -0,0 +1,9 @@ +struct k_sigaction { + void (*handler)(int); + unsigned long flags; + void (*restorer)(void); + unsigned mask[2]; +}; + +void __restore_rt(); +#define __restore __restore_rt diff --git a/arch/x86_64/ksigaction.h b/arch/x86_64/ksigaction.h new file mode 100644 index 00000000..7743c5c6 --- /dev/null +++ b/arch/x86_64/ksigaction.h @@ -0,0 +1,9 @@ +struct k_sigaction { + void (*handler)(int); + unsigned long flags; + void (*restorer)(void); + unsigned mask[2]; +}; + +void __restore_rt(); +#define __restore __restore_rt diff --git a/src/signal/x32/restore.s b/src/signal/x32/restore.s index 27cd3cef..2f06e787 100644 --- a/src/signal/x32/restore.s +++ b/src/signal/x32/restore.s @@ -1,8 +1,7 @@ + nop .global __restore_rt -.global __restore .type __restore_rt,@function -.type __restore,@function __restore_rt: -__restore: - movl $0x40000201, %eax /* SYS_rt_sigreturn */ + mov $0x40000201, %rax /* SYS_rt_sigreturn */ syscall +.size __restore_rt,.-__restore_rt diff --git a/src/signal/x86_64/restore.s b/src/signal/x86_64/restore.s index 682af2dd..b5c6e37f 100644 --- a/src/signal/x86_64/restore.s +++ b/src/signal/x86_64/restore.s @@ -1,8 +1,7 @@ + nop .global __restore_rt -.global __restore .type __restore_rt,@function -.type __restore,@function __restore_rt: -__restore: - movl $15, %eax + mov $15, %rax syscall +.size __restore_rt,.-__restore_rt From 6f1866768a86239672ed811777dfe89994d64a65 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 6 Dec 2016 22:57:15 -0500 Subject: [PATCH 235/412] remove largish unused field from pthread structure --- src/internal/pthread_impl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h index 7a679dbf..757b86ad 100644 --- a/src/internal/pthread_impl.h +++ b/src/internal/pthread_impl.h @@ -30,7 +30,6 @@ struct pthread { void *result; struct __ptcb *cancelbuf; void **tsd; - pthread_attr_t attr; volatile int dead; struct { volatile void *volatile head; From ffaaa6d230512f3a7f3d040b943517728f3dc3cf Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 15 Dec 2016 12:18:24 -0500 Subject: [PATCH 236/412] remove legacy i386 fallback stdarg implementation and framework this has been slated for removal for a long time. there is fundamentally no way to implement stdarg without compiler assistance; any attempt to do so has serious undefined behavior; its working depends not just (as a common misconception goes) on ABI, but also on assumptions about compiler code generation internal to a translation unit, which is not subject to external ABI constraints. --- arch/generic/bits/stdarg.h | 4 ---- arch/i386/bits/stdarg.h | 9 --------- include/stdarg.h | 4 ---- 3 files changed, 17 deletions(-) delete mode 100644 arch/generic/bits/stdarg.h delete mode 100644 arch/i386/bits/stdarg.h diff --git a/arch/generic/bits/stdarg.h b/arch/generic/bits/stdarg.h deleted file mode 100644 index fde37814..00000000 --- a/arch/generic/bits/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#define va_copy(d,s) __builtin_va_copy(d,s) diff --git a/arch/i386/bits/stdarg.h b/arch/i386/bits/stdarg.h deleted file mode 100644 index 6b1830d2..00000000 --- a/arch/i386/bits/stdarg.h +++ /dev/null @@ -1,9 +0,0 @@ -#define __VA_ALIGNED_SIZE(x) ((sizeof(x) + sizeof(int) - 1) & ~(sizeof(int) - 1)) - -#define va_start(ap, last) ((ap) = (void *)(((char *)&(last)) + __VA_ALIGNED_SIZE(last))) -#define va_end(ap) ((void)0) -#define va_copy(dest, src) ((dest) = (src)) - -#define va_arg(ap, type) \ - ( ((ap) = (va_list)((char *)(ap) + __VA_ALIGNED_SIZE(type))), \ - *(type *)(void *)((char *)(ap) - __VA_ALIGNED_SIZE(type)) ) diff --git a/include/stdarg.h b/include/stdarg.h index 60d4e2af..3256f805 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -9,14 +9,10 @@ extern "C" { #include -#if __GNUC__ >= 3 #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #define va_copy(d,s) __builtin_va_copy(d,s) -#else -#include -#endif #ifdef __cplusplus } From afefce19fd7d1dd6aa8789f598a60b1d974f45fb Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Mon, 14 Nov 2016 21:37:41 -0600 Subject: [PATCH 237/412] fix typo in s390x user.h --- arch/s390x/bits/user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390x/bits/user.h b/arch/s390x/bits/user.h index d2065b5e..428a3979 100644 --- a/arch/s390x/bits/user.h +++ b/arch/s390x/bits/user.h @@ -12,7 +12,7 @@ typedef struct { } elf_fpregset_t; #define ELF_NGREG 27 -typedef unsigned long elf_greg_t, elf_gregset_t[ELG_NGREG]; +typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; struct _user_psw_struct { unsigned long mask, addr; From 3f79eaa870a87c7f7d19c0e340791fac80a16d06 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Mon, 14 Nov 2016 21:37:42 -0600 Subject: [PATCH 238/412] fix use of incomplete struct type in s390x user.h --- arch/s390x/bits/user.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/s390x/bits/user.h b/arch/s390x/bits/user.h index 428a3979..90f07b78 100644 --- a/arch/s390x/bits/user.h +++ b/arch/s390x/bits/user.h @@ -23,16 +23,6 @@ struct _user_fpregs_struct { double fprs[16]; }; -struct _user_regs_struct { - struct _user_psw_struct psw; - unsigned long gprs[16]; - unsigned acrs[16]; - unsigned long orig_gpr2; - struct _user_fpregs_struct fp_regs; - struct _user_per_struct per_info; - unsigned long ieee_instruction_pointer; -}; - struct _user_per_struct { unsigned long control_regs[3]; unsigned single_step : 1; @@ -44,6 +34,16 @@ struct _user_per_struct { unsigned char access_id; } per_struct; +struct _user_regs_struct { + struct _user_psw_struct psw; + unsigned long gprs[16]; + unsigned acrs[16]; + unsigned long orig_gpr2; + struct _user_fpregs_struct fp_regs; + struct _user_per_struct per_info; + unsigned long ieee_instruction_pointer; +}; + struct user { struct _user_regs_struct regs; unsigned long u_tsize, u_dsize, u_ssize; From c1020cf21e7c09cf313c98b69d5c5af8f3895502 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 27 Nov 2016 12:18:10 -0600 Subject: [PATCH 239/412] fix crashing sigsetjmp on s390x the bz instruction that was wrongly used only admits a small immediate displacement and cannot be used with external symbols; apparently the linker fails to diagnose the overflow. --- src/signal/s390x/sigsetjmp.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signal/s390x/sigsetjmp.s b/src/signal/s390x/sigsetjmp.s index 72dfc25d..41b1bd9a 100644 --- a/src/signal/s390x/sigsetjmp.s +++ b/src/signal/s390x/sigsetjmp.s @@ -6,7 +6,7 @@ sigsetjmp: __sigsetjmp: ltgr %r3, %r3 - bz ___setjmp + jz ___setjmp stg %r14, 18*8(%r2) stg %r6, 20*8(%r2) From bfcf5735d08b4e57e0865006392822f8b526771a Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Mon, 12 Dec 2016 21:01:26 +0100 Subject: [PATCH 240/412] in public headers, don't assume pre-C99 compilers have __inline keyword --- include/features.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/features.h b/include/features.h index 3cc3e579..f4d651ef 100644 --- a/include/features.h +++ b/include/features.h @@ -24,6 +24,8 @@ #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) #define __inline inline +#elif !defined(__GNUC__) +#define __inline #endif #if __STDC_VERSION__ >= 201112L From adfe682eb0d77c6afc751f5e407d9da39623c24e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 16 Dec 2016 23:19:27 -0500 Subject: [PATCH 241/412] fix mrand48/jrand48 return value on 64-bit archs POSIX specifies the result to have signed 32-bit range. on 32-bit archs, the implicit conversion to long achieved the desired range already, but when long is 64-bit, a cast is needed. patch by Ed Schouten. --- src/prng/mrand48.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prng/mrand48.c b/src/prng/mrand48.c index ee650fc3..0519d667 100644 --- a/src/prng/mrand48.c +++ b/src/prng/mrand48.c @@ -6,7 +6,7 @@ extern unsigned short __seed48[7]; long jrand48(unsigned short s[3]) { - return __rand48_step(s, __seed48+3) >> 16; + return (int32_t)(__rand48_step(s, __seed48+3) >> 16); } long mrand48(void) From 7a4c25d78030b3a43ed5c8dd1a456f73cb990f44 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 24 Nov 2016 01:44:49 +0100 Subject: [PATCH 242/412] handle ^ and $ in BRE subexpression start and end as anchors In BRE, ^ is an anchor at the beginning of an expression, optionally it may be an anchor at the beginning of a subexpression and must be treated as a literal otherwise. Previously musl treated ^ in subexpressions as literal, but at least glibc and gnu sed treats it as an anchor and that's the more useful behaviour: it can always be escaped to get back the literal meaning. Same for $ at the end of a subexpression. Portable BRE should not rely on this, but there are sed commands in build scripts which do. This changes the meaning of the BREs: \(^a\) \(a\|^b\) \(a$\) \(a$\|b\) --- src/regex/regcomp.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 65f2fd0b..5a7b53a7 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -401,8 +401,8 @@ typedef struct { tre_ast_node_t *n; /* Position in the regexp pattern after a parse function returns. */ const char *s; - /* The first character of the regexp. */ - const char *re; + /* The first character of the last subexpression parsed. */ + const char *start; /* Current submatch ID. */ int submatch_id; /* Current position (number of literal). */ @@ -876,14 +876,14 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) break; case '^': /* '^' has a special meaning everywhere in EREs, and at beginning of BRE. */ - if (!ere && s != ctx->re) + if (!ere && s != ctx->start) goto parse_literal; node = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_BOL, -1); s++; break; case '$': - /* '$' is special everywhere in EREs, and in the end of the string in BREs. */ - if (!ere && s[1]) + /* '$' is special everywhere in EREs, and at the end of a BRE subexpression. */ + if (!ere && s[1] && (s[1]!='\\'|| (s[2]!=')' && s[2]!='|'))) goto parse_literal; node = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_EOL, -1); s++; @@ -944,7 +944,7 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) { tre_ast_node_t *nbranch=0, *nunion=0; int ere = ctx->cflags & REG_EXTENDED; - const char *s = ctx->re; + const char *s = ctx->start; int subid = 0; int depth = 0; reg_errcode_t err; @@ -962,6 +962,7 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) s++; depth++; nbranch = nunion = 0; + ctx->start = s; continue; } if ((!ere && *s == '\\' && s[1] == ')') || @@ -994,8 +995,8 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) if (*s=='\\') s++; - /* handle ^* at the start of a complete BRE. */ - if (!ere && s==ctx->re+1 && s[-1]=='^') + /* handle ^* at the start of a BRE. */ + if (!ere && s==ctx->start+1 && s[-1]=='^') break; /* extension: multiple consecutive *+?{,} is unspecified, @@ -1038,8 +1039,10 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) if (c == '\\' && s[1] == '|') { s+=2; + ctx->start = s; } else if (c == '|') { s++; + ctx->start = s; } else { if (c == '\\') { if (!depth) return REG_EPAREN; @@ -2705,7 +2708,7 @@ regcomp(regex_t *restrict preg, const char *restrict regex, int cflags) memset(&parse_ctx, 0, sizeof(parse_ctx)); parse_ctx.mem = mem; parse_ctx.stack = stack; - parse_ctx.re = regex; + parse_ctx.start = regex; parse_ctx.cflags = cflags; parse_ctx.max_backref = -1; errcode = tre_parse(&parse_ctx); From 61ff1af76f4887bb7c555e4d0b8a7eeb73b05086 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 17 Dec 2016 15:03:24 +0100 Subject: [PATCH 243/412] use lookup table for malloc bin index instead of float conversion float conversion is slow and big on soft-float targets. The lookup table increases code size a bit on most hard float targets (and adds 60byte rodata), performance can be a bit slower because of position independent data access and cpu internal state dependence (cache, extra branches), but the overall effect should be minimal (common, small size allocations should be unaffected). --- src/malloc/malloc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c index b90636cc..c38c46fe 100644 --- a/src/malloc/malloc.c +++ b/src/malloc/malloc.c @@ -111,19 +111,29 @@ static int first_set(uint64_t x) #endif } +static const unsigned char bin_tab[60] = { + 32,33,34,35,36,36,37,37,38,38,39,39, + 40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43, + 44,44,44,44,44,44,44,44,45,45,45,45,45,45,45,45, + 46,46,46,46,46,46,46,46,47,47,47,47,47,47,47,47, +}; + static int bin_index(size_t x) { x = x / SIZE_ALIGN - 1; if (x <= 32) return x; + if (x < 512) return bin_tab[x/8-4]; if (x > 0x1c00) return 63; - return ((union { float v; uint32_t r; }){(int)x}.r>>21) - 496; + return bin_tab[x/128-4] + 16; } static int bin_index_up(size_t x) { x = x / SIZE_ALIGN - 1; if (x <= 32) return x; - return ((union { float v; uint32_t r; }){(int)x}.r+0x1fffff>>21) - 496; + x--; + if (x < 512) return bin_tab[x/8-4] + 1; + return bin_tab[x/128-4] + 17; } #if 0 From fbbeda172d6f146067f9f57ab1498cf99c8d1007 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 17 Dec 2016 19:30:03 -0500 Subject: [PATCH 244/412] make arm setjmp/longjmp asm thumb2-compatible sp cannot be used in the ldm/stm register set in thumb mode. --- src/setjmp/arm/longjmp.s | 4 +++- src/setjmp/arm/setjmp.s | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/setjmp/arm/longjmp.s b/src/setjmp/arm/longjmp.s index e28d8f31..6191ab26 100644 --- a/src/setjmp/arm/longjmp.s +++ b/src/setjmp/arm/longjmp.s @@ -8,7 +8,9 @@ longjmp: mov ip,r0 movs r0,r1 moveq r0,#1 - ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp,sp,lr} + ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp} + ldmia ip!, {r2,lr} + mov sp,r2 adr r1,1f ldr r2,1f diff --git a/src/setjmp/arm/setjmp.s b/src/setjmp/arm/setjmp.s index 87791634..c6fe1bb2 100644 --- a/src/setjmp/arm/setjmp.s +++ b/src/setjmp/arm/setjmp.s @@ -9,7 +9,9 @@ __setjmp: _setjmp: setjmp: mov ip,r0 - stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,sp,lr} + stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp} + mov r2,sp + stmia ip!,{r2,lr} mov r0,#0 adr r1,1f From 9067a3006ea2f84395ab23a1dd30191387312e0c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 17 Dec 2016 19:39:28 -0500 Subject: [PATCH 245/412] disable use of arm memcpy asm if building as thumb code the thumb incompatibilities in the asm are probably only minor and should be fixable, but for now just use the C version. --- src/string/arm/memcpy.c | 2 +- src/string/arm/memcpy_le.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/string/arm/memcpy.c b/src/string/arm/memcpy.c index 041614f4..f703c9bd 100644 --- a/src/string/arm/memcpy.c +++ b/src/string/arm/memcpy.c @@ -1,3 +1,3 @@ -#if __ARMEB__ +#if __ARMEB__ || __thumb__ #include "../memcpy.c" #endif diff --git a/src/string/arm/memcpy_le.S b/src/string/arm/memcpy_le.S index 4db48445..9cfbcb2a 100644 --- a/src/string/arm/memcpy_le.S +++ b/src/string/arm/memcpy_le.S @@ -1,4 +1,4 @@ -#ifndef __ARMEB__ +#if !__ARMEB__ && !__thumb__ /* * Copyright (C) 2008 The Android Open Source Project From 29237f7f5c09c436825a7a12b68ab4143b0ebd1f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 18 Dec 2016 19:38:53 -0500 Subject: [PATCH 246/412] rework arm atomic/tp backends to be thumb-compatible and fdpic-ready three problems are addressed: - use of pc arithmetic, which was difficult if not impossible to make correct in thumb mode on all models, so that relative rather than absolute pointers to the backends could be used. this was designed back when there was no coherent model for the early stages of the dynamic linker before relocations, and is no longer necessary. - assumption that data (the relative pointers to the backends) can be accessed at a constant displacement from the code. this will not be possible on future fdpic subarchs (for cortex-m), so move responsibility for loading the backend code address to the caller. - hard-coded arm opcodes using the .word directive. instead, use the .arch directive to work around the assembler's refusal to assemble instructions not available (or in some cases, available but just considered deprecated) in the target isa level. the obscure v6t2 arch is used for v6 code so as to (1) allow generation of thumb2 output if -mthumb is active, and (2) avoid warnings/errors for mcr barriers that clang would produce if we just set arch to v7-a. in addition, the __aeabi_read_tp function is moved out of the inner workings and implemented as an asm wrapper around a C function, so that asm code does not need to read global data. the asm wrapper serves to satisfy the ABI calling convention requirements for this function. --- arch/arm/atomic_arch.h | 21 ++++++--- arch/arm/pthread_arch.h | 16 ++++--- src/thread/arm/__aeabi_read_tp.s | 8 ++++ src/thread/arm/__aeabi_read_tp_c.c | 8 ++++ src/thread/arm/__set_thread_area.c | 34 ++++++++------ src/thread/arm/atomics.s | 75 ++++++++++++++---------------- 6 files changed, 92 insertions(+), 70 deletions(-) create mode 100644 src/thread/arm/__aeabi_read_tp.s create mode 100644 src/thread/arm/__aeabi_read_tp_c.c diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index 706fa1f2..d6af84d0 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -1,5 +1,11 @@ -__attribute__((__visibility__("hidden"))) -extern const void *__arm_atomics[3]; /* gettp, cas, barrier */ +#if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4 +#define BLX "mov lr,pc\n\tbx" +#else +#define BLX "blx" +#endif + +extern uintptr_t __attribute__((__visibility__("hidden"))) + __a_cas_ptr, __a_barrier_ptr; #if ((__ARM_ARCH_6__ || __ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 @@ -42,11 +48,12 @@ static inline int a_cas(volatile int *p, int t, int s) register int r0 __asm__("r0") = t; register int r1 __asm__("r1") = s; register volatile int *r2 __asm__("r2") = p; + register uintptr_t r3 __asm__("r3") = __a_cas_ptr; int old; __asm__ __volatile__ ( - "bl __a_cas" - : "+r"(r0) : "r"(r1), "r"(r2) - : "memory", "r3", "lr", "ip", "cc" ); + BLX " r3" + : "+r"(r0), "+r"(r3) : "r"(r1), "r"(r2) + : "memory", "lr", "ip", "cc" ); if (!r0) return t; if ((old=*p)!=t) return old; } @@ -58,8 +65,8 @@ static inline int a_cas(volatile int *p, int t, int s) #define a_barrier a_barrier static inline void a_barrier() { - __asm__ __volatile__("bl __a_barrier" - : : : "memory", "cc", "ip", "lr" ); + register uintptr_t ip __asm__("ip") = __a_barrier_ptr; + __asm__ __volatile__( BLX " ip" : "+r"(ip) : : "memory", "cc", "lr" ); } #endif diff --git a/arch/arm/pthread_arch.h b/arch/arm/pthread_arch.h index 8b8a7fb6..197752ef 100644 --- a/arch/arm/pthread_arch.h +++ b/arch/arm/pthread_arch.h @@ -10,15 +10,17 @@ static inline pthread_t __pthread_self() #else +#if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4 +#define BLX "mov lr,pc\n\tbx" +#else +#define BLX "blx" +#endif + static inline pthread_t __pthread_self() { -#ifdef __clang__ - char *p; - __asm__ __volatile__ ( "bl __a_gettp\n\tmov %0,r0" : "=r"(p) : : "cc", "r0", "lr" ); -#else - register char *p __asm__("r0"); - __asm__ __volatile__ ( "bl __a_gettp" : "=r"(p) : : "cc", "lr" ); -#endif + extern uintptr_t __attribute__((__visibility__("hidden"))) __a_gettp_ptr; + register uintptr_t p __asm__("r0"); + __asm__ __volatile__ ( BLX " %1" : "=r"(p) : "r"(__a_gettp_ptr) : "cc", "lr" ); return (void *)(p+8-sizeof(struct pthread)); } diff --git a/src/thread/arm/__aeabi_read_tp.s b/src/thread/arm/__aeabi_read_tp.s new file mode 100644 index 00000000..9d0cd311 --- /dev/null +++ b/src/thread/arm/__aeabi_read_tp.s @@ -0,0 +1,8 @@ +.syntax unified +.global __aeabi_read_tp +.type __aeabi_read_tp,%function +__aeabi_read_tp: + push {r1,r2,r3,lr} + bl __aeabi_read_tp_c + pop {r1,r2,r3,lr} + bx lr diff --git a/src/thread/arm/__aeabi_read_tp_c.c b/src/thread/arm/__aeabi_read_tp_c.c new file mode 100644 index 00000000..654bdc57 --- /dev/null +++ b/src/thread/arm/__aeabi_read_tp_c.c @@ -0,0 +1,8 @@ +#include "pthread_impl.h" +#include + +__attribute__((__visibility__("hidden"))) +void *__aeabi_read_tp_c(void) +{ + return (void *)((uintptr_t)__pthread_self()-8+sizeof(struct pthread)); +} diff --git a/src/thread/arm/__set_thread_area.c b/src/thread/arm/__set_thread_area.c index 61d02827..daf496c2 100644 --- a/src/thread/arm/__set_thread_area.c +++ b/src/thread/arm/__set_thread_area.c @@ -6,43 +6,47 @@ #define HWCAP_TLS (1 << 15) extern const unsigned char __attribute__((__visibility__("hidden"))) - __a_barrier_dummy[], __a_barrier_oldkuser[], - __a_barrier_v6[], __a_barrier_v7[], - __a_cas_dummy[], __a_cas_v6[], __a_cas_v7[], - __a_gettp_dummy[]; + __a_barrier_oldkuser[], __a_barrier_v6[], __a_barrier_v7[], + __a_cas_v6[], __a_cas_v7[], + __a_gettp_cp15[]; #define __a_barrier_kuser 0xffff0fa0 +#define __a_barrier_oldkuser (uintptr_t)__a_barrier_oldkuser +#define __a_barrier_v6 (uintptr_t)__a_barrier_v6 +#define __a_barrier_v7 (uintptr_t)__a_barrier_v7 + #define __a_cas_kuser 0xffff0fc0 +#define __a_cas_v6 (uintptr_t)__a_cas_v6 +#define __a_cas_v7 (uintptr_t)__a_cas_v7 + #define __a_gettp_kuser 0xffff0fe0 +#define __a_gettp_cp15 (uintptr_t)__a_gettp_cp15 extern uintptr_t __attribute__((__visibility__("hidden"))) __a_barrier_ptr, __a_cas_ptr, __a_gettp_ptr; -#define SET(op,ver) (__a_##op##_ptr = \ - (uintptr_t)__a_##op##_##ver - (uintptr_t)__a_##op##_dummy) - int __set_thread_area(void *p) { #if !__ARM_ARCH_7A__ && !__ARM_ARCH_7R__ && __ARM_ARCH < 7 if (__hwcap & HWCAP_TLS) { size_t *aux; - SET(cas, v7); - SET(barrier, v7); + __a_cas_ptr = __a_cas_v7; + __a_barrier_ptr = __a_barrier_v7; for (aux=libc.auxv; *aux; aux+=2) { if (*aux != AT_PLATFORM) continue; const char *s = (void *)aux[1]; if (s[0]!='v' || s[1]!='6' || s[2]-'0'<10u) break; - SET(cas, v6); - SET(barrier, v6); + __a_cas_ptr = __a_cas_v6; + __a_barrier_ptr = __a_barrier_v6; break; } } else { int ver = *(int *)0xffff0ffc; - SET(gettp, kuser); - SET(cas, kuser); - SET(barrier, kuser); + __a_gettp_ptr = __a_gettp_kuser; + __a_cas_ptr = __a_cas_kuser; + __a_barrier_ptr = __a_barrier_kuser; if (ver < 2) a_crash(); - if (ver < 3) SET(barrier, oldkuser); + if (ver < 3) __a_barrier_ptr = __a_barrier_oldkuser; } #endif return __syscall(0xf0005, p); diff --git a/src/thread/arm/atomics.s b/src/thread/arm/atomics.s index 673fc03b..202faa4a 100644 --- a/src/thread/arm/atomics.s +++ b/src/thread/arm/atomics.s @@ -1,20 +1,15 @@ .syntax unified .text -.global __a_barrier -.hidden __a_barrier -.type __a_barrier,%function -__a_barrier: - ldr ip,1f - ldr ip,[pc,ip] - add pc,pc,ip -1: .word __a_barrier_ptr-1b .global __a_barrier_dummy .hidden __a_barrier_dummy +.type __a_barrier_dummy,%function __a_barrier_dummy: bx lr + .global __a_barrier_oldkuser .hidden __a_barrier_oldkuser +.type __a_barrier_oldkuser,%function __a_barrier_oldkuser: push {r0,r1,r2,r3,ip,lr} mov r1,r0 @@ -24,90 +19,88 @@ __a_barrier_oldkuser: mov pc,ip pop {r0,r1,r2,r3,ip,lr} bx lr + .global __a_barrier_v6 .hidden __a_barrier_v6 +.type __a_barrier_v6,%function __a_barrier_v6: + .arch armv6t2 mcr p15,0,r0,c7,c10,5 bx lr + .global __a_barrier_v7 .hidden __a_barrier_v7 +.type __a_barrier_v7,%function __a_barrier_v7: - .word 0xf57ff05b /* dmb ish */ + .arch armv7-a + dmb ish bx lr -.global __a_cas -.hidden __a_cas -.type __a_cas,%function -__a_cas: - ldr ip,1f - ldr ip,[pc,ip] - add pc,pc,ip -1: .word __a_cas_ptr-1b .global __a_cas_dummy .hidden __a_cas_dummy +.type __a_cas_dummy,%function __a_cas_dummy: mov r3,r0 ldr r0,[r2] subs r0,r3,r0 streq r1,[r2] bx lr + .global __a_cas_v6 .hidden __a_cas_v6 +.type __a_cas_v6,%function __a_cas_v6: + .arch armv6t2 mov r3,r0 mcr p15,0,r0,c7,c10,5 -1: .word 0xe1920f9f /* ldrex r0,[r2] */ +1: ldrex r0,[r2] subs r0,r3,r0 - .word 0x01820f91 /* strexeq r0,r1,[r2] */ + strexeq r0,r1,[r2] teqeq r0,#1 beq 1b mcr p15,0,r0,c7,c10,5 bx lr + .global __a_cas_v7 .hidden __a_cas_v7 +.type __a_cas_v7,%function __a_cas_v7: + .arch armv7-a mov r3,r0 - .word 0xf57ff05b /* dmb ish */ -1: .word 0xe1920f9f /* ldrex r0,[r2] */ + dmb ish +1: ldrex r0,[r2] subs r0,r3,r0 - .word 0x01820f91 /* strexeq r0,r1,[r2] */ + strexeq r0,r1,[r2] teqeq r0,#1 beq 1b - .word 0xf57ff05b /* dmb ish */ + dmb ish bx lr -.global __aeabi_read_tp -.type __aeabi_read_tp,%function -__aeabi_read_tp: - -.global __a_gettp -.hidden __a_gettp -.type __a_gettp,%function -__a_gettp: - ldr r0,1f - ldr r0,[pc,r0] - add pc,pc,r0 -1: .word __a_gettp_ptr-1b -.global __a_gettp_dummy -.hidden __a_gettp_dummy -__a_gettp_dummy: +.global __a_gettp_cp15 +.hidden __a_gettp_cp15 +.type __a_gettp_cp15,%function +__a_gettp_cp15: mrc p15,0,r0,c13,c0,3 bx lr +/* Tag this file with minimum ISA level so as not to affect linking. */ +.arch armv4t +.eabi_attribute 6,2 + .data .align 2 .global __a_barrier_ptr .hidden __a_barrier_ptr __a_barrier_ptr: - .word 0 + .word __a_barrier_dummy .global __a_cas_ptr .hidden __a_cas_ptr __a_cas_ptr: - .word 0 + .word __a_cas_dummy .global __a_gettp_ptr .hidden __a_gettp_ptr __a_gettp_ptr: - .word 0 + .word __a_gettp_cp15 From 088c9674a9c81cf20e9a863df571ba6d48e9ae37 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 19 Dec 2016 21:53:33 -0500 Subject: [PATCH 247/412] when building for arm as thumb2 code, also request assembly as thumb all assembly is now thumb2-compatible. on existing targets this is at best a size optimization, but it will also facilitate porting to thumb2-isa-only arm variants. --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index 81e90f79..c2db298c 100755 --- a/configure +++ b/configure @@ -602,6 +602,10 @@ trycppif __ILP32__ "$t" && ARCH=x32 fi if test "$ARCH" = "arm" ; then +if trycppif __thumb2__ "$t" ; then +tryflag CFLAGS_AUTO -Wa,-mimplicit-it=always +tryflag CFLAGS_AUTO -Wa,-mthumb +fi trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf # Versions of clang up until at least 3.8 have the wrong constraint codes From 5bf7eba213cacc4c1220627c91c28deff2ffecda Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 20 Dec 2016 14:19:32 -0500 Subject: [PATCH 248/412] fix support for initialized TLS in static PIE binaries the static-linked version of __init_tls needs to locate the TLS initialization image via the ELF program headers, which requires determining the base address at which the program was loaded. the existing code attempted to do this by comparing the actual address of the program headers (obtained via auxv) with the virtual address for the PT_PHDR record in the program headers. however, the linker seems to produce a PT_PHDR record only when a program interpreter (dynamic linker) is used. thus the computation failed and used the default base address of 0, leading to a crash when trying to access the TLS image at the wrong address. the dynamic linker entry point and static-PIE rcrt1.o startup code compute the base address instead by taking the difference between the run-time address of _DYNAMIC and the virtual address in the PT_DYNAMIC record. this patch copies the approach they use, but with a weak symbolic reference to _DYNAMIC instead of obtaining the address from the crt_arch.h asm. this works because relocations have already been performed at the time __init_tls is called. --- src/env/__init_tls.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c index 0107a545..b125eb1f 100644 --- a/src/env/__init_tls.c +++ b/src/env/__init_tls.c @@ -71,6 +71,9 @@ typedef Elf32_Phdr Phdr; typedef Elf64_Phdr Phdr; #endif +__attribute__((__weak__, __visibility__("hidden"))) +extern const size_t _DYNAMIC[]; + static void static_init_tls(size_t *aux) { unsigned char *p; @@ -83,6 +86,8 @@ static void static_init_tls(size_t *aux) phdr = (void *)p; if (phdr->p_type == PT_PHDR) base = aux[AT_PHDR] - phdr->p_vaddr; + if (phdr->p_type == PT_DYNAMIC && _DYNAMIC) + base = (size_t)_DYNAMIC - phdr->p_vaddr; if (phdr->p_type == PT_TLS) tls_phdr = phdr; } From 62eaf40bf4247751f630faa3c853eacf81874c94 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 25 Dec 2016 10:41:06 +0100 Subject: [PATCH 249/412] add pkey_{mprotect,alloc,free} syscalls from linux v4.9 see linux commit e8c24d3a23a469f1f40d4de24d872ca7023ced0a and linux Documentation/x86/protection-keys.txt --- arch/aarch64/bits/syscall.h.in | 3 +++ arch/arm/bits/syscall.h.in | 3 +++ arch/i386/bits/syscall.h.in | 3 +++ arch/mips/bits/syscall.h.in | 3 +++ arch/mips64/bits/syscall.h.in | 3 +++ arch/mipsn32/bits/syscall.h.in | 3 +++ arch/or1k/bits/syscall.h.in | 3 +++ arch/x32/bits/syscall.h.in | 3 +++ arch/x86_64/bits/syscall.h.in | 3 +++ 9 files changed, 27 insertions(+) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index 332f437d..fd388eec 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -271,4 +271,7 @@ #define __NR_copy_file_range 285 #define __NR_preadv2 286 #define __NR_pwritev2 287 +#define __NR_pkey_mprotect 288 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index 04c8b1cf..9b129b23 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -347,6 +347,9 @@ #define __NR_copy_file_range 391 #define __NR_preadv2 392 #define __NR_pwritev2 393 +#define __NR_pkey_mprotect 394 +#define __NR_pkey_alloc 395 +#define __NR_pkey_free 396 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index 5fe9c5c4..3a1d9270 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -378,4 +378,7 @@ #define __NR_copy_file_range 377 #define __NR_preadv2 378 #define __NR_pwritev2 379 +#define __NR_pkey_mprotect 380 +#define __NR_pkey_alloc 381 +#define __NR_pkey_free 382 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index bcceaa2a..6c9b3d8c 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -360,4 +360,7 @@ #define __NR_copy_file_range 4360 #define __NR_preadv2 4361 #define __NR_pwritev2 4362 +#define __NR_pkey_mprotect 4363 +#define __NR_pkey_alloc 4364 +#define __NR_pkey_free 4365 diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in index eef85435..a207133c 100644 --- a/arch/mips64/bits/syscall.h.in +++ b/arch/mips64/bits/syscall.h.in @@ -320,4 +320,7 @@ #define __NR_copy_file_range 5320 #define __NR_preadv2 5321 #define __NR_pwritev2 5322 +#define __NR_pkey_mprotect 5323 +#define __NR_pkey_alloc 5324 +#define __NR_pkey_free 5325 diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index 5fda0b57..d6b24e8f 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -324,4 +324,7 @@ #define __NR_copy_file_range 6324 #define __NR_preadv2 6325 #define __NR_pwritev2 6326 +#define __NR_pkey_mprotect 6327 +#define __NR_pkey_alloc 6328 +#define __NR_pkey_free 6329 diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index c6b6cf2c..89788a9d 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -271,4 +271,7 @@ #define __NR_copy_file_range 285 #define __NR_preadv2 286 #define __NR_pwritev2 287 +#define __NR_pkey_mprotect 288 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index e94dcb2f..de6cffe0 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -280,6 +280,9 @@ #define __NR_membarrier (0x40000000 + 324) #define __NR_mlock2 (0x40000000 + 325) #define __NR_copy_file_range (0x40000000 + 326) +#define __NR_pkey_mprotect (0x40000000 + 329) +#define __NR_pkey_alloc (0x40000000 + 330) +#define __NR_pkey_free (0x40000000 + 331) #define __NR_rt_sigaction (0x40000000 + 512) #define __NR_rt_sigreturn (0x40000000 + 513) diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in index d0c55185..6e743dfb 100644 --- a/arch/x86_64/bits/syscall.h.in +++ b/arch/x86_64/bits/syscall.h.in @@ -327,4 +327,7 @@ #define __NR_copy_file_range 326 #define __NR_preadv2 327 #define __NR_pwritev2 328 +#define __NR_pkey_mprotect 329 +#define __NR_pkey_alloc 330 +#define __NR_pkey_free 331 From a8a8fdff968c19a05331b032cf395b5cf0dbbd84 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 25 Dec 2016 10:42:15 +0100 Subject: [PATCH 250/412] add MS_NOREMOTELOCK mount flag from linux v4.9 for handling file locking on overlayfs. see linux commit c568d68341be7030f5647def68851e469b21ca11 --- include/sys/mount.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/mount.h b/include/sys/mount.h index 6674e657..57a89c09 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -47,6 +47,7 @@ extern "C" { #define MS_I_VERSION (1<<23) #define MS_STRICTATIME (1<<24) #define MS_LAZYTIME (1<<25) +#define MS_NOREMOTELOCK (1<<27) #define MS_NOSEC (1<<28) #define MS_BORN (1<<29) #define MS_ACTIVE (1<<30) From 60c46db80b0b5def37bd306cf526da0b491a1454 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 25 Dec 2016 10:43:42 +0100 Subject: [PATCH 251/412] update tcp_info struct to linux v4.9 export tcp data delivery rate in tcp_info struct. see linux commit eb8329e0a04db0061f714f033b4454326ba147f4 --- include/netinet/tcp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index b9b8a7fa..1339fcc3 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -154,6 +154,7 @@ struct tcp_info { uint8_t tcpi_backoff; uint8_t tcpi_options; uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; + uint8_t tcpi_delivery_rate_app_limited : 1; uint32_t tcpi_rto; uint32_t tcpi_ato; uint32_t tcpi_snd_mss; @@ -188,6 +189,7 @@ struct tcp_info { uint32_t tcpi_min_rtt; uint32_t tcpi_data_segs_in; uint32_t tcpi_data_segs_out; + uint64_t tcpi_delivery_rate; }; #define TCP_MD5SIG_MAXKEYLEN 80 From 8fe1f2d79b275b7f7fb0d41c99e379357df63cd9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 31 Dec 2016 22:27:17 -0500 Subject: [PATCH 252/412] release 1.1.16 --- VERSION | 2 +- WHATSNEW | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 645377ee..63b283b2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.15 +1.1.16 diff --git a/WHATSNEW b/WHATSNEW index be688cbb..d5433367 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1730,3 +1730,49 @@ arch-specific bugs fixed: - broken posix_fadvise on arm and powerpc (32-bit) - thread structure/dtv corruption on powerpc at thread startup - various wrong mips and powerpc ioctl and termios constant values + + + +1.1.16 release notes + +new features: +- s390x (64-bit S/390) port +- pthread_setname_np extension function +- limited pthread_setattr_default_np function to set stack size defaults +- header-level support for linux 4.7, 4.8, and 4.9 features +- confstr _CS_V6_ENV and _CS_V7_ENV items + +compatibility: +- public prototypes for abi-compat *_unlocked symbols, etc. +- fflush_unlocked(NULL) now works +- resolv.h __RES version macro now matches supported APIs +- workaround for gdb bugs backtracing across signals on x86_64 +- anchors ^ and $ are now accepted in BRE subexpressions +- building for thumb2-only arm isa levels is now possible + +bugs fixed: +- integer overflows in regexec buffer allocation (CVE-2016-8859) +- failure of regexec to report matches at offsets past INT_MAX +- static-pie executables with initialized thread-local storage crashed +- printf failed to catch EOVERFLOW in some cases, wrongly produced it in others +- printf produced wrong output, result for float with precision near INT_MAX +- printf produced wrong results with alt-form octal, zero flag, & field width +- printf float rounding was wrong for some midpoint cases +- swprintf printed junk after internal (256-byte) buffer filled up +- strtod family rounded incorrectly in several corner cases +- getmntent failed to handle long records +- getopt_long_only wrongly treated "--" as an option +- asctime output wrongly varied by locale +- strftime %y specifier produced wrong output for negative tm_year +- time zone names quoted with <> were misparsed +- corner case integer overflow in tm_year for some date conversions +- failure to load shared libs whose names were prefixes of standard lib names +- wrong error codes for several failure cases in various functions +- various asymptomatic undefined behavior +- various minor namespace issues in headers + +arch-specific bugs fixed: +- tcsetattr regression on mips (completely non-working) +- wrong pread/pwrite syscall calling convention on sh +- wrong preadv2/pwritev2 syscall numbers on x32 +- mrand48/jrand48 produced wrong-signedness results on 64-bit archs From 61fb81e3959ecf0848eef8d2767bb80ae5d1a68e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 2 Jan 2017 17:30:40 -0500 Subject: [PATCH 253/412] fix strftime %y for negative years commit 583ea83541dcc6481c7a1bd1a9b485526bad84a1 fixed the case where tm_year is negative but the resulting year (offset by 1900) was still positive, which is always the case for time_t values that fit in 32 bits, but not for arbitrary inputs. based on an earlier patch by Julien Ramseier which was overlooked at the time the previous fix was applied. --- src/time/strftime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/time/strftime.c b/src/time/strftime.c index e103e02b..a3039204 100644 --- a/src/time/strftime.c +++ b/src/time/strftime.c @@ -166,8 +166,8 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm * item = T_FMT; goto nl_strftime; case 'y': - val = tm->tm_year % 100; - if (val<0) val += 100; + val = (tm->tm_year + 1900LL) % 100; + if (val < 0) val = -val; goto number; case 'Y': val = tm->tm_year + 1900LL; From 769f53598e781ffc89191520f3f8a93cb58db91f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 2 Jan 2017 19:47:12 -0500 Subject: [PATCH 254/412] make globfree safe after failed glob from over-length argument commit 0dc99ac413d8bc054a2e95578475c7122455eee8 added input length checking to avoid unsafe VLA allocation, but put it in the wrong place, before the glob_t structure was zeroed out. while POSIX isn't clear on whether it's permitted to call globfree after glob failed with GLOB_NOSPACE, making it safe is clearly better than letting uninitialized pointers get passed to free in non-conforming callers. while we're fixing this, change strlen check to the idiomatic strnlen version to avoid unbounded input scanning before returning an error. --- src/regex/glob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regex/glob.c b/src/regex/glob.c index 6affee04..5b6ff124 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -169,8 +169,6 @@ int glob(const char *restrict pat, int flags, int (*errfunc)(const char *path, i d = ""; } - if (strlen(p) > PATH_MAX) return GLOB_NOSPACE; - if (!errfunc) errfunc = ignore_err; if (!(flags & GLOB_APPEND)) { @@ -179,6 +177,8 @@ int glob(const char *restrict pat, int flags, int (*errfunc)(const char *path, i g->gl_pathv = NULL; } + if (strnlen(p, PATH_MAX+1) > PATH_MAX) return GLOB_NOSPACE; + if (*p) error = match_in_dir(d, p, flags, errfunc, &tail); if (error == GLOB_NOSPACE) { freelist(&head); From 150747b41e1ecefe82aa45d68c84b9e957b03e29 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 4 Jan 2017 17:08:19 -0500 Subject: [PATCH 255/412] reduce impact of REG_* namespace pollution in x86[_64] signal.h when _GNU_SOURCE is defined, which is always the case when compiling c++ with gcc, these macros for the the indices in gregset_t are exposed and likely to clash with applications. by using enum constants rather than macros defined with integer literals, we can make the clash slightly less likely to break software. the macros are still defined in case anything checks for them with #ifdef, but they're defined to expand to themselves so that non-file-scope (e.g. namespaced) identifiers by the same names still work. for the sake of avoiding mistakes, the changes were generated with sed via the command: sed -i -e 's/#define *\(REG_[A-Z_0-9]\{1,\}\) *\([0-9]\{1,\}\)'\ '/enum { \1 = \2 };\n#define \1 \1/' \ arch/i386/bits/signal.h arch/x86_64/bits/signal.h arch/x32/bits/signal.h --- arch/i386/bits/signal.h | 57 +++++++++++++++++++++----------- arch/x32/bits/signal.h | 69 ++++++++++++++++++++++++++------------- arch/x86_64/bits/signal.h | 69 ++++++++++++++++++++++++++------------- 3 files changed, 130 insertions(+), 65 deletions(-) diff --git a/arch/i386/bits/signal.h b/arch/i386/bits/signal.h index 1f9085a5..9931ee93 100644 --- a/arch/i386/bits/signal.h +++ b/arch/i386/bits/signal.h @@ -7,25 +7,44 @@ #endif #ifdef _GNU_SOURCE -#define REG_GS 0 -#define REG_FS 1 -#define REG_ES 2 -#define REG_DS 3 -#define REG_EDI 4 -#define REG_ESI 5 -#define REG_EBP 6 -#define REG_ESP 7 -#define REG_EBX 8 -#define REG_EDX 9 -#define REG_ECX 10 -#define REG_EAX 11 -#define REG_TRAPNO 12 -#define REG_ERR 13 -#define REG_EIP 14 -#define REG_CS 15 -#define REG_EFL 16 -#define REG_UESP 17 -#define REG_SS 18 +enum { REG_GS = 0 }; +#define REG_GS REG_GS +enum { REG_FS = 1 }; +#define REG_FS REG_FS +enum { REG_ES = 2 }; +#define REG_ES REG_ES +enum { REG_DS = 3 }; +#define REG_DS REG_DS +enum { REG_EDI = 4 }; +#define REG_EDI REG_EDI +enum { REG_ESI = 5 }; +#define REG_ESI REG_ESI +enum { REG_EBP = 6 }; +#define REG_EBP REG_EBP +enum { REG_ESP = 7 }; +#define REG_ESP REG_ESP +enum { REG_EBX = 8 }; +#define REG_EBX REG_EBX +enum { REG_EDX = 9 }; +#define REG_EDX REG_EDX +enum { REG_ECX = 10 }; +#define REG_ECX REG_ECX +enum { REG_EAX = 11 }; +#define REG_EAX REG_EAX +enum { REG_TRAPNO = 12 }; +#define REG_TRAPNO REG_TRAPNO +enum { REG_ERR = 13 }; +#define REG_ERR REG_ERR +enum { REG_EIP = 14 }; +#define REG_EIP REG_EIP +enum { REG_CS = 15 }; +#define REG_CS REG_CS +enum { REG_EFL = 16 }; +#define REG_EFL REG_EFL +enum { REG_UESP = 17 }; +#define REG_UESP REG_UESP +enum { REG_SS = 18 }; +#define REG_SS REG_SS #endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) diff --git a/arch/x32/bits/signal.h b/arch/x32/bits/signal.h index 4c4adf31..097be6f4 100644 --- a/arch/x32/bits/signal.h +++ b/arch/x32/bits/signal.h @@ -7,29 +7,52 @@ #endif #ifdef _GNU_SOURCE -#define REG_R8 0 -#define REG_R9 1 -#define REG_R10 2 -#define REG_R11 3 -#define REG_R12 4 -#define REG_R13 5 -#define REG_R14 6 -#define REG_R15 7 -#define REG_RDI 8 -#define REG_RSI 9 -#define REG_RBP 10 -#define REG_RBX 11 -#define REG_RDX 12 -#define REG_RAX 13 -#define REG_RCX 14 -#define REG_RSP 15 -#define REG_RIP 16 -#define REG_EFL 17 -#define REG_CSGSFS 18 -#define REG_ERR 19 -#define REG_TRAPNO 20 -#define REG_OLDMASK 21 -#define REG_CR2 22 +enum { REG_R8 = 0 }; +#define REG_R8 REG_R8 +enum { REG_R9 = 1 }; +#define REG_R9 REG_R9 +enum { REG_R10 = 2 }; +#define REG_R10 REG_R10 +enum { REG_R11 = 3 }; +#define REG_R11 REG_R11 +enum { REG_R12 = 4 }; +#define REG_R12 REG_R12 +enum { REG_R13 = 5 }; +#define REG_R13 REG_R13 +enum { REG_R14 = 6 }; +#define REG_R14 REG_R14 +enum { REG_R15 = 7 }; +#define REG_R15 REG_R15 +enum { REG_RDI = 8 }; +#define REG_RDI REG_RDI +enum { REG_RSI = 9 }; +#define REG_RSI REG_RSI +enum { REG_RBP = 10 }; +#define REG_RBP REG_RBP +enum { REG_RBX = 11 }; +#define REG_RBX REG_RBX +enum { REG_RDX = 12 }; +#define REG_RDX REG_RDX +enum { REG_RAX = 13 }; +#define REG_RAX REG_RAX +enum { REG_RCX = 14 }; +#define REG_RCX REG_RCX +enum { REG_RSP = 15 }; +#define REG_RSP REG_RSP +enum { REG_RIP = 16 }; +#define REG_RIP REG_RIP +enum { REG_EFL = 17 }; +#define REG_EFL REG_EFL +enum { REG_CSGSFS = 18 }; +#define REG_CSGSFS REG_CSGSFS +enum { REG_ERR = 19 }; +#define REG_ERR REG_ERR +enum { REG_TRAPNO = 20 }; +#define REG_TRAPNO REG_TRAPNO +enum { REG_OLDMASK = 21 }; +#define REG_OLDMASK REG_OLDMASK +enum { REG_CR2 = 22 }; +#define REG_CR2 REG_CR2 #endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) diff --git a/arch/x86_64/bits/signal.h b/arch/x86_64/bits/signal.h index e3c31417..c99317d3 100644 --- a/arch/x86_64/bits/signal.h +++ b/arch/x86_64/bits/signal.h @@ -7,29 +7,52 @@ #endif #ifdef _GNU_SOURCE -#define REG_R8 0 -#define REG_R9 1 -#define REG_R10 2 -#define REG_R11 3 -#define REG_R12 4 -#define REG_R13 5 -#define REG_R14 6 -#define REG_R15 7 -#define REG_RDI 8 -#define REG_RSI 9 -#define REG_RBP 10 -#define REG_RBX 11 -#define REG_RDX 12 -#define REG_RAX 13 -#define REG_RCX 14 -#define REG_RSP 15 -#define REG_RIP 16 -#define REG_EFL 17 -#define REG_CSGSFS 18 -#define REG_ERR 19 -#define REG_TRAPNO 20 -#define REG_OLDMASK 21 -#define REG_CR2 22 +enum { REG_R8 = 0 }; +#define REG_R8 REG_R8 +enum { REG_R9 = 1 }; +#define REG_R9 REG_R9 +enum { REG_R10 = 2 }; +#define REG_R10 REG_R10 +enum { REG_R11 = 3 }; +#define REG_R11 REG_R11 +enum { REG_R12 = 4 }; +#define REG_R12 REG_R12 +enum { REG_R13 = 5 }; +#define REG_R13 REG_R13 +enum { REG_R14 = 6 }; +#define REG_R14 REG_R14 +enum { REG_R15 = 7 }; +#define REG_R15 REG_R15 +enum { REG_RDI = 8 }; +#define REG_RDI REG_RDI +enum { REG_RSI = 9 }; +#define REG_RSI REG_RSI +enum { REG_RBP = 10 }; +#define REG_RBP REG_RBP +enum { REG_RBX = 11 }; +#define REG_RBX REG_RBX +enum { REG_RDX = 12 }; +#define REG_RDX REG_RDX +enum { REG_RAX = 13 }; +#define REG_RAX REG_RAX +enum { REG_RCX = 14 }; +#define REG_RCX REG_RCX +enum { REG_RSP = 15 }; +#define REG_RSP REG_RSP +enum { REG_RIP = 16 }; +#define REG_RIP REG_RIP +enum { REG_EFL = 17 }; +#define REG_EFL REG_EFL +enum { REG_CSGSFS = 18 }; +#define REG_CSGSFS REG_CSGSFS +enum { REG_ERR = 19 }; +#define REG_ERR REG_ERR +enum { REG_TRAPNO = 20 }; +#define REG_TRAPNO REG_TRAPNO +enum { REG_OLDMASK = 21 }; +#define REG_OLDMASK REG_OLDMASK +enum { REG_CR2 = 22 }; +#define REG_CR2 REG_CR2 #endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) From 786fda875a901dc1807289c940338487854cd3ba Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 4 Jan 2017 19:02:02 -0500 Subject: [PATCH 256/412] fix getopt[_long] clobbering of optopt on success getopt is only specified to modify optopt on error, and some software apparently infers an error from optopt!=0. getopt_long is changed analogously. the resulting behavior differs slightly from the behavior of the GNU implementation of getopt_long, which keeps an internal shadow copy of optopt and copies it to the public one on return, but since the GNU implementation also exhibits this shadow-copy behavior for plain getopt where is is non-conforming, I think this can reasonably be considered a bug rather than an intentional behavior that merits mimicing. --- src/misc/getopt.c | 3 ++- src/misc/getopt_long.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/misc/getopt.c b/src/misc/getopt.c index 8290aef7..e9bab41c 100644 --- a/src/misc/getopt.c +++ b/src/misc/getopt.c @@ -60,7 +60,6 @@ int getopt(int argc, char * const argv[], const char *optstring) c = 0xfffd; /* replacement char */ } optchar = argv[optind]+optpos; - optopt = c; optpos += k; if (!argv[optind][optpos]) { @@ -79,6 +78,7 @@ int getopt(int argc, char * const argv[], const char *optstring) } while (l && d != c); if (d != c) { + optopt = c; if (optstring[0] != ':' && opterr) __getopt_msg(argv[0], ": unrecognized option: ", optchar, k); return '?'; @@ -86,6 +86,7 @@ int getopt(int argc, char * const argv[], const char *optstring) if (optstring[i] == ':') { if (optstring[i+1] == ':') optarg = 0; else if (optind >= argc) { + optopt = c; if (optstring[0] == ':') return ':'; if (opterr) __getopt_msg(argv[0], ": option requires an argument: ", diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c index c6e14625..568ae7ba 100644 --- a/src/misc/getopt_long.c +++ b/src/misc/getopt_long.c @@ -75,9 +75,9 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring if (cnt==1) { i = match; optind++; - optopt = longopts[i].val; if (*opt == '=') { if (!longopts[i].has_arg) { + optopt = longopts[i].val; if (colon || !opterr) return '?'; __getopt_msg(argv[0], @@ -89,6 +89,7 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring optarg = opt+1; } else if (longopts[i].has_arg == required_argument) { if (!(optarg = argv[optind])) { + optopt = longopts[i].val; if (colon) return ':'; if (!opterr) return '?'; __getopt_msg(argv[0], @@ -107,6 +108,7 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring return longopts[i].val; } if (argv[optind][1] == '-') { + optopt = 0; if (!colon && opterr) __getopt_msg(argv[0], cnt ? ": option is ambiguous: " : From 809ff8cf90254921ea38eb6fa1ce326d9008513b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 4 Jan 2017 19:48:21 -0500 Subject: [PATCH 257/412] treat base 1 as an error in strtol-family functions ISO C and POSIX only specify behavior for base arguments of 0 and 2-36; POSIX mandates an EINVAL error for unsupported bases. it's not clear that there's a requirement for implementations not to "support" additional bases as an extension, but "base 1" did not work in any meaningful way anyway, so it should be considered unsupported and thus an error. --- src/internal/intscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/intscan.c b/src/internal/intscan.c index 65d497ec..a4a5ae86 100644 --- a/src/internal/intscan.c +++ b/src/internal/intscan.c @@ -29,7 +29,7 @@ unsigned long long __intscan(FILE *f, unsigned base, int pok, unsigned long long int c, neg=0; unsigned x; unsigned long long y; - if (base > 36) { + if (base > 36 || base == 1) { errno = EINVAL; return 0; } From 27b3fd68f67b674440d21ea7ca5cf918d2e1559f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 4 Jan 2017 22:54:06 -0500 Subject: [PATCH 258/412] fix crash from corrupted tls module list after failed dlopen commit d56460c939c94a6c547abe8238f442b8de10bfbd introduced this regression as part of splitting the tls module list out of the dso list. the new code added to dlopen's failure path to undo the changes adding the partially-loaded libraries reset the tls_tail pointer correctly, but did not clear its link to the next list entry. thus, at least until the next successful dlopen, the list was not terminated but ended with an invalid next pointer, which __copy_tls attempted to follow when a new thread was created. patch by Mikael Vidstedt. --- ldso/dynlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index c6890845..48dcd1c2 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1686,6 +1686,7 @@ void *dlopen(const char *file, int mode) } if (!orig_tls_tail) libc.tls_head = 0; tls_tail = orig_tls_tail; + if (tls_tail) tls_tail->next = 0; tls_cnt = orig_tls_cnt; tls_offset = orig_tls_offset; tls_align = orig_tls_align; From 1f53e7d00c375efb32e2e468f91a42668653d5f0 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Fri, 13 Jan 2017 10:28:46 +0000 Subject: [PATCH 259/412] fix crashes in x32 __tls_get_addr x32 has another gratuitous difference to all other archs: it passes an array of 64bit values to __tls_get_addr(). usually it is an array of size_t. --- arch/x32/pthread_arch.h | 2 ++ ldso/dynlink.c | 10 +++++----- src/internal/pthread_impl.h | 4 ++++ src/thread/__tls_get_addr.c | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/x32/pthread_arch.h b/arch/x32/pthread_arch.h index ecb0bbfb..267ad073 100644 --- a/arch/x32/pthread_arch.h +++ b/arch/x32/pthread_arch.h @@ -10,3 +10,5 @@ static inline struct pthread *__pthread_self() #define MC_PC gregs[REG_RIP] #define CANARY canary2 + +#define tls_mod_off_t unsigned long long diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 48dcd1c2..a03f75e3 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1257,7 +1257,7 @@ void __init_tls(size_t *auxv) } __attribute__((__visibility__("hidden"))) -void *__tls_get_new(size_t *v) +void *__tls_get_new(tls_mod_off_t *v) { pthread_t self = __pthread_self(); @@ -1769,7 +1769,7 @@ static void *addr2dso(size_t a) return 0; } -void *__tls_get_addr(size_t *); +void *__tls_get_addr(tls_mod_off_t *); static void *do_dlsym(struct dso *p, const char *s, void *ra) { @@ -1787,7 +1787,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra) struct symdef def = find_sym(p, s, 0); if (!def.sym) goto failed; if ((def.sym->st_info&0xf) == STT_TLS) - return __tls_get_addr((size_t []){def.dso->tls_id, def.sym->st_value}); + return __tls_get_addr((tls_mod_off_t []){def.dso->tls_id, def.sym->st_value}); if (DL_FDPIC && (def.sym->st_info&0xf) == STT_FUNC) return def.dso->funcdescs + (def.sym - def.dso->syms); return laddr(def.dso, def.sym->st_value); @@ -1802,7 +1802,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra) sym = sysv_lookup(s, h, p); } if (sym && (sym->st_info&0xf) == STT_TLS) - return __tls_get_addr((size_t []){p->tls_id, sym->st_value}); + return __tls_get_addr((tls_mod_off_t []){p->tls_id, sym->st_value}); if (DL_FDPIC && sym && sym->st_shndx && (sym->st_info&0xf) == STT_FUNC) return p->funcdescs + (sym - p->syms); if (sym && sym->st_value && (1<<(sym->st_info&0xf) & OK_TYPES)) @@ -1816,7 +1816,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra) sym = sysv_lookup(s, h, p->deps[i]); } if (sym && (sym->st_info&0xf) == STT_TLS) - return __tls_get_addr((size_t []){p->deps[i]->tls_id, sym->st_value}); + return __tls_get_addr((tls_mod_off_t []){p->deps[i]->tls_id, sym->st_value}); if (DL_FDPIC && sym && sym->st_shndx && (sym->st_info&0xf) == STT_FUNC) return p->deps[i]->funcdescs + (sym - p->deps[i]->syms); if (sym && sym->st_value && (1<<(sym->st_info&0xf) & OK_TYPES)) diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h index 757b86ad..ae0ab1c5 100644 --- a/src/internal/pthread_impl.h +++ b/src/internal/pthread_impl.h @@ -97,6 +97,10 @@ struct __timer { #define DTP_OFFSET 0 #endif +#ifndef tls_mod_off_t +#define tls_mod_off_t size_t +#endif + #define SIGTIMER 32 #define SIGCANCEL 33 #define SIGSYNCCALL 34 diff --git a/src/thread/__tls_get_addr.c b/src/thread/__tls_get_addr.c index 6945faa0..3b6c9b1b 100644 --- a/src/thread/__tls_get_addr.c +++ b/src/thread/__tls_get_addr.c @@ -3,9 +3,9 @@ #include "libc.h" __attribute__((__visibility__("hidden"))) -void *__tls_get_new(size_t *); +void *__tls_get_new(tls_mod_off_t *); -void *__tls_get_addr(size_t *v) +void *__tls_get_addr(tls_mod_off_t *v) { pthread_t self = __pthread_self(); if (v[0]<=(size_t)self->dtv[0]) From 6894f8472614e22c76820b6469d2551d17e024ed Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 19 Jan 2017 11:45:01 -0500 Subject: [PATCH 260/412] fix spurious EINTR errors from multithreaded set*id, etc. commit 78a8ef47c4d92b7680c52a85f80a81e29da86bb9 inadvertently removed the SA_RESTART flag from the sigaction for the internal signal handler used by __synccall for broadcasting. as a result, programs which did not use interrupting signals but which used set*id() in a multithreaded context could wrongly observe EINTR errors they're not prepared to handle. --- src/thread/synccall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/synccall.c b/src/thread/synccall.c index 000ec4e3..f6813576 100644 --- a/src/thread/synccall.c +++ b/src/thread/synccall.c @@ -50,7 +50,7 @@ void __synccall(void (*func)(void *), void *ctx) int cs, i, r, pid, self;; DIR dir = {0}; struct dirent *de; - struct sigaction sa = { .sa_flags = 0, .sa_handler = handler }; + struct sigaction sa = { .sa_flags = SA_RESTART, .sa_handler = handler }; struct chain *cp, *next; struct timespec ts; From 01e6bbece2bdcac243cdb8dff6916f2bb80a19e1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 29 Jan 2017 00:11:23 -0500 Subject: [PATCH 261/412] fix bindtextdomain logic error deactivating other domains this loop was only supposed to deactivate other bindings for the same text domain name, but due to copy-and-paste error, deactivated all other bindings. patch by He X. --- src/locale/dcngettext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c index a5ff8475..e48c50f0 100644 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -74,7 +74,7 @@ char *bindtextdomain(const char *domainname, const char *dirname) a_store(&p->active, 1); for (q=bindings; q; q=q->next) { - if (!strcmp(p->domainname, domainname) && q != p) + if (!strcmp(q->domainname, domainname) && q != p) a_store(&q->active, 0); } From dbbb3734d8c0176feabd6c46e2e85bbc3b8a60af Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 29 Jan 2017 11:14:00 -0500 Subject: [PATCH 262/412] fix use of uninitialized pointer in gettext core the plural_rule field of allocated msgcat structures was assumed to be initially-null but was never initialized. for future-proofing, the nplurals field which was left uninitialized should also be cleared. likewise, in the binding structure, the active field could be used uninitialized by a technicality: the a_store which stores the initial value of 0 may be implemented as a cas operation, which reads the old value. rather than fixing these issues individually, just use calloc for both allocations. this does result in wasteful clearing of name buffers (up to NAME_MAX+PATH_MAX) before filling them, but since the size if bounded and the time is dominated by filesystem operations, it really doesn't matter; simplicity and future-proofing have more value here. modified from patch submitted by He X. --- src/locale/dcngettext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c index e48c50f0..73a9fd70 100644 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -57,7 +57,7 @@ char *bindtextdomain(const char *domainname, const char *dirname) } if (!p) { - p = malloc(sizeof *p + domlen + dirlen + 2); + p = calloc(sizeof *p + domlen + dirlen + 2, 1); if (!p) { UNLOCK(lock); return 0; @@ -171,7 +171,7 @@ notrans: size_t map_size; const void *map = __map_file(name, &map_size); if (!map) goto notrans; - p = malloc(sizeof *p + namelen + 1); + p = calloc(sizeof *p + namelen + 1, 1); if (!p) { __munmap((void *)map, map_size); goto notrans; From d6601f0af0452b218d247cb47513fc9cd6bbf2e2 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 29 Jan 2017 11:24:20 -0500 Subject: [PATCH 263/412] avoid unbounded strlen in gettext functions use the standard strnlen idiom for cases where lengths greater than an imposed limit are going to be rejected immediately anyway. --- src/locale/dcngettext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c index 73a9fd70..b68e24bc 100644 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -40,8 +40,8 @@ char *bindtextdomain(const char *domainname, const char *dirname) if (!domainname) return 0; if (!dirname) return gettextdir(domainname, &(size_t){0}); - size_t domlen = strlen(domainname); - size_t dirlen = strlen(dirname); + size_t domlen = strnlen(domainname, NAME_MAX+1); + size_t dirlen = strnlen(dirname, PATH_MAX); if (domlen > NAME_MAX || dirlen >= PATH_MAX) { errno = EINVAL; return 0; @@ -127,7 +127,7 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, if (!domainname) domainname = __gettextdomain(); - domlen = strlen(domainname); + domlen = strnlen(domainname, NAME_MAX+1); if (domlen > NAME_MAX) goto notrans; dirname = gettextdir(domainname, &dirlen); From 9201c3afce0ff53a9b1c5da5285ff84c11dee9d4 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 5 Feb 2017 21:29:52 -0600 Subject: [PATCH 264/412] s390x: implement dlsym This was missed when writing the port initially. --- src/ldso/s390x/dlsym.s | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/ldso/s390x/dlsym.s diff --git a/src/ldso/s390x/dlsym.s b/src/ldso/s390x/dlsym.s new file mode 100644 index 00000000..2e9fa8fb --- /dev/null +++ b/src/ldso/s390x/dlsym.s @@ -0,0 +1,6 @@ + .global dlsym + .hidden __dlsym + .type dlsym,@function +dlsym: + lgr %r4, %r14 + jg __dlsym From b261a24256792177a5f0531dbb25cc6267220ca5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 15 Feb 2017 17:05:50 -0500 Subject: [PATCH 265/412] fix build regression in arm atomics asm with new binutils binutils commit bada43421274615d0d5f629a61a60b7daa71bc15 tightened immediate fixup handling in gas in such a way that the final .arch of an object file must be compatible with the fixups used when the instruction was assembled; this in turn broke assembling of atomics.s, at least in thumb mode. it's not clear whether this should be considered a bug in gas, but .object_arch is preferable anyway for our purpose here of controlling the ISA level tag on the object file being produced, and it's the intended directive for use in object files with runtime code selection. research by Szabolcs Nagy confirmed that .object_arch is supported in all relevant versions of binutils and clang's integrated assembler. patch by Reiner Herrmann. --- src/thread/arm/atomics.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/arm/atomics.s b/src/thread/arm/atomics.s index 202faa4a..101ad391 100644 --- a/src/thread/arm/atomics.s +++ b/src/thread/arm/atomics.s @@ -84,7 +84,7 @@ __a_gettp_cp15: bx lr /* Tag this file with minimum ISA level so as not to affect linking. */ -.arch armv4t +.object_arch armv4t .eabi_attribute 6,2 .data From 0a4a16d11cc263c3f32325f985b9ed94b04af79f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 22 Feb 2017 19:25:13 -0500 Subject: [PATCH 266/412] allow page size to vary on arm the ABI for arm was silently changed at some point to allow page sizes other than 4k; traditional binaries built with only 4k-aligned offsets between load segments cannot run on such systems, but newer binutils versions use 64k offset alignment. while larger page size is undesirable for various reasons, users have encountered hardware and/or kernels that lock the page size to a larger value, so follow the new ABI and allow it to vary. --- arch/arm/bits/limits.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/bits/limits.h b/arch/arm/bits/limits.h index 65a3dd64..fbc6d238 100644 --- a/arch/arm/bits/limits.h +++ b/arch/arm/bits/limits.h @@ -1,6 +1,5 @@ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define PAGE_SIZE 4096 #define LONG_BIT 32 #endif From 827c4e6fbe46142049ef3d8bcb8f35951712797d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 5 Mar 2017 23:03:35 +0100 Subject: [PATCH 267/412] fix lsearch and lfind to pass key as first arg to the compar callback this is not a conformance issue as posix does not specify the argument order, but the order is specified for bsearch and some systems document the order for lsearch consistently (openbsd). since there were two indpendent reports of this issue it's better to use the more widely expected argument order. --- src/search/lsearch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search/lsearch.c b/src/search/lsearch.c index 63f31922..5eb5cc2b 100644 --- a/src/search/lsearch.c +++ b/src/search/lsearch.c @@ -9,7 +9,7 @@ void *lsearch(const void *key, void *base, size_t *nelp, size_t width, size_t i; for (i = 0; i < n; i++) - if (compar(p[i], key) == 0) + if (compar(key, p[i]) == 0) return p[i]; *nelp = n+1; return memcpy(p[n], key, width); @@ -23,7 +23,7 @@ void *lfind(const void *key, const void *base, size_t *nelp, size_t i; for (i = 0; i < n; i++) - if (compar(p[i], key) == 0) + if (compar(key, p[i]) == 0) return p[i]; return 0; } From fc85fb38605a8bf341c367b8ab0d36edab2bdbfc Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 8 Mar 2017 13:35:33 -0500 Subject: [PATCH 268/412] fix ld-behavior-dependent crash in ppc64 ldso startup the 32-bit pc-relative address for stage 2 of dynamic linker entry was wrongly loaded with a zero-extending load instead of sign-extending load, resulting in an invalid jump if the offset happened to be negative, which depends on the linker's ordering of text sections. --- arch/powerpc64/reloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc64/reloc.h b/arch/powerpc64/reloc.h index e1bad009..faf70acd 100644 --- a/arch/powerpc64/reloc.h +++ b/arch/powerpc64/reloc.h @@ -27,6 +27,6 @@ " bl 1f \n" \ " .long " #sym "-. \n" \ "1: mflr %1 \n" \ - " lwz %0, 0(%1) \n" \ + " lwa %0, 0(%1) \n" \ " add %0, %0, %1 \n" \ : "=r"(*(fp)), "=r"((long){0}) : : "memory", "lr" ) From c9783e4d32e786c4b76bf77c6030111d9e79dbb7 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 3 Dec 2016 20:52:43 +0000 Subject: [PATCH 269/412] treat STB_WEAK and STB_GNU_UNIQUE like STB_GLOBAL in find_sym A weak symbol definition is not special during dynamic linking, so don't let a strong definition in a later module override it. (glibc dynamic linker allows overriding weak definitions if LD_DYNAMIC_WEAK is set, musl does not.) STB_GNU_UNIQUE means that the symbol is global, even if it is in a module that's loaded with RTLD_LOCAL, and all references resolve to the same definition. This semantics is only relevant for c++ plugin systems and even there it's often not what the user wants (so it can be turned off in g++ by -fno-gnu-unique when the c++ shared lib is compiled). In musl just treat it like STB_GLOBAL. --- ldso/dynlink.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index a03f75e3..d00827a3 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -286,11 +286,9 @@ static struct symdef find_sym(struct dso *dso, const char *s, int need_def) continue; if (!(1<<(sym->st_info&0xf) & OK_TYPES)) continue; if (!(1<<(sym->st_info>>4) & OK_BINDS)) continue; - - if (def.sym && sym->st_info>>4 == STB_WEAK) continue; def.sym = sym; def.dso = dso; - if (sym->st_info>>4 == STB_GLOBAL) break; + break; } return def; } From 4ff234f6cba96403b5de6d29d48a59fd73252040 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 12 Mar 2017 21:03:05 -0400 Subject: [PATCH 270/412] rework ldso handling of global symbol table for consistency when loading libraries with dlopen, the caller can request that the library's symbols become part of the global symbol table, or that they only be used for resolving relocations in the loaded library and its dependencies. in the latter case, a subsequent dlopen of the same library can upgrade it to global status. previously, if a library was upgraded from local to global mode, its symbols entered the symbol lookup search order at the point where the library was originally loaded. this means that a new call to dlopen could change the value of a symbol that already had a visible definition, an inconsistency which applications could observe. POSIX is unclear whether this should happen or whether it's permitted to happen, but the resolution of Austin Group issue #982 made it formally unspecified. with this patch, a library whose mode is upgraded from local to global enters the symbol lookup order at the point where it was made global, so that symbol resolution before and after the upgrade are consistent. in order to implement this change, the per-dso global flag is replaced with a separate set of linked-list pointers for participation in the global symbol table. this permits the order of dso objects for symbol resolution to differ from the order used for iteration of all loaded libraries. it also improves performance of find_sym, by avoiding a branch per iteration and skipping, and especially in the case where many non-global libraries have been loaded, by allowing the loop to skip over them entirely. logic for temporarily adding non-global libraries to the symbol table for relocation purposes is also mildly simplified. --- ldso/dynlink.c | 97 +++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index d00827a3..0e394e0d 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -58,11 +58,11 @@ struct dso { uint32_t *ghashtab; int16_t *versym; char *strings; + struct dso *syms_next; unsigned char *map; size_t map_len; dev_t dev; ino_t ino; - signed char global; char relocated; char constructed; char kernel_mapped; @@ -113,7 +113,7 @@ static struct builtin_tls { static size_t *saved_addends, *apply_addends_to; static struct dso ldso; -static struct dso *head, *tail, *fini_head; +static struct dso *head, *tail, *fini_head, *syms_tail; static char *env_path, *sys_path; static unsigned long long gencnt; static int runtime; @@ -261,9 +261,8 @@ static struct symdef find_sym(struct dso *dso, const char *s, int need_def) uint32_t h = 0, gh, gho, *ght; size_t ghm = 0; struct symdef def = {0}; - for (; dso; dso=dso->next) { + for (; dso; dso=dso->syms_next) { Sym *sym; - if (!dso->global) continue; if ((ght = dso->ghashtab)) { if (!ghm) { gh = gnu_hash(s); @@ -329,7 +328,7 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri if (sym_index) { sym = syms + sym_index; name = strings + sym->st_name; - ctx = type==REL_COPY ? head->next : head; + ctx = type==REL_COPY ? head->syms_next : head; def = (sym->st_info&0xf) == STT_SECTION ? (struct symdef){ .dso = dso, .sym = sym } : find_sym(ctx, name, type==REL_PLT); @@ -932,7 +931,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by) if (!ldso.prev) { tail->next = &ldso; ldso.prev = tail; - tail = ldso.next ? ldso.next : &ldso; + tail = &ldso; } return &ldso; } @@ -1113,9 +1112,24 @@ static void load_preload(char *s) } } -static void make_global(struct dso *p) +static void add_syms(struct dso *p) { - for (; p; p=p->next) p->global = 1; + if (!p->syms_next && syms_tail != p) { + syms_tail->syms_next = p; + syms_tail = p; + } +} + +static void revert_syms(struct dso *old_tail) +{ + struct dso *p, *next; + /* Chop off the tail of the list of dsos that participate in + * the global symbol table, reverting them to RTLD_LOCAL. */ + for (p=old_tail; p; p=next) { + next = p->syms_next; + p->syms_next = 0; + } + syms_tail = old_tail; } static void do_mips_relocs(struct dso *p, size_t *got) @@ -1344,7 +1358,6 @@ void __dls2(unsigned char *base, size_t *sp) } Ehdr *ehdr = (void *)ldso.base; ldso.name = ldso.shortname = "libc.so"; - ldso.global = 1; ldso.phnum = ehdr->e_phnum; ldso.phdr = laddr(&ldso, ehdr->e_phoff); ldso.phentsize = ehdr->e_phentsize; @@ -1532,7 +1545,6 @@ _Noreturn void __dls3(size_t *sp) #endif tls_align = MAXP2(tls_align, app.tls.align); } - app.global = 1; decode_dyn(&app); if (DL_FDPIC) { makefuncdescs(&app); @@ -1547,7 +1559,21 @@ _Noreturn void __dls3(size_t *sp) argv[-3] = (void *)app.loadmap; } - /* Attach to vdso, if provided by the kernel */ + /* Initial dso chain consists only of the app. */ + head = tail = syms_tail = &app; + + /* Donate unused parts of app and library mapping to malloc */ + reclaim_gaps(&app); + reclaim_gaps(&ldso); + + /* Load preload/needed libraries, add symbols to global namespace. */ + if (env_preload) load_preload(env_preload); + load_deps(&app); + for (struct dso *p=head; p; p=p->next) + add_syms(p); + + /* Attach to vdso, if provided by the kernel, last so that it does + * not become part of the global namespace. */ if (search_vec(auxv, &vdso_base, AT_SYSINFO_EHDR) && vdso_base) { Ehdr *ehdr = (void *)vdso_base; Phdr *phdr = vdso.phdr = (void *)(vdso_base + ehdr->e_phoff); @@ -1561,26 +1587,13 @@ _Noreturn void __dls3(size_t *sp) } vdso.name = ""; vdso.shortname = "linux-gate.so.1"; - vdso.global = 1; vdso.relocated = 1; decode_dyn(&vdso); - vdso.prev = &ldso; - ldso.next = &vdso; + vdso.prev = tail; + tail->next = &vdso; + tail = &vdso; } - /* Initial dso chain consists only of the app. */ - head = tail = &app; - - /* Donate unused parts of app and library mapping to malloc */ - reclaim_gaps(&app); - reclaim_gaps(&ldso); - - /* Load preload/needed libraries, add their symbols to the global - * namespace, and perform all remaining relocations. */ - if (env_preload) load_preload(env_preload); - load_deps(&app); - make_global(&app); - for (i=0; app.dynv[i]; i+=2) { if (!DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG) app.dynv[i+1] = (size_t)&debug; @@ -1641,7 +1654,7 @@ _Noreturn void __dls3(size_t *sp) void *dlopen(const char *file, int mode) { - struct dso *volatile p, *orig_tail, *next; + struct dso *volatile p, *orig_tail, *orig_syms_tail, *next; struct tls_module *orig_tls_tail; size_t orig_tls_cnt, orig_tls_offset, orig_tls_align; size_t i; @@ -1659,15 +1672,14 @@ void *dlopen(const char *file, int mode) orig_tls_cnt = tls_cnt; orig_tls_offset = tls_offset; orig_tls_align = tls_align; + orig_syms_tail = syms_tail; orig_tail = tail; noload = mode & RTLD_NOLOAD; rtld_fail = &jb; if (setjmp(*rtld_fail)) { /* Clean up anything new that was (partially) loaded */ - if (p && p->deps) for (i=0; p->deps[i]; i++) - if (p->deps[i]->global < 0) - p->deps[i]->global = 0; + revert_syms(orig_syms_tail); for (p=orig_tail->next; p; p=next) { next = p->next; while (p->td_index) { @@ -1703,24 +1715,21 @@ void *dlopen(const char *file, int mode) } /* First load handling */ - if (!p->deps) { + if (!p->relocated) { load_deps(p); + /* Make new symbols global, at least temporarily, so we can do + * relocations. If not RTLD_GLOBAL, this is reverted below. */ + add_syms(p); if (p->deps) for (i=0; p->deps[i]; i++) - if (!p->deps[i]->global) - p->deps[i]->global = -1; - if (!p->global) p->global = -1; + add_syms(p->deps[i]); reloc_all(p); - if (p->deps) for (i=0; p->deps[i]; i++) - if (p->deps[i]->global < 0) - p->deps[i]->global = 0; - if (p->global < 0) p->global = 0; } - if (mode & RTLD_GLOBAL) { - if (p->deps) for (i=0; p->deps[i]; i++) - p->deps[i]->global = 1; - p->global = 1; - } + /* If RTLD_GLOBAL was not specified, undo any new additions + * to the global symbol table. This is a nop if the library was + * previously loaded and already global. */ + if (!(mode & RTLD_GLOBAL)) + revert_syms(orig_syms_tail); update_tls_size(); _dl_debug_state(); From 4823b13a75b40c4408c1101b363ab00fd118fb27 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 13 Mar 2017 00:30:26 -0400 Subject: [PATCH 271/412] reorder addend handling before symbol lookup in relocation code these two tasks are independent now, but in order to support lazy relocations, the failure path for symbol lookup may want the addend to be available. --- ldso/dynlink.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 0e394e0d..0bd9d50c 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -323,8 +323,24 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri if (skip_relative && IS_RELATIVE(rel[1], dso->syms)) continue; type = R_TYPE(rel[1]); if (type == REL_NONE) continue; - sym_index = R_SYM(rel[1]); reloc_addr = laddr(dso, rel[0]); + + if (stride > 2) { + addend = rel[2]; + } else if (type==REL_GOT || type==REL_PLT|| type==REL_COPY) { + addend = 0; + } else if (reuse_addends) { + /* Save original addend in stage 2 where the dso + * chain consists of just ldso; otherwise read back + * saved addend since the inline one was clobbered. */ + if (head==&ldso) + saved_addends[save_slot] = *reloc_addr; + addend = saved_addends[save_slot++]; + } else { + addend = *reloc_addr; + } + + sym_index = R_SYM(rel[1]); if (sym_index) { sym = syms + sym_index; name = strings + sym->st_name; @@ -345,21 +361,6 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri def.dso = dso; } - if (stride > 2) { - addend = rel[2]; - } else if (type==REL_GOT || type==REL_PLT|| type==REL_COPY) { - addend = 0; - } else if (reuse_addends) { - /* Save original addend in stage 2 where the dso - * chain consists of just ldso; otherwise read back - * saved addend since the inline one was clobbered. */ - if (head==&ldso) - saved_addends[save_slot] = *reloc_addr; - addend = saved_addends[save_slot++]; - } else { - addend = *reloc_addr; - } - sym_val = def.sym ? (size_t)laddr(def.dso, def.sym->st_value) : 0; tls_val = def.sym ? def.sym->st_value : 0; From 6476b8135760659b25c93ff9308425ca98a9e777 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 13 Mar 2017 08:52:41 -0400 Subject: [PATCH 272/412] emulate lazy relocation as deferrable relocation traditional lazy relocation with call-time plt resolver is intentionally not implemented, as it is a huge bug surface and demands significant amounts of arch-specific code and requires ongoing maintenance to ensure compatibility with applications which make use of new additions to the arch's register file in passing function arguments. some applications, however, depend on the ability to dlopen modules which have unsatisfied symbol references at the time they are loaded, either avoiding use of the affected interfaces or manually loading another module to provide the missing definition via their own module dependency tracking outside the ELF data structures. while such usage is non-conforming, failure to support it has been a significant obstacle for users/distributions trying to support affected software, particularly the X.org server. instead of resolving lazy relocations at call time, this patch saves unresolved GOT/PLT relocations for deferral and retries them after each subsequent dlopen until they are resolved. since dlopen is the only time at which the effective global symbol table can change, this behavior is not observably different from traditional lazy binding, and the required code is minimal. --- ldso/dynlink.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 0bd9d50c..f8db1f82 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -58,7 +58,8 @@ struct dso { uint32_t *ghashtab; int16_t *versym; char *strings; - struct dso *syms_next; + struct dso *syms_next, *lazy_next; + size_t *lazy, lazy_cnt; unsigned char *map; size_t map_len; dev_t dev; @@ -113,7 +114,7 @@ static struct builtin_tls { static size_t *saved_addends, *apply_addends_to; static struct dso ldso; -static struct dso *head, *tail, *fini_head, *syms_tail; +static struct dso *head, *tail, *fini_head, *syms_tail, *lazy_head; static char *env_path, *sys_path; static unsigned long long gencnt; static int runtime; @@ -350,6 +351,13 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri : find_sym(ctx, name, type==REL_PLT); if (!def.sym && (sym->st_shndx != SHN_UNDEF || sym->st_info>>4 != STB_WEAK)) { + if (dso->lazy && (type==REL_PLT || type==REL_GOT)) { + dso->lazy[3*dso->lazy_cnt+0] = rel[0]; + dso->lazy[3*dso->lazy_cnt+1] = rel[1]; + dso->lazy[3*dso->lazy_cnt+2] = addend; + dso->lazy_cnt++; + continue; + } error("Error relocating %s: %s: symbol not found", dso->name, name); if (runtime) longjmp(*rtld_fail, 1); @@ -451,6 +459,26 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri } } +static void redo_lazy_relocs() +{ + struct dso *p = lazy_head, *next; + lazy_head = 0; + for (; p; p=next) { + next = p->lazy_next; + size_t size = p->lazy_cnt*3*sizeof(size_t); + p->lazy_cnt = 0; + do_relocs(p, p->lazy, size, 3); + if (p->lazy_cnt) { + p->lazy_next = lazy_head; + lazy_head = p; + } else { + free(p->lazy); + p->lazy = 0; + p->lazy_next = 0; + } + } +} + /* A huge hack: to make up for the wastefulness of shared libraries * needing at least a page of dirty memory even if they have no global * data, we reclaim the gaps at the beginning and end of writable maps @@ -1653,9 +1681,31 @@ _Noreturn void __dls3(size_t *sp) for(;;); } +static void prepare_lazy(struct dso *p) +{ + size_t dyn[DYN_CNT], n, flags1=0; + decode_vec(p->dynv, dyn, DYN_CNT); + search_vec(p->dynv, &flags1, DT_FLAGS_1); + if (dyn[DT_BIND_NOW] || (dyn[DT_FLAGS] & DF_BIND_NOW) || (flags1 & DF_1_NOW)) + return; + n = dyn[DT_RELSZ]/2 + dyn[DT_RELASZ]/3 + dyn[DT_PLTRELSZ]/2 + 1; + if (NEED_MIPS_GOT_RELOCS) { + size_t j=0; search_vec(p->dynv, &j, DT_MIPS_GOTSYM); + size_t i=0; search_vec(p->dynv, &i, DT_MIPS_SYMTABNO); + n += i-j; + } + p->lazy = calloc(n, 3*sizeof(size_t)); + if (!p->lazy) { + error("Error preparing lazy relocation for %s: %m", p->name); + longjmp(*rtld_fail, 1); + } + p->lazy_next = lazy_head; + lazy_head = p; +} + void *dlopen(const char *file, int mode) { - struct dso *volatile p, *orig_tail, *orig_syms_tail, *next; + struct dso *volatile p, *orig_tail, *orig_syms_tail, *orig_lazy_head, *next; struct tls_module *orig_tls_tail; size_t orig_tls_cnt, orig_tls_offset, orig_tls_align; size_t i; @@ -1673,6 +1723,7 @@ void *dlopen(const char *file, int mode) orig_tls_cnt = tls_cnt; orig_tls_offset = tls_offset; orig_tls_align = tls_align; + orig_lazy_head = lazy_head; orig_syms_tail = syms_tail; orig_tail = tail; noload = mode & RTLD_NOLOAD; @@ -1701,6 +1752,7 @@ void *dlopen(const char *file, int mode) tls_cnt = orig_tls_cnt; tls_offset = orig_tls_offset; tls_align = orig_tls_align; + lazy_head = orig_lazy_head; tail = orig_tail; tail->next = 0; p = 0; @@ -1718,6 +1770,12 @@ void *dlopen(const char *file, int mode) /* First load handling */ if (!p->relocated) { load_deps(p); + if ((mode & RTLD_LAZY)) { + prepare_lazy(p); + if (p->deps) for (i=0; p->deps[i]; i++) + if (!p->deps[i]->relocated) + prepare_lazy(p->deps[i]); + } /* Make new symbols global, at least temporarily, so we can do * relocations. If not RTLD_GLOBAL, this is reverted below. */ add_syms(p); @@ -1732,6 +1790,11 @@ void *dlopen(const char *file, int mode) if (!(mode & RTLD_GLOBAL)) revert_syms(orig_syms_tail); + /* Processing of deferred lazy relocations must not happen until + * the new libraries are committed; otherwise we could end up with + * relocations resolved to symbol definitions that get removed. */ + redo_lazy_relocs(); + update_tls_size(); _dl_debug_state(); orig_tail = tail; From 6582baa752a8facb2c8a7b5b3dcf67331429cdc1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Mar 2017 14:18:07 -0400 Subject: [PATCH 273/412] fix free of uninitialized buffer pointer on error in regexec the fix in commit c3edc06d1e1360f3570db9155d6b318ae0d0f0f7 for CVE-2016-8859 used gotos to exit on overflow conditions, but the code in that error path assumed the buffer pointer was valid or null. thus, the conditions which previously led to under-allocation and buffer overflow could instead lead to an invalid pointer being passed to free. --- src/regex/regexec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/regex/regexec.c b/src/regex/regexec.c index 5c4cb922..253b0e14 100644 --- a/src/regex/regexec.c +++ b/src/regex/regexec.c @@ -215,15 +215,15 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, /* Ensure that tbytes and xbytes*num_states cannot overflow, and that * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */ if (num_tags > SIZE_MAX/(8 * sizeof(regoff_t) * tnfa->num_states)) - goto error_exit; + return REG_ESPACE; /* Likewise check rbytes. */ if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next))) - goto error_exit; + return REG_ESPACE; /* Likewise check pbytes. */ if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos))) - goto error_exit; + return REG_ESPACE; /* Compute the length of the block we need. */ tbytes = sizeof(*tmp_tags) * num_tags; From 500f5bee6c03981961f1586fca2a1dee6fdce7c7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Mar 2017 14:29:50 -0400 Subject: [PATCH 274/412] in static dl_iterate_phdr, fix use of possibly-uninitialized aux data this could only happen if an incomplete auxv was passed into the program, but it's better to just initialize the data anyway. --- src/ldso/dl_iterate_phdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ldso/dl_iterate_phdr.c b/src/ldso/dl_iterate_phdr.c index c141fd9b..e55cbf76 100644 --- a/src/ldso/dl_iterate_phdr.c +++ b/src/ldso/dl_iterate_phdr.c @@ -11,7 +11,7 @@ static int static_dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size size_t base = 0; size_t n; struct dl_phdr_info info; - size_t i, aux[AUX_CNT]; + size_t i, aux[AUX_CNT] = {0}; for (i=0; libc.auxv[i]; i+=2) if (libc.auxv[i] Date: Tue, 14 Mar 2017 14:31:34 -0400 Subject: [PATCH 275/412] fix possible fd leak, unrestored cancellation state on dns socket fail --- src/network/res_msend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/res_msend.c b/src/network/res_msend.c index de7f6157..3e018009 100644 --- a/src/network/res_msend.c +++ b/src/network/res_msend.c @@ -76,7 +76,11 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); family = AF_INET; } - if (fd < 0 || bind(fd, (void *)&sa, sl) < 0) return -1; + if (fd < 0 || bind(fd, (void *)&sa, sl) < 0) { + if (fd >= 0) close(fd); + pthread_setcancelstate(cs, 0); + return -1; + } /* Past this point, there are no errors. Each individual query will * yield either no reply (indicated by zero length) or an answer From 733d1ea759119bcd0554f25034d1b4113b910900 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Mar 2017 15:06:58 -0400 Subject: [PATCH 276/412] fix wide scanf's use of a compound literal past its lifetime --- src/stdio/vfwscanf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stdio/vfwscanf.c b/src/stdio/vfwscanf.c index 223aad4f..1ebc5cef 100644 --- a/src/stdio/vfwscanf.c +++ b/src/stdio/vfwscanf.c @@ -214,11 +214,12 @@ int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap) set = L""; } else if (t == 's') { invert = 1; - set = (const wchar_t[]){ + static const wchar_t spaces[] = { ' ', '\t', '\n', '\r', 11, 12, 0x0085, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2008, 0x2009, 0x200a, 0x2028, 0x2029, 0x205f, 0x3000, 0 }; + set = spaces; } else { if (*++p == '^') p++, invert = 1; else invert = 0; From 3ec8b3aeb88cef8574a7b0f677ebc1801f03821d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Mar 2017 15:13:16 -0400 Subject: [PATCH 277/412] fix one-byte overflow in legacy getpass function if the length of the input was equal to the buffer size (128), a fixed value of zero was written one byte past the end of the static buffer. --- src/legacy/getpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacy/getpass.c b/src/legacy/getpass.c index 15ab9851..d51286c0 100644 --- a/src/legacy/getpass.c +++ b/src/legacy/getpass.c @@ -27,7 +27,7 @@ char *getpass(const char *prompt) l = read(fd, password, sizeof password); if (l >= 0) { - if (l > 0 && password[l-1] == '\n') l--; + if (l > 0 && password[l-1] == '\n' || l==sizeof password) l--; password[l] = 0; } From c49d3c8adadfa24235fcf4779bb722b1aa6f480b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Mar 2017 18:51:27 -0400 Subject: [PATCH 278/412] avoid loading of multiple libc versions via explicit pathname such loading is unsafe, and can happen when programs use their own logic to locate a .so file then pass the absolute pathname to dlopen, or if an absolute pathname ends up in DT_NEEDED headers. multiple loads with only the base name were already precluded, provided libc was named appropriately, by special-casing standard library names. one function symbol (in the reserved namespace, but public, since it's part of the crt1 entry point ABI) and one data symbol are checked. this way we avoid likely false positives, particularly from libraries interposing and wrapping functions. there is no hard requirement to avoid breaking such usage, since trying to run a hook before libc is even initialized is not a supported usage case, but it's friendlier not to break things. --- ldso/dynlink.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index f8db1f82..80d85e94 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1042,6 +1042,17 @@ static struct dso *load_library(const char *name, struct dso *needed_by) close(fd); if (!map) return 0; + /* Avoid the danger of getting two versions of libc mapped into the + * same process when an absolute pathname was used. The symbols + * checked are chosen to catch both musl and glibc, and to avoid + * false positives from interposition-hack libraries. */ + decode_dyn(&temp_dso); + if (find_sym(&temp_dso, "__libc_start_main", 1).sym && + find_sym(&temp_dso, "stdin", 1).sym) { + unmap_library(&temp_dso); + return load_library("libc.so", needed_by); + } + /* Allocate storage for the new DSO. When there is TLS, this * storage must include a reservation for all pre-existing * threads to obtain copies of both the new TLS, and an @@ -1061,7 +1072,6 @@ static struct dso *load_library(const char *name, struct dso *needed_by) return 0; } memcpy(p, &temp_dso, sizeof temp_dso); - decode_dyn(p); p->dev = st.st_dev; p->ino = st.st_ino; p->refcnt = 1; From cb525397bb053ea49cf160965477a17b17286eb3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Mar 2017 19:00:02 -0400 Subject: [PATCH 279/412] remove unused refcnt field for shared libraries --- ldso/dynlink.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 80d85e94..178fe27e 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -52,7 +52,6 @@ struct dso { Phdr *phdr; int phnum; size_t phentsize; - int refcnt; Sym *syms; Elf_Symndx *hashtab; uint32_t *ghashtab; @@ -971,7 +970,6 @@ static struct dso *load_library(const char *name, struct dso *needed_by) /* Search for the name to see if it's already loaded */ for (p=head->next; p; p=p->next) { if (p->shortname && !strcmp(p->shortname, name)) { - p->refcnt++; return p; } } @@ -1034,7 +1032,6 @@ static struct dso *load_library(const char *name, struct dso *needed_by) if (!p->shortname && pathname != name) p->shortname = strrchr(p->name, '/')+1; close(fd); - p->refcnt++; return p; } } @@ -1074,7 +1071,6 @@ static struct dso *load_library(const char *name, struct dso *needed_by) memcpy(p, &temp_dso, sizeof temp_dso); p->dev = st.st_dev; p->ino = st.st_ino; - p->refcnt = 1; p->needed_by = needed_by; p->name = p->buf; strcpy(p->name, pathname); From 8cba1dc46c8f29261aa441e70bac798f2c2c0f58 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 15 Mar 2017 02:55:49 +0100 Subject: [PATCH 280/412] fix threshold constants in j0f, y0f, j1f, y1f partly following freebsd rev 279491 https://svnweb.freebsd.org/base?view=revision&revision=279491 (musl had some of the fixes before freebsd). the change should not matter much for j0f, y0f, but it improves j1f and y1f in [2.5,~3.75] (that is [0x40200000,~0x40700000]). near roots (e.g. around 3.8317 for j1f) there are still large ulp errors. dropped code that tried to raise inexact. --- src/math/j0f.c | 8 ++++---- src/math/j1f.c | 17 ++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/math/j0f.c b/src/math/j0f.c index 45883dc4..fab554a3 100644 --- a/src/math/j0f.c +++ b/src/math/j0f.c @@ -208,8 +208,8 @@ static float pzerof(float x) GET_FLOAT_WORD(ix, x); ix &= 0x7fffffff; if (ix >= 0x41000000){p = pR8; q = pS8;} - else if (ix >= 0x40f71c58){p = pR5; q = pS5;} - else if (ix >= 0x4036db68){p = pR3; q = pS3;} + else if (ix >= 0x409173eb){p = pR5; q = pS5;} + else if (ix >= 0x4036d917){p = pR3; q = pS3;} else /*ix >= 0x40000000*/ {p = pR2; q = pS2;} z = 1.0f/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); @@ -304,8 +304,8 @@ static float qzerof(float x) GET_FLOAT_WORD(ix, x); ix &= 0x7fffffff; if (ix >= 0x41000000){p = qR8; q = qS8;} - else if (ix >= 0x40f71c58){p = qR5; q = qS5;} - else if (ix >= 0x4036db68){p = qR3; q = qS3;} + else if (ix >= 0x409173eb){p = qR5; q = qS5;} + else if (ix >= 0x4036d917){p = qR3; q = qS3;} else /*ix >= 0x40000000*/ {p = qR2; q = qS2;} z = 1.0f/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); diff --git a/src/math/j1f.c b/src/math/j1f.c index 58875af9..3434c53d 100644 --- a/src/math/j1f.c +++ b/src/math/j1f.c @@ -74,14 +74,13 @@ float j1f(float x) return 1/(x*x); if (ix >= 0x40000000) /* |x| >= 2 */ return common(ix, fabsf(x), 0, sign); - if (ix >= 0x32000000) { /* |x| >= 2**-27 */ + if (ix >= 0x39000000) { /* |x| >= 2**-13 */ z = x*x; r = z*(r00+z*(r01+z*(r02+z*r03))); s = 1+z*(s01+z*(s02+z*(s03+z*(s04+z*s05)))); z = 0.5f + r/s; } else - /* raise inexact if x!=0 */ - z = 0.5f + x; + z = 0.5f; return z*x; } @@ -114,7 +113,7 @@ float y1f(float x) return 1/x; if (ix >= 0x40000000) /* |x| >= 2.0 */ return common(ix,x,1,0); - if (ix < 0x32000000) /* x < 2**-27 */ + if (ix < 0x33000000) /* x < 2**-25 */ return -tpi/x; z = x*x; u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4]))); @@ -205,8 +204,8 @@ static float ponef(float x) GET_FLOAT_WORD(ix, x); ix &= 0x7fffffff; if (ix >= 0x41000000){p = pr8; q = ps8;} - else if (ix >= 0x40f71c58){p = pr5; q = ps5;} - else if (ix >= 0x4036db68){p = pr3; q = ps3;} + else if (ix >= 0x409173eb){p = pr5; q = ps5;} + else if (ix >= 0x4036d917){p = pr3; q = ps3;} else /*ix >= 0x40000000*/ {p = pr2; q = ps2;} z = 1.0f/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); @@ -300,9 +299,9 @@ static float qonef(float x) GET_FLOAT_WORD(ix, x); ix &= 0x7fffffff; - if (ix >= 0x40200000){p = qr8; q = qs8;} - else if (ix >= 0x40f71c58){p = qr5; q = qs5;} - else if (ix >= 0x4036db68){p = qr3; q = qs3;} + if (ix >= 0x41000000){p = qr8; q = qs8;} + else if (ix >= 0x409173eb){p = qr5; q = qs5;} + else if (ix >= 0x4036d917){p = qr3; q = qs3;} else /*ix >= 0x40000000*/ {p = qr2; q = qs2;} z = 1.0f/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); From a393d5cc8d22b628fcc1da1b3a2cdae42ca643a9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 15 Mar 2017 16:50:19 -0400 Subject: [PATCH 281/412] precalculate gnu hash rather than doing it lazily in find_sym inner loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this change was suggested based on testing done by Timo Teräs almost two years ago; the branch (and probably call prep overhead) in the inner loop was found to contribute noticably to total symbol lookup time. this change will make lookup slightly slower if libraries were built with only the traditional "sysv" ELF hash table, but based on how much slower lookup tends to be without the gnu hash table, it seems reasonable to assume that (1) users building without gnu hash don't care about dynamic linking performance, and (2) the extra time spent computing the gnu hash is likely to be dominated by the slowness of the sysv hash table lookup anyway. --- ldso/dynlink.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 178fe27e..5361b844 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -258,18 +258,12 @@ static Sym *gnu_lookup_filtered(uint32_t h1, uint32_t *hashtab, struct dso *dso, static struct symdef find_sym(struct dso *dso, const char *s, int need_def) { - uint32_t h = 0, gh, gho, *ght; - size_t ghm = 0; + uint32_t h = 0, gh = gnu_hash(s), gho = gh / (8*sizeof(size_t)), *ght; + size_t ghm = 1ul << gh % (8*sizeof(size_t)); struct symdef def = {0}; for (; dso; dso=dso->syms_next) { Sym *sym; if ((ght = dso->ghashtab)) { - if (!ghm) { - gh = gnu_hash(s); - int maskbits = 8 * sizeof ghm; - gho = gh / maskbits; - ghm = 1ul << gh % maskbits; - } sym = gnu_lookup_filtered(gh, ght, dso, s, gho, ghm); } else { if (!h) h = sysv_hash(s); From 74bca42e1613c58805d7b048841c2fa8f8502158 Mon Sep 17 00:00:00 2001 From: "Tuan M. Hoang" Date: Tue, 14 Mar 2017 16:44:04 -0400 Subject: [PATCH 282/412] s390x: fix fpreg_t and remove unused per_struct Including sys/procfs.h complains unknown type name 'fpreg_t' in bits/user.h. fpreg_t in bits/signal.h and elf_fpreg_t in bits/user.h are practically the same. per_struct is never used, even conflicts with kernel header asm/ptrace.h --- arch/s390x/bits/user.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390x/bits/user.h b/arch/s390x/bits/user.h index 90f07b78..17bce16f 100644 --- a/arch/s390x/bits/user.h +++ b/arch/s390x/bits/user.h @@ -8,7 +8,7 @@ typedef union { typedef struct { unsigned fpc; - fpreg_t fprs[16]; + elf_fpreg_t fprs[16]; } elf_fpregset_t; #define ELF_NGREG 27 @@ -32,7 +32,7 @@ struct _user_per_struct { unsigned short perc_atmid; unsigned long address; unsigned char access_id; -} per_struct; +}; struct _user_regs_struct { struct _user_psw_struct psw; From dbff2bb889bc831599b022c49252c69bf48f4e4e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 15 Mar 2017 20:27:38 -0400 Subject: [PATCH 283/412] fix POSIX-format TZ dst transition times for southern hemisphere the time of day at which daylight time switches over is specified in local time in the dst state prior to the transition. the code for handling this wrongly assumed it needed to switch whether dst or standard offset is applied to the transition time when the dst end date is before the dst start date (souther hemisphere summer), but in fact the end transition time should always be adjusted for dst, and the start transition time should always be adjusted for standard time. --- src/time/__tz.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/time/__tz.c b/src/time/__tz.c index 0e0c4ea2..ffe8d402 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -373,18 +373,14 @@ void __secs_to_zone(long long t, int local, int *isdst, long *offset, long *oppo long long t0 = rule_to_secs(r0, y); long long t1 = rule_to_secs(r1, y); + if (!local) { + t0 += __timezone; + t1 += dst_off; + } if (t0 < t1) { - if (!local) { - t0 += __timezone; - t1 += dst_off; - } if (t >= t0 && t < t1) goto dst; goto std; } else { - if (!local) { - t1 += __timezone; - t0 += dst_off; - } if (t >= t1 && t < t0) goto std; goto dst; } From 0c53178ec09478ca5f6ca6b5ad09d50a10c8f19d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 21 Mar 2017 08:35:59 -0400 Subject: [PATCH 284/412] fix dlopen/dlsym regression opening libs already loaded at startup commit 4ff234f6cba96403b5de6d29d48a59fd73252040 erroneously changed the condition for running certain code at dlopen time to check whether the library was already relocated rather than whether it already had its deps[] table filled. this was out of concern over whether the code under the conditional would be idempotent/safe to call on an already-loaded libraries. however, I missed a consideration in the opposite direction: if a library was loaded at program startup rather than dlopen, its deps[] table was not yet allocated/filled, and load_deps needs to be called at dlopen time in order for dlsym to be able to perform dependency-order symbol lookups. in order to avoid wasteful allocation of lazy-binding relocation tables for libraries which were already loaded and relocated at startup, the check for !p->relocated is not deleted entirely, but moved to apply only to allocation of these dables. --- ldso/dynlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 5361b844..d20dbd87 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1768,9 +1768,9 @@ void *dlopen(const char *file, int mode) } /* First load handling */ - if (!p->relocated) { + if (!p->deps) { load_deps(p); - if ((mode & RTLD_LAZY)) { + if (!p->relocated && (mode & RTLD_LAZY)) { prepare_lazy(p); if (p->deps) for (i=0; p->deps[i]; i++) if (!p->deps[i]->relocated) From 16319a5df9d50cfc642ffc8db76bc36562d4b3dd Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 21 Mar 2017 08:54:19 -0400 Subject: [PATCH 285/412] make setlocale return a single name for LC_ALL if all categories match when called for LC_ALL, setlocale has to return a string representing the state of all locale categories. the simplest way to do this was to always return a delimited list of values for each category, but that's not friendly in the fairly common case where all categories have the same setting. He X proposed a patch to check for this case and return a single name; this patch is a simplified approach to do the same. --- src/locale/setlocale.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/locale/setlocale.c b/src/locale/setlocale.c index 8dae5a4e..623660cc 100644 --- a/src/locale/setlocale.c +++ b/src/locale/setlocale.c @@ -48,10 +48,13 @@ char *setlocale(int cat, const char *name) } } char *s = buf; + const char *part; + int same = 0; for (i=0; iname : "C"; + if (lm == libc.global_locale.cat[0]) same++; + part = lm ? lm->name : "C"; size_t l = strlen(part); memcpy(s, part, l); s[l] = ';'; @@ -59,7 +62,7 @@ char *setlocale(int cat, const char *name) } *--s = 0; UNLOCK(lock); - return buf; + return same==LC_ALL ? (char *)part : buf; } char *ret = setlocale_one_unlocked(cat, name); From e4fc9ad780e36c84e1ed6b0fc01b3c53ae65ff9d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 21 Mar 2017 08:59:48 -0400 Subject: [PATCH 286/412] search locale name variants for gettext translations often translations will be named only by language, whereas locale names may also include a territory code, modifier, and codeset portion. previously, only translations exactly matching the locale name were loaded. this was a major usability issue, requiring workarounds like symlinks or tweaking of the locale name. with these changes, gettext now searches for translations by first removing the codeset portion of the locale name, then trying the remainder in full, with modifier (@mod) removed, with territory code (_XX) removed, and with both removed. part of the reason gettext lacked support for searching fallbacks before is that the candidate pathname for a translation file was constructed on each call and used as the key to lookup an already-mapped translation file. this was very costly/inefficient. we now use the tuple of textdomain binding pointer, locale map pointer, and integer category id as the key for looking up a translation file mapping. based on patch by He X. --- src/locale/dcngettext.c | 87 ++++++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 32 deletions(-) diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c index b68e24bc..b79b7010 100644 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -100,7 +100,9 @@ struct msgcat { size_t map_size; void *volatile plural_rule; volatile int nplurals; - char name[]; + struct binding *binding; + const struct __locale_map *lm; + int cat; }; static char *dummy_gettextdomain() @@ -120,8 +122,8 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, struct msgcat *p; struct __locale_struct *loc = CURRENT_LOCALE; const struct __locale_map *lm; - const char *dirname, *locname, *catname; - size_t dirlen, loclen, catlen, domlen; + size_t domlen; + struct binding *q; if ((unsigned)category >= LC_ALL) goto notrans; @@ -130,55 +132,76 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, domlen = strnlen(domainname, NAME_MAX+1); if (domlen > NAME_MAX) goto notrans; - dirname = gettextdir(domainname, &dirlen); - if (!dirname) goto notrans; + for (q=bindings; q; q=q->next) + if (!strcmp(q->domainname, domainname) && q->active) + break; + if (!q) goto notrans; lm = loc->cat[category]; if (!lm) { notrans: return (char *) ((n == 1) ? msgid1 : msgid2); } - locname = lm->name; - - catname = catnames[category]; - catlen = catlens[category]; - loclen = strlen(locname); - - size_t namelen = dirlen+1 + loclen+1 + catlen+1 + domlen+3; - char name[namelen+1], *s = name; - - memcpy(s, dirname, dirlen); - s[dirlen] = '/'; - s += dirlen + 1; - memcpy(s, locname, loclen); - s[loclen] = '/'; - s += loclen + 1; - memcpy(s, catname, catlen); - s[catlen] = '/'; - s += catlen + 1; - memcpy(s, domainname, domlen); - s[domlen] = '.'; - s[domlen+1] = 'm'; - s[domlen+2] = 'o'; - s[domlen+3] = 0; for (p=cats; p; p=p->next) - if (!strcmp(p->name, name)) + if (p->binding == q && p->lm == lm && p->cat == category) break; if (!p) { + const char *dirname, *locname, *catname, *modname, *locp; + size_t dirlen, loclen, catlen, modlen, alt_modlen; void *old_cats; size_t map_size; - const void *map = __map_file(name, &map_size); + + dirname = q->dirname; + locname = lm->name; + catname = catnames[category]; + + dirlen = q->dirlen; + loclen = strlen(locname); + catlen = catlens[category]; + + /* Logically split @mod suffix from locale name. */ + modname = memchr(locname, '@', loclen); + if (!modname) modname = locname + loclen; + alt_modlen = modlen = loclen - (modname-locname); + loclen = modname-locname; + + /* Drop .charset identifier; it is not used. */ + const char *csp = memchr(locname, '.', loclen); + if (csp) loclen = csp-locname; + + char name[dirlen+1 + loclen+modlen+1 + catlen+1 + domlen+3 + 1]; + const void *map; + + for (;;) { + snprintf(name, sizeof name, "%s/%.*s%.*s/%s/%s.mo\0", + dirname, (int)loclen, locname, + (int)alt_modlen, modname, catname, domainname); + if (map = __map_file(name, &map_size)) break; + + /* Try dropping @mod, _YY, then both. */ + if (alt_modlen) { + alt_modlen = 0; + } else if ((locp = memchr(locname, '_', loclen))) { + loclen = locp-locname; + alt_modlen = modlen; + } else { + break; + } + } if (!map) goto notrans; - p = calloc(sizeof *p + namelen + 1, 1); + + p = calloc(sizeof *p, 1); if (!p) { __munmap((void *)map, map_size); goto notrans; } + p->cat = category; + p->binding = q; + p->lm = lm; p->map = map; p->map_size = map_size; - memcpy(p->name, name, namelen+1); do { old_cats = cats; p->next = old_cats; From e6917eced2cc841fe3dfd9c04deec9202f9e34f3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 21 Mar 2017 12:13:59 -0400 Subject: [PATCH 287/412] increase limit on locale name length from 15 to 23 bytes the old limit was one byte too short to support locale names of the form xx_XX.UTF-8@modifier where modifier is more than 3 bytes, a form which various real-world locale names take. the problem could be avoided by omitting the useless ".UTF-8" part, but users may need to have it present when operating on mixed-libc systems or when it will be carried over (e.g. across ssh) to other systems. the new limit is chosen sufficient for existing/reasonable locale names while still keeping the size of setlocale's static buffer small. also add locale_impl.h to the Makefile's list of headers which force rebuild of source files, to prevent dangerously inconsistent object files from getting used after this change. --- Makefile | 2 +- src/internal/locale_impl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8246b78f..d2e89979 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ AOBJS = $(LIBC_OBJS) LOBJS = $(LIBC_OBJS:.o=.lo) GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h GENH_INT = obj/src/internal/version.h -IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h) +IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/locale_impl.h src/internal/libc.h) LDFLAGS = LDFLAGS_AUTO = diff --git a/src/internal/locale_impl.h b/src/internal/locale_impl.h index f5e4d9b4..d5a3cc94 100644 --- a/src/internal/locale_impl.h +++ b/src/internal/locale_impl.h @@ -6,7 +6,7 @@ #include "libc.h" #include "pthread_impl.h" -#define LOCALE_NAME_MAX 15 +#define LOCALE_NAME_MAX 23 struct __locale_map { const void *map; From 9571c5314a8064eda8a56faa2ae2aeced34497a3 Mon Sep 17 00:00:00 2001 From: Julien Ramseier Date: Tue, 21 Mar 2017 12:24:23 -0400 Subject: [PATCH 288/412] regex: fix newline matching with negated brackets With REG_NEWLINE, POSIX says: "A in string shall not be matched by a period outside a bracket expression or by any form of a non-matching list" --- src/regex/regcomp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 5a7b53a7..fb24556e 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -636,6 +636,20 @@ static reg_errcode_t parse_bracket(tre_parse_ctx_t *ctx, const char *s) goto parse_bracket_done; if (neg.negate) { + /* + * With REG_NEWLINE, POSIX requires that newlines are not matched by + * any form of a non-matching list. + */ + if (ctx->cflags & REG_NEWLINE) { + lit = tre_new_lit(&ls); + if (!lit) { + err = REG_ESPACE; + goto parse_bracket_done; + } + lit->code_min = '\n'; + lit->code_max = '\n'; + lit->position = -1; + } /* Sort the array if we need to negate it. */ qsort(ls.a, ls.len, sizeof *ls.a, tre_compare_lit); /* extra lit for the last negated range */ From 85dfab7eaf1624577ec6de8375fd771ef9b4672a Mon Sep 17 00:00:00 2001 From: Julien Ramseier Date: Tue, 21 Mar 2017 12:30:03 -0400 Subject: [PATCH 289/412] fix off-by-one in strptime %j tm_yday range is 0-365 while %j is 1-366 --- src/time/strptime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/time/strptime.c b/src/time/strptime.c index 55c7ed1b..da9e1f42 100644 --- a/src/time/strptime.c +++ b/src/time/strptime.c @@ -73,6 +73,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri dest = &tm->tm_yday; min = 1; range = 366; + adj = 1; goto numeric_range; case 'm': dest = &tm->tm_mon; From 834ef7aff5695e79b1feeacfdc15eaba6a42cab9 Mon Sep 17 00:00:00 2001 From: Julien Ramseier Date: Tue, 21 Mar 2017 12:30:45 -0400 Subject: [PATCH 290/412] fix processing of strptime %p format string pointer was not advanced after matching. --- src/time/strptime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/time/strptime.c b/src/time/strptime.c index da9e1f42..cff0a7c1 100644 --- a/src/time/strptime.c +++ b/src/time/strptime.c @@ -94,6 +94,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri len = strlen(ex); if (!strncasecmp(s, ex, len)) { tm->tm_hour %= 12; + s += len; break; } ex = nl_langinfo(PM_STR); @@ -101,6 +102,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri if (!strncasecmp(s, ex, len)) { tm->tm_hour %= 12; tm->tm_hour += 12; + s += len; break; } return 0; From b6e1fe0d5e78dac647e85d49c2d537bb071ba49e Mon Sep 17 00:00:00 2001 From: Julien Ramseier Date: Tue, 21 Mar 2017 12:35:16 -0400 Subject: [PATCH 291/412] fix strptime output for %C without %y in this case, a potentially-uninitialized or unrelated existing value in tm_year was being used. instead use 0 if %y was not present. --- src/time/strptime.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/time/strptime.c b/src/time/strptime.c index cff0a7c1..c54a0d8c 100644 --- a/src/time/strptime.c +++ b/src/time/strptime.c @@ -11,7 +11,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri int i, w, neg, adj, min, range, *dest, dummy; const char *ex; size_t len; - int want_century = 0, century = 0; + int want_century = 0, century = 0, relyear = 0; while (*f) { if (*f != '%') { if (isspace(*f)) for (; *s && isspace(*s); s++); @@ -144,7 +144,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri if (!s) return 0; break; case 'y': - dest = &tm->tm_year; + dest = &relyear; w = 2; want_century |= 1; goto numeric_digits; @@ -198,6 +198,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri } } if (want_century) { + tm->tm_year = relyear; if (want_century & 2) tm->tm_year += century * 100 - 1900; else if (tm->tm_year <= 68) tm->tm_year += 100; } From 54807d47acecab778498ced88ce8f62bfa16e379 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 19 Mar 2017 05:26:45 +0100 Subject: [PATCH 292/412] aarch64: add single instruction math functions this should increase performance and reduce code size on aarch64. the compiled code was checked against using __builtin_* instead of inline asm with gcc-6.2.0. lrint is two instructions. c with inline asm is used because it is safer than a pure asm implementation, this prevents ll{rint,round} to be an alias of l{rint,round} (because the types don't match) and depends on gcc style inline asm support. ceil, floor, round, trunc can either raise inexact on finite non-integer inputs or not raise any exceptions. the new implementation does not raise exceptions while the generic c code does. on aarch64, the underflow exception is signaled before rounding (ieee 754 allows both before and after rounding, but it must be consistent), the generic fma c code signals it after rounding so using single instruction fixes a slight conformance issue too. --- src/math/aarch64/ceil.c | 7 +++++++ src/math/aarch64/ceilf.c | 7 +++++++ src/math/aarch64/fabs.c | 7 +++++++ src/math/aarch64/fabs.s | 6 ------ src/math/aarch64/fabsf.c | 7 +++++++ src/math/aarch64/fabsf.s | 6 ------ src/math/aarch64/floor.c | 7 +++++++ src/math/aarch64/floorf.c | 7 +++++++ src/math/aarch64/fma.c | 7 +++++++ src/math/aarch64/fmaf.c | 7 +++++++ src/math/aarch64/fmax.c | 7 +++++++ src/math/aarch64/fmaxf.c | 7 +++++++ src/math/aarch64/fmin.c | 7 +++++++ src/math/aarch64/fminf.c | 7 +++++++ src/math/aarch64/llrint.c | 10 ++++++++++ src/math/aarch64/llrintf.c | 10 ++++++++++ src/math/aarch64/llround.c | 8 ++++++++ src/math/aarch64/llroundf.c | 8 ++++++++ src/math/aarch64/lrint.c | 10 ++++++++++ src/math/aarch64/lrintf.c | 10 ++++++++++ src/math/aarch64/lround.c | 8 ++++++++ src/math/aarch64/lroundf.c | 8 ++++++++ src/math/aarch64/nearbyint.c | 7 +++++++ src/math/aarch64/nearbyintf.c | 7 +++++++ src/math/aarch64/rint.c | 7 +++++++ src/math/aarch64/rintf.c | 7 +++++++ src/math/aarch64/round.c | 7 +++++++ src/math/aarch64/roundf.c | 7 +++++++ src/math/aarch64/sqrt.c | 7 +++++++ src/math/aarch64/sqrt.s | 6 ------ src/math/aarch64/sqrtf.c | 7 +++++++ src/math/aarch64/sqrtf.s | 6 ------ src/math/aarch64/trunc.c | 7 +++++++ src/math/aarch64/truncf.c | 7 +++++++ 34 files changed, 226 insertions(+), 24 deletions(-) create mode 100644 src/math/aarch64/ceil.c create mode 100644 src/math/aarch64/ceilf.c create mode 100644 src/math/aarch64/fabs.c delete mode 100644 src/math/aarch64/fabs.s create mode 100644 src/math/aarch64/fabsf.c delete mode 100644 src/math/aarch64/fabsf.s create mode 100644 src/math/aarch64/floor.c create mode 100644 src/math/aarch64/floorf.c create mode 100644 src/math/aarch64/fma.c create mode 100644 src/math/aarch64/fmaf.c create mode 100644 src/math/aarch64/fmax.c create mode 100644 src/math/aarch64/fmaxf.c create mode 100644 src/math/aarch64/fmin.c create mode 100644 src/math/aarch64/fminf.c create mode 100644 src/math/aarch64/llrint.c create mode 100644 src/math/aarch64/llrintf.c create mode 100644 src/math/aarch64/llround.c create mode 100644 src/math/aarch64/llroundf.c create mode 100644 src/math/aarch64/lrint.c create mode 100644 src/math/aarch64/lrintf.c create mode 100644 src/math/aarch64/lround.c create mode 100644 src/math/aarch64/lroundf.c create mode 100644 src/math/aarch64/nearbyint.c create mode 100644 src/math/aarch64/nearbyintf.c create mode 100644 src/math/aarch64/rint.c create mode 100644 src/math/aarch64/rintf.c create mode 100644 src/math/aarch64/round.c create mode 100644 src/math/aarch64/roundf.c create mode 100644 src/math/aarch64/sqrt.c delete mode 100644 src/math/aarch64/sqrt.s create mode 100644 src/math/aarch64/sqrtf.c delete mode 100644 src/math/aarch64/sqrtf.s create mode 100644 src/math/aarch64/trunc.c create mode 100644 src/math/aarch64/truncf.c diff --git a/src/math/aarch64/ceil.c b/src/math/aarch64/ceil.c new file mode 100644 index 00000000..ac80c1dc --- /dev/null +++ b/src/math/aarch64/ceil.c @@ -0,0 +1,7 @@ +#include + +double ceil(double x) +{ + __asm__ ("frintp %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/ceilf.c b/src/math/aarch64/ceilf.c new file mode 100644 index 00000000..1ef1e9c8 --- /dev/null +++ b/src/math/aarch64/ceilf.c @@ -0,0 +1,7 @@ +#include + +float ceilf(float x) +{ + __asm__ ("frintp %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/fabs.c b/src/math/aarch64/fabs.c new file mode 100644 index 00000000..5c3ecaf4 --- /dev/null +++ b/src/math/aarch64/fabs.c @@ -0,0 +1,7 @@ +#include + +double fabs(double x) +{ + __asm__ ("fabs %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/fabs.s b/src/math/aarch64/fabs.s deleted file mode 100644 index 8c04d091..00000000 --- a/src/math/aarch64/fabs.s +++ /dev/null @@ -1,6 +0,0 @@ -.text -.global fabs -.type fabs,%function -fabs: - fabs d0, d0 - ret diff --git a/src/math/aarch64/fabsf.c b/src/math/aarch64/fabsf.c new file mode 100644 index 00000000..7fde9817 --- /dev/null +++ b/src/math/aarch64/fabsf.c @@ -0,0 +1,7 @@ +#include + +float fabsf(float x) +{ + __asm__ ("fabs %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/fabsf.s b/src/math/aarch64/fabsf.s deleted file mode 100644 index 6e96dd43..00000000 --- a/src/math/aarch64/fabsf.s +++ /dev/null @@ -1,6 +0,0 @@ -.text -.global fabsf -.type fabsf,%function -fabsf: - fabs s0, s0 - ret diff --git a/src/math/aarch64/floor.c b/src/math/aarch64/floor.c new file mode 100644 index 00000000..50ffdb28 --- /dev/null +++ b/src/math/aarch64/floor.c @@ -0,0 +1,7 @@ +#include + +double floor(double x) +{ + __asm__ ("frintm %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/floorf.c b/src/math/aarch64/floorf.c new file mode 100644 index 00000000..8d007e9f --- /dev/null +++ b/src/math/aarch64/floorf.c @@ -0,0 +1,7 @@ +#include + +float floorf(float x) +{ + __asm__ ("frintm %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/fma.c b/src/math/aarch64/fma.c new file mode 100644 index 00000000..2450ea7e --- /dev/null +++ b/src/math/aarch64/fma.c @@ -0,0 +1,7 @@ +#include + +double fma(double x, double y, double z) +{ + __asm__ ("fmadd %d0, %d1, %d2, %d3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); + return x; +} diff --git a/src/math/aarch64/fmaf.c b/src/math/aarch64/fmaf.c new file mode 100644 index 00000000..9a147213 --- /dev/null +++ b/src/math/aarch64/fmaf.c @@ -0,0 +1,7 @@ +#include + +float fmaf(float x, float y, float z) +{ + __asm__ ("fmadd %s0, %s1, %s2, %s3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); + return x; +} diff --git a/src/math/aarch64/fmax.c b/src/math/aarch64/fmax.c new file mode 100644 index 00000000..86dcb3b4 --- /dev/null +++ b/src/math/aarch64/fmax.c @@ -0,0 +1,7 @@ +#include + +double fmax(double x, double y) +{ + __asm__ ("fmaxnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); + return x; +} diff --git a/src/math/aarch64/fmaxf.c b/src/math/aarch64/fmaxf.c new file mode 100644 index 00000000..ee5eac2d --- /dev/null +++ b/src/math/aarch64/fmaxf.c @@ -0,0 +1,7 @@ +#include + +float fmaxf(float x, float y) +{ + __asm__ ("fmaxnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); + return x; +} diff --git a/src/math/aarch64/fmin.c b/src/math/aarch64/fmin.c new file mode 100644 index 00000000..f1e99808 --- /dev/null +++ b/src/math/aarch64/fmin.c @@ -0,0 +1,7 @@ +#include + +double fmin(double x, double y) +{ + __asm__ ("fminnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); + return x; +} diff --git a/src/math/aarch64/fminf.c b/src/math/aarch64/fminf.c new file mode 100644 index 00000000..80468f67 --- /dev/null +++ b/src/math/aarch64/fminf.c @@ -0,0 +1,7 @@ +#include + +float fminf(float x, float y) +{ + __asm__ ("fminnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); + return x; +} diff --git a/src/math/aarch64/llrint.c b/src/math/aarch64/llrint.c new file mode 100644 index 00000000..a9e07a93 --- /dev/null +++ b/src/math/aarch64/llrint.c @@ -0,0 +1,10 @@ +#include + +long long llrint(double x) +{ + long long n; + __asm__ ( + "frintx %d1, %d1\n" + "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); + return n; +} diff --git a/src/math/aarch64/llrintf.c b/src/math/aarch64/llrintf.c new file mode 100644 index 00000000..12b6804f --- /dev/null +++ b/src/math/aarch64/llrintf.c @@ -0,0 +1,10 @@ +#include + +long long llrintf(float x) +{ + long long n; + __asm__ ( + "frintx %s1, %s1\n" + "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); + return n; +} diff --git a/src/math/aarch64/llround.c b/src/math/aarch64/llround.c new file mode 100644 index 00000000..e09ddd48 --- /dev/null +++ b/src/math/aarch64/llround.c @@ -0,0 +1,8 @@ +#include + +long long llround(double x) +{ + long long n; + __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); + return n; +} diff --git a/src/math/aarch64/llroundf.c b/src/math/aarch64/llroundf.c new file mode 100644 index 00000000..16699598 --- /dev/null +++ b/src/math/aarch64/llroundf.c @@ -0,0 +1,8 @@ +#include + +long long llroundf(float x) +{ + long long n; + __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); + return n; +} diff --git a/src/math/aarch64/lrint.c b/src/math/aarch64/lrint.c new file mode 100644 index 00000000..cb7785ad --- /dev/null +++ b/src/math/aarch64/lrint.c @@ -0,0 +1,10 @@ +#include + +long lrint(double x) +{ + long n; + __asm__ ( + "frintx %d1, %d1\n" + "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); + return n; +} diff --git a/src/math/aarch64/lrintf.c b/src/math/aarch64/lrintf.c new file mode 100644 index 00000000..4d750d69 --- /dev/null +++ b/src/math/aarch64/lrintf.c @@ -0,0 +1,10 @@ +#include + +long lrintf(float x) +{ + long n; + __asm__ ( + "frintx %s1, %s1\n" + "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); + return n; +} diff --git a/src/math/aarch64/lround.c b/src/math/aarch64/lround.c new file mode 100644 index 00000000..85656c78 --- /dev/null +++ b/src/math/aarch64/lround.c @@ -0,0 +1,8 @@ +#include + +long lround(double x) +{ + long n; + __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); + return n; +} diff --git a/src/math/aarch64/lroundf.c b/src/math/aarch64/lroundf.c new file mode 100644 index 00000000..32e51f3c --- /dev/null +++ b/src/math/aarch64/lroundf.c @@ -0,0 +1,8 @@ +#include + +long lroundf(float x) +{ + long n; + __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); + return n; +} diff --git a/src/math/aarch64/nearbyint.c b/src/math/aarch64/nearbyint.c new file mode 100644 index 00000000..9c3fdb44 --- /dev/null +++ b/src/math/aarch64/nearbyint.c @@ -0,0 +1,7 @@ +#include + +double nearbyint(double x) +{ + __asm__ ("frinti %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/nearbyintf.c b/src/math/aarch64/nearbyintf.c new file mode 100644 index 00000000..8e7f61df --- /dev/null +++ b/src/math/aarch64/nearbyintf.c @@ -0,0 +1,7 @@ +#include + +float nearbyintf(float x) +{ + __asm__ ("frinti %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/rint.c b/src/math/aarch64/rint.c new file mode 100644 index 00000000..45b194b5 --- /dev/null +++ b/src/math/aarch64/rint.c @@ -0,0 +1,7 @@ +#include + +double rint(double x) +{ + __asm__ ("frintx %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/rintf.c b/src/math/aarch64/rintf.c new file mode 100644 index 00000000..1ae7dd25 --- /dev/null +++ b/src/math/aarch64/rintf.c @@ -0,0 +1,7 @@ +#include + +float rintf(float x) +{ + __asm__ ("frintx %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/round.c b/src/math/aarch64/round.c new file mode 100644 index 00000000..897a84cc --- /dev/null +++ b/src/math/aarch64/round.c @@ -0,0 +1,7 @@ +#include + +double round(double x) +{ + __asm__ ("frinta %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/roundf.c b/src/math/aarch64/roundf.c new file mode 100644 index 00000000..91637eaa --- /dev/null +++ b/src/math/aarch64/roundf.c @@ -0,0 +1,7 @@ +#include + +float roundf(float x) +{ + __asm__ ("frinta %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/sqrt.c b/src/math/aarch64/sqrt.c new file mode 100644 index 00000000..fe93c3e6 --- /dev/null +++ b/src/math/aarch64/sqrt.c @@ -0,0 +1,7 @@ +#include + +double sqrt(double x) +{ + __asm__ ("fsqrt %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/sqrt.s b/src/math/aarch64/sqrt.s deleted file mode 100644 index 1917e18d..00000000 --- a/src/math/aarch64/sqrt.s +++ /dev/null @@ -1,6 +0,0 @@ -.text -.global sqrt -.type sqrt,%function -sqrt: - fsqrt d0, d0 - ret diff --git a/src/math/aarch64/sqrtf.c b/src/math/aarch64/sqrtf.c new file mode 100644 index 00000000..275c7f39 --- /dev/null +++ b/src/math/aarch64/sqrtf.c @@ -0,0 +1,7 @@ +#include + +float sqrtf(float x) +{ + __asm__ ("fsqrt %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/sqrtf.s b/src/math/aarch64/sqrtf.s deleted file mode 100644 index 1639497b..00000000 --- a/src/math/aarch64/sqrtf.s +++ /dev/null @@ -1,6 +0,0 @@ -.text -.global sqrtf -.type sqrtf,%function -sqrtf: - fsqrt s0, s0 - ret diff --git a/src/math/aarch64/trunc.c b/src/math/aarch64/trunc.c new file mode 100644 index 00000000..e592147a --- /dev/null +++ b/src/math/aarch64/trunc.c @@ -0,0 +1,7 @@ +#include + +double trunc(double x) +{ + __asm__ ("frintz %d0, %d1" : "=w"(x) : "w"(x)); + return x; +} diff --git a/src/math/aarch64/truncf.c b/src/math/aarch64/truncf.c new file mode 100644 index 00000000..20ef30f1 --- /dev/null +++ b/src/math/aarch64/truncf.c @@ -0,0 +1,7 @@ +#include + +float truncf(float x) +{ + __asm__ ("frintz %s0, %s1" : "=w"(x) : "w"(x)); + return x; +} From 1ca597551bab424a1302938dd3504ddf73904efd Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 11 Apr 2017 22:01:31 -0400 Subject: [PATCH 293/412] fix read past end of buffer in getaddrinfo backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit due to testing buf[i].family==AF_INET before checking i==cnt, it was possible to read past the end of the array, or past the valid part. in practice, without active bounds/indeterminate-value checking by the compiler, the worst that happened was failure to return early and optimize out the sorting that's unneeded for v4-only results. returning on i==cnt-1 rather than i==cnt would be an alternate fix, but the approach this patch takes is more idiomatic and less error-prone. patch by Timo Teräs. --- src/network/lookup_name.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index fb7303a3..066be4d5 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -338,8 +338,8 @@ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], c /* No further processing is needed if there are fewer than 2 * results or if there are only IPv4 results. */ if (cnt<2 || family==AF_INET) return cnt; - for (i=0; buf[i].family == AF_INET; i++) - if (i==cnt) return cnt; + for (i=0; i Date: Tue, 11 Apr 2017 22:10:52 -0400 Subject: [PATCH 294/412] fix dl_iterate_phdr in static PIE binaries analogous to commit 5bf7eba213cacc4c1220627c91c28deff2ffecda, use of AT_PHDR/PT_PHDR does not actually work to find the program base, and the method with _DYNAMIC vs PT_DYNAMIC must be used as an alternative. patch by Shiz, along with testing to confirm that this fixes unwinding in static PIE. --- src/ldso/dl_iterate_phdr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ldso/dl_iterate_phdr.c b/src/ldso/dl_iterate_phdr.c index e55cbf76..f3160ef4 100644 --- a/src/ldso/dl_iterate_phdr.c +++ b/src/ldso/dl_iterate_phdr.c @@ -4,6 +4,9 @@ #define AUX_CNT 38 +__attribute__((__weak__, __visibility__("hidden"))) +extern const size_t _DYNAMIC[]; + static int static_dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void *data), void *data) { unsigned char *p; @@ -20,6 +23,8 @@ static int static_dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size phdr = (void *)p; if (phdr->p_type == PT_PHDR) base = aux[AT_PHDR] - phdr->p_vaddr; + if (phdr->p_type == PT_DYNAMIC && _DYNAMIC) + base = (size_t)_DYNAMIC - phdr->p_vaddr; if (phdr->p_type == PT_TLS) tls_phdr = phdr; } From 2577b1bc16124d0690b9dd268a9f582f80bdcd67 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 21 Apr 2017 17:24:46 -0400 Subject: [PATCH 295/412] allow full-range file offsets to mmap on archs with 64-bit syscall args normally 32-bit archs use the mmap2 syscall and are limited to an offset of 2^32 pages. however some 32-bit archs (mainly ILP32-on-64 ones like x32) have 64-bit syscall argument slots and thus can accept the full range. don't artifically limit them. --- src/mman/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mman/mmap.c b/src/mman/mmap.c index b85f25ca..19caadbd 100644 --- a/src/mman/mmap.c +++ b/src/mman/mmap.c @@ -10,7 +10,7 @@ static void dummy(void) { } weak_alias(dummy, __vm_wait); #define UNIT SYSCALL_MMAP2_UNIT -#define OFF_MASK ((-0x2000ULL << (8*sizeof(long)-1)) | (UNIT-1)) +#define OFF_MASK ((-0x2000ULL << (8*sizeof(syscall_arg_t)-1)) | (UNIT-1)) void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) { From 8c44a060243f04283ca68dad199aab90336141db Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 3 Apr 2017 02:38:13 +0200 Subject: [PATCH 296/412] fix scalbn when result is in the subnormal range in nearest rounding mode scalbn could introduce double rounding error when an intermediate value and the final result were both in the subnormal range e.g. scalbn(0x1.7ffffffffffffp-1, -1073) returned 0x1p-1073 instead of 0x1p-1074, because the intermediate computation got rounded to 0x1.8p-1023. with the fix an intermediate value can only be in the subnormal range if the final result is 0 which is correct even after double rounding. (there still can be two roundings so signals may be raised twice, but that's only observable with trapping exceptions which is not supported.) --- src/math/scalbn.c | 10 ++++++---- src/math/scalbnf.c | 8 ++++---- src/math/scalbnl.c | 8 ++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/math/scalbn.c b/src/math/scalbn.c index 530e07c7..182f5610 100644 --- a/src/math/scalbn.c +++ b/src/math/scalbn.c @@ -16,11 +16,13 @@ double scalbn(double x, int n) n = 1023; } } else if (n < -1022) { - y *= 0x1p-1022; - n += 1022; + /* make sure final n < -53 to avoid double + rounding in the subnormal range */ + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; if (n < -1022) { - y *= 0x1p-1022; - n += 1022; + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; if (n < -1022) n = -1022; } diff --git a/src/math/scalbnf.c b/src/math/scalbnf.c index 0b62c3c7..a5ad208b 100644 --- a/src/math/scalbnf.c +++ b/src/math/scalbnf.c @@ -16,11 +16,11 @@ float scalbnf(float x, int n) n = 127; } } else if (n < -126) { - y *= 0x1p-126f; - n += 126; + y *= 0x1p-126f * 0x1p24f; + n += 126 - 24; if (n < -126) { - y *= 0x1p-126f; - n += 126; + y *= 0x1p-126f * 0x1p24f; + n += 126 - 24; if (n < -126) n = -126; } diff --git a/src/math/scalbnl.c b/src/math/scalbnl.c index 08a4c587..db44dab0 100644 --- a/src/math/scalbnl.c +++ b/src/math/scalbnl.c @@ -20,11 +20,11 @@ long double scalbnl(long double x, int n) n = 16383; } } else if (n < -16382) { - x *= 0x1p-16382L; - n += 16382; + x *= 0x1p-16382L * 0x1p113L; + n += 16382 - 113; if (n < -16382) { - x *= 0x1p-16382L; - n += 16382; + x *= 0x1p-16382L * 0x1p113L; + n += 16382 - 113; if (n < -16382) n = -16382; } From 1a7fa5e5211a67e89861583516ee1566609467a1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 21 Apr 2017 17:34:26 -0400 Subject: [PATCH 297/412] fix regression in support for resolv.conf attempts option commit d6cb08bcaca4ff1f921375510ca72bccea969c75 moved the code and introduced an incorrect string offset for the new parsing, probably due to a copy-and-paste error. patch by Stefan Sedich. --- src/network/resolvconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c index 2cf1f475..4c3e4c4b 100644 --- a/src/network/resolvconf.c +++ b/src/network/resolvconf.c @@ -45,8 +45,8 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) if (z != p) conf->ndots = x > 15 ? 15 : x; } p = strstr(line, "attempts:"); - if (p && isdigit(p[6])) { - p += 6; + if (p && isdigit(p[9])) { + p += 9; unsigned long x = strtoul(p, &z, 10); if (z != p) conf->attempts = x > 10 ? 10 : x; } From e1232f5b5185e8f337806841018369407e32e77d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 21 Apr 2017 17:41:10 -0400 Subject: [PATCH 298/412] make ttyname[_r] return ENODEV rather than ENOENT commit 0a950dcf15bb9f7274c804dca490e9e20e475f3e added checking that the pathname a tty device was opened with actually matches the device, which can fail to hold when a container inherits a tty from outside the container. the error code added at the time was ENOENT; however, discussions between affected applications and glibc developers resulted in glibc adopting ENODEV as the error for this condition, and this has now been documented in the man pages project as well. adopt the same error code for consistency. patch by Christian Brauner. --- src/unistd/ttyname_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unistd/ttyname_r.c b/src/unistd/ttyname_r.c index a38ba4f2..33aa4ae1 100644 --- a/src/unistd/ttyname_r.c +++ b/src/unistd/ttyname_r.c @@ -23,7 +23,7 @@ int ttyname_r(int fd, char *name, size_t size) if (stat(name, &st1) || fstat(fd, &st2)) return errno; if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) - return ENOENT; + return ENODEV; return 0; } From 58e2396a9aa23c132faf4198ca4d779c84955b38 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 22 Apr 2017 17:48:37 -0400 Subject: [PATCH 299/412] remove va_arg hacks in printf core with undefined behavior the code being removed was written to optimize for size assuming the compiler cannot collapse code paths for different types with the same underlying representation. modern compilers sometimes succeed in making this optimization themselves, but either way it's a small size difference and not worth the source-level complexity or the UB involved in this hack. some incorrect use of va_arg still remains, particularly use of void * where the actual argument has a different pointer type. fixing this requires some actual code additions, rather than just removing cruft, so I'm leaving it to be done later as a separate commit. --- src/stdio/vfprintf.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 60da14d8..8c81efc2 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -26,14 +27,6 @@ #define FLAGMASK (ALT_FORM|ZERO_PAD|LEFT_ADJ|PAD_POS|MARK_POS|GROUPED) -#if UINT_MAX == ULONG_MAX -#define LONG_IS_INT -#endif - -#if SIZE_MAX != ULONG_MAX || UINTMAX_MAX != ULLONG_MAX -#define ODD_TYPES -#endif - /* State machine to accept length modifiers + conversion specifiers. * Result is 0 on failure, or an argument type to pop on success. */ @@ -42,23 +35,9 @@ enum { ZTPRE, JPRE, STOP, PTR, INT, UINT, ULLONG, -#ifndef LONG_IS_INT LONG, ULONG, -#else -#define LONG INT -#define ULONG UINT -#endif SHORT, USHORT, CHAR, UCHAR, -#ifdef ODD_TYPES LLONG, SIZET, IMAX, UMAX, PDIFF, UIPTR, -#else -#define LLONG ULLONG -#define SIZET ULONG -#define IMAX LLONG -#define UMAX ULLONG -#define PDIFF LONG -#define UIPTR ULONG -#endif DBL, LDBL, NOARG, MAXSTATE @@ -134,23 +113,19 @@ static void pop_arg(union arg *arg, int type, va_list *ap) case PTR: arg->p = va_arg(*ap, void *); break; case INT: arg->i = va_arg(*ap, int); break; case UINT: arg->i = va_arg(*ap, unsigned int); -#ifndef LONG_IS_INT break; case LONG: arg->i = va_arg(*ap, long); break; case ULONG: arg->i = va_arg(*ap, unsigned long); -#endif break; case ULLONG: arg->i = va_arg(*ap, unsigned long long); break; case SHORT: arg->i = (short)va_arg(*ap, int); break; case USHORT: arg->i = (unsigned short)va_arg(*ap, int); break; case CHAR: arg->i = (signed char)va_arg(*ap, int); break; case UCHAR: arg->i = (unsigned char)va_arg(*ap, int); -#ifdef ODD_TYPES break; case LLONG: arg->i = va_arg(*ap, long long); break; case SIZET: arg->i = va_arg(*ap, size_t); break; case IMAX: arg->i = va_arg(*ap, intmax_t); break; case UMAX: arg->i = va_arg(*ap, uintmax_t); break; case PDIFF: arg->i = va_arg(*ap, ptrdiff_t); break; case UIPTR: arg->i = (uintptr_t)va_arg(*ap, void *); -#endif break; case DBL: arg->f = va_arg(*ap, double); break; case LDBL: arg->f = va_arg(*ap, long double); } From bb439bb17108b67f3df9c9af824d3a607b5b059d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 22 Apr 2017 18:39:40 -0400 Subject: [PATCH 300/412] implement new posix_spawn flag POSIX_SPAWN_SETSID this functionality has been adopted for inclusion in the next issue of POSIX as the result of Austin Group issue #1044. based on patch by Daurnimator. --- include/spawn.h | 1 + src/process/posix_spawn.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/spawn.h b/include/spawn.h index 29c799ee..f3e9e23c 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -21,6 +21,7 @@ struct sched_param; #define POSIX_SPAWN_SETSIGMASK 8 #define POSIX_SPAWN_SETSCHEDPARAM 16 #define POSIX_SPAWN_SETSCHEDULER 32 +#define POSIX_SPAWN_SETSID 128 typedef struct { int __flags; diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c index 0bdf71cd..ea5d2998 100644 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -73,6 +73,10 @@ static int child(void *args_vp) __libc_sigaction(i, &sa, 0); } + if (attr->__flags & POSIX_SPAWN_SETSID) + if ((ret=__syscall(SYS_setsid)) < 0) + goto fail; + if (attr->__flags & POSIX_SPAWN_SETPGROUP) if ((ret=__syscall(SYS_setpgid, 0, attr->__pgrp))) goto fail; From 555504166852a9b9c56ac4e1fb5bb1bf20cbf8ad Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 26 Mar 2017 14:50:37 -0500 Subject: [PATCH 301/412] s390x: provide sigcontext struct definition This structure was missed when creating the s390x port. This is based on the report and patch from William Pitcock, but with a modified structure defintion to more closely match the kernel's definition. --- arch/s390x/bits/signal.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/s390x/bits/signal.h b/arch/s390x/bits/signal.h index c8665832..e5aca4ba 100644 --- a/arch/s390x/bits/signal.h +++ b/arch/s390x/bits/signal.h @@ -33,6 +33,21 @@ typedef struct fpregset_t fpregs; } mcontext_t; +struct sigcontext { + unsigned long oldmask[1]; + struct { + struct { + __psw_t psw; + unsigned long gprs[16]; + unsigned acrs[16]; + } regs; + struct { + unsigned fpc; + double fprs[16]; + } fpregs; + } *sregs; +}; + #else typedef struct { From 77e895dcfadb156c9f378d26c9d0497ce2baf13f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 22 Apr 2017 20:40:09 -0400 Subject: [PATCH 302/412] add no-op POSIX_SPAWN_USEVFORK to spawn.h the bit is reserved anyway for ABI-compat reasons; this documents it and makes it so we can have posix_spawnattr_setflags check for flag validity without hard-coding an anonymous bit value. --- include/spawn.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/spawn.h b/include/spawn.h index f3e9e23c..bba57ce4 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -21,6 +21,7 @@ struct sched_param; #define POSIX_SPAWN_SETSIGMASK 8 #define POSIX_SPAWN_SETSCHEDPARAM 16 #define POSIX_SPAWN_SETSCHEDULER 32 +#define POSIX_SPAWN_USEVFORK 64 #define POSIX_SPAWN_SETSID 128 typedef struct { From f9f686b7721e2cc35e20fa5c6df6da2dc4ac3f50 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 22 Apr 2017 20:45:16 -0400 Subject: [PATCH 303/412] have posix_spawnattr_setflags check for supported flags per POSIX, EINVAL is not a mandatory error, only an optional one. but reporting unsupported flags allows an application to fallback gracefully when a requested feature is not supported. this is not helpful now, but it may be in the future if additional flags are added. had this checking been present before, applications would have been able to check for the newly-added POSIX_SPAWN_SETSID feature (added in commit bb439bb17108b67f3df9c9af824d3a607b5b059d) at runtime. --- src/process/posix_spawnattr_setflags.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/process/posix_spawnattr_setflags.c b/src/process/posix_spawnattr_setflags.c index f750c040..68780992 100644 --- a/src/process/posix_spawnattr_setflags.c +++ b/src/process/posix_spawnattr_setflags.c @@ -1,7 +1,18 @@ #include +#include int posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags) { + const unsigned all_flags = + POSIX_SPAWN_RESETIDS | + POSIX_SPAWN_SETPGROUP | + POSIX_SPAWN_SETSIGDEF | + POSIX_SPAWN_SETSIGMASK | + POSIX_SPAWN_SETSCHEDPARAM | + POSIX_SPAWN_SETSCHEDULER | + POSIX_SPAWN_USEVFORK | + POSIX_SPAWN_SETSID; + if (flags & ~all_flags) return EINVAL; attr->__flags = flags; return 0; } From 97bd6b09dbe7478d5a90a06ecd9e5b59389d8eb9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 27 May 2017 21:36:00 -0400 Subject: [PATCH 304/412] fix iconv conversions to legacy 8bit encodings there was missing reverse-conversion logic for the case, handled specially in the character set tables, where a byte represents a unicode codepoint with the same value. this patch adds code to handle the case, and refactors the two-level 10-bit table lookup for legacy character sets into a function to avoid repeating it yet another time as part of the fix. --- src/locale/iconv.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 1eeea94e..4636307f 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -151,6 +151,14 @@ static void put_32(unsigned char *s, unsigned c, int e) #define mbrtowc_utf8 mbrtowc #define wctomb_utf8 wctomb +static unsigned legacy_map(const unsigned char *map, unsigned c) +{ + unsigned x = c - 128 + map[-1]; + x = legacy_chars[ map[x*5/4]>>2*x%8 | + map[x*5/4+1]<<8-2*x%8 & 1023 ]; + return x ? x : c; +} + size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) { size_t x=0; @@ -364,10 +372,7 @@ size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restr break; default: if (c < 128+type) break; - c -= 128+type; - c = legacy_chars[ map[c*5/4]>>2*c%8 | - map[c*5/4+1]<<8-2*c%8 & 1023 ]; - if (!c) c = *(unsigned char *)*in; + c = legacy_map(map, c); if (c==1) goto ilseq; } @@ -392,17 +397,15 @@ size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restr if (c > 0x7f) subst: x++, c='*'; default: if (*outb < 1) goto toobig; - if (c < 128+totype) { + if (c < 128+totype || (c<256 && c==legacy_map(tomap, c))) { revout: *(*out)++ = c; *outb -= 1; break; } d = c; - for (c=0; c<128-totype; c++) { - if (d == legacy_chars[ tomap[c*5/4]>>2*c%8 | - tomap[c*5/4+1]<<8-2*c%8 & 1023 ]) { - c += 128; + for (c=128+totype; c<256; c++) { + if (d == legacy_map(tomap, c)) { goto revout; } } From 81f4a1200a58a84c83e73da645d4f226a8785bdf Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 27 May 2017 15:20:01 -0500 Subject: [PATCH 305/412] fix fchown fallback on arches without chown(2) The flags argument was missing, causing uninitalized data to be passed to fchownat(2). The correct value of flags should match the fallback for chown(3). --- src/unistd/fchown.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unistd/fchown.c b/src/unistd/fchown.c index 03459849..75075eec 100644 --- a/src/unistd/fchown.c +++ b/src/unistd/fchown.c @@ -16,7 +16,7 @@ int fchown(int fd, uid_t uid, gid_t gid) #ifdef SYS_chown return syscall(SYS_chown, buf, uid, gid); #else - return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid); + return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid, 0); #endif } From 4073f03add269be8be9f84d374fe69920b78d53d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 31 May 2017 21:46:15 -0400 Subject: [PATCH 306/412] fix fstatat syscall on mips64 mips64 requires 'struct stat' conversion due to incorrect 32-bit fields where time_t should be in the kernel version of the structure. syscall_arch.h already performed the correct translation for stat, fstat, and lstat syscalls, but omitted special handling for fstatat. --- arch/mips64/syscall_arch.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/arch/mips64/syscall_arch.h b/arch/mips64/syscall_arch.h index 1bd6c18f..bb73dc3c 100644 --- a/arch/mips64/syscall_arch.h +++ b/arch/mips64/syscall_arch.h @@ -149,13 +149,15 @@ static inline long __syscall4(long n, long a, long b, long c, long d) register long r7 __asm__("$7"); register long r2 __asm__("$2"); - r5 = b; - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - r5 = (long) &kst; - r4 = a; + r5 = b; r6 = c; r7 = d; + if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) + r5 = (long) &kst; + if (n == SYS_newfstatat) + r6 = (long) &kst; + __asm__ __volatile__ ( "daddu $2,$0,%2 ; syscall" : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), @@ -168,6 +170,8 @@ static inline long __syscall4(long n, long a, long b, long c, long d) if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(&kst, (struct stat *)b); + if (n == SYS_newfstatat) + __stat_fix(&kst, (struct stat *)c); return ret; } @@ -224,16 +228,21 @@ static inline long __syscall4(long n, long a, long b, long c, long d) { long r2; long old_b = b; + long old_c = c; struct kernel_stat kst; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) b = (long) &kst; + if (n == SYS_newfstatat) + c = (long) &kst; r2 = (__syscall)(n, a, b, c, d); if (r2 > -4096UL) return r2; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(&kst, (struct stat *)old_b); + if (n == SYS_newfstatat) + __stat_fix(&kst, (struct stat *)old_c); return r2; } @@ -244,16 +253,21 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e) { long r2; long old_b = b; + long old_c = c; struct kernel_stat kst; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) b = (long) &kst; + if (n == SYS_newfstatat) + c = (long) &kst; r2 = (__syscall)(n, a, b, c, d, e); if (r2 > -4096UL) return r2; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(&kst, (struct stat *)old_b); + if (n == SYS_newfstatat) + __stat_fix(&kst, (struct stat *)old_c); return r2; } @@ -262,16 +276,21 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo { long r2; long old_b = b; + long old_c = c; struct kernel_stat kst; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) b = (long) &kst; + if (n == SYS_newfstatat) + c = (long) &kst; r2 = (__syscall)(n, a, b, c, d, e, f); if (r2 > -4096UL) return r2; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(&kst, (struct stat *)old_b); + if (n == SYS_newfstatat) + __stat_fix(&kst, (struct stat *)old_c); return r2; } From 1c497005ee58fd237646a49231b73fd3ea79e2d5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 31 May 2017 21:49:44 -0400 Subject: [PATCH 307/412] remove long-obsolete clang workarounds from mips* syscall_arch.h files at one point, clang reportedly failed to support the asm register constraints needed for inline syscalls. versions of clang that old have much bigger problems that preclude using them to compile musl libc. --- arch/mips/syscall_arch.h | 41 -------------------- arch/mips64/syscall_arch.h | 75 ------------------------------------- arch/mipsn32/syscall_arch.h | 41 -------------------- 3 files changed, 157 deletions(-) diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h index 39c0ea32..3ac4da21 100644 --- a/arch/mips/syscall_arch.h +++ b/arch/mips/syscall_arch.h @@ -20,8 +20,6 @@ static inline void __stat_fix(long p) } #endif -#ifndef __clang__ - static inline long __syscall0(long n) { register long r7 __asm__("$7"); @@ -105,45 +103,6 @@ static inline long __syscall4(long n, long a, long b, long c, long d) return ret; } -#else - -static inline long __syscall0(long n) -{ - return (__syscall)(n); -} - -static inline long __syscall1(long n, long a) -{ - return (__syscall)(n, a); -} - -static inline long __syscall2(long n, long a, long b) -{ - long r2 = (__syscall)(n, a, b); - if (r2 > -4096UL) return r2; - if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b); - return r2; -} - -static inline long __syscall3(long n, long a, long b, long c) -{ - long r2 = (__syscall)(n, a, b, c); - if (r2 > -4096UL) return r2; - if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b); - return r2; -} - -static inline long __syscall4(long n, long a, long b, long c, long d) -{ - long r2 = (__syscall)(n, a, b, c, d); - if (r2 > -4096UL) return r2; - if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); - return r2; -} - -#endif - static inline long __syscall5(long n, long a, long b, long c, long d, long e) { long r2 = (__syscall)(n, a, b, c, d, e); diff --git a/arch/mips64/syscall_arch.h b/arch/mips64/syscall_arch.h index bb73dc3c..5eabdf46 100644 --- a/arch/mips64/syscall_arch.h +++ b/arch/mips64/syscall_arch.h @@ -49,8 +49,6 @@ static void __stat_fix(struct kernel_stat *kst, struct stat *st) st->st_blocks = kst->st_blocks; } -#ifndef __clang__ - static inline long __syscall0(long n) { register long r7 __asm__("$7"); @@ -176,79 +174,6 @@ static inline long __syscall4(long n, long a, long b, long c, long d) return ret; } -#else - -static inline long __syscall0(long n) -{ - return (__syscall)(n); -} - -static inline long __syscall1(long n, long a) -{ - return (__syscall)(n, a); -} - -static inline long __syscall2(long n, long a, long b) -{ - long r2; - long old_b = b; - struct kernel_stat kst; - - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - b = (long) &kst; - - r2 = (__syscall)(n, a, b); - if (r2 > -4096UL) return r2; - - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - __stat_fix(&kst, (struct stat *)old_b); - - return r2; -} - -static inline long __syscall3(long n, long a, long b, long c) -{ - long r2; - long old_b = b; - struct kernel_stat kst; - - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - b = (long) &kst; - - r2 = (__syscall)(n, a, b, c); - if (r2 > -4096UL) return r2; - - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - __stat_fix(&kst, (struct stat *)old_b); - - return r2; -} - -static inline long __syscall4(long n, long a, long b, long c, long d) -{ - long r2; - long old_b = b; - long old_c = c; - struct kernel_stat kst; - - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - b = (long) &kst; - if (n == SYS_newfstatat) - c = (long) &kst; - - r2 = (__syscall)(n, a, b, c, d); - if (r2 > -4096UL) return r2; - - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) - __stat_fix(&kst, (struct stat *)old_b); - if (n == SYS_newfstatat) - __stat_fix(&kst, (struct stat *)old_c); - - return r2; -} - -#endif - static inline long __syscall5(long n, long a, long b, long c, long d, long e) { long r2; diff --git a/arch/mipsn32/syscall_arch.h b/arch/mipsn32/syscall_arch.h index 58d2c8bd..37e71a7e 100644 --- a/arch/mipsn32/syscall_arch.h +++ b/arch/mipsn32/syscall_arch.h @@ -18,8 +18,6 @@ static inline void __stat_fix(long p) } #endif -#ifndef __clang__ - static inline long __syscall0(long n) { register long r7 __asm__("$7"); @@ -103,45 +101,6 @@ static inline long __syscall4(long n, long a, long b, long c, long d) return ret; } -#else - -static inline long __syscall0(long n) -{ - return (__syscall)(n); -} - -static inline long __syscall1(long n, long a) -{ - return (__syscall)(n, a); -} - -static inline long __syscall2(long n, long a, long b) -{ - long r2 = (__syscall)(n, a, b); - if (r2 > -4096UL) return r2; - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); - return r2; -} - -static inline long __syscall3(long n, long a, long b, long c) -{ - long r2 = (__syscall)(n, a, b, c); - if (r2 > -4096UL) return r2; - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); - return r2; -} - -static inline long __syscall4(long n, long a, long b, long c, long d) -{ - long r2 = (__syscall)(n, a, b, c, d); - if (r2 > -4096UL) return r2; - if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); - return r2; -} - -#endif - static inline long __syscall5(long n, long a, long b, long c, long d, long e) { long r2 = (__syscall)(n, a, b, c, d, e); From 179766aa2ef06df854bc1d9616bf6f00ce49b7f9 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 30 May 2017 14:23:24 +0200 Subject: [PATCH 308/412] towupper/towlower: fast path for ascii chars Make a fast path for ascii chars which is assumed to be the most common case. This has significant performance benefit on xml json and similar --- src/ctype/towctrans.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ctype/towctrans.c b/src/ctype/towctrans.c index 6af61875..cf13a862 100644 --- a/src/ctype/towctrans.c +++ b/src/ctype/towctrans.c @@ -1,3 +1,4 @@ +#include #include #include "libc.h" @@ -9,7 +10,6 @@ static const struct { signed char lower; unsigned char len; } casemaps[] = { - CASEMAP('A','Z','a'), CASEMAP(0xc0,0xde,0xe0), CASELACE(0x0100,0x012e), @@ -257,12 +257,12 @@ static wchar_t __towcase(wchar_t wc, int lower) wint_t towupper(wint_t wc) { - return __towcase(wc, 0); + return (unsigned)wc < 128 ? toupper(wc) : __towcase(wc, 0); } wint_t towlower(wint_t wc) { - return __towcase(wc, 1); + return (unsigned)wc < 128 ? tolower(wc) : __towcase(wc, 1); } wint_t __towupper_l(wint_t c, locale_t l) From bc313e880c6cde2e512d2f43e84968d1b12bd19d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 8 Jun 2017 19:44:27 -0400 Subject: [PATCH 309/412] use hard-coded sh4a atomic opcodes to avoid linker errors on sh when using the sh4a opcodes, the assembler tags the resulting object file as requiring sh4a. the linker then refuses to (static) link it with object files marked as requiring j2, since there is no isa level that includes both sh4a and j2 instructions. --- src/thread/sh/atomics.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thread/sh/atomics.s b/src/thread/sh/atomics.s index 3b58cccc..9d9fcb6e 100644 --- a/src/thread/sh/atomics.s +++ b/src/thread/sh/atomics.s @@ -28,15 +28,15 @@ __sh_cas_gusa: .hidden __sh_cas_llsc __sh_cas_llsc: mov r0,r1 - synco -0: movli.l @r1,r0 + .word 0x00ab /* synco */ +0: .word 0x0163 /* movli.l @r1,r0 */ cmp/eq r0,r2 bf 1f mov r3,r0 - movco.l r0,@r1 + .word 0x0173 /* movco.l r0,@r1 */ bf 0b mov r2,r0 -1: synco +1: .word 0x00ab /* synco */ mov r0,r3 rts mov r1,r0 From 84eff797e3e38210cc311b000b1586b948b4fc35 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 8 Jun 2017 19:50:23 -0400 Subject: [PATCH 310/412] fix glob failure to match plain "/" to root directory the check to prevent matching empty string wrongly blocked matching of "/" due to checking emptiness after stripping leading slashes rather than checking the full original argument string. simplified from patch by Julien Ramseier. --- src/regex/glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regex/glob.c b/src/regex/glob.c index 5b6ff124..2d4d562e 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -179,7 +179,7 @@ int glob(const char *restrict pat, int flags, int (*errfunc)(const char *path, i if (strnlen(p, PATH_MAX+1) > PATH_MAX) return GLOB_NOSPACE; - if (*p) error = match_in_dir(d, p, flags, errfunc, &tail); + if (*pat) error = match_in_dir(d, p, flags, errfunc, &tail); if (error == GLOB_NOSPACE) { freelist(&head); return error; From af0517301677b4206c605caaef25f5d57a31b5b8 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 9 Jun 2017 00:26:16 -0500 Subject: [PATCH 311/412] catopen: set errno to EOPNOTSUPP Per 1003.1-2008 (2016 ed.), catopen must set errno on failure. We set errno to EOPNOTSUPP because musl does not currently support message catalogues. --- src/locale/catopen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/locale/catopen.c b/src/locale/catopen.c index 4423c4d9..3fbc7717 100644 --- a/src/locale/catopen.c +++ b/src/locale/catopen.c @@ -1,6 +1,8 @@ #include +#include nl_catd catopen (const char *name, int oflag) { + errno = EOPNOTSUPP; return (nl_catd)-1; } From 10800088099ec4c27c1db6c613c8bbf9f76e4057 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 9 Jun 2017 00:26:18 -0500 Subject: [PATCH 312/412] getdate: correctly specify error number POSIX defines getdate error #5 as: "An I/O error is encountered while reading the template file." POSIX defines getdate error #7 as: "There is no line in the template that matches the input." This change correctly disambiguates between the two error conditions. --- src/time/getdate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/time/getdate.c b/src/time/getdate.c index 89f21699..420cd8e4 100644 --- a/src/time/getdate.c +++ b/src/time/getdate.c @@ -37,7 +37,8 @@ struct tm *getdate(const char *s) } } - getdate_err = 7; + if (ferror(f)) getdate_err = 5; + else getdate_err = 7; out: if (f) fclose(f); pthread_setcancelstate(cs, 0); From 1c86c7f5c26dd0569df7afc23ee9866fb3f645dc Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 15 Jun 2017 12:54:40 -0400 Subject: [PATCH 313/412] handle mremap failure in realloc of mmap-serviced allocations mremap seems to always fail on nommu, and on some non-Linux implementations of the Linux syscall API, it at least fails to increase allocation size, and may fail to move (i.e. defragment) the existing mapping when shrinking it too. instead of failing realloc or leaving an over-sized allocation that may waste a large amount of memory, fallback to malloc-memcpy-free if mremap fails. --- src/malloc/malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c index c38c46fe..d5ee4280 100644 --- a/src/malloc/malloc.c +++ b/src/malloc/malloc.c @@ -406,7 +406,7 @@ void *realloc(void *p, size_t n) if (oldlen == newlen) return p; base = __mremap(base, oldlen, newlen, MREMAP_MAYMOVE); if (base == (void *)-1) - return newlen < oldlen ? p : 0; + goto copy_realloc; self = (void *)(base + extra); self->csize = newlen - extra; return CHUNK_TO_MEM(self); @@ -439,6 +439,7 @@ void *realloc(void *p, size_t n) return CHUNK_TO_MEM(self); } +copy_realloc: /* As a last resort, allocate a new chunk and copy to it. */ new = malloc(n-OVERHEAD); if (!new) return 0; From 5c10c33d2a35204ee76931625a007fcc8cca3228 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 15 Jun 2017 12:58:08 -0400 Subject: [PATCH 314/412] handle localtime errors in ctime ctime passes the result from localtime directly to asctime. But in case of error, localtime returns 0. This causes an error (NULL pointer dereference) in asctime. based on patch by Omer Anson. --- src/time/ctime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/time/ctime.c b/src/time/ctime.c index 185ec554..36029315 100644 --- a/src/time/ctime.c +++ b/src/time/ctime.c @@ -2,5 +2,7 @@ char *ctime(const time_t *t) { - return asctime(localtime(t)); + struct tm *tm = localtime(t); + if (!tm) return 0; + return asctime(tm); } From 2d7d05f031e014068a61d3076c6178513395d2ae Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 15 Jun 2017 13:01:34 -0400 Subject: [PATCH 315/412] set errno when getpw*_r, getgr*_r, and getspnam_r fail these functions return an error code, and are not explicitly documented to set errno, but they are nonstandard and the historical implementations do set errno as well, and some applications expect this behavior. do likewise for compatibility. patch by Rudolph Pereira. --- src/passwd/getgr_r.c | 1 + src/passwd/getpw_r.c | 1 + src/passwd/getspnam_r.c | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/passwd/getgr_r.c b/src/passwd/getgr_r.c index 7246e8a4..f3e8f603 100644 --- a/src/passwd/getgr_r.c +++ b/src/passwd/getgr_r.c @@ -34,6 +34,7 @@ static int getgr_r(const char *name, gid_t gid, struct group *gr, char *buf, siz free(mem); free(line); pthread_setcancelstate(cs, 0); + if (rv) errno = rv; return rv; } diff --git a/src/passwd/getpw_r.c b/src/passwd/getpw_r.c index e8cc811e..0c87ab05 100644 --- a/src/passwd/getpw_r.c +++ b/src/passwd/getpw_r.c @@ -27,6 +27,7 @@ static int getpw_r(const char *name, uid_t uid, struct passwd *pw, char *buf, si } free(line); pthread_setcancelstate(cs, 0); + if (rv) errno = rv; return rv; } diff --git a/src/passwd/getspnam_r.c b/src/passwd/getspnam_r.c index 92339528..e488b67f 100644 --- a/src/passwd/getspnam_r.c +++ b/src/passwd/getspnam_r.c @@ -72,14 +72,15 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct /* Disallow potentially-malicious user names */ if (*name=='.' || strchr(name, '/') || !l) - return EINVAL; + return errno = EINVAL; /* Buffer size must at least be able to hold name, plus some.. */ - if (size < l+100) return ERANGE; + if (size < l+100) + return errno = EINVAL; /* Protect against truncation */ if (snprintf(path, sizeof path, "/etc/tcb/%s/shadow", name) >= sizeof path) - return EINVAL; + return errno = EINVAL; fd = open(path, O_RDONLY|O_NOFOLLOW|O_NONBLOCK|O_CLOEXEC); if (fd >= 0) { @@ -112,5 +113,6 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct break; } pthread_cleanup_pop(1); + if (rv) errno = rv; return rv; } From 64f855874c32e192382df69f4765a7e32057a005 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 20 Jun 2017 20:31:35 -0400 Subject: [PATCH 316/412] handle errors from localtime_r in ctime_r POSIX requires ctime_r return a null pointer on failure, which can occur if the input time_t value is not representable in broken down form. based on patch by Alexander Monakov. --- src/time/ctime_r.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/time/ctime_r.c b/src/time/ctime_r.c index d2260a16..3e24aa68 100644 --- a/src/time/ctime_r.c +++ b/src/time/ctime_r.c @@ -2,7 +2,6 @@ char *ctime_r(const time_t *t, char *buf) { - struct tm tm; - localtime_r(t, &tm); - return asctime_r(&tm, buf); + struct tm tm, *tm_p = localtime_r(t, &tm); + return tm_p ? asctime_r(tm_p, buf) : 0; } From b7bfb5c3a8330002250f304cb5deb522fa054eae Mon Sep 17 00:00:00 2001 From: Bartosz Brachaczek Date: Thu, 15 Jun 2017 23:30:48 +0200 Subject: [PATCH 317/412] fix iconv conversions for iso88592-iso885916 commit 97bd6b09dbe7478d5a90a06ecd9e5b59389d8eb9 refactored the table lookup into a function and introduced an error in index computation. the error caused garbage to be read from the table if the given charmap had a non-zero number of elided entries. --- src/locale/iconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 4636307f..fd2f2e01 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -153,7 +153,7 @@ static void put_32(unsigned char *s, unsigned c, int e) static unsigned legacy_map(const unsigned char *map, unsigned c) { - unsigned x = c - 128 + map[-1]; + unsigned x = c - 128 - map[-1]; x = legacy_chars[ map[x*5/4]>>2*x%8 | map[x*5/4+1]<<8-2*x%8 & 1023 ]; return x ? x : c; From 5948bc1a642e6cead729602c9e1a251d5f60bddb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 21 Jun 2017 12:47:15 -0400 Subject: [PATCH 318/412] fix omission of microblaze user.h definitions --- arch/microblaze/bits/user.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/microblaze/bits/user.h b/arch/microblaze/bits/user.h index c4e3b82b..dbc25e04 100644 --- a/arch/microblaze/bits/user.h +++ b/arch/microblaze/bits/user.h @@ -1 +1,25 @@ -/* FIXME: missing in kernel? */ +struct user_fpregs_struct { + long cwd, swd, twd, fip, fcs, foo, fos, st_space[20]; +}; + +struct user_regs_struct { + unsigned grp[32], pc, msr, ear, esr, fsr, btr, pvr[12]; +}; + +struct user { + struct user_regs_struct regs; + int u_fpvalid; + struct user_fpregs_struct elf_fpregset_t; + unsigned long u_tsize, u_dsize, u_ssize, start_code, start_stack; + long signal; + int reserved; + struct user_regs_struct *u_ar0; + struct user_fpregs_struct *u_fpstate; + unsigned long magic; + char u_comm[32]; + int u_debugreg[8]; +}; + +#define ELF_NGREG 50 +typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; +typedef struct user_fpregs_struct elf_fpregset_t; From 91d34c4533e6bf6eacad7a9f001f28f9e5ebc656 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 21 Jun 2017 19:06:45 -0400 Subject: [PATCH 319/412] fix regression in getspnam[_r] error code for insufficient buffer size commit 2d7d05f031e014068a61d3076c6178513395d2ae wrongly changed ERANGE to EINVAL, likely as the result of copy-and-paste error. --- src/passwd/getspnam_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passwd/getspnam_r.c b/src/passwd/getspnam_r.c index e488b67f..541206fa 100644 --- a/src/passwd/getspnam_r.c +++ b/src/passwd/getspnam_r.c @@ -76,7 +76,7 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct /* Buffer size must at least be able to hold name, plus some.. */ if (size < l+100) - return errno = EINVAL; + return errno = ERANGE; /* Protect against truncation */ if (snprintf(path, sizeof path, "/etc/tcb/%s/shadow", name) >= sizeof path) From e6def544358afd5648a428d2e02c147a1f901048 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 21 Feb 2017 00:07:34 +0000 Subject: [PATCH 320/412] fix arm run-time abi string functions in arm rtabi these __aeabi_* functions have special abi (they are only allowed to clobber r0,r1,r2,r3,ip,lr,cpsr), so they cannot be simple wrappers around normal string functions (which may clobber other registers), the safest solution is to write them in asm, a minimalistic implementation works because these are not supposed to be emitted by compilers or used in general. --- src/string/arm/__aeabi_memclr.c | 9 ------- src/string/arm/__aeabi_memcpy.c | 9 ------- src/string/arm/__aeabi_memcpy.s | 45 ++++++++++++++++++++++++++++++++ src/string/arm/__aeabi_memmove.c | 9 ------- src/string/arm/__aeabi_memset.c | 9 ------- src/string/arm/__aeabi_memset.s | 31 ++++++++++++++++++++++ 6 files changed, 76 insertions(+), 36 deletions(-) delete mode 100644 src/string/arm/__aeabi_memclr.c delete mode 100644 src/string/arm/__aeabi_memcpy.c create mode 100644 src/string/arm/__aeabi_memcpy.s delete mode 100644 src/string/arm/__aeabi_memmove.c delete mode 100644 src/string/arm/__aeabi_memset.c create mode 100644 src/string/arm/__aeabi_memset.s diff --git a/src/string/arm/__aeabi_memclr.c b/src/string/arm/__aeabi_memclr.c deleted file mode 100644 index a25306d7..00000000 --- a/src/string/arm/__aeabi_memclr.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include "libc.h" - -void __aeabi_memclr(void *dest, size_t n) -{ - memset(dest, 0, n); -} -weak_alias(__aeabi_memclr, __aeabi_memclr4); -weak_alias(__aeabi_memclr, __aeabi_memclr8); diff --git a/src/string/arm/__aeabi_memcpy.c b/src/string/arm/__aeabi_memcpy.c deleted file mode 100644 index 4ae5c777..00000000 --- a/src/string/arm/__aeabi_memcpy.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include "libc.h" - -void __aeabi_memcpy(void *restrict dest, const void *restrict src, size_t n) -{ - memcpy(dest, src, n); -} -weak_alias(__aeabi_memcpy, __aeabi_memcpy4); -weak_alias(__aeabi_memcpy, __aeabi_memcpy8); diff --git a/src/string/arm/__aeabi_memcpy.s b/src/string/arm/__aeabi_memcpy.s new file mode 100644 index 00000000..3a527e41 --- /dev/null +++ b/src/string/arm/__aeabi_memcpy.s @@ -0,0 +1,45 @@ +.syntax unified + +.global __aeabi_memcpy8 +.global __aeabi_memcpy4 +.global __aeabi_memcpy +.global __aeabi_memmove8 +.global __aeabi_memmove4 +.global __aeabi_memmove + +.type __aeabi_memcpy8,%function +.type __aeabi_memcpy4,%function +.type __aeabi_memcpy,%function +.type __aeabi_memmove8,%function +.type __aeabi_memmove4,%function +.type __aeabi_memmove,%function + +__aeabi_memmove8: +__aeabi_memmove4: +__aeabi_memmove: + cmp r0, r1 + bls 3f + cmp r2, #0 + beq 2f + adds r0, r0, r2 + adds r2, r1, r2 +1: subs r2, r2, #1 + ldrb r3, [r2] + subs r0, r0, #1 + strb r3, [r0] + cmp r1, r2 + bne 1b +2: bx lr +__aeabi_memcpy8: +__aeabi_memcpy4: +__aeabi_memcpy: +3: cmp r2, #0 + beq 2f + adds r2, r1, r2 +1: ldrb r3, [r1] + adds r1, r1, #1 + strb r3, [r0] + adds r0, r0, #1 + cmp r1, r2 + bne 1b +2: bx lr diff --git a/src/string/arm/__aeabi_memmove.c b/src/string/arm/__aeabi_memmove.c deleted file mode 100644 index 951e7d39..00000000 --- a/src/string/arm/__aeabi_memmove.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include "libc.h" - -void __aeabi_memmove(void *dest, const void *src, size_t n) -{ - memmove(dest, src, n); -} -weak_alias(__aeabi_memmove, __aeabi_memmove4); -weak_alias(__aeabi_memmove, __aeabi_memmove8); diff --git a/src/string/arm/__aeabi_memset.c b/src/string/arm/__aeabi_memset.c deleted file mode 100644 index 89299757..00000000 --- a/src/string/arm/__aeabi_memset.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include "libc.h" - -void __aeabi_memset(void *dest, size_t n, int c) -{ - memset(dest, c, n); -} -weak_alias(__aeabi_memset, __aeabi_memset4); -weak_alias(__aeabi_memset, __aeabi_memset8); diff --git a/src/string/arm/__aeabi_memset.s b/src/string/arm/__aeabi_memset.s new file mode 100644 index 00000000..f9f60583 --- /dev/null +++ b/src/string/arm/__aeabi_memset.s @@ -0,0 +1,31 @@ +.syntax unified + +.global __aeabi_memclr8 +.global __aeabi_memclr4 +.global __aeabi_memclr +.global __aeabi_memset8 +.global __aeabi_memset4 +.global __aeabi_memset + +.type __aeabi_memclr8,%function +.type __aeabi_memclr4,%function +.type __aeabi_memclr,%function +.type __aeabi_memset8,%function +.type __aeabi_memset4,%function +.type __aeabi_memset,%function + +__aeabi_memclr8: +__aeabi_memclr4: +__aeabi_memclr: + movs r2, #0 +__aeabi_memset8: +__aeabi_memset4: +__aeabi_memset: + cmp r1, #0 + beq 2f + adds r1, r0, r1 +1: strb r2, [r0] + adds r0, r0, #1 + cmp r1, r0 + bne 1b +2: bx lr From ce385fcfb2db74b109067083db4a26ca810eaa14 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 23 Jun 2017 15:28:10 -0400 Subject: [PATCH 321/412] s390x: add single-instruction math functions these were introduced in z196 and not available in the baseline (z900) ISA level. use __HTM__ as an alternate indicator for ISA level, since gcc did not define __ARCH__ until 7.x. patch by David Edelsohn. --- src/math/s390x/ceil.c | 15 +++++++++++++++ src/math/s390x/ceilf.c | 15 +++++++++++++++ src/math/s390x/ceill.c | 15 +++++++++++++++ src/math/s390x/fabs.c | 15 +++++++++++++++ src/math/s390x/fabsf.c | 15 +++++++++++++++ src/math/s390x/fabsl.c | 15 +++++++++++++++ src/math/s390x/floor.c | 15 +++++++++++++++ src/math/s390x/floorf.c | 15 +++++++++++++++ src/math/s390x/floorl.c | 15 +++++++++++++++ src/math/s390x/nearbyint.c | 15 +++++++++++++++ src/math/s390x/nearbyintf.c | 15 +++++++++++++++ src/math/s390x/nearbyintl.c | 15 +++++++++++++++ src/math/s390x/rint.c | 15 +++++++++++++++ src/math/s390x/rintf.c | 15 +++++++++++++++ src/math/s390x/rintl.c | 15 +++++++++++++++ src/math/s390x/round.c | 15 +++++++++++++++ src/math/s390x/roundf.c | 15 +++++++++++++++ src/math/s390x/roundl.c | 15 +++++++++++++++ src/math/s390x/sqrt.c | 15 +++++++++++++++ src/math/s390x/sqrtf.c | 15 +++++++++++++++ src/math/s390x/sqrtl.c | 15 +++++++++++++++ src/math/s390x/trunc.c | 15 +++++++++++++++ src/math/s390x/truncf.c | 15 +++++++++++++++ src/math/s390x/truncl.c | 15 +++++++++++++++ 24 files changed, 360 insertions(+) create mode 100644 src/math/s390x/ceil.c create mode 100644 src/math/s390x/ceilf.c create mode 100644 src/math/s390x/ceill.c create mode 100644 src/math/s390x/fabs.c create mode 100644 src/math/s390x/fabsf.c create mode 100644 src/math/s390x/fabsl.c create mode 100644 src/math/s390x/floor.c create mode 100644 src/math/s390x/floorf.c create mode 100644 src/math/s390x/floorl.c create mode 100644 src/math/s390x/nearbyint.c create mode 100644 src/math/s390x/nearbyintf.c create mode 100644 src/math/s390x/nearbyintl.c create mode 100644 src/math/s390x/rint.c create mode 100644 src/math/s390x/rintf.c create mode 100644 src/math/s390x/rintl.c create mode 100644 src/math/s390x/round.c create mode 100644 src/math/s390x/roundf.c create mode 100644 src/math/s390x/roundl.c create mode 100644 src/math/s390x/sqrt.c create mode 100644 src/math/s390x/sqrtf.c create mode 100644 src/math/s390x/sqrtl.c create mode 100644 src/math/s390x/trunc.c create mode 100644 src/math/s390x/truncf.c create mode 100644 src/math/s390x/truncl.c diff --git a/src/math/s390x/ceil.c b/src/math/s390x/ceil.c new file mode 100644 index 00000000..aee17df7 --- /dev/null +++ b/src/math/s390x/ceil.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double ceil(double x) +{ + __asm__ ("fidbra %0, 6, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../ceil.c" + +#endif diff --git a/src/math/s390x/ceilf.c b/src/math/s390x/ceilf.c new file mode 100644 index 00000000..29ba8d4e --- /dev/null +++ b/src/math/s390x/ceilf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float ceilf(float x) +{ + __asm__ ("fiebra %0, 6, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../ceilf.c" + +#endif diff --git a/src/math/s390x/ceill.c b/src/math/s390x/ceill.c new file mode 100644 index 00000000..b838dc13 --- /dev/null +++ b/src/math/s390x/ceill.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double ceill(long double x) +{ + __asm__ ("fixbra %0, 6, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../ceill.c" + +#endif diff --git a/src/math/s390x/fabs.c b/src/math/s390x/fabs.c new file mode 100644 index 00000000..9bb51cb5 --- /dev/null +++ b/src/math/s390x/fabs.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double fabs(double x) +{ + __asm__ ("lpdbr %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../fabs.c" + +#endif diff --git a/src/math/s390x/fabsf.c b/src/math/s390x/fabsf.c new file mode 100644 index 00000000..9fd96bc9 --- /dev/null +++ b/src/math/s390x/fabsf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float fabsf(float x) +{ + __asm__ ("lpebr %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../fabsf.c" + +#endif diff --git a/src/math/s390x/fabsl.c b/src/math/s390x/fabsl.c new file mode 100644 index 00000000..65f1005d --- /dev/null +++ b/src/math/s390x/fabsl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double fabsl(long double x) +{ + __asm__ ("lpxbr %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../fabsl.c" + +#endif diff --git a/src/math/s390x/floor.c b/src/math/s390x/floor.c new file mode 100644 index 00000000..4c0c7f1a --- /dev/null +++ b/src/math/s390x/floor.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double floor(double x) +{ + __asm__ ("fidbra %0, 7, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../floor.c" + +#endif diff --git a/src/math/s390x/floorf.c b/src/math/s390x/floorf.c new file mode 100644 index 00000000..ea28ec7a --- /dev/null +++ b/src/math/s390x/floorf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float floorf(float x) +{ + __asm__ ("fiebra %0, 7, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../floorf.c" + +#endif diff --git a/src/math/s390x/floorl.c b/src/math/s390x/floorl.c new file mode 100644 index 00000000..8a0e16a2 --- /dev/null +++ b/src/math/s390x/floorl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double floorl(long double x) +{ + __asm__ ("fixbra %0, 7, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../floorl.c" + +#endif diff --git a/src/math/s390x/nearbyint.c b/src/math/s390x/nearbyint.c new file mode 100644 index 00000000..b70da52d --- /dev/null +++ b/src/math/s390x/nearbyint.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double nearbyint(double x) +{ + __asm__ ("fidbra %0, 0, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../nearbyint.c" + +#endif diff --git a/src/math/s390x/nearbyintf.c b/src/math/s390x/nearbyintf.c new file mode 100644 index 00000000..704f2678 --- /dev/null +++ b/src/math/s390x/nearbyintf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float nearbyintf(float x) +{ + __asm__ ("fiebra %0, 0, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../nearbyintf.c" + +#endif diff --git a/src/math/s390x/nearbyintl.c b/src/math/s390x/nearbyintl.c new file mode 100644 index 00000000..b4bd5523 --- /dev/null +++ b/src/math/s390x/nearbyintl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double nearbyintl(long double x) +{ + __asm__ ("fixbra %0, 0, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../nearbyintl.c" + +#endif diff --git a/src/math/s390x/rint.c b/src/math/s390x/rint.c new file mode 100644 index 00000000..b02f09eb --- /dev/null +++ b/src/math/s390x/rint.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double rint(double x) +{ + __asm__ ("fidbr %0, 0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../rint.c" + +#endif diff --git a/src/math/s390x/rintf.c b/src/math/s390x/rintf.c new file mode 100644 index 00000000..c9f13130 --- /dev/null +++ b/src/math/s390x/rintf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float rintf(float x) +{ + __asm__ ("fiebr %0, 0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../rintf.c" + +#endif diff --git a/src/math/s390x/rintl.c b/src/math/s390x/rintl.c new file mode 100644 index 00000000..bae53185 --- /dev/null +++ b/src/math/s390x/rintl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double rintl(long double x) +{ + __asm__ ("fixbr %0, 0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../rintl.c" + +#endif diff --git a/src/math/s390x/round.c b/src/math/s390x/round.c new file mode 100644 index 00000000..71f80251 --- /dev/null +++ b/src/math/s390x/round.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double round(double x) +{ + __asm__ ("fidbra %0, 1, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../round.c" + +#endif diff --git a/src/math/s390x/roundf.c b/src/math/s390x/roundf.c new file mode 100644 index 00000000..46d2e10c --- /dev/null +++ b/src/math/s390x/roundf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float roundf(float x) +{ + __asm__ ("fiebra %0, 1, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../roundf.c" + +#endif diff --git a/src/math/s390x/roundl.c b/src/math/s390x/roundl.c new file mode 100644 index 00000000..ce644ddd --- /dev/null +++ b/src/math/s390x/roundl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double roundl(long double x) +{ + __asm__ ("fixbra %0, 1, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../roundl.c" + +#endif diff --git a/src/math/s390x/sqrt.c b/src/math/s390x/sqrt.c new file mode 100644 index 00000000..a80dc4a7 --- /dev/null +++ b/src/math/s390x/sqrt.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double sqrt(double x) +{ + __asm__ ("sqdbr %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../sqrt.c" + +#endif diff --git a/src/math/s390x/sqrtf.c b/src/math/s390x/sqrtf.c new file mode 100644 index 00000000..52f57eb9 --- /dev/null +++ b/src/math/s390x/sqrtf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float sqrtf(float x) +{ + __asm__ ("sqebr %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../sqrtf.c" + +#endif diff --git a/src/math/s390x/sqrtl.c b/src/math/s390x/sqrtl.c new file mode 100644 index 00000000..5702d54d --- /dev/null +++ b/src/math/s390x/sqrtl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double sqrtl(long double x) +{ + __asm__ ("sqxbr %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../sqrtl.c" + +#endif diff --git a/src/math/s390x/trunc.c b/src/math/s390x/trunc.c new file mode 100644 index 00000000..3e5d8862 --- /dev/null +++ b/src/math/s390x/trunc.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +double trunc(double x) +{ + __asm__ ("fidbra %0, 5, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../trunc.c" + +#endif diff --git a/src/math/s390x/truncf.c b/src/math/s390x/truncf.c new file mode 100644 index 00000000..9097bacd --- /dev/null +++ b/src/math/s390x/truncf.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +float truncf(float x) +{ + __asm__ ("fiebra %0, 5, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../truncf.c" + +#endif diff --git a/src/math/s390x/truncl.c b/src/math/s390x/truncl.c new file mode 100644 index 00000000..4eb920a5 --- /dev/null +++ b/src/math/s390x/truncl.c @@ -0,0 +1,15 @@ +#include + +#if defined(__HTM__) || __ARCH__ >= 9 + +long double truncl(long double x) +{ + __asm__ ("fixbra %0, 5, %1, 4" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../truncl.c" + +#endif From 9d12a6a21fd146f543e8a6b8ec4cce7fd61be606 Mon Sep 17 00:00:00 2001 From: Dmitry Golovin Date: Fri, 9 Jun 2017 17:10:47 +0300 Subject: [PATCH 322/412] fix clang CFLAGS checks and silence unused argument warnings --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure b/configure index c2db298c..539c9fcb 100755 --- a/configure +++ b/configure @@ -249,6 +249,7 @@ fi # tryflag CFLAGS_TRY -Werror=unknown-warning-option tryflag CFLAGS_TRY -Werror=unused-command-line-argument +tryflag CFLAGS_TRY -Werror=ignored-optimization-argument tryldflag LDFLAGS_TRY -Werror=unknown-warning-option tryldflag LDFLAGS_TRY -Werror=unused-command-line-argument @@ -504,6 +505,13 @@ tryflag CFLAGS_AUTO -Werror=implicit-int tryflag CFLAGS_AUTO -Werror=pointer-sign tryflag CFLAGS_AUTO -Werror=pointer-arith +# +# GCC ignores unused arguements by default, but Clang needs this extra +# parameter to stop printing warnings about LDFLAGS passed during +# compiling stage and CFLAGS passed during linking stage. +# +tryflag CFLAGS_AUTO -Qunused-arguments + if test "x$warnings" = xyes ; then tryflag CFLAGS_AUTO -Wall tryflag CFLAGS_AUTO -Wno-parentheses From 94f744195e17cf787a36c259254d56386b31fe20 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 23 Jun 2017 16:01:00 -0400 Subject: [PATCH 323/412] powerpc64: add single-instruction math functions while the official elfv2 abi for "powerpc64le" sets power8 as the baseline isa, we use it for both little and big endian powerpc64 targets and need to maintain compatibility with pre-power8 models. the instructions for sqrt, fabs, and fma are in the baseline isa; support for the rest is conditional via predefined isa-level macros. patch by David Edelsohn. --- src/math/powerpc64/ceil.c | 15 +++++++++++++++ src/math/powerpc64/ceilf.c | 15 +++++++++++++++ src/math/powerpc64/fabs.c | 7 +++++++ src/math/powerpc64/fabsf.c | 7 +++++++ src/math/powerpc64/floor.c | 15 +++++++++++++++ src/math/powerpc64/floorf.c | 15 +++++++++++++++ src/math/powerpc64/fma.c | 7 +++++++ src/math/powerpc64/fmaf.c | 7 +++++++ src/math/powerpc64/fmax.c | 15 +++++++++++++++ src/math/powerpc64/fmaxf.c | 15 +++++++++++++++ src/math/powerpc64/fmin.c | 15 +++++++++++++++ src/math/powerpc64/fminf.c | 15 +++++++++++++++ src/math/powerpc64/lrint.c | 16 ++++++++++++++++ src/math/powerpc64/lrintf.c | 16 ++++++++++++++++ src/math/powerpc64/lround.c | 18 ++++++++++++++++++ src/math/powerpc64/lroundf.c | 18 ++++++++++++++++++ src/math/powerpc64/round.c | 15 +++++++++++++++ src/math/powerpc64/roundf.c | 15 +++++++++++++++ src/math/powerpc64/sqrt.c | 7 +++++++ src/math/powerpc64/sqrtf.c | 7 +++++++ src/math/powerpc64/trunc.c | 15 +++++++++++++++ src/math/powerpc64/truncf.c | 15 +++++++++++++++ 22 files changed, 290 insertions(+) create mode 100644 src/math/powerpc64/ceil.c create mode 100644 src/math/powerpc64/ceilf.c create mode 100644 src/math/powerpc64/fabs.c create mode 100644 src/math/powerpc64/fabsf.c create mode 100644 src/math/powerpc64/floor.c create mode 100644 src/math/powerpc64/floorf.c create mode 100644 src/math/powerpc64/fma.c create mode 100644 src/math/powerpc64/fmaf.c create mode 100644 src/math/powerpc64/fmax.c create mode 100644 src/math/powerpc64/fmaxf.c create mode 100644 src/math/powerpc64/fmin.c create mode 100644 src/math/powerpc64/fminf.c create mode 100644 src/math/powerpc64/lrint.c create mode 100644 src/math/powerpc64/lrintf.c create mode 100644 src/math/powerpc64/lround.c create mode 100644 src/math/powerpc64/lroundf.c create mode 100644 src/math/powerpc64/round.c create mode 100644 src/math/powerpc64/roundf.c create mode 100644 src/math/powerpc64/sqrt.c create mode 100644 src/math/powerpc64/sqrtf.c create mode 100644 src/math/powerpc64/trunc.c create mode 100644 src/math/powerpc64/truncf.c diff --git a/src/math/powerpc64/ceil.c b/src/math/powerpc64/ceil.c new file mode 100644 index 00000000..4b011336 --- /dev/null +++ b/src/math/powerpc64/ceil.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +double ceil(double x) +{ + __asm__ ("frip %0, %1" : "=d"(x) : "d"(x)); + return x; +} + +#else + +#include "../ceil.c" + +#endif diff --git a/src/math/powerpc64/ceilf.c b/src/math/powerpc64/ceilf.c new file mode 100644 index 00000000..59ba3961 --- /dev/null +++ b/src/math/powerpc64/ceilf.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +float ceilf(float x) +{ + __asm__ ("frip %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../ceilf.c" + +#endif diff --git a/src/math/powerpc64/fabs.c b/src/math/powerpc64/fabs.c new file mode 100644 index 00000000..6123c753 --- /dev/null +++ b/src/math/powerpc64/fabs.c @@ -0,0 +1,7 @@ +#include + +double fabs(double x) +{ + __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x)); + return x; +} diff --git a/src/math/powerpc64/fabsf.c b/src/math/powerpc64/fabsf.c new file mode 100644 index 00000000..e9e45643 --- /dev/null +++ b/src/math/powerpc64/fabsf.c @@ -0,0 +1,7 @@ +#include + +float fabsf(float x) +{ + __asm__ ("fabs %0, %1" : "=f"(x) : "f"(x)); + return x; +} diff --git a/src/math/powerpc64/floor.c b/src/math/powerpc64/floor.c new file mode 100644 index 00000000..4e680444 --- /dev/null +++ b/src/math/powerpc64/floor.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +double floor(double x) +{ + __asm__ ("frim %0, %1" : "=d"(x) : "d"(x)); + return x; +} + +#else + +#include "../floor.c" + +#endif diff --git a/src/math/powerpc64/floorf.c b/src/math/powerpc64/floorf.c new file mode 100644 index 00000000..e1031ef4 --- /dev/null +++ b/src/math/powerpc64/floorf.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +float floorf(float x) +{ + __asm__ ("frim %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../floorf.c" + +#endif diff --git a/src/math/powerpc64/fma.c b/src/math/powerpc64/fma.c new file mode 100644 index 00000000..5aebd1ac --- /dev/null +++ b/src/math/powerpc64/fma.c @@ -0,0 +1,7 @@ +#include + +double fma(double x, double y, double z) +{ + __asm__ ("fmadd %0, %1, %2, %3" : "=d"(x) : "d"(x), "d"(y), "d"(z)); + return x; +} diff --git a/src/math/powerpc64/fmaf.c b/src/math/powerpc64/fmaf.c new file mode 100644 index 00000000..c678fefe --- /dev/null +++ b/src/math/powerpc64/fmaf.c @@ -0,0 +1,7 @@ +#include + +float fmaf(float x, float y, float z) +{ + __asm__ ("fmadds %0, %1, %2, %3" : "=f"(x) : "f"(x), "f"(y), "f"(z)); + return x; +} diff --git a/src/math/powerpc64/fmax.c b/src/math/powerpc64/fmax.c new file mode 100644 index 00000000..992df7f1 --- /dev/null +++ b/src/math/powerpc64/fmax.c @@ -0,0 +1,15 @@ +#include + +#ifdef __VSX__ + +double fmax(double x, double y) +{ + __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y)); + return x; +} + +#else + +#include "../fmax.c" + +#endif diff --git a/src/math/powerpc64/fmaxf.c b/src/math/powerpc64/fmaxf.c new file mode 100644 index 00000000..345a234a --- /dev/null +++ b/src/math/powerpc64/fmaxf.c @@ -0,0 +1,15 @@ +#include + +#ifdef __VSX__ + +float fmaxf(float x, float y) +{ + __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y)); + return x; +} + +#else + +#include "../fmaxf.c" + +#endif diff --git a/src/math/powerpc64/fmin.c b/src/math/powerpc64/fmin.c new file mode 100644 index 00000000..adf71bad --- /dev/null +++ b/src/math/powerpc64/fmin.c @@ -0,0 +1,15 @@ +#include + +#ifdef __VSX__ + +double fmin(double x, double y) +{ + __asm__ ("xsmindp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y)); + return x; +} + +#else + +#include "../fmin.c" + +#endif diff --git a/src/math/powerpc64/fminf.c b/src/math/powerpc64/fminf.c new file mode 100644 index 00000000..faf0e47e --- /dev/null +++ b/src/math/powerpc64/fminf.c @@ -0,0 +1,15 @@ +#include + +#ifdef __VSX__ + +float fminf(float x, float y) +{ + __asm__ ("xsmindp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y)); + return x; +} + +#else + +#include "../fminf.c" + +#endif diff --git a/src/math/powerpc64/lrint.c b/src/math/powerpc64/lrint.c new file mode 100644 index 00000000..4e4b2e00 --- /dev/null +++ b/src/math/powerpc64/lrint.c @@ -0,0 +1,16 @@ +#include + +#ifdef _ARCH_PWR5X + +long lrint(double x) +{ + long n; + __asm__ ("fctid %0, %1" : "=d"(n) : "d"(x)); + return n; +} + +#else + +#include "../lrint.c" + +#endif diff --git a/src/math/powerpc64/lrintf.c b/src/math/powerpc64/lrintf.c new file mode 100644 index 00000000..9070fc03 --- /dev/null +++ b/src/math/powerpc64/lrintf.c @@ -0,0 +1,16 @@ +#include + +#ifdef _ARCH_PWR5X + +long lrintf(float x) +{ + long n; + __asm__ ("fctid %0, %1" : "=d"(n) : "f"(x)); + return n; +} + +#else + +#include "../lrintf.c" + +#endif diff --git a/src/math/powerpc64/lround.c b/src/math/powerpc64/lround.c new file mode 100644 index 00000000..ee4d1143 --- /dev/null +++ b/src/math/powerpc64/lround.c @@ -0,0 +1,18 @@ +#include + +#ifdef __VSX__ + +long lround(double x) +{ + long n; + __asm__ ( + "xsrdpi %1, %1\n" + "fctid %0, %1\n" : "=d"(n), "+d"(x)); + return n; +} + +#else + +#include "../lround.c" + +#endif diff --git a/src/math/powerpc64/lroundf.c b/src/math/powerpc64/lroundf.c new file mode 100644 index 00000000..033094ff --- /dev/null +++ b/src/math/powerpc64/lroundf.c @@ -0,0 +1,18 @@ +#include + +#ifdef __VSX__ + +long lroundf(float x) +{ + long n; + __asm__ ( + "xsrdpi %1, %1\n" + "fctid %0, %1\n" : "=d"(n), "+f"(x)); + return n; +} + +#else + +#include "../lroundf.c" + +#endif diff --git a/src/math/powerpc64/round.c b/src/math/powerpc64/round.c new file mode 100644 index 00000000..4b9318e0 --- /dev/null +++ b/src/math/powerpc64/round.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +double round(double x) +{ + __asm__ ("frin %0, %1" : "=d"(x) : "d"(x)); + return x; +} + +#else + +#include "../round.c" + +#endif diff --git a/src/math/powerpc64/roundf.c b/src/math/powerpc64/roundf.c new file mode 100644 index 00000000..ae93f999 --- /dev/null +++ b/src/math/powerpc64/roundf.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +float roundf(float x) +{ + __asm__ ("frin %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../roundf.c" + +#endif diff --git a/src/math/powerpc64/sqrt.c b/src/math/powerpc64/sqrt.c new file mode 100644 index 00000000..13bb98d9 --- /dev/null +++ b/src/math/powerpc64/sqrt.c @@ -0,0 +1,7 @@ +#include + +double sqrt(double x) +{ + __asm__ ("fsqrt %0, %1" : "=d"(x) : "d"(x)); + return x; +} diff --git a/src/math/powerpc64/sqrtf.c b/src/math/powerpc64/sqrtf.c new file mode 100644 index 00000000..b6ecb106 --- /dev/null +++ b/src/math/powerpc64/sqrtf.c @@ -0,0 +1,7 @@ +#include + +float sqrtf(float x) +{ + __asm__ ("fsqrts %0, %1" : "=f"(x) : "f"(x)); + return x; +} diff --git a/src/math/powerpc64/trunc.c b/src/math/powerpc64/trunc.c new file mode 100644 index 00000000..57918548 --- /dev/null +++ b/src/math/powerpc64/trunc.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +double trunc(double x) +{ + __asm__ ("friz %0, %1" : "=d"(x) : "d"(x)); + return x; +} + +#else + +#include "../trunc.c" + +#endif diff --git a/src/math/powerpc64/truncf.c b/src/math/powerpc64/truncf.c new file mode 100644 index 00000000..94e638fb --- /dev/null +++ b/src/math/powerpc64/truncf.c @@ -0,0 +1,15 @@ +#include + +#ifdef _ARCH_PWR5X + +float truncf(float x) +{ + __asm__ ("friz %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../truncf.c" + +#endif From 66b53cfa8876342f7e7d7907d30c719c38cd5a1b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 4 Jul 2017 10:58:13 -0400 Subject: [PATCH 324/412] ldso: avoid spurious & possible erroneous work for libs with no deps a null pointer for a library's deps list was ambiguous: it could indicate either no dependencies or that the dependency list had not yet been populated. inability to distinguish could lead to spurious work when dlopen is called multiple times on a library with no deps, and due to related bugs, could actually cause other libraries to falsely appear as dependencies, translating into false positives for dlsym. avoid the problem by always initializing the deps pointer, pointing to an empty list if there are no deps. rather than wasting memory and introducing another failure path by allocating an empty list per library, simply share a global dummy list. further fixes will be needed for related bugs, and much of this code may end up being replaced. --- ldso/dynlink.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index d20dbd87..239007ff 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -129,6 +129,7 @@ static size_t static_tls_cnt; static pthread_mutex_t init_fini_lock = { ._m_type = PTHREAD_MUTEX_RECURSIVE }; static struct fdpic_loadmap *app_loadmap; static struct fdpic_dummy_loadmap app_dummy_loadmap; +static struct dso *const nodeps_dummy; struct debug *_dl_debug_addr = &debug; @@ -1125,6 +1126,7 @@ static void load_deps(struct dso *p) } } } + if (!*deps) *deps = (struct dso **)&nodeps_dummy; } static void load_preload(char *s) @@ -1742,7 +1744,8 @@ void *dlopen(const char *file, int mode) free(p->funcdescs); if (p->rpath != p->rpath_orig) free(p->rpath); - free(p->deps); + if (p->deps != &nodeps_dummy) + free(p->deps); unmap_library(p); free(p); } @@ -1772,14 +1775,14 @@ void *dlopen(const char *file, int mode) load_deps(p); if (!p->relocated && (mode & RTLD_LAZY)) { prepare_lazy(p); - if (p->deps) for (i=0; p->deps[i]; i++) + for (i=0; p->deps[i]; i++) if (!p->deps[i]->relocated) prepare_lazy(p->deps[i]); } /* Make new symbols global, at least temporarily, so we can do * relocations. If not RTLD_GLOBAL, this is reverted below. */ add_syms(p); - if (p->deps) for (i=0; p->deps[i]; i++) + for (i=0; p->deps[i]; i++) add_syms(p->deps[i]); reloc_all(p); } @@ -1878,7 +1881,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra) return p->funcdescs + (sym - p->syms); if (sym && sym->st_value && (1<<(sym->st_info&0xf) & OK_TYPES)) return laddr(p, sym->st_value); - if (p->deps) for (i=0; p->deps[i]; i++) { + for (i=0; p->deps[i]; i++) { if ((ght = p->deps[i]->ghashtab)) { if (!gh) gh = gnu_hash(s); sym = gnu_lookup(gh, ght, p->deps[i], s); From 43c423af5b8453afde86e4ba81e0fcc663ae7c22 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 4 Jul 2017 11:34:39 -0400 Subject: [PATCH 325/412] fix regression in dlopen promotion from RTLD_LOCAL to RTLD_GLOBAL commit 4ff234f6cba96403b5de6d29d48a59fd73252040 inadvertently removed the logic to do this when changing the representation of global status. --- ldso/dynlink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 239007ff..fc6a68b8 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1771,7 +1771,8 @@ void *dlopen(const char *file, int mode) } /* First load handling */ - if (!p->deps) { + int first_load = !p->deps; + if (first_load) { load_deps(p); if (!p->relocated && (mode & RTLD_LAZY)) { prepare_lazy(p); @@ -1779,11 +1780,15 @@ void *dlopen(const char *file, int mode) if (!p->deps[i]->relocated) prepare_lazy(p->deps[i]); } + } + if (first_load || (mode & RTLD_GLOBAL)) { /* Make new symbols global, at least temporarily, so we can do * relocations. If not RTLD_GLOBAL, this is reverted below. */ add_syms(p); for (i=0; p->deps[i]; i++) add_syms(p->deps[i]); + } + if (first_load) { reloc_all(p); } From f3055e0163aad1cebb0867078643b36643c5d95f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 4 Jul 2017 16:58:28 -0400 Subject: [PATCH 326/412] allow specifying argv[0] when invoking a program via ldso command previously, the pathname used to load the program was always used as argv[0]. the default remains the same, but a new --argv0 option can be used to provide a different value. --- ldso/dynlink.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index fc6a68b8..35a90aef 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -1437,6 +1437,7 @@ _Noreturn void __dls3(size_t *sp) size_t aux[AUX_CNT], *auxv; size_t i; char *env_preload=0; + char *replace_argv0=0; size_t vdso_base; int argc = *sp; char **argv = (void *)(sp+1); @@ -1521,6 +1522,10 @@ _Noreturn void __dls3(size_t *sp) if (opt[7]=='=') env_preload = opt+8; else if (opt[7]) *argv = 0; else if (*argv) env_preload = *argv++; + } else if (!memcmp(opt, "argv0", 5)) { + if (opt[5]=='=') replace_argv0 = opt+6; + else if (opt[5]) *argv = 0; + else if (*argv) replace_argv0 = *argv++; } else { argv[0] = 0; } @@ -1677,6 +1682,8 @@ _Noreturn void __dls3(size_t *sp) debug.state = 0; _dl_debug_state(); + if (replace_argv0) argv[0] = replace_argv0; + errno = 0; CRTJMP((void *)aux[AT_ENTRY], argv-1); From bd00cc87819875882356298b6c6bdabc1700753f Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Mon, 3 Jul 2017 19:24:02 +0300 Subject: [PATCH 327/412] remove useless declarations in string.h The two functions str{,n}casecmp_l are specified to be declared in which is already included from under _GNU_SOURCE. --- include/string.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/string.h b/include/string.h index ff9badb9..ce1dc300 100644 --- a/include/string.h +++ b/include/string.h @@ -87,8 +87,6 @@ size_t strlcpy (char *, const char *, size_t); #ifdef _GNU_SOURCE #define strdupa(x) strcpy(alloca(strlen(x)+1),x) int strverscmp (const char *, const char *); -int strcasecmp_l (const char *, const char *, locale_t); -int strncasecmp_l (const char *, const char *, size_t, locale_t); char *strchrnul(const char *, int); char *strcasestr(const char *, const char *); void *memmem(const void *, size_t, const void *, size_t); From f6888840613a510c99915ba7732df8ec54d52637 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Tue, 4 Jul 2017 22:59:06 +0300 Subject: [PATCH 328/412] reapply va_arg hacks removal to wprintf commit 58e2396a9aa23c132faf4198ca4d779c84955b38 missed that the same code was duplicated in implementation of vfwprintf. --- src/stdio/vfwprintf.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index b8fff208..1e6e47cc 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -19,14 +20,6 @@ #define FLAGMASK (ALT_FORM|ZERO_PAD|LEFT_ADJ|PAD_POS|MARK_POS|GROUPED) -#if UINT_MAX == ULONG_MAX -#define LONG_IS_INT -#endif - -#if SIZE_MAX != ULONG_MAX || UINTMAX_MAX != ULLONG_MAX -#define ODD_TYPES -#endif - /* State machine to accept length modifiers + conversion specifiers. * Result is 0 on failure, or an argument type to pop on success. */ @@ -35,23 +28,9 @@ enum { ZTPRE, JPRE, STOP, PTR, INT, UINT, ULLONG, -#ifndef LONG_IS_INT LONG, ULONG, -#else -#define LONG INT -#define ULONG UINT -#endif SHORT, USHORT, CHAR, UCHAR, -#ifdef ODD_TYPES LLONG, SIZET, IMAX, UMAX, PDIFF, UIPTR, -#else -#define LLONG ULLONG -#define SIZET ULONG -#define IMAX LLONG -#define UMAX ULLONG -#define PDIFF LONG -#define UIPTR ULONG -#endif DBL, LDBL, NOARG, MAXSTATE @@ -125,23 +104,19 @@ static void pop_arg(union arg *arg, int type, va_list *ap) case PTR: arg->p = va_arg(*ap, void *); break; case INT: arg->i = va_arg(*ap, int); break; case UINT: arg->i = va_arg(*ap, unsigned int); -#ifndef LONG_IS_INT break; case LONG: arg->i = va_arg(*ap, long); break; case ULONG: arg->i = va_arg(*ap, unsigned long); -#endif break; case ULLONG: arg->i = va_arg(*ap, unsigned long long); break; case SHORT: arg->i = (short)va_arg(*ap, int); break; case USHORT: arg->i = (unsigned short)va_arg(*ap, int); break; case CHAR: arg->i = (signed char)va_arg(*ap, int); break; case UCHAR: arg->i = (unsigned char)va_arg(*ap, int); -#ifdef ODD_TYPES break; case LLONG: arg->i = va_arg(*ap, long long); break; case SIZET: arg->i = va_arg(*ap, size_t); break; case IMAX: arg->i = va_arg(*ap, intmax_t); break; case UMAX: arg->i = va_arg(*ap, uintmax_t); break; case PDIFF: arg->i = va_arg(*ap, ptrdiff_t); break; case UIPTR: arg->i = (uintptr_t)va_arg(*ap, void *); -#endif break; case DBL: arg->f = va_arg(*ap, double); break; case LDBL: arg->f = va_arg(*ap, long double); } From 60ab365cae24063b0f21821860ca16fb63e81f81 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Tue, 27 Jun 2017 20:58:47 +0300 Subject: [PATCH 329/412] fix undefined behavior in free --- src/malloc/malloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c index d5ee4280..9e05e1d6 100644 --- a/src/malloc/malloc.c +++ b/src/malloc/malloc.c @@ -450,14 +450,15 @@ copy_realloc: void free(void *p) { - struct chunk *self = MEM_TO_CHUNK(p); - struct chunk *next; + struct chunk *self, *next; size_t final_size, new_size, size; int reclaim=0; int i; if (!p) return; + self = MEM_TO_CHUNK(p); + if (IS_MMAPPED(self)) { size_t extra = self->psize; char *base = (char *)self - extra; From d906fa3118c888227d858b6d642a09e055eca2b4 Mon Sep 17 00:00:00 2001 From: Jens Gustedt Date: Sat, 24 Jun 2017 10:18:05 +0200 Subject: [PATCH 330/412] unify the use of FUTEX_PRIVATE The flag 1<<7 is used in several places for different purposes that are not always easy to distinguish. Mark those usages that correspond to the flag that is used by the kernel for futexes. --- src/internal/pthread_impl.h | 2 +- src/thread/__timedwait.c | 2 +- src/thread/pthread_barrier_wait.c | 2 +- src/thread/pthread_cond_timedwait.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h index ae0ab1c5..56e19348 100644 --- a/src/internal/pthread_impl.h +++ b/src/internal/pthread_impl.h @@ -131,7 +131,7 @@ int __timedwait_cp(volatile int *, int, clockid_t, const struct timespec *, int) void __wait(volatile int *, volatile int *, int, int); static inline void __wake(volatile void *addr, int cnt, int priv) { - if (priv) priv = 128; + if (priv) priv = FUTEX_PRIVATE; if (cnt<0) cnt = INT_MAX; __syscall(SYS_futex, addr, FUTEX_WAKE|priv, cnt) != -ENOSYS || __syscall(SYS_futex, addr, FUTEX_WAKE, cnt); diff --git a/src/thread/__timedwait.c b/src/thread/__timedwait.c index 13d8465a..d2079c88 100644 --- a/src/thread/__timedwait.c +++ b/src/thread/__timedwait.c @@ -14,7 +14,7 @@ int __timedwait_cp(volatile int *addr, int val, int r; struct timespec to, *top=0; - if (priv) priv = 128; + if (priv) priv = FUTEX_PRIVATE; if (at) { if (at->tv_nsec >= 1000000000UL) return EINVAL; diff --git a/src/thread/pthread_barrier_wait.c b/src/thread/pthread_barrier_wait.c index 06b83db9..cc2a8bbf 100644 --- a/src/thread/pthread_barrier_wait.c +++ b/src/thread/pthread_barrier_wait.c @@ -84,7 +84,7 @@ int pthread_barrier_wait(pthread_barrier_t *b) a_spin(); a_inc(&inst->finished); while (inst->finished == 1) - __syscall(SYS_futex,&inst->finished,FUTEX_WAIT|128,1,0) != -ENOSYS + __syscall(SYS_futex,&inst->finished,FUTEX_WAIT|FUTEX_PRIVATE,1,0) != -ENOSYS || __syscall(SYS_futex,&inst->finished,FUTEX_WAIT,1,0); return PTHREAD_BARRIER_SERIAL_THREAD; } diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c index 3526ecfb..ed8569c2 100644 --- a/src/thread/pthread_cond_timedwait.c +++ b/src/thread/pthread_cond_timedwait.c @@ -54,7 +54,7 @@ static inline void unlock_requeue(volatile int *l, volatile int *r, int w) { a_store(l, 0); if (w) __wake(l, 1, 1); - else __syscall(SYS_futex, l, FUTEX_REQUEUE|128, 0, 1, r) != -ENOSYS + else __syscall(SYS_futex, l, FUTEX_REQUEUE|FUTEX_PRIVATE, 0, 1, r) != -ENOSYS || __syscall(SYS_futex, l, FUTEX_REQUEUE, 0, 1, r); } From bc42dcbfd9466c22d8ab0f8235e5091689a95aad Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Wed, 5 Jul 2017 00:51:05 +0300 Subject: [PATCH 331/412] fix undefined behavior in ptrace --- src/linux/ptrace.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/linux/ptrace.c b/src/linux/ptrace.c index 83b8022b..a3f393d9 100644 --- a/src/linux/ptrace.c +++ b/src/linux/ptrace.c @@ -7,14 +7,18 @@ long ptrace(int req, ...) { va_list ap; pid_t pid; - void *addr, *data, *addr2; + void *addr, *data, *addr2 = 0; long ret, result; va_start(ap, req); pid = va_arg(ap, pid_t); addr = va_arg(ap, void *); data = va_arg(ap, void *); - addr2 = va_arg(ap, void *); + /* PTRACE_{READ,WRITE}{DATA,TEXT} (16...19) are specific to SPARC. */ +#ifdef PTRACE_READDATA + if ((unsigned)req - PTRACE_READDATA < 4) + addr2 = va_arg(ap, void *); +#endif va_end(ap); if (req-1U < 3) data = &result; From 2e6e08423b95b1b2bce7568f650c2b69d8d8fb8b Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Tue, 4 Jul 2017 22:53:12 +0300 Subject: [PATCH 332/412] remove ineffective compiler assist from printf The switch statement has no 'default:' case and the function ends immediately following the switch, so the extra comparison did not communicate any extra information to the compiler. --- src/stdio/vfprintf.c | 2 -- src/stdio/vfwprintf.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 8c81efc2..15356f53 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -107,8 +107,6 @@ union arg static void pop_arg(union arg *arg, int type, va_list *ap) { - /* Give the compiler a hint for optimizing the switch. */ - if ((unsigned)type > MAXSTATE) return; switch (type) { case PTR: arg->p = va_arg(*ap, void *); break; case INT: arg->i = va_arg(*ap, int); diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index 1e6e47cc..e87ad42a 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -98,8 +98,6 @@ union arg static void pop_arg(union arg *arg, int type, va_list *ap) { - /* Give the compiler a hint for optimizing the switch. */ - if ((unsigned)type > MAXSTATE) return; switch (type) { case PTR: arg->p = va_arg(*ap, void *); break; case INT: arg->i = va_arg(*ap, int); From a08910fc2cc739f631b75b2d09b8d72a0d64d285 Mon Sep 17 00:00:00 2001 From: Jens Gustedt Date: Sat, 24 Jun 2017 11:54:25 +0200 Subject: [PATCH 333/412] fix missing volatile qualifier on lock in __get_locale --- src/locale/locale_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locale/locale_map.c b/src/locale/locale_map.c index c3e59174..188fcf39 100644 --- a/src/locale/locale_map.c +++ b/src/locale/locale_map.c @@ -26,7 +26,7 @@ static const char envvars[][12] = { const struct __locale_map *__get_locale(int cat, const char *val) { - static int lock[2]; + static volatile int lock[2]; static void *volatile loc_head; const struct __locale_map *p; struct __locale_map *new = 0; From 947d330f68c49680dcc54439f56da2a297228962 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 31 Jul 2017 23:08:27 -0400 Subject: [PATCH 334/412] add _NL_LOCALE_NAME extension to nl_langinfo since setlocale(cat, NULL) is required to return the setting for the global locale, there is no standard mechanism to obtain the name of the currently active thread-local locale set by uselocale. this makes it impossible for application/library software to load appropriate translations, etc. unless using the gettext implementation provided by libc, which has privileged access to libc internals. to fill this gap, glibc introduced the _NL_LOCALE_NAME macro which can be used with nl_langinfo to obtain the name. GNU gettext/gnulib code already use this functionality on glibc, and can easily be adapted to make use of it on non-glibc systems if it's available; for other systems they poke at locale implementation internals, which we want to avoid. this patch provides a compatible interface to the one glibc introduced. --- include/langinfo.h | 6 ++++++ src/locale/langinfo.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/include/langinfo.h b/include/langinfo.h index 2153c42e..519c0612 100644 --- a/include/langinfo.h +++ b/include/langinfo.h @@ -77,6 +77,12 @@ extern "C" { #define YESEXPR 0x50000 #define NOEXPR 0x50001 +#define _NL_LOCALE_NAME(cat) (((cat)<<16) | 0xffff) + +#if defined(_GNU_SOURCE) +#define NL_LOCALE_NAME(cat) _NL_LOCALE_NAME(cat) +#endif + #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define YESSTR 0x50002 #define NOSTR 0x50003 diff --git a/src/locale/langinfo.c b/src/locale/langinfo.c index b2c8569e..b16caf44 100644 --- a/src/locale/langinfo.c +++ b/src/locale/langinfo.c @@ -34,6 +34,10 @@ char *__nl_langinfo_l(nl_item item, locale_t loc) const char *str; if (item == CODESET) return MB_CUR_MAX==1 ? "ASCII" : "UTF-8"; + + /* _NL_LOCALE_NAME extension */ + if (idx == 65535 && cat < LC_ALL) + return loc->cat[cat] ? (char *)loc->cat[cat]->name : "C"; switch (cat) { case LC_NUMERIC: From dc2f368e565c37728b0d620380b849c3a1ddd78f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 11 Aug 2017 00:17:00 -0400 Subject: [PATCH 335/412] disable global visibility override hack (vis.h) by default neither current compilers nor linkers treat protected visibility the way I expected, as having fixed source-level semantics rather than being dependent on target-specific ABI details, and change seems unlikely. while the use here does not actually depend on the specific semantics, at least some versions of some linkers, especially lld, refuse to allow linking to a libc.so where the symbols have protected visibility. this cannot be detected at configure-time because linking libc.so itself works fine, and because even if we could test linking an application against libc.so successfully, we could not justifiably assume that the same linker used to link libc.so would also be used later to link applications. disable the vis.h hack by default at the configure level, but add an explicit "auto" option to request the old configure-time detection rather than just removing it. this leaves it easy to evaluate whether it actually resulted in significant size or performance benefits while ensuring that out-of-the-box builds are not unlinkable for some users. fortunately, preliminary evaluation suggests that at least x86_64, arm, and aarch64 don't suffer at all from the change, and impact on other archs is low. if low is not low enough, it should not be hard to analyze where the significant PLT call ABI costs are present and mitigate them without the hack. --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 539c9fcb..02b736ce 100755 --- a/configure +++ b/configure @@ -31,7 +31,7 @@ Optional features: --enable-optimize=... optimize listed components for speed over size [auto] --enable-debug build with debugging information [disabled] --enable-warnings build with recommended warnings flags [disabled] - --enable-visibility use global visibility options to optimize PIC [auto] + --enable-visibility use global visibility options to optimize PIC [no] --enable-wrapper=... build given musl toolchain wrapper [auto] --disable-shared inhibit building shared library [enabled] --disable-static inhibit building static library [enabled] @@ -135,7 +135,7 @@ target= optimize=auto debug=no warnings=no -visibility=auto +visibility=no shared=auto static=yes wrapper=auto @@ -163,6 +163,7 @@ case "$arg" in --disable-debug|--enable-debug=no) debug=no ;; --enable-warnings|--enable-warnings=yes) warnings=yes ;; --disable-warnings|--enable-warnings=no) warnings=no ;; +--enable-visibility=auto) visibility=auto ;; --enable-visibility|--enable-visibility=yes) visibility=yes ;; --disable-visibility|--enable-visibility=no) visibility=no ;; --enable-wrapper|--enable-wrapper=yes) wrapper=detect ;; From 52cf5c18f4ad3a7a59fb7113cf115c6fc05c7494 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 10 Aug 2017 15:35:13 +0200 Subject: [PATCH 336/412] qsort: add a short comment about the algorithm --- src/stdlib/qsort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c index 434d9350..da58fd31 100644 --- a/src/stdlib/qsort.c +++ b/src/stdlib/qsort.c @@ -21,6 +21,9 @@ /* Minor changes by Rich Felker for integration in musl, 2011-04-27. */ +/* Smoothsort, an adaptive variant of Heapsort. Memory usage: O(1). + Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */ + #include #include #include From e31c8c2d796e8a9596503f079dc567c45f93c2ae Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Fri, 4 Aug 2017 00:12:32 -0500 Subject: [PATCH 337/412] ppc64: fix setjmp/longjmp handling of TOC pointer The TOC pointer is constant within a single dso, but needs to be saved and restored around cross-dso calls. The PLT stub saves it to the caller's stack frame, and the linker adds code to the caller to restore it. With a local call, as within a single dso or with static linking, this doesn't happen and the TOC pointer is always in r2. Therefore, setjmp/longjmp need to save/restore the TOC pointer from/to different locations depending on whether the call to setjmp was a local or non-local call. It is always safe for longjmp to restore to both r2 and the caller's stack. If the call to setjmp was local, and only r2 matters and the stack location will be ignored, but is required by the ABI to be reserved for the TOC pointer. If the call was non-local, then only the stack location matters, and whatever is restored into r2 will be clobbered anyway when the caller reloads r2 from the stack. A little extra care is required for sigsetjmp, because it uses setjmp internally. After the second return from this setjmp call, r2 will contain the caller's TOC pointer instead of libc's TOC pointer. We need to save and restore the correct libc pointer before we can tail call to __sigsetjmp_tail. --- src/setjmp/powerpc64/longjmp.s | 14 +++++++++----- src/setjmp/powerpc64/setjmp.s | 21 ++++++++++++++++----- src/signal/powerpc64/sigsetjmp.s | 21 ++++++++++++++------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/setjmp/powerpc64/longjmp.s b/src/setjmp/powerpc64/longjmp.s index 7f241c2d..81d45ff6 100644 --- a/src/setjmp/powerpc64/longjmp.s +++ b/src/setjmp/powerpc64/longjmp.s @@ -10,10 +10,14 @@ longjmp: # 1) restore cr ld 0, 1*8(3) mtcr 0 - # 2) restore r1-r2 (SP and TOC) + # 2) restore SP ld 1, 2*8(3) + # 3) restore TOC into both r2 and the caller's stack. + # Which location is required depends on whether setjmp was called + # locally or non-locally, but it's always safe to restore to both. ld 2, 3*8(3) - # 3) restore r14-r31 + std 2, 24(1) + # 4) restore r14-r31 ld 14, 4*8(3) ld 15, 5*8(3) ld 16, 6*8(3) @@ -32,7 +36,7 @@ longjmp: ld 29, 19*8(3) ld 30, 20*8(3) ld 31, 21*8(3) - # 4) restore floating point registers f14-f31 + # 5) restore floating point registers f14-f31 lfd 14, 22*8(3) lfd 15, 23*8(3) lfd 16, 24*8(3) @@ -52,7 +56,7 @@ longjmp: lfd 30, 38*8(3) lfd 31, 39*8(3) - # 5) restore vector registers v20-v31 + # 6) restore vector registers v20-v31 addi 3, 3, 40*8 lvx 20, 0, 3 ; addi 3, 3, 16 lvx 21, 0, 3 ; addi 3, 3, 16 @@ -67,7 +71,7 @@ longjmp: lvx 30, 0, 3 ; addi 3, 3, 16 lvx 31, 0, 3 - # 6) return r4 ? r4 : 1 + # 7) return r4 ? r4 : 1 mr 3, 4 cmpwi cr7, 4, 0 bne cr7, 1f diff --git a/src/setjmp/powerpc64/setjmp.s b/src/setjmp/powerpc64/setjmp.s index d16d4bae..37683fda 100644 --- a/src/setjmp/powerpc64/setjmp.s +++ b/src/setjmp/powerpc64/setjmp.s @@ -1,24 +1,35 @@ - .global ___setjmp - .hidden ___setjmp .global __setjmp .global _setjmp .global setjmp .type __setjmp,@function .type _setjmp,@function .type setjmp,@function -___setjmp: __setjmp: _setjmp: setjmp: + ld 5, 24(1) # load from the TOC slot in the caller's stack frame + b __setjmp_toc + + .localentry __setjmp,.-__setjmp + .localentry _setjmp,.-_setjmp + .localentry setjmp,.-setjmp + mr 5, 2 + + .global __setjmp_toc + .hidden __setjmp_toc + # same as normal setjmp, except TOC pointer to save is provided in r5. + # r4 would normally be the 2nd parameter, but we're using r5 to simplify calling from sigsetjmp. + # solves the problem of knowing whether to save the TOC pointer from r2 or the caller's stack frame. +__setjmp_toc: # 0) store IP into 0, then into the jmpbuf pointed to by r3 (first arg) mflr 0 std 0, 0*8(3) # 1) store cr mfcr 0 std 0, 1*8(3) - # 2) store r1-r2 (SP and TOC) + # 2) store SP and TOC std 1, 2*8(3) - std 2, 3*8(3) + std 5, 3*8(3) # 3) store r14-31 std 14, 4*8(3) std 15, 5*8(3) diff --git a/src/signal/powerpc64/sigsetjmp.s b/src/signal/powerpc64/sigsetjmp.s index 52ac1d03..410c2831 100644 --- a/src/signal/powerpc64/sigsetjmp.s +++ b/src/signal/powerpc64/sigsetjmp.s @@ -2,29 +2,36 @@ .global __sigsetjmp .type sigsetjmp,%function .type __sigsetjmp,%function - .hidden ___setjmp + .hidden __setjmp_toc sigsetjmp: __sigsetjmp: addis 2, 12, .TOC.-__sigsetjmp@ha addi 2, 2, .TOC.-__sigsetjmp@l + ld 5, 24(1) # load from the TOC slot in the caller's stack frame + b 1f + .localentry sigsetjmp,.-sigsetjmp .localentry __sigsetjmp,.-__sigsetjmp + mr 5, 2 +1: cmpwi cr7, 4, 0 - beq- cr7, ___setjmp + beq- cr7, __setjmp_toc - mflr 5 - std 5, 512(3) - std 16, 512+8+8(3) + mflr 6 + std 6, 512(3) + std 2, 512+16(3) + std 16, 512+24(3) mr 16, 3 - bl ___setjmp + bl __setjmp_toc mr 4, 3 mr 3, 16 ld 5, 512(3) mtlr 5 - ld 16, 512+8+8(3) + ld 2, 512+16(3) + ld 16, 512+24(3) .hidden __sigsetjmp_tail b __sigsetjmp_tail From 80bf5952551c002cf12d96deb145629765272db0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 11 Aug 2017 20:42:30 -0400 Subject: [PATCH 338/412] trap UB from attempts to join a detached thread passing to pthread_join the id of a thread which is not joinable results in undefined behavior. in principle the check to trap does not necessarily work if pthread_detach was called after thread creation, since no effort is made here to synchronize access to t->detached, but the check is well-defined and harmless for callers which did not invoke UB, and likely to help catch erroneous code that would otherwise mysteriously hang. patch by William Pitcock. --- src/thread/pthread_join.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c index 52111489..b7175c09 100644 --- a/src/thread/pthread_join.c +++ b/src/thread/pthread_join.c @@ -11,6 +11,7 @@ int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec *at) __pthread_testcancel(); __pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); if (cs == PTHREAD_CANCEL_ENABLE) __pthread_setcancelstate(cs, 0); + if (t->detached) a_crash(); while ((tmp = t->tid) && r != ETIMEDOUT && r != EINVAL) r = __timedwait_cp(&t->tid, tmp, CLOCK_REALTIME, at, 0); __pthread_setcancelstate(cs, 0); From 1698fe6cdcdeaad03aa19a85433d5396ecfc51ef Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 28 Jul 2017 23:05:54 +0200 Subject: [PATCH 339/412] fix build failure for sh4a due to missing colon in asm statement Due to a missing ":" in an asm() statement, the "memory" clobber is considered by gcc as an input operand and not a clobber, which causes a build failure. --- arch/sh/atomic_arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/atomic_arch.h b/arch/sh/atomic_arch.h index 74444d5d..d48a7651 100644 --- a/arch/sh/atomic_arch.h +++ b/arch/sh/atomic_arch.h @@ -21,7 +21,7 @@ static inline int a_sc(volatile int *p, int v) #define a_barrier a_barrier static inline void a_barrier() { - __asm__ __volatile__ ("synco" : : "memory"); + __asm__ __volatile__ ("synco" ::: "memory"); } #define a_pre_llsc a_barrier From 511b7042b3844b42a940f1c31436fb04ce93ac19 Mon Sep 17 00:00:00 2001 From: Daniel Sabogal Date: Fri, 11 Aug 2017 22:55:22 -0400 Subject: [PATCH 340/412] fix signed overflow in ftok --- src/ipc/ftok.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/ftok.c b/src/ipc/ftok.c index cd6002ed..c36b4b60 100644 --- a/src/ipc/ftok.c +++ b/src/ipc/ftok.c @@ -6,5 +6,5 @@ key_t ftok(const char *path, int id) struct stat st; if (stat(path, &st) < 0) return -1; - return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xff) << 24)); + return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xffu) << 24)); } From 670d6d01f53b4e85be6b333bf8a137e2be6d3fc3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Aug 2017 19:39:03 -0400 Subject: [PATCH 341/412] fix unsynchronized access to FILE structure in fflush(0) commit c002668eb0352e619ea7064e4940b397b4a6e68d inadvertently moved the check for unflushed write buffer outside of the scope of the existing lock. --- src/stdio/fflush.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stdio/fflush.c b/src/stdio/fflush.c index c2881065..bf1e8437 100644 --- a/src/stdio/fflush.c +++ b/src/stdio/fflush.c @@ -9,8 +9,11 @@ int fflush(FILE *f) if (!f) { int r = __stdout_used ? fflush(__stdout_used) : 0; - for (f=*__ofl_lock(); f; f=f->next) + for (f=*__ofl_lock(); f; f=f->next) { + FLOCK(f); if (f->wpos > f->wbase) r |= fflush(f); + FUNLOCK(f); + } __ofl_unlock(); return r; From 02b50c9d0a749f3e89e352a5760cc55a11977761 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 13 Aug 2017 22:46:38 +0200 Subject: [PATCH 342/412] fix mips ioctl macros to match linux asm/sockios.h --- arch/mips/bits/ioctl.h | 10 +++++----- arch/mips64/bits/ioctl.h | 10 +++++----- arch/mipsn32/bits/ioctl.h | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index accd7af2..793c66ee 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -139,11 +139,11 @@ struct winsize { #define N_SYNC_PPP 14 #define N_HCI 15 -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 +#define FIOGETOWN _IOR('f', 123, int) +#define FIOSETOWN _IOW('f', 124, int) +#define SIOCATMARK _IOR('s', 7, int) +#define SIOCSPGRP _IOW('s', 8, pid_t) +#define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 #define SIOCADDRT 0x890B diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index accd7af2..793c66ee 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -139,11 +139,11 @@ struct winsize { #define N_SYNC_PPP 14 #define N_HCI 15 -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 +#define FIOGETOWN _IOR('f', 123, int) +#define FIOSETOWN _IOW('f', 124, int) +#define SIOCATMARK _IOR('s', 7, int) +#define SIOCSPGRP _IOW('s', 8, pid_t) +#define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 #define SIOCADDRT 0x890B diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index accd7af2..793c66ee 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -139,11 +139,11 @@ struct winsize { #define N_SYNC_PPP 14 #define N_HCI 15 -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 +#define FIOGETOWN _IOR('f', 123, int) +#define FIOSETOWN _IOW('f', 124, int) +#define SIOCATMARK _IOR('s', 7, int) +#define SIOCSPGRP _IOW('s', 8, pid_t) +#define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 #define SIOCADDRT 0x890B From cc086693808c007679f02d5e0ee592446bf1b386 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 13 Aug 2017 22:47:42 +0200 Subject: [PATCH 343/412] add SIOCGSTAMPNS socket ioctl macro to ioctl.h it is defined in linux asm/sockios.h since commit ae40eb1ef30ab4120bd3c8b7e3da99ee53d27a23 (linux v2.6.22) but was missing from musl by accident. in musl the sockios macros are exposed in sys/ioctl.h together with other ioctl requests instead of in sys/socket.h because of namespace rules. (glibc has them in sys/socket.h under _GNU_SOURCE.) --- arch/generic/bits/ioctl.h | 1 + arch/mips/bits/ioctl.h | 1 + arch/mips64/bits/ioctl.h | 1 + arch/mipsn32/bits/ioctl.h | 1 + arch/powerpc/bits/ioctl.h | 1 + arch/powerpc64/bits/ioctl.h | 1 + arch/s390x/bits/ioctl.h | 1 + arch/sh/bits/ioctl.h | 1 + 8 files changed, 8 insertions(+) diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index c2035fc5..44deb11a 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -137,6 +137,7 @@ struct winsize { #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index 793c66ee..71394449 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -145,6 +145,7 @@ struct winsize { #define SIOCSPGRP _IOW('s', 8, pid_t) #define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index 793c66ee..71394449 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -145,6 +145,7 @@ struct winsize { #define SIOCSPGRP _IOW('s', 8, pid_t) #define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index 793c66ee..71394449 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -145,6 +145,7 @@ struct winsize { #define SIOCSPGRP _IOW('s', 8, pid_t) #define SIOCGPGRP _IOR('s', 9, pid_t) #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index 6d49cf4e..d3771dd3 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -150,6 +150,7 @@ struct winsize { #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h index 6d49cf4e..d3771dd3 100644 --- a/arch/powerpc64/bits/ioctl.h +++ b/arch/powerpc64/bits/ioctl.h @@ -150,6 +150,7 @@ struct winsize { #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/s390x/bits/ioctl.h b/arch/s390x/bits/ioctl.h index 11196e15..0ebac590 100644 --- a/arch/s390x/bits/ioctl.h +++ b/arch/s390x/bits/ioctl.h @@ -131,6 +131,7 @@ struct winsize { #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index e6e7d344..15256c51 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -141,6 +141,7 @@ struct winsize { #define SIOCSPGRP _IOW('s', 8, int) #define SIOCGPGRP _IOW('s', 9, int) #define SIOCGSTAMP _IOR('s', 100, char[8]) +#define SIOCGSTAMPNS _IOR('s', 101, char[8]) #define SIOCADDRT 0x890B #define SIOCDELRT 0x890C From c7f56b4d2f58714b7286ef12fa5410213847f2fe Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Fri, 28 Jul 2017 17:46:49 +0300 Subject: [PATCH 344/412] __init_libc: add fallbacks for __progname setup It is possible for argv[0] to be a null pointer, but the __progname variable is used to implement functions in src/legacy/err.c that do not expect it to be null. It is also available to the user via the program_invocation_name alias as a GNU extension, and the implementation in Glibc initializes it to a pointer to empty string rather than NULL. Since argv[0] is usually non-null and it's preferable to keep those variables in BSS, implement the fallbacks in __init_libc, which also allows to have an intermediate fallback to AT_EXECFN. --- src/env/__libc_start_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c index 5c79be28..18afdc1d 100644 --- a/src/env/__libc_start_main.c +++ b/src/env/__libc_start_main.c @@ -30,10 +30,10 @@ void __init_libc(char **envp, char *pn) __sysinfo = aux[AT_SYSINFO]; libc.page_size = aux[AT_PAGESZ]; - if (pn) { - __progname = __progname_full = pn; - for (i=0; pn[i]; i++) if (pn[i]=='/') __progname = pn+i+1; - } + if (!pn) pn = (void*)aux[AT_EXECFN]; + if (!pn) pn = ""; + __progname = __progname_full = pn; + for (i=0; pn[i]; i++) if (pn[i]=='/') __progname = pn+i+1; __init_tls(aux); __init_ssp((void *)aux[AT_RANDOM]); From 9d4c902c42b3fda368d7ea64bb9575c46228fa7f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Aug 2017 19:53:50 -0400 Subject: [PATCH 345/412] fix undefined behavior in memset due to missing sequence points patch by Pascal Cuoq. --- src/string/memset.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/string/memset.c b/src/string/memset.c index f438b073..5613a148 100644 --- a/src/string/memset.c +++ b/src/string/memset.c @@ -11,12 +11,16 @@ void *memset(void *dest, int c, size_t n) * offsets are well-defined and in the dest region. */ if (!n) return dest; - s[0] = s[n-1] = c; + s[0] = c; + s[n-1] = c; if (n <= 2) return dest; - s[1] = s[n-2] = c; - s[2] = s[n-3] = c; + s[1] = c; + s[2] = c; + s[n-2] = c; + s[n-3] = c; if (n <= 6) return dest; - s[3] = s[n-4] = c; + s[3] = c; + s[n-4] = c; if (n <= 8) return dest; /* Advance pointer to align it at a 4-byte boundary, From 5f3b652afe423dd2bd6f266535f79f685909cf60 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Aug 2017 20:48:02 -0400 Subject: [PATCH 346/412] add powerpc64 and s390x to list of supported archs in INSTALL file --- INSTALL | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 526c3f62..a2a142bf 100644 --- a/INSTALL +++ b/INSTALL @@ -69,12 +69,20 @@ and ABI combinations: that does not use FPU registers or instructions is available * PowerPC - * Only 32-bit is supported * Compiler toolchain must provide 64-bit long double, not IBM double-double or IEEE quad * For dynamic linking, compiler toolchain must be configured for "secure PLT" variant +* PowerPC64 + * Both little and big endian variants are supported + * Compiler toolchain must provide 64-bit long double, not IBM + double-double or IEEE quad + * Compiler toolchain must use the new (ELFv2) ABI regardless of + whether it is for little or big endian + +* S390X (64-bit S390) + * SuperH (SH) * Standard ELF ABI or FDPIC ABI (shared-text without MMU) * Little-endian by default; big-engian variant also supported From 5f7efb87a28a311ad377dd26adf53715dedb096d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Aug 2017 20:50:48 -0400 Subject: [PATCH 347/412] move IPPORT_RESERVED from netdb.h to netinet/in.h it's in the reserved namespace for the latter, where it seems it was historically defined, and some programs expect to find it there. --- include/netdb.h | 2 -- include/netinet/in.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/netdb.h b/include/netdb.h index 967ca211..adde2c5e 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -24,8 +24,6 @@ struct addrinfo { struct addrinfo *ai_next; }; -#define IPPORT_RESERVED 1024 - #define AI_PASSIVE 0x01 #define AI_CANONNAME 0x02 #define AI_NUMERICHOST 0x04 diff --git a/include/netinet/in.h b/include/netinet/in.h index 0d4d04aa..84982f5e 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -69,6 +69,8 @@ uint16_t htons(uint16_t); uint32_t ntohl(uint32_t); uint16_t ntohs(uint16_t); +#define IPPORT_RESERVED 1024 + #define IPPROTO_IP 0 #define IPPROTO_HOPOPTS 0 #define IPPROTO_ICMP 1 From 3356177979bea717451362e746252ed38de77514 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 29 Aug 2017 19:46:46 +0200 Subject: [PATCH 348/412] s390x: add bits/hwcap.h aligned with linux arch/s390/include/asm/elf.h (these macros should be exported into uapi, but they are not) --- arch/s390x/bits/hwcap.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 arch/s390x/bits/hwcap.h diff --git a/arch/s390x/bits/hwcap.h b/arch/s390x/bits/hwcap.h new file mode 100644 index 00000000..ecc6ce1f --- /dev/null +++ b/arch/s390x/bits/hwcap.h @@ -0,0 +1,15 @@ +#define HWCAP_S390_ESAN3 1 +#define HWCAP_S390_ZARCH 2 +#define HWCAP_S390_STFLE 4 +#define HWCAP_S390_MSA 8 +#define HWCAP_S390_LDISP 16 +#define HWCAP_S390_EIMM 32 +#define HWCAP_S390_DFP 64 +#define HWCAP_S390_HPAGE 128 +#define HWCAP_S390_ETF3EH 256 +#define HWCAP_S390_HIGH_GPRS 512 +#define HWCAP_S390_TE 1024 +#define HWCAP_S390_VXRS 2048 +#define HWCAP_S390_VXRS_BCD 4096 +#define HWCAP_S390_VXRS_EXT 8192 +#define HWCAP_S390_GS 16384 From 06fbefd10046a0fae7e588b7c6d25fb51811b931 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 19 Apr 2017 00:20:54 +0200 Subject: [PATCH 349/412] add a_clz_64 helper function counts leading zero bits of a 64bit int, undefined on zero input. (has nothing to do with atomics, added to atomic.h so target specific helper functions are together.) there is a logarithmic generic implementation and another in terms of a 32bit a_clz_32 on targets where that's available. --- arch/aarch64/atomic_arch.h | 7 +++++++ arch/arm/atomic_arch.h | 7 +++++++ arch/i386/atomic_arch.h | 7 +++++++ arch/powerpc/atomic_arch.h | 7 +++++++ arch/powerpc64/atomic_arch.h | 7 +++++++ arch/x32/atomic_arch.h | 7 +++++++ arch/x86_64/atomic_arch.h | 7 +++++++ src/internal/atomic.h | 21 +++++++++++++++++++++ 8 files changed, 70 insertions(+) diff --git a/arch/aarch64/atomic_arch.h b/arch/aarch64/atomic_arch.h index 8ab68c1c..40fefc25 100644 --- a/arch/aarch64/atomic_arch.h +++ b/arch/aarch64/atomic_arch.h @@ -73,3 +73,10 @@ static inline int a_ctz_64(uint64_t x) : "=r"(x) : "r"(x)); return x; } + +#define a_clz_64 a_clz_64 +static inline int a_clz_64(uint64_t x) +{ + __asm__("clz %0, %1" : "=r"(x) : "r"(x)); + return x; +} diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index d6af84d0..a121010f 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -81,3 +81,10 @@ static inline void a_crash() #endif : : : "memory"); } + +#define a_clz_32 a_clz_32 +static inline int a_clz_32(uint32_t x) +{ + __asm__ ("clz %0, %1" : "=r"(x) : "r"(x)); + return x; +} diff --git a/arch/i386/atomic_arch.h b/arch/i386/atomic_arch.h index 2b1a0490..7d2a48a5 100644 --- a/arch/i386/atomic_arch.h +++ b/arch/i386/atomic_arch.h @@ -99,3 +99,10 @@ static inline int a_ctz_l(unsigned long x) __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) ); return r; } + +#define a_clz_32 a_clz_32 +static inline int a_clz_32(uint32_t x) +{ + __asm__( "bsr %1,%0 ; xor $31,%0" : "=r"(x) : "r"(x) ); + return x; +} diff --git a/arch/powerpc/atomic_arch.h b/arch/powerpc/atomic_arch.h index f31566b2..5b65cde7 100644 --- a/arch/powerpc/atomic_arch.h +++ b/arch/powerpc/atomic_arch.h @@ -37,3 +37,10 @@ static inline void a_store(volatile int *p, int v) *p = v; a_post_llsc(); } + +#define a_clz_32 a_clz_32 +static inline int a_clz_32(uint32_t x) +{ + __asm__ ("cntlzw %0, %1" : "=r"(x) : "r"(x)); + return x; +} diff --git a/arch/powerpc64/atomic_arch.h b/arch/powerpc64/atomic_arch.h index 269d79c6..17cababd 100644 --- a/arch/powerpc64/atomic_arch.h +++ b/arch/powerpc64/atomic_arch.h @@ -61,3 +61,10 @@ static inline void a_crash() { __asm__ __volatile__ (".long 0"); } + +#define a_clz_64 a_clz_64 +static inline int a_clz_64(uint64_t x) +{ + __asm__ ("cntlzd %0, %1" : "=r"(x) : "r"(x)); + return x; +} diff --git a/arch/x32/atomic_arch.h b/arch/x32/atomic_arch.h index 7daf4ae2..a744c299 100644 --- a/arch/x32/atomic_arch.h +++ b/arch/x32/atomic_arch.h @@ -112,3 +112,10 @@ static inline int a_ctz_l(unsigned long x) __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) ); return x; } + +#define a_clz_64 a_clz_64 +static inline int a_clz_64(uint64_t x) +{ + __asm__( "bsr %1,%0 ; xor $63,%0" : "=r"(x) : "r"(x) ); + return x; +} diff --git a/arch/x86_64/atomic_arch.h b/arch/x86_64/atomic_arch.h index 55fc6fb9..da4e2037 100644 --- a/arch/x86_64/atomic_arch.h +++ b/arch/x86_64/atomic_arch.h @@ -114,3 +114,10 @@ static inline int a_ctz_64(uint64_t x) __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) ); return x; } + +#define a_clz_64 a_clz_64 +static inline int a_clz_64(uint64_t x) +{ + __asm__( "bsr %1,%0 ; xor $63,%0" : "=r"(x) : "r"(x) ); + return x; +} diff --git a/src/internal/atomic.h b/src/internal/atomic.h index 6f37d252..ab473dd7 100644 --- a/src/internal/atomic.h +++ b/src/internal/atomic.h @@ -277,6 +277,27 @@ static inline int a_ctz_64(uint64_t x) } #endif +#ifndef a_clz_64 +#define a_clz_64 a_clz_64 +static inline int a_clz_64(uint64_t x) +{ +#ifdef a_clz_32 + if (x>>32) + return a_clz_32(x>>32); + return a_clz_32(x) + 32; +#else + uint32_t y; + int r; + if (x>>32) y=x>>32, r=0; else y=x, r=32; + if (y>>16) y>>=16; else r |= 16; + if (y>>8) y>>=8; else r |= 8; + if (y>>4) y>>=4; else r |= 4; + if (y>>2) y>>=2; else r |= 2; + return r | !(y>>1); +#endif +} +#endif + #ifndef a_ctz_l #define a_ctz_l a_ctz_l static inline int a_ctz_l(unsigned long x) From 8459c6f2647a378eca2c6375210ddf29dd499043 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 8 Feb 2017 00:31:56 +0000 Subject: [PATCH 350/412] arm: add HWCAP_ARM_ hwcap macros Glibc renamed the linux uapi HWCAP_* macros to HWCAP_ARM_* so have both variants in case some code depends on it. (The HWCAP2_ macros are not defined in glibc currently so those only have the linux uapi variant.) --- arch/arm/bits/hwcap.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/bits/hwcap.h b/arch/arm/bits/hwcap.h index ac4edeac..a3d87312 100644 --- a/arch/arm/bits/hwcap.h +++ b/arch/arm/bits/hwcap.h @@ -27,3 +27,27 @@ #define HWCAP2_SHA1 (1 << 2) #define HWCAP2_SHA2 (1 << 3) #define HWCAP2_CRC32 (1 << 4) + +#define HWCAP_ARM_SWP (1 << 0) +#define HWCAP_ARM_HALF (1 << 1) +#define HWCAP_ARM_THUMB (1 << 2) +#define HWCAP_ARM_26BIT (1 << 3) +#define HWCAP_ARM_FAST_MULT (1 << 4) +#define HWCAP_ARM_FPA (1 << 5) +#define HWCAP_ARM_VFP (1 << 6) +#define HWCAP_ARM_EDSP (1 << 7) +#define HWCAP_ARM_JAVA (1 << 8) +#define HWCAP_ARM_IWMMXT (1 << 9) +#define HWCAP_ARM_CRUNCH (1 << 10) +#define HWCAP_ARM_THUMBEE (1 << 11) +#define HWCAP_ARM_NEON (1 << 12) +#define HWCAP_ARM_VFPv3 (1 << 13) +#define HWCAP_ARM_VFPv3D16 (1 << 14) +#define HWCAP_ARM_TLS (1 << 15) +#define HWCAP_ARM_VFPv4 (1 << 16) +#define HWCAP_ARM_IDIVA (1 << 17) +#define HWCAP_ARM_IDIVT (1 << 18) +#define HWCAP_ARM_VFPD32 (1 << 19) +#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT) +#define HWCAP_ARM_LPAE (1 << 20) +#define HWCAP_ARM_EVTSTRM (1 << 21) From 11ddc314b57196519316103b02acffe10299dad3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 31 Aug 2017 14:30:28 -0400 Subject: [PATCH 351/412] fix erroneous stop before input limit in mbsnrtowcs and wcsnrtombs the value computed as an output limit that bounds the amount of input consumed below the input limit was incorrectly being used as the actual amount of input consumed. instead, compute the actual amount of input consumed as a difference of pointers before and after the conversion. patch by Mikhail Kremnyov. --- src/multibyte/mbsnrtowcs.c | 4 +++- src/multibyte/wcsnrtombs.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/multibyte/mbsnrtowcs.c b/src/multibyte/mbsnrtowcs.c index cae4caa2..931192e2 100644 --- a/src/multibyte/mbsnrtowcs.c +++ b/src/multibyte/mbsnrtowcs.c @@ -5,6 +5,7 @@ size_t mbsnrtowcs(wchar_t *restrict wcs, const char **restrict src, size_t n, si size_t l, cnt=0, n2; wchar_t *ws, wbuf[256]; const char *s = *src; + const char *tmp_s; if (!wcs) ws = wbuf, wn = sizeof wbuf / sizeof *wbuf; else ws = wcs; @@ -15,7 +16,7 @@ size_t mbsnrtowcs(wchar_t *restrict wcs, const char **restrict src, size_t n, si while ( s && wn && ( (n2=n/4)>=wn || n2>32 ) ) { if (n2>=wn) n2=wn; - n -= n2; + tmp_s = s; l = mbsrtowcs(ws, &s, n2, st); if (!(l+1)) { cnt = l; @@ -26,6 +27,7 @@ size_t mbsnrtowcs(wchar_t *restrict wcs, const char **restrict src, size_t n, si ws += l; wn -= l; } + n = s ? n - (s - tmp_s) : 0; cnt += l; } if (s) while (wn && n) { diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c index 640cbbeb..676932b5 100644 --- a/src/multibyte/wcsnrtombs.c +++ b/src/multibyte/wcsnrtombs.c @@ -5,13 +5,14 @@ size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, s size_t l, cnt=0, n2; char *s, buf[256]; const wchar_t *ws = *wcs; + const wchar_t *tmp_ws; if (!dst) s = buf, n = sizeof buf; else s = dst; while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) { if (n2>=n) n2=n; - wn -= n2; + tmp_ws = ws; l = wcsrtombs(s, &ws, n2, 0); if (!(l+1)) { cnt = l; @@ -22,6 +23,7 @@ size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, s s += l; n -= l; } + wn = ws ? wn - (ws - tmp_ws) : 0; cnt += l; } if (ws) while (n && wn) { From 39db00afadc9d8d0456c46eab42b8cb8ff9f375c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 1 Sep 2017 17:05:40 -0400 Subject: [PATCH 352/412] fix erroneous acceptance of f4 9x xx xx code sequences by utf-8 decoder the DFA table controlling accepted ranges for the f4 prefix used an incorrect upper bound of 0xa0 where it should have been 0x90, allowing such sequences to be accepted and decoded as non-Unicode-scalar values 0x110000 through 0x11ffff. --- src/multibyte/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multibyte/internal.c b/src/multibyte/internal.c index 7e1b1c03..2f5aaa91 100644 --- a/src/multibyte/internal.c +++ b/src/multibyte/internal.c @@ -9,7 +9,7 @@ | x ) #define F(x) ( ( x>=5 ? 0 : \ x==0 ? R(0x90,0xc0) : \ - x==4 ? R(0x80,0xa0) : \ + x==4 ? R(0x80,0x90) : \ R(0x80,0xc0) ) \ | ( R(0x80,0xc0) >> 6 ) \ | ( R(0x80,0xc0) >> 12 ) \ From 8e932792c917d11545c2953b35159149f7411eca Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sun, 3 Sep 2017 22:12:20 +0300 Subject: [PATCH 353/412] overhaul environment functions Rewrite environment access functions to slim down code, fix bugs and avoid invoking undefined behavior. * avoid using int-typed iterators where size_t would be correct; * use strncmp instead of memcmp consistently; * tighten prologues by invoking __strchrnul; * handle NULL environ. putenv: * handle "=value" input via unsetenv too (will return -1/EINVAL); * rewrite and simplify __putenv; fix the leak caused by failure to deallocate entry added by preceding setenv when called from putenv. setenv: * move management of libc-allocated entries to this translation unit, and use no-op weak symbols in putenv/unsetenv; unsetenv: * rewrite; this fixes UB caused by testing a free'd pointer against NULL on entry to subsequent loops. Not changed: Failure to extend allocation tracking array (previously __env_map, now env_alloced) is ignored rather than causing to report -1/ENOMEM to the caller; the worst-case consequence is leaking this allocation when it is removed or replaced in a subsequent environment access. Initially UB in unsetenv was reported by Alexander Cherepanov. Using a weak alias to avoid pulling in malloc via unsetenv was suggested by Rich Felker. --- src/env/getenv.c | 15 ++++----- src/env/putenv.c | 76 ++++++++++++++++++++-------------------------- src/env/setenv.c | 41 +++++++++++++++++-------- src/env/unsetenv.c | 35 +++++++++++---------- 4 files changed, 86 insertions(+), 81 deletions(-) diff --git a/src/env/getenv.c b/src/env/getenv.c index 00c1bce0..cf34672c 100644 --- a/src/env/getenv.c +++ b/src/env/getenv.c @@ -2,13 +2,14 @@ #include #include "libc.h" +char *__strchrnul(const char *, int); + char *getenv(const char *name) { - int i; - size_t l = strlen(name); - if (!__environ || !*name || strchr(name, '=')) return NULL; - for (i=0; __environ[i] && (strncmp(name, __environ[i], l) - || __environ[i][l] != '='); i++); - if (__environ[i]) return __environ[i] + l+1; - return NULL; + size_t l = __strchrnul(name, '=') - name; + if (l && !name[l] && __environ) + for (char **e = __environ; *e; e++) + if (!strncmp(name, *e, l) && l[*e] == '=') + return *e + l+1; + return 0; } diff --git a/src/env/putenv.c b/src/env/putenv.c index 71530426..fa4a4ddc 100644 --- a/src/env/putenv.c +++ b/src/env/putenv.c @@ -1,58 +1,48 @@ #include #include +#include "libc.h" -extern char **__environ; -char **__env_map; +char *__strchrnul(const char *, int); -int __putenv(char *s, int a) +static void dummy(char *old, char *new) {} +weak_alias(dummy, __env_rm_add); + +int __putenv(char *s, size_t l, char *r) { - int i=0, j=0; - char *z = strchr(s, '='); - char **newenv = 0; - char **newmap = 0; - static char **oldenv; - - if (!z) return unsetenv(s); - if (z==s) return -1; - for (; __environ[i] && memcmp(s, __environ[i], z-s+1); i++); - if (a) { - if (!__env_map) { - __env_map = calloc(2, sizeof(char *)); - if (__env_map) __env_map[0] = s; - } else { - for (; __env_map[j] && __env_map[j] != __environ[i]; j++); - if (!__env_map[j]) { - newmap = realloc(__env_map, sizeof(char *)*(j+2)); - if (newmap) { - __env_map = newmap; - __env_map[j] = s; - __env_map[j+1] = NULL; - } - } else { - free(__env_map[j]); - __env_map[j] = s; + size_t i=0; + if (__environ) { + for (char **e = __environ; *e; e++, i++) + if (!strncmp(s, *e, l+1)) { + char *tmp = *e; + *e = s; + __env_rm_add(tmp, r); + return 0; } - } } - if (!__environ[i]) { - newenv = malloc(sizeof(char *)*(i+2)); - if (!newenv) { - if (a && __env_map) __env_map[j] = 0; - return -1; - } - memcpy(newenv, __environ, sizeof(char *)*i); - newenv[i] = s; - newenv[i+1] = 0; - __environ = newenv; + static char **oldenv; + char **newenv; + if (__environ == oldenv) { + newenv = realloc(oldenv, sizeof *newenv * (i+2)); + if (!newenv) goto oom; + } else { + newenv = malloc(sizeof *newenv * (i+2)); + if (!newenv) goto oom; + if (i) memcpy(newenv, __environ, sizeof *newenv * i); free(oldenv); - oldenv = __environ; } - - __environ[i] = s; + newenv[i] = s; + newenv[i+1] = 0; + __environ = oldenv = newenv; + if (r) __env_rm_add(0, r); return 0; +oom: + free(r); + return -1; } int putenv(char *s) { - return __putenv(s, 0); + size_t l = __strchrnul(s, '=') - s; + if (!l || !s[l]) return unsetenv(s); + return __putenv(s, l, 0); } diff --git a/src/env/setenv.c b/src/env/setenv.c index 76e8ee12..a7dd2b60 100644 --- a/src/env/setenv.c +++ b/src/env/setenv.c @@ -2,29 +2,44 @@ #include #include -int __putenv(char *s, int a); +char *__strchrnul(const char *, int); +int __putenv(char *, size_t, char *); + +void __env_rm_add(char *old, char *new) +{ + static char **env_alloced; + static size_t env_alloced_n; + for (size_t i=0; i < env_alloced_n; i++) + if (env_alloced[i] == old) { + env_alloced[i] = new; + free(old); + return; + } else if (!env_alloced[i] && new) { + env_alloced[i] = new; + new = 0; + } + if (!new) return; + char **t = realloc(env_alloced, sizeof *t * (env_alloced_n+1)); + if (!t) return; + (env_alloced = t)[env_alloced_n++] = new; +} int setenv(const char *var, const char *value, int overwrite) { char *s; - int l1, l2; + size_t l1, l2; - if (!var || !*var || strchr(var, '=')) { + if (!var || !(l1 = __strchrnul(var, '=') - var) || var[l1]) { errno = EINVAL; return -1; } if (!overwrite && getenv(var)) return 0; - l1 = strlen(var); l2 = strlen(value); s = malloc(l1+l2+2); - if (s) { - memcpy(s, var, l1); - s[l1] = '='; - memcpy(s+l1+1, value, l2); - s[l1+l2+1] = 0; - if (!__putenv(s, 1)) return 0; - } - free(s); - return -1; + if (!s) return -1; + memcpy(s, var, l1); + s[l1] = '='; + memcpy(s+l1+1, value, l2+1); + return __putenv(s, l1, s); } diff --git a/src/env/unsetenv.c b/src/env/unsetenv.c index 35693354..8630e2d7 100644 --- a/src/env/unsetenv.c +++ b/src/env/unsetenv.c @@ -1,31 +1,30 @@ #include #include #include +#include "libc.h" -extern char **__environ; -extern char **__env_map; +char *__strchrnul(const char *, int); + +static void dummy(char *old, char *new) {} +weak_alias(dummy, __env_rm_add); int unsetenv(const char *name) { - int i, j; - size_t l = strlen(name); - - if (!*name || strchr(name, '=')) { + size_t l = __strchrnul(name, '=') - name; + if (!l || name[l]) { errno = EINVAL; return -1; } -again: - for (i=0; __environ[i] && (memcmp(name, __environ[i], l) || __environ[i][l] != '='); i++); - if (__environ[i]) { - if (__env_map) { - for (j=0; __env_map[j] && __env_map[j] != __environ[i]; j++); - free (__env_map[j]); - for (; __env_map[j]; j++) - __env_map[j] = __env_map[j+1]; - } - for (; __environ[i]; i++) - __environ[i] = __environ[i+1]; - goto again; + if (__environ) { + char **e = __environ, **eo = e; + for (; *e; e++) + if (!strncmp(name, *e, l) && l[*e] == '=') + __env_rm_add(*e, 0); + else if (eo != e) + *eo++ = *e; + else + eo++; + if (eo != e) *eo = 0; } return 0; } From cc0dbd5f09337c187156fe8b697245e6ea9263d0 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sun, 3 Sep 2017 22:12:21 +0300 Subject: [PATCH 354/412] free allocations in clearenv This aligns clearenv with the Linux man page by setting 'environ' rather than '*environ' to NULL, and stops it from leaking entries allocated by the libc. --- src/env/clearenv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/env/clearenv.c b/src/env/clearenv.c index 62d50952..da187752 100644 --- a/src/env/clearenv.c +++ b/src/env/clearenv.c @@ -1,10 +1,14 @@ #define _GNU_SOURCE #include +#include "libc.h" -extern char **__environ; +static void dummy(char *old, char *new) {} +weak_alias(dummy, __env_rm_add); int clearenv() { - __environ[0] = 0; + char **e = __environ; + __environ = 0; + if (e) while (*e) __env_rm_add(*e++, 0); return 0; } From 51bdcdc424bd7169c8cccdc2de7cad17f5ea0f70 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Fri, 30 Jun 2017 00:35:33 +0300 Subject: [PATCH 355/412] fix OOB reads in Xbyte_memmem Reported by Leah Neukirchen. --- src/string/memmem.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/string/memmem.c b/src/string/memmem.c index 4be6a310..54a66e46 100644 --- a/src/string/memmem.c +++ b/src/string/memmem.c @@ -5,27 +5,27 @@ static char *twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1]; - for (h++, k--; k; k--, hw = hw<<8 | *++h) - if (hw == nw) return (char *)h-1; - return 0; + for (h+=2, k-=2; k; k--, hw = hw<<8 | *h++) + if (hw == nw) return (char *)h-2; + return hw == nw ? (char *)h-2 : 0; } static char *threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8; uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8; - for (h+=2, k-=2; k; k--, hw = (hw|*++h)<<8) - if (hw == nw) return (char *)h-2; - return 0; + for (h+=3, k-=3; k; k--, hw = (hw|*h++)<<8) + if (hw == nw) return (char *)h-3; + return hw == nw ? (char *)h-3 : 0; } static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3]; uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3]; - for (h+=3, k-=3; k; k--, hw = hw<<8 | *++h) - if (hw == nw) return (char *)h-3; - return 0; + for (h+=4, k-=4; k; k--, hw = hw<<8 | *h++) + if (hw == nw) return (char *)h-4; + return hw == nw ? (char *)h-4 : 0; } #define MAX(a,b) ((a)>(b)?(a):(b)) From 9255dad97e7bfd4165d1aa0f93f2aae321a7a4d8 Mon Sep 17 00:00:00 2001 From: Bartosz Brachaczek Date: Sun, 9 Jul 2017 23:00:18 +0200 Subject: [PATCH 356/412] handle whitespace before %% in scanf this is mandated by C and POSIX standards and is in accordance with glibc behavior. --- src/stdio/vfscanf.c | 10 +++++++--- src/stdio/vfwscanf.c | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c index d4d2454b..9e030fc4 100644 --- a/src/stdio/vfscanf.c +++ b/src/stdio/vfscanf.c @@ -89,15 +89,19 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) continue; } if (*p != '%' || p[1] == '%') { - p += *p=='%'; shlim(f, 0); - c = shgetc(f); + if (*p == '%') { + p++; + while (isspace((c=shgetc(f)))); + } else { + c = shgetc(f); + } if (c!=*p) { shunget(f); if (c<0) goto input_fail; goto match_fail; } - pos++; + pos += shcnt(f); continue; } diff --git a/src/stdio/vfwscanf.c b/src/stdio/vfwscanf.c index 1ebc5cef..a7cd0923 100644 --- a/src/stdio/vfwscanf.c +++ b/src/stdio/vfwscanf.c @@ -117,8 +117,12 @@ int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap) continue; } if (*p != '%' || p[1] == '%') { - p += *p=='%'; - c = getwc(f); + if (*p == '%') { + p++; + while (iswspace((c=getwc(f)))) pos++; + } else { + c = getwc(f); + } if (c!=*p) { ungetwc(c, f); if (c<0) goto input_fail; From 822dddfbf1884553341114663aff56ed87d57663 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Feb 2017 00:50:09 +0000 Subject: [PATCH 357/412] make syscall.h consistent with linux most of the found naming differences don't matter to musl, because internally it unifies the syscall names that vary across targets, but for external code the names should match the kernel uapi. aarch64: __NR_fstatat is called __NR_newfstatat in linux. __NR_or1k_atomic got mistakenly copied from or1k. arm: __NR_arm_sync_file_range is an alias for __NR_sync_file_range2 __NR_fadvise64_64 is called __NR_arm_fadvise64_64 in linux, the old non-arm name is kept too, it should not cause issues. (powerpc has similar nonstandard fadvise and it uses the normal name.) i386: __NR_madvise1 was removed from linux in commit 303395ac3bf3e2cb488435537d416bc840438fcb 2011-11-11 microblaze: __NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite had different name in linux. mips: __NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite, __NR_select had different name in linux. mipsn32: __NR_fstatat is called __NR_newfstatat in linux. or1k: __NR__llseek is called __NR_llseek in linux. the old name is kept too because that's the name musl uses internally. powerpc: __NR_{get,set}res{gid,uid}32 was never present in powerpc linux. __NR_timerfd was briefly defined in linux but then got renamed. --- arch/aarch64/bits/syscall.h.in | 3 +-- arch/arm/bits/syscall.h.in | 2 ++ arch/i386/bits/syscall.h.in | 1 - arch/microblaze/bits/syscall.h.in | 8 ++++---- arch/mips/bits/syscall.h.in | 10 +++++----- arch/mips/syscall_arch.h | 6 +++--- arch/mipsn32/bits/syscall.h.in | 2 +- arch/mipsn32/syscall_arch.h | 6 +++--- arch/or1k/bits/syscall.h.in | 1 + arch/powerpc/bits/syscall.h.in | 5 ----- 10 files changed, 20 insertions(+), 24 deletions(-) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index fd388eec..8b56afff 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -77,7 +77,7 @@ #define __NR_splice 76 #define __NR_tee 77 #define __NR_readlinkat 78 -#define __NR_fstatat 79 +#define __NR_newfstatat 79 #define __NR_fstat 80 #define __NR_sync 81 #define __NR_fsync 82 @@ -242,7 +242,6 @@ #define __NR_perf_event_open 241 #define __NR_accept4 242 #define __NR_recvmmsg 243 -#define __NR_or1k_atomic 244 #define __NR_wait4 260 #define __NR_prlimit64 261 #define __NR_fanotify_init 262 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index 9b129b23..0096fe7c 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -224,6 +224,7 @@ #define __NR_tgkill 268 #define __NR_utimes 269 #define __NR_fadvise64_64 270 +#define __NR_arm_fadvise64_64 270 #define __NR_pciconfig_iobase 271 #define __NR_pciconfig_read 272 #define __NR_pciconfig_write 273 @@ -295,6 +296,7 @@ #define __NR_get_robust_list 339 #define __NR_splice 340 #define __NR_sync_file_range2 341 +#define __NR_arm_sync_file_range 341 #define __NR_tee 342 #define __NR_vmsplice 343 #define __NR_move_pages 344 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index 3a1d9270..1217f89a 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -218,7 +218,6 @@ #define __NR_pivot_root 217 #define __NR_mincore 218 #define __NR_madvise 219 -#define __NR_madvise1 219 #define __NR_getdents64 220 #define __NR_fcntl64 221 /* 223 is unused */ diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index 109fcdeb..e5f928e3 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -178,8 +178,8 @@ #define __NR_rt_sigtimedwait 177 #define __NR_rt_sigqueueinfo 178 #define __NR_rt_sigsuspend 179 -#define __NR_pread 180 -#define __NR_pwrite 181 +#define __NR_pread64 180 +#define __NR_pwrite64 181 #define __NR_chown 182 #define __NR_getcwd 183 #define __NR_capget 184 @@ -246,7 +246,7 @@ #define __NR_io_getevents 247 #define __NR_io_submit 248 #define __NR_io_cancel 249 -#define __NR_fadvise 250 +#define __NR_fadvise64 250 #define __NR_exit_group 252 #define __NR_lookup_dcookie 253 #define __NR_epoll_create 254 @@ -294,7 +294,7 @@ #define __NR_mknodat 297 #define __NR_fchownat 298 #define __NR_futimesat 299 -#define __NR_fstatat 300 +#define __NR_fstatat64 300 #define __NR_unlinkat 301 #define __NR_renameat 302 #define __NR_linkat 303 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index 6c9b3d8c..1a2147a7 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -140,7 +140,7 @@ #define __NR_setfsgid 4139 #define __NR__llseek 4140 #define __NR_getdents 4141 -#define __NR_select 4142 +#define __NR__newselect 4142 #define __NR_flock 4143 #define __NR_msync 4144 #define __NR_readv 4145 @@ -198,8 +198,8 @@ #define __NR_rt_sigtimedwait 4197 #define __NR_rt_sigqueueinfo 4198 #define __NR_rt_sigsuspend 4199 -#define __NR_pread 4200 -#define __NR_pwrite 4201 +#define __NR_pread64 4200 +#define __NR_pwrite64 4201 #define __NR_chown 4202 #define __NR_getcwd 4203 #define __NR_capget 4204 @@ -252,7 +252,7 @@ #define __NR_remap_file_pages 4251 #define __NR_set_tid_address 4252 #define __NR_restart_syscall 4253 -#define __NR_fadvise 4254 +#define __NR_fadvise64 4254 #define __NR_statfs64 4255 #define __NR_fstatfs64 4256 #define __NR_timer_create 4257 @@ -290,7 +290,7 @@ #define __NR_mknodat 4290 #define __NR_fchownat 4291 #define __NR_futimesat 4292 -#define __NR_fstatat 4293 +#define __NR_fstatat64 4293 #define __NR_unlinkat 4294 #define __NR_renameat 4295 #define __NR_linkat 4296 diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h index 3ac4da21..666f413f 100644 --- a/arch/mips/syscall_arch.h +++ b/arch/mips/syscall_arch.h @@ -99,7 +99,7 @@ static inline long __syscall4(long n, long a, long b, long c, long d) if (r7) return -r2; long ret = r2; if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); + if (n == SYS_fstatat64) __stat_fix(c); return ret; } @@ -108,7 +108,7 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e) long r2 = (__syscall)(n, a, b, c, d, e); if (r2 > -4096UL) return r2; if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); + if (n == SYS_fstatat64) __stat_fix(c); return r2; } @@ -117,7 +117,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo long r2 = (__syscall)(n, a, b, c, d, e, f); if (r2 > -4096UL) return r2; if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); + if (n == SYS_fstatat64) __stat_fix(c); return r2; } diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index d6b24e8f..cd843a76 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -253,7 +253,7 @@ #define __NR_mknodat 6253 #define __NR_fchownat 6254 #define __NR_futimesat 6255 -#define __NR_fstatat 6256 +#define __NR_newfstatat 6256 #define __NR_unlinkat 6257 #define __NR_renameat 6258 #define __NR_linkat 6259 diff --git a/arch/mipsn32/syscall_arch.h b/arch/mipsn32/syscall_arch.h index 37e71a7e..93a026f6 100644 --- a/arch/mipsn32/syscall_arch.h +++ b/arch/mipsn32/syscall_arch.h @@ -97,7 +97,7 @@ static inline long __syscall4(long n, long a, long b, long c, long d) if (r7) return -r2; long ret = r2; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); + if (n == SYS_newfstatat) __stat_fix(c); return ret; } @@ -106,7 +106,7 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e) long r2 = (__syscall)(n, a, b, c, d, e); if (r2 > -4096UL) return r2; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); + if (n == SYS_newfstatat) __stat_fix(c); return r2; } @@ -115,7 +115,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo long r2 = (__syscall)(n, a, b, c, d, e, f); if (r2 > -4096UL) return r2; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); - if (n == SYS_fstatat) __stat_fix(c); + if (n == SYS_newfstatat) __stat_fix(c); return r2; } diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index 89788a9d..54581fb4 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -61,6 +61,7 @@ #define __NR_quotactl 60 #define __NR_getdents64 61 #define __NR__llseek 62 +#define __NR_llseek 62 #define __NR_read 63 #define __NR_write 64 #define __NR_readv 65 diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index 9d022321..35f7033e 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -162,16 +162,12 @@ #define __NR_sched_rr_get_interval 161 #define __NR_nanosleep 162 #define __NR_mremap 163 -#define __NR_setresuid32 164 #define __NR_setresuid 164 -#define __NR_getresuid32 165 #define __NR_getresuid 165 #define __NR_query_module 166 #define __NR_poll 167 #define __NR_nfsservctl 168 -#define __NR_setresgid32 169 #define __NR_setresgid 169 -#define __NR_getresgid32 170 #define __NR_getresgid 170 #define __NR_prctl 171 #define __NR_rt_sigreturn 172 @@ -306,7 +302,6 @@ #define __NR_epoll_pwait 303 #define __NR_utimensat 304 #define __NR_signalfd 305 -#define __NR_timerfd 306 #define __NR_timerfd_create 306 #define __NR_eventfd 307 #define __NR_sync_file_range2 308 From 9e01be6e49b9ae433072207f420ef33c8189eb78 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 6 Sep 2017 20:37:19 -0400 Subject: [PATCH 358/412] fix signal masking race in pthread_create with priority attributes if the parent thread was able to set the new thread's priority before it reached the check for 'startlock', the new thread failed to restore its signal mask and thus ran with all signals blocked. concept for patch by Sergei, who reported the issue; unnecessary changes were removed and comments added since the whole 'startlock' thing is non-idiomatic and confusing. eventually it should be replaced with use of idiomatic synchronization primitives. --- src/thread/pthread_create.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 49f2f729..6cbf85b3 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -131,9 +131,14 @@ void __do_cleanup_pop(struct __ptcb *cb) static int start(void *p) { pthread_t self = p; + /* States for startlock: + * 0 = no need for start sync + * 1 = waiting for parent to do work + * 2 = failure in parent, child must abort + * 3 = success in parent, child must restore sigmask */ if (self->startlock[0]) { __wait(self->startlock, 0, 1, 1); - if (self->startlock[0]) { + if (self->startlock[0] == 2) { self->detached = 2; pthread_exit(0); } @@ -295,7 +300,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att if (do_sched) { ret = __syscall(SYS_sched_setscheduler, new->tid, attr._a_policy, &attr._a_prio); - a_store(new->startlock, ret<0 ? 2 : 0); + a_store(new->startlock, ret<0 ? 2 : 3); __wake(new->startlock, 1, 1); if (ret < 0) return -ret; } From 565dbee24d4bf55728be1c274fca1e7f3196fd73 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 6 Sep 2017 21:42:15 -0400 Subject: [PATCH 359/412] don't treat numeric port strings as servent records in getservby*() some applications use getservbyport to find port numbers that are not assigned to a service; if getservbyport always succeeds with a numeric string as the result, they fail to find any available ports. POSIX doesn't seem to mandate the behavior one way or another. it specifies an abstract service database, which an implementation could define to include numeric port strings, but it makes more sense to align behavior with traditional implementations. based on patch by A. Wilcox. the original patch only changed getservbyport[_r]. to maintain a consistent view of the "service database", I have also modified getservbyname[_r] to exclude numeric port strings. --- src/network/getservbyname_r.c | 6 ++++++ src/network/getservbyport_r.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/network/getservbyname_r.c b/src/network/getservbyname_r.c index ad3d6164..cad6317a 100644 --- a/src/network/getservbyname_r.c +++ b/src/network/getservbyname_r.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "lookup.h" #define ALIGN (sizeof(struct { char a; char *b; }) - sizeof(char *)) @@ -17,6 +18,11 @@ int getservbyname_r(const char *name, const char *prots, *res = 0; + /* Don't treat numeric port number strings as service records. */ + char *end = ""; + strtoul(name, &end, 10); + if (!*end) return ENOENT; + /* Align buffer */ align = -(uintptr_t)buf & ALIGN-1; if (buflen < 2*sizeof(char *)+align) diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c index 0ae0e415..b7f21c6b 100644 --- a/src/network/getservbyport_r.c +++ b/src/network/getservbyport_r.c @@ -5,6 +5,7 @@ #include #include #include +#include int getservbyport_r(int port, const char *prots, struct servent *se, char *buf, size_t buflen, struct servent **res) @@ -51,6 +52,9 @@ int getservbyport_r(int port, const char *prots, break; } + /* A numeric port string is not a service record. */ + if (strtol(buf, 0, 10)==ntohs(port)) return ENOENT; + *res = se; return 0; } From 8c4be3e2209d2a1d3874b8bc2b474668fcbbbac6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 6 Sep 2017 21:59:22 -0400 Subject: [PATCH 360/412] fix glob descent into . and .. with GLOB_PERIOD GLOB_PERIOD is a gnu extension, and GNU glob does not seem to honor it except in the last path component. it's not clear whether this a bug or intentional, but it seems reasonable that it should exclude the special entries . and .. when walking. changes based on report and analysis by Julien Ramseier. --- src/regex/glob.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/regex/glob.c b/src/regex/glob.c index 2d4d562e..6f8425ca 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -100,6 +100,10 @@ static int match_in_dir(const char *d, const char *p, int flags, int (*errfunc)( continue; if (p2 && de->d_type && !S_ISDIR(de->d_type<<12) && !S_ISLNK(de->d_type<<12)) continue; + if (p2 && de->d_name[0]=='.' && !de->d_name[1]) + continue; + if (p2 && de->d_name[0]=='.' && de->d_name[1]=='.' && !de->d_name[2]) + continue; if (*d) { memcpy(name, d, l); name[l] = '/'; From da438ee1fc516c41ba1790cef7be551a9e244397 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 6 Sep 2017 22:09:28 -0400 Subject: [PATCH 361/412] work around incorrect EPERM from mmap syscall under some conditions, the mmap syscall wrongly fails with EPERM instead of ENOMEM when memory is exhausted; this is probably the result of the kernel trying to fit the allocation somewhere that crosses into the kernel range or below mmap_min_addr. in any case it's a conformance bug, so work around it. for now, only handle the case of anonymous mappings with no requested address; in other cases EPERM may be a legitimate error. this indirectly fixes the possibility of malloc failing with the wrong errno value. --- src/mman/mmap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mman/mmap.c b/src/mman/mmap.c index 19caadbd..15924033 100644 --- a/src/mman/mmap.c +++ b/src/mman/mmap.c @@ -14,6 +14,7 @@ weak_alias(dummy, __vm_wait); void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) { + long ret; if (off & OFF_MASK) { errno = EINVAL; return MAP_FAILED; @@ -26,10 +27,14 @@ void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) __vm_wait(); } #ifdef SYS_mmap2 - return (void *)syscall(SYS_mmap2, start, len, prot, flags, fd, off/UNIT); + ret = __syscall(SYS_mmap2, start, len, prot, flags, fd, off/UNIT); #else - return (void *)syscall(SYS_mmap, start, len, prot, flags, fd, off); + ret = __syscall(SYS_mmap, start, len, prot, flags, fd, off); #endif + /* Fixup incorrect EPERM from kernel. */ + if (ret == -EPERM && !start && (flags&MAP_ANON) && !(flags&MAP_FIXED)) + ret = -ENOMEM; + return (void *)__syscall_ret(ret); } weak_alias(__mmap, mmap); From c10bc61508dc52b8315084e628f36a6c3c2dabb1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 10 Sep 2017 13:34:54 +0200 Subject: [PATCH 362/412] powerpc{64}: fix MAP_NORESERVE and MAP_LOCKED in mman.h MAP_{NORESERVE,LOCKED} have different values on powerpc than in generic. --- arch/powerpc/bits/mman.h | 7 ++++++- arch/powerpc64/bits/mman.h | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h index b6a15a12..95ec4358 100644 --- a/arch/powerpc/bits/mman.h +++ b/arch/powerpc/bits/mman.h @@ -1,4 +1,9 @@ -#define PROT_SAO 0x10 +#define PROT_SAO 0x10 + +#undef MAP_NORESERVE +#define MAP_NORESERVE 0x40 +#undef MAP_LOCKED +#define MAP_LOCKED 0x80 #undef MCL_CURRENT #define MCL_CURRENT 0x2000 diff --git a/arch/powerpc64/bits/mman.h b/arch/powerpc64/bits/mman.h index f5974f82..95ec4358 100644 --- a/arch/powerpc64/bits/mman.h +++ b/arch/powerpc64/bits/mman.h @@ -1,5 +1,10 @@ #define PROT_SAO 0x10 +#undef MAP_NORESERVE +#define MAP_NORESERVE 0x40 +#undef MAP_LOCKED +#define MAP_LOCKED 0x80 + #undef MCL_CURRENT #define MCL_CURRENT 0x2000 #undef MCL_FUTURE From 48be5b6313d7b827acf555769e93b389fa9f6307 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 28 Sep 2017 12:57:06 -0400 Subject: [PATCH 363/412] fix use of memset without declaration in sched.h cpu set macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit patch by Jörg Krause. --- include/sched.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sched.h b/include/sched.h index d1cccb70..05d40b1e 100644 --- a/include/sched.h +++ b/include/sched.h @@ -72,6 +72,7 @@ int setns(int, int); void *memcpy(void *__restrict, const void *__restrict, size_t); int memcmp(const void *, const void *, size_t); +void *memset (void *, int, size_t); void *calloc(size_t, size_t); void free(void *); From e364774d7ca0a78db1b8457d5094b747eb2df318 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 13 Oct 2017 10:23:48 -0400 Subject: [PATCH 364/412] fix access by setjmp and longjmp to __hwcap on arm built as thumb2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is a subtle issue with how the assembler/linker work. for the adr pseudo-instruction used to find __hwcap, the assembler in thumb mode generates a 16-bit thumb add instruction which can only represent word-aligned addresses, despite not knowing the alignment of the label. if the setjmp function is assigned a non-multiple-of-4 address at link time, the load then loads from the wrong address (the last instruction rather than the data containing the offset) and ends up reading nonsense instead of the value of __hwcap. this in turn causes the checks for floating-point/vector register sets (e.g. IWMMX) to evaluate incorrectly, crashing when setjmp/longjmp try to save/restore those registers. fix based on bug report by Felix Hädicke. --- src/setjmp/arm/longjmp.s | 1 + src/setjmp/arm/setjmp.s | 1 + 2 files changed, 2 insertions(+) diff --git a/src/setjmp/arm/longjmp.s b/src/setjmp/arm/longjmp.s index 6191ab26..76cc2920 100644 --- a/src/setjmp/arm/longjmp.s +++ b/src/setjmp/arm/longjmp.s @@ -39,4 +39,5 @@ longjmp: 3: bx lr .hidden __hwcap +.align 2 1: .word __hwcap-1b diff --git a/src/setjmp/arm/setjmp.s b/src/setjmp/arm/setjmp.s index c6fe1bb2..011315b7 100644 --- a/src/setjmp/arm/setjmp.s +++ b/src/setjmp/arm/setjmp.s @@ -41,4 +41,5 @@ setjmp: 3: bx lr .hidden __hwcap +.align 2 1: .word __hwcap-1b From b3516058eb9ff9e52a8720f0e5c0f6936cce6047 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 13 Oct 2017 10:39:51 -0400 Subject: [PATCH 365/412] for executing init array functions, use function type with prototype this is for consistency with the way it's done in in the dynamic linker, avoiding a deprecated C feature (non-prototype function types), and improving code generation. GCC unnecessarily uses the variadic calling convention (e.g. clearing rax on x86_64) when making a call where the argument types are not known for compatibility with wrong code which calls variadic functions this way. (C on the other hand is clear that such calls have undefined behavior.) --- src/env/__libc_start_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c index 18afdc1d..2d758af7 100644 --- a/src/env/__libc_start_main.c +++ b/src/env/__libc_start_main.c @@ -58,7 +58,7 @@ static void libc_start_init(void) _init(); uintptr_t a = (uintptr_t)&__init_array_start; for (; a<(uintptr_t)&__init_array_end; a+=sizeof(void(*)())) - (*(void (**)())a)(); + (*(void (**)(void))a)(); } weak_alias(libc_start_init, __libc_start_init); From 907476925fca05f24ebca5fcdc21f1e58ba7b313 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 17 Sep 2017 17:31:20 +0000 Subject: [PATCH 366/412] math: rewrite fma with mostly int arithmetics the freebsd fma code failed to raise underflow exception in some cases in nearest rounding mode (affects fmal too) e.g. fma(-0x1p-1000, 0x1.000001p-74, 0x1p-1022) and the inexact exception may be raised spuriously since the fenv is not saved/restored around the exact multiplication algorithm (affects x86 fma too). another issue is that the underflow behaviour when the rounded result is the minimal normal number is target dependent, ieee754 allows two ways to raise underflow for inexact results: raise if the result before rounding is in the subnormal range (e.g. aarch64, arm, powerpc) or if the result after rounding with infinite exponent range is in the subnormal range (e.g. x86, mips, sh). to avoid all these issues the algorithm was rewritten with mostly int arithmetics and float arithmetics is only used to get correct rounding and raise exceptions according to the behaviour of the target without any fenv.h dependency. it also unifies x86 and non-x86 fma. fmaf is not affected, fmal need to be fixed too. this algorithm depends on a_clz_64 and it required a few spurious instructions to make sure underflow exception is raised in a particular corner case. (normally FORCE_EVAL(tiny*tiny) would be used for this, but on i386 gcc is broken if the expression is constant https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57245 and there is no easy portable fix for the macro.) --- src/math/fma.c | 589 +++++++++++++------------------------------------ 1 file changed, 156 insertions(+), 433 deletions(-) diff --git a/src/math/fma.c b/src/math/fma.c index 741ccd75..0c6f90c9 100644 --- a/src/math/fma.c +++ b/src/math/fma.c @@ -1,460 +1,183 @@ -#include -#include "libm.h" +#include +#include +#include +#include "atomic.h" -#if LDBL_MANT_DIG==64 && LDBL_MAX_EXP==16384 -/* exact add, assumes exponent_x >= exponent_y */ -static void add(long double *hi, long double *lo, long double x, long double y) +#define ASUINT64(x) ((union {double f; uint64_t i;}){x}).i +#define ZEROINFNAN (0x7ff-0x3ff-52-1) + +struct num { uint64_t m; int e; int sign; }; + +static struct num normalize(double x) { - long double r; - - r = x + y; - *hi = r; - r -= x; - *lo = y - r; -} - -/* exact mul, assumes no over/underflow */ -static void mul(long double *hi, long double *lo, long double x, long double y) -{ - static const long double c = 1.0 + 0x1p32L; - long double cx, xh, xl, cy, yh, yl; - - cx = c*x; - xh = (x - cx) + cx; - xl = x - xh; - cy = c*y; - yh = (y - cy) + cy; - yl = y - yh; - *hi = x*y; - *lo = (xh*yh - *hi) + xh*yl + xl*yh + xl*yl; -} - -/* -assume (long double)(hi+lo) == hi -return an adjusted hi so that rounding it to double (or less) precision is correct -*/ -static long double adjust(long double hi, long double lo) -{ - union ldshape uhi, ulo; - - if (lo == 0) - return hi; - uhi.f = hi; - if (uhi.i.m & 0x3ff) - return hi; - ulo.f = lo; - if ((uhi.i.se & 0x8000) == (ulo.i.se & 0x8000)) - uhi.i.m++; - else { - /* handle underflow and take care of ld80 implicit msb */ - if (uhi.i.m << 1 == 0) { - uhi.i.m = 0; - uhi.i.se--; - } - uhi.i.m--; + uint64_t ix = ASUINT64(x); + int e = ix>>52; + int sign = e & 0x800; + e &= 0x7ff; + if (!e) { + ix = ASUINT64(x*0x1p63); + e = ix>>52 & 0x7ff; + e = e ? e-63 : 0x800; } - return uhi.f; + ix &= (1ull<<52)-1; + ix |= 1ull<<52; + ix <<= 1; + e -= 0x3ff + 52 + 1; + return (struct num){ix,e,sign}; } -/* adjusted add so the result is correct when rounded to double (or less) precision */ -static long double dadd(long double x, long double y) +static void mul(uint64_t *hi, uint64_t *lo, uint64_t x, uint64_t y) { - add(&x, &y, x, y); - return adjust(x, y); -} + uint64_t t1,t2,t3; + uint64_t xlo = (uint32_t)x, xhi = x>>32; + uint64_t ylo = (uint32_t)y, yhi = y>>32; -/* adjusted mul so the result is correct when rounded to double (or less) precision */ -static long double dmul(long double x, long double y) -{ - mul(&x, &y, x, y); - return adjust(x, y); -} - -static int getexp(long double x) -{ - union ldshape u; - u.f = x; - return u.i.se & 0x7fff; + t1 = xlo*ylo; + t2 = xlo*yhi + xhi*ylo; + t3 = xhi*yhi; + *lo = t1 + (t2<<32); + *hi = t3 + (t2>>32) + (t1 > *lo); } double fma(double x, double y, double z) { #pragma STDC FENV_ACCESS ON - long double hi, lo1, lo2, xy; - int round, ez, exy; - /* handle +-inf,nan */ - if (!isfinite(x) || !isfinite(y)) + /* normalize so top 10bits and last bit are 0 */ + struct num nx, ny, nz; + nx = normalize(x); + ny = normalize(y); + nz = normalize(z); + + if (nx.e >= ZEROINFNAN || ny.e >= ZEROINFNAN) return x*y + z; - if (!isfinite(z)) + if (nz.e >= ZEROINFNAN) { + if (nz.e > ZEROINFNAN) /* z==0 */ + return x*y + z; return z; - /* handle +-0 */ - if (x == 0.0 || y == 0.0) - return x*y + z; - round = fegetround(); - if (z == 0.0) { - if (round == FE_TONEAREST) - return dmul(x, y); - return x*y; } - /* exact mul and add require nearest rounding */ - /* spurious inexact exceptions may be raised */ - fesetround(FE_TONEAREST); - mul(&xy, &lo1, x, y); - exy = getexp(xy); - ez = getexp(z); - if (ez > exy) { - add(&hi, &lo2, z, xy); - } else if (ez > exy - 12) { - add(&hi, &lo2, xy, z); - if (hi == 0) { - /* - xy + z is 0, but it should be calculated with the - original rounding mode so the sign is correct, if the - compiler does not support FENV_ACCESS ON it does not - know about the changed rounding mode and eliminates - the xy + z below without the volatile memory access - */ - volatile double z_; - fesetround(round); - z_ = z; - return (xy + z_) + lo1; + /* mul: r = x*y */ + uint64_t rhi, rlo, zhi, zlo; + mul(&rhi, &rlo, nx.m, ny.m); + /* either top 20 or 21 bits of rhi and last 2 bits of rlo are 0 */ + + /* align exponents */ + int e = nx.e + ny.e; + int d = nz.e - e; + /* shift bits z<<=kz, r>>=kr, so kz+kr == d, set e = e+kr (== ez-kz) */ + if (d > 0) { + if (d < 64) { + zlo = nz.m<>64-d; + } else { + zlo = 0; + zhi = nz.m; + e = nz.e - 64; + d -= 64; + if (d == 0) { + } else if (d < 64) { + rlo = rhi<<64-d | rlo>>d | !!(rlo<<64-d); + rhi = rhi>>d; + } else { + rlo = 1; + rhi = 0; + } } } else { - /* - ez <= exy - 12 - the 12 extra bits (1guard, 11round+sticky) are needed so with - lo = dadd(lo1, lo2) - elo <= ehi - 11, and we use the last 10 bits in adjust so - dadd(hi, lo) - gives correct result when rounded to double - */ - hi = xy; - lo2 = z; - } - /* - the result is stored before return for correct precision and exceptions - - one corner case is when the underflow flag should be raised because - the precise result is an inexact subnormal double, but the calculated - long double result is an exact subnormal double - (so rounding to double does not raise exceptions) - - in nearest rounding mode dadd takes care of this: the last bit of the - result is adjusted so rounding sees an inexact value when it should - - in non-nearest rounding mode fenv is used for the workaround - */ - fesetround(round); - if (round == FE_TONEAREST) - z = dadd(hi, dadd(lo1, lo2)); - else { -#if defined(FE_INEXACT) && defined(FE_UNDERFLOW) - int e = fetestexcept(FE_INEXACT); - feclearexcept(FE_INEXACT); -#endif - z = hi + (lo1 + lo2); -#if defined(FE_INEXACT) && defined(FE_UNDERFLOW) - if (getexp(z) < 0x3fff-1022 && fetestexcept(FE_INEXACT)) - feraiseexcept(FE_UNDERFLOW); - else if (e) - feraiseexcept(FE_INEXACT); -#endif - } - return z; -} -#else -/* origin: FreeBSD /usr/src/lib/msun/src/s_fma.c */ -/*- - * Copyright (c) 2005-2011 David Schultz - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * A struct dd represents a floating-point number with twice the precision - * of a double. We maintain the invariant that "hi" stores the 53 high-order - * bits of the result. - */ -struct dd { - double hi; - double lo; -}; - -/* - * Compute a+b exactly, returning the exact result in a struct dd. We assume - * that both a and b are finite, but make no assumptions about their relative - * magnitudes. - */ -static inline struct dd dd_add(double a, double b) -{ - struct dd ret; - double s; - - ret.hi = a + b; - s = ret.hi - a; - ret.lo = (a - (ret.hi - s)) + (b - s); - return (ret); -} - -/* - * Compute a+b, with a small tweak: The least significant bit of the - * result is adjusted into a sticky bit summarizing all the bits that - * were lost to rounding. This adjustment negates the effects of double - * rounding when the result is added to another number with a higher - * exponent. For an explanation of round and sticky bits, see any reference - * on FPU design, e.g., - * - * J. Coonen. An Implementation Guide to a Proposed Standard for - * Floating-Point Arithmetic. Computer, vol. 13, no. 1, Jan 1980. - */ -static inline double add_adjusted(double a, double b) -{ - struct dd sum; - union {double f; uint64_t i;} uhi, ulo; - - sum = dd_add(a, b); - if (sum.lo != 0) { - uhi.f = sum.hi; - if ((uhi.i & 1) == 0) { - /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ - ulo.f = sum.lo; - uhi.i += 1 - ((uhi.i ^ ulo.i) >> 62); - sum.hi = uhi.f; + zhi = 0; + d = -d; + if (d == 0) { + zlo = nz.m; + } else if (d < 64) { + zlo = nz.m>>d | !!(nz.m<<64-d); + } else { + zlo = 1; } } - return (sum.hi); -} -/* - * Compute ldexp(a+b, scale) with a single rounding error. It is assumed - * that the result will be subnormal, and care is taken to ensure that - * double rounding does not occur. - */ -static inline double add_and_denormalize(double a, double b, int scale) -{ - struct dd sum; - union {double f; uint64_t i;} uhi, ulo; - int bits_lost; + /* add */ + int sign = nx.sign^ny.sign; + int samesign = !(sign^nz.sign); + int nonzero = 1; + if (samesign) { + /* r += z */ + rlo += zlo; + rhi += zhi + (rlo < zlo); + } else { + /* r -= z */ + uint64_t t = rlo; + rlo -= zlo; + rhi = rhi - zhi - (t < rlo); + if (rhi>>63) { + rlo = -rlo; + rhi = -rhi-!!rlo; + sign = !sign; + } + nonzero = !!rhi; + } - sum = dd_add(a, b); + /* set rhi to top 63bit of the result (last bit is sticky) */ + if (nonzero) { + e += 64; + d = a_clz_64(rhi)-1; + /* note: d > 0 */ + rhi = rhi<>64-d | !!(rlo<>1 | (rlo&1); + else + rhi = rlo<> 52) & 0x7ff) - scale + 1; - if ((bits_lost != 1) ^ (int)(uhi.i & 1)) { - /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ - ulo.f = sum.lo; - uhi.i += 1 - (((uhi.i ^ ulo.i) >> 62) & 2); - sum.hi = uhi.f; + /* convert to double */ + int64_t i = rhi; /* i is in [1<<62,(1<<63)-1] */ + if (sign) + i = -i; + double r = i; /* |r| is in [0x1p62,0x1p63] */ + + if (e < -1022-62) { + /* result is subnormal before rounding */ + if (e == -1022-63) { + double c = 0x1p63; + if (sign) + c = -c; + if (r == c) { + /* min normal after rounding, underflow depends + on arch behaviour which can be imitated by + a double to float conversion */ + float fltmin = 0x0.ffffff8p-63*FLT_MIN * r; + return DBL_MIN/FLT_MIN * fltmin; + } + /* one bit is lost when scaled, add another top bit to + only round once at conversion if it is inexact */ + if (rhi << 53) { + i = rhi>>1 | (rhi&1) | 1ull<<62; + if (sign) + i = -i; + r = i; + r = 2*r - c; /* remove top bit */ + + /* raise underflow portably, such that it + cannot be optimized away */ + { + double_t tiny = DBL_MIN/FLT_MIN * r; + r += (double)(tiny*tiny) * (r-r); + } + } + } else { + /* only round once when scaled */ + d = 10; + i = ( rhi>>d | !!(rhi<<64-d) ) << d; + if (sign) + i = -i; + r = i; } } - return scalbn(sum.hi, scale); + return scalbn(r, e); } - -/* - * Compute a*b exactly, returning the exact result in a struct dd. We assume - * that both a and b are normalized, so no underflow or overflow will occur. - * The current rounding mode must be round-to-nearest. - */ -static inline struct dd dd_mul(double a, double b) -{ - static const double split = 0x1p27 + 1.0; - struct dd ret; - double ha, hb, la, lb, p, q; - - p = a * split; - ha = a - p; - ha += p; - la = a - ha; - - p = b * split; - hb = b - p; - hb += p; - lb = b - hb; - - p = ha * hb; - q = ha * lb + la * hb; - - ret.hi = p + q; - ret.lo = p - ret.hi + q + la * lb; - return (ret); -} - -/* - * Fused multiply-add: Compute x * y + z with a single rounding error. - * - * We use scaling to avoid overflow/underflow, along with the - * canonical precision-doubling technique adapted from: - * - * Dekker, T. A Floating-Point Technique for Extending the - * Available Precision. Numer. Math. 18, 224-242 (1971). - * - * This algorithm is sensitive to the rounding precision. FPUs such - * as the i387 must be set in double-precision mode if variables are - * to be stored in FP registers in order to avoid incorrect results. - * This is the default on FreeBSD, but not on many other systems. - * - * Hardware instructions should be used on architectures that support it, - * since this implementation will likely be several times slower. - */ -double fma(double x, double y, double z) -{ - #pragma STDC FENV_ACCESS ON - double xs, ys, zs, adj; - struct dd xy, r; - int oround; - int ex, ey, ez; - int spread; - - /* - * Handle special cases. The order of operations and the particular - * return values here are crucial in handling special cases involving - * infinities, NaNs, overflows, and signed zeroes correctly. - */ - if (!isfinite(x) || !isfinite(y)) - return (x * y + z); - if (!isfinite(z)) - return (z); - if (x == 0.0 || y == 0.0) - return (x * y + z); - if (z == 0.0) - return (x * y); - - xs = frexp(x, &ex); - ys = frexp(y, &ey); - zs = frexp(z, &ez); - oround = fegetround(); - spread = ex + ey - ez; - - /* - * If x * y and z are many orders of magnitude apart, the scaling - * will overflow, so we handle these cases specially. Rounding - * modes other than FE_TONEAREST are painful. - */ - if (spread < -DBL_MANT_DIG) { -#ifdef FE_INEXACT - feraiseexcept(FE_INEXACT); -#endif -#ifdef FE_UNDERFLOW - if (!isnormal(z)) - feraiseexcept(FE_UNDERFLOW); -#endif - switch (oround) { - default: /* FE_TONEAREST */ - return (z); -#ifdef FE_TOWARDZERO - case FE_TOWARDZERO: - if (x > 0.0 ^ y < 0.0 ^ z < 0.0) - return (z); - else - return (nextafter(z, 0)); -#endif -#ifdef FE_DOWNWARD - case FE_DOWNWARD: - if (x > 0.0 ^ y < 0.0) - return (z); - else - return (nextafter(z, -INFINITY)); -#endif -#ifdef FE_UPWARD - case FE_UPWARD: - if (x > 0.0 ^ y < 0.0) - return (nextafter(z, INFINITY)); - else - return (z); -#endif - } - } - if (spread <= DBL_MANT_DIG * 2) - zs = scalbn(zs, -spread); - else - zs = copysign(DBL_MIN, zs); - - fesetround(FE_TONEAREST); - - /* - * Basic approach for round-to-nearest: - * - * (xy.hi, xy.lo) = x * y (exact) - * (r.hi, r.lo) = xy.hi + z (exact) - * adj = xy.lo + r.lo (inexact; low bit is sticky) - * result = r.hi + adj (correctly rounded) - */ - xy = dd_mul(xs, ys); - r = dd_add(xy.hi, zs); - - spread = ex + ey; - - if (r.hi == 0.0) { - /* - * When the addends cancel to 0, ensure that the result has - * the correct sign. - */ - fesetround(oround); - volatile double vzs = zs; /* XXX gcc CSE bug workaround */ - return xy.hi + vzs + scalbn(xy.lo, spread); - } - - if (oround != FE_TONEAREST) { - /* - * There is no need to worry about double rounding in directed - * rounding modes. - * But underflow may not be raised properly, example in downward rounding: - * fma(0x1.000000001p-1000, 0x1.000000001p-30, -0x1p-1066) - */ - double ret; -#if defined(FE_INEXACT) && defined(FE_UNDERFLOW) - int e = fetestexcept(FE_INEXACT); - feclearexcept(FE_INEXACT); -#endif - fesetround(oround); - adj = r.lo + xy.lo; - ret = scalbn(r.hi + adj, spread); -#if defined(FE_INEXACT) && defined(FE_UNDERFLOW) - if (ilogb(ret) < -1022 && fetestexcept(FE_INEXACT)) - feraiseexcept(FE_UNDERFLOW); - else if (e) - feraiseexcept(FE_INEXACT); -#endif - return ret; - } - - adj = add_adjusted(r.lo, xy.lo); - if (spread + ilogb(r.hi) > -1023) - return scalbn(r.hi + adj, spread); - else - return add_and_denormalize(r.hi, adj, spread); -} -#endif From c1e27367a9b26b9baac0f37a12349fc36567c8b6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 13 Oct 2017 23:00:34 -0400 Subject: [PATCH 367/412] fix read-after-free type error in pthread_detach calling __unlock on t->exitlock is not valid because __unlock reads the waiters count after making the atomic store that could allow pthread_exit to continue and unmap the thread's stack and the object t points to. for now, inline the __unlock logic with an unconditional futex wake operation so that the waiters count is not needed. once __lock/__unlock have been made safe for self-synchronized destruction, we could switch back to using them. --- src/thread/pthread_detach.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c index ed77f74d..13482607 100644 --- a/src/thread/pthread_detach.c +++ b/src/thread/pthread_detach.c @@ -9,7 +9,8 @@ static int __pthread_detach(pthread_t t) if (a_swap(t->exitlock, 1)) return __pthread_join(t, 0); t->detached = 2; - __unlock(t->exitlock); + a_store(t->exitlock, 0); + __wake(t->exitlock, 1, 1); return 0; } From 5b5eb527c5ed5ca2786bf82892a04ca3bdf33d31 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 13 Oct 2017 23:08:21 -0400 Subject: [PATCH 368/412] fix incorrect base name offset from nftw when pathname ends in slash(es) the rightmost '/' character is not necessarily the delimiter before the basename; it could be a spurious trailing character on the directory name. this change does not introduce any normalization of pathnames or stripping of trailing slashes, contrary to at least glibc and perhaps other implementations; it jusst prevents their presence from breaking things. whether further changes should be made is an open question that may depend on conformance and/or application compatibility considerations. based loosely on patch by Joakim Sindholt. --- src/misc/nftw.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/misc/nftw.c b/src/misc/nftw.c index efb2b895..eb9014bc 100644 --- a/src/misc/nftw.c +++ b/src/misc/nftw.c @@ -28,7 +28,6 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, int type; int r; struct FTW lev; - char *name; if ((flags & FTW_PHYS) ? lstat(path, &st) : stat(path, &st) < 0) { if (!(flags & FTW_PHYS) && errno==ENOENT && !lstat(path, &st)) @@ -53,10 +52,17 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, new.dev = st.st_dev; new.ino = st.st_ino; new.level = h ? h->level+1 : 0; - new.base = l+1; + new.base = j+1; lev.level = new.level; - lev.base = h ? h->base : (name=strrchr(path, '/')) ? name-path : 0; + if (h) { + lev.base = h->base; + } else { + size_t k; + for (k=j; k && path[k]=='/'; k--); + for (; k && path[k-1]!='/'; k--); + lev.base = k; + } if (!(flags & FTW_DEPTH) && (r=fn(path, &st, type, &lev))) return r; From 45ca5d3fcb6f874bf5ba55d0e9651cef68515395 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 18 Oct 2017 14:50:03 -0400 Subject: [PATCH 369/412] in dns parsing callback, enforce MAXADDRS to preclude overflow MAXADDRS was chosen not to need enforcement, but the logic used to compute it assumes the answers received match the RR types of the queries. specifically, it assumes that only one replu contains A record answers. if the replies to both the A and the AAAA query have their answer sections filled with A records, MAXADDRS can be exceeded and clobber the stack of the calling function. this bug was found and reported by Felix Wilhelm. --- src/network/lookup_name.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index 066be4d5..209c20f0 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -111,6 +111,7 @@ static int dns_parse_callback(void *c, int rr, const void *data, int len, const { char tmp[256]; struct dpc_ctx *ctx = c; + if (ctx->cnt >= MAXADDRS) return -1; switch (rr) { case RR_A: if (len != 4) return -1; From 2cd663fb2d576d590a08c1e40386c07b378d5ad6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 19 Oct 2017 15:39:01 -0400 Subject: [PATCH 370/412] release 1.1.17 --- VERSION | 2 +- WHATSNEW | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 63b283b2..cbb8cbae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.16 +1.1.17 diff --git a/WHATSNEW b/WHATSNEW index d5433367..bab432d6 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1776,3 +1776,79 @@ arch-specific bugs fixed: - wrong pread/pwrite syscall calling convention on sh - wrong preadv2/pwritev2 syscall numbers on x32 - mrand48/jrand48 produced wrong-signedness results on 64-bit archs + + +1.1.17 release notes + +new features: +- RTLD_LAZY deferred symbol binding, functionally equivalent to lazy binding +- safeguard against dlopen of multiple libc versions/instances +- new posix_spawn flag POSIX_SPAWN_SETSID +- posix_spawnattr_setflags now reports unknown flags as error +- ldso option --argv0 to set argv[0] +- added _NL_LOCALE_NAME extension to nl_langinfo + +compatibility: +- dlopen local-to-global promotion no longer changes existing symbols +- gettext now searches locale name variants for translation files +- increased locale name length limit from 15 to 23 bytes +- setlocale(LC_ALL, 0) returns single name if all categories are same +- realloc no longer fails when mremap doesn't work +- getservby* no longer treat numeric port strings as service records +- mmap now works around incorrect EPERM error codes from kernel +- impact of REG_* namespace pollution in x86[_64] signal.h is reduced +- arm atomic asm now assembles correctly with new binutils +- PAGE_SIZE on arm is no longer constant (quiet upstream ABI relaxation) +- lsearch/lfind now pass args to compare callback in canonical order +- STB_WEAK and STB_GNU_UNIQUE symbols now behave same as STB_GLOBAL +- better clang CFLAGS checks in configure +- global vis.h hack, which made lld refuse to link to libc.so, is disabled + +performance: +- single-instruction optimized math functions for aarch64, s390x, powerpc64 +- fast path for ASCII in towupper/towlower +- new mostly-integer-math fma function + +semantic bugs fixed: +- POSIX-format TZ dst time transitions were wrong for southern hemisphere +- regex REG_NEWLINE semantics were wrong with negated brackets +- various bugs in strptime %j, %p, %C formats +- iconv mapped some characters to legacy 8bit encodings incorrectly +- glob failed to match "/" +- UTF-8 decoder accepted invalid f4 9x xx xx code sequences +- scanf %% conversion failed to consume whitespace +- glob with GLOB_PERIOD wrongly descended into . and .. +- nftw gave incorrect base name offset when pathname ends in "/" +- functional regression in resolv.conf attempts option +- scalbn could produce wrong result due to double rounding in subnormal range +- strftime %y format wrong with negative years +- mbsnrtowcs and wcsnrtombs mishandled input limits +- minor issues with error codes for various functions + +safety/consistency bugs fixed: +- stack-based buffer overflow in dns response processing +- invalid free in regexec on certain error paths +- invalid free in globfree after failed glob +- one-byte buffer overflow in legacy getpass function +- failed dlopen corrupted thread-local storage module list +- race in pthread_create with priority attributes could leave signals masked +- multithreaded set*id() functions could induce spurious EINTRs +- dl_iterate_phdr reported wrong base address in static PIE +- fd leak and wrong cancellation state after dns socket failure +- memory leaks and other issues in environment-modification functions +- read-after-free race in pthread_detach +- memmem performed single-byte over-read in short-needle code paths +- read via uninitialized pointer in gettext core +- bindtextdomain broke bindings for all other domains +- various silent undefined behavior +- getopt clobbered optopt on success + +arch-specific bugs fixed: +- x32 dynamic TLS accesses crashed +- s390x was missing dlsym entry point (needed for RTLD_NEXT) +- powerpc64 ldso startup could crash depending on link order +- powerpc64 setjmp/longjmp didn't properly save/restore TOC pointer +- thumb2 setjmp/longjmp silently broke at ld-time with text not aligned +- fchown was broken on archs without SYS_fchown syscall +- fstatat was broken on mips64 +- various incorrect constants in powerpc64 and mips headers From 004dc9549b8003288e635ba5aa91e3353e1974c4 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 14 Sep 2017 16:32:59 -0500 Subject: [PATCH 371/412] posix_spawn: use larger stack to cover worst-case in execvpe execvpe stack-allocates a buffer used to hold the full path (combination of a PATH entry and the program name) while searching through $PATH, so at least NAME_MAX+PATH_MAX is needed. The stack size can be made conditionally smaller (the current 1024 appears appropriate) should this larger size be burdensome in those situations. --- src/process/posix_spawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c index ea5d2998..0849c71f 100644 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -152,7 +152,7 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path, char *const argv[restrict], char *const envp[restrict]) { pid_t pid; - char stack[1024]; + char stack[1024+PATH_MAX]; int ec=0, cs; struct args args; From ec04d122f1182aeb91f39b0e80ae40c68e4d9605 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 21 Oct 2017 12:17:49 -0400 Subject: [PATCH 372/412] fix regression in glob with literal . or .. path component commit 8c4be3e2209d2a1d3874b8bc2b474668fcbbbac6 was written to preclude the GLOB_PERIOD extension from matching these directory entries, but also precluded literal matches. adjust the check that excludes . and .. to check whether the GLOB_PERIOD flag is in effect, so that it cannot alter behavior in cases governed by the standard, and also don't exclude . or .. in any case where normal glob behavior (fnmatch's FNM_PERIOD flag) would have included one or both of them (patterns such as ".*"). it's still not clear whether this is the preferred behavior for GLOB_PERIOD, but at least it's clear that it can no longer break applications which are not relying on quirks of a nonstandard feature. --- src/regex/glob.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/regex/glob.c b/src/regex/glob.c index 6f8425ca..85671985 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -100,9 +100,11 @@ static int match_in_dir(const char *d, const char *p, int flags, int (*errfunc)( continue; if (p2 && de->d_type && !S_ISDIR(de->d_type<<12) && !S_ISLNK(de->d_type<<12)) continue; - if (p2 && de->d_name[0]=='.' && !de->d_name[1]) - continue; - if (p2 && de->d_name[0]=='.' && de->d_name[1]=='.' && !de->d_name[2]) + /* With GLOB_PERIOD, don't allow matching . or .. unless + * fnmatch would match them with FNM_PERIOD rules in effect. */ + if (p2 && (flags & GLOB_PERIOD) && de->d_name[0]=='.' + && (!de->d_name[1] || de->d_name[1]=='.' && !de->d_name[2]) + && fnmatch(p, de->d_name, fnm_flags | FNM_PERIOD)) continue; if (*d) { memcpy(name, d, l); From 1b9406b03c0a94ebe2076a8fc1746a8c45e78a83 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 25 Oct 2017 11:54:16 -0400 Subject: [PATCH 373/412] fix build regression on ARM for ISA levels less than v5 commit 06fbefd10046a0fae7e588b7c6d25fb51811b931 (first included in release 1.1.17) introduced this regression. patch by Adrian Bunk. it fixes the regression in all cases, but spuriously prevents use of the clz instruction on very old compiler versions that don't define __ARM_ARCH. this may be fixed in a more general way at some point in the future. it also omits thumb1 logic since building as thumb1 code is currently not supported. --- arch/arm/atomic_arch.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index a121010f..c5c56f81 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -82,9 +82,13 @@ static inline void a_crash() : : : "memory"); } +#if __ARM_ARCH >= 5 + #define a_clz_32 a_clz_32 static inline int a_clz_32(uint32_t x) { __asm__ ("clz %0, %1" : "=r"(x) : "r"(x)); return x; } + +#endif From eb03bde2f24582874cb72b56c7811bf51da0c817 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 31 Oct 2017 15:13:58 -0400 Subject: [PATCH 374/412] release 1.1.18 --- VERSION | 2 +- WHATSNEW | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index cbb8cbae..852ed67c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.17 +1.1.18 diff --git a/WHATSNEW b/WHATSNEW index bab432d6..3d2fefa1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1852,3 +1852,13 @@ arch-specific bugs fixed: - fchown was broken on archs without SYS_fchown syscall - fstatat was broken on mips64 - various incorrect constants in powerpc64 and mips headers + + +1.1.18 release notes + +regression fixes: +- glob failed to match literal . and .. path components +- build for armv4t ISA level was broken + +other bug fixes: +- stack overflow in posix_spawnp with large PATH variable in environment From 6fc6ca1a323bc0b6b9e9cdc8fa72221ae18fe206 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 5 Nov 2017 17:26:48 -0500 Subject: [PATCH 375/412] adjust posix_spawn dup2 action behavior to match future requirements the resolution to Austin Group issue #411 defined new semantics for the posix_spawn dup2 file action in the (previously useless) case where src and dest fd are equal. future issues will require the dup2 file action to remove the close-on-exec flag. without this change, passing fds to a child with posix_spawn while avoiding fd-leak races in a multithreaded parent required a complex dance with temporary fds. based on patch by Petr Skocik. changes were made to preserve the 80-column formatting of the function and to remove code that became unreachable as a result of the new functionality. --- src/process/posix_spawn.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c index 0849c71f..93fb1555 100644 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -27,12 +27,7 @@ static int __sys_dup2(int old, int new) #ifdef SYS_dup2 return __syscall(SYS_dup2, old, new); #else - if (old==new) { - int r = __syscall(SYS_fcntl, old, F_GETFD); - return r<0 ? r : old; - } else { - return __syscall(SYS_dup3, old, new, 0); - } + return __syscall(SYS_dup3, old, new, 0); #endif } @@ -109,8 +104,17 @@ static int child(void *args_vp) __syscall(SYS_close, op->fd); break; case FDOP_DUP2: - if ((ret=__sys_dup2(op->srcfd, op->fd))<0) - goto fail; + fd = op->srcfd; + if (fd != op->fd) { + if ((ret=__sys_dup2(fd, op->fd))<0) + goto fail; + } else { + ret = __syscall(SYS_fcntl, fd, F_GETFD); + ret = __syscall(SYS_fcntl, fd, F_SETFD, + ret & ~FD_CLOEXEC); + if (ret<0) + goto fail; + } break; case FDOP_OPEN: fd = __sys_open(op->path, op->oflag, op->mode); From 5c596ed8673836109d5f63a9eaa35d1196b96882 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 5 Mar 2017 20:51:23 +0000 Subject: [PATCH 376/412] add SCM_TIMESTAMPING_OPT_STATS and related TCP_ enums from linux v4.10 for tcp timestamp control messages, new in linux commit 1c885808e45601b2b6f68b30ac1d999e10b6f606 and export time measurements via tcp_info, added in linux commit efd90174167530c67a54273fd5d8369c87f9bd32 --- include/netinet/tcp.h | 10 ++++++++++ include/sys/socket.h | 1 + 2 files changed, 11 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 1339fcc3..935107a5 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -44,6 +44,13 @@ #define TCP_LISTEN 10 #define TCP_CLOSING 11 +enum { + TCP_NLA_PAD, + TCP_NLA_BUSY, + TCP_NLA_RWND_LIMITED, + TCP_NLA_SNDBUF_LIMITED, +}; + #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define TCPOPT_EOL 0 #define TCPOPT_NOP 1 @@ -190,6 +197,9 @@ struct tcp_info { uint32_t tcpi_data_segs_in; uint32_t tcpi_data_segs_out; uint64_t tcpi_delivery_rate; + uint64_t tcpi_busy_time; + uint64_t tcpi_rwnd_limited; + uint64_t tcpi_sndbuf_limited; }; #define TCP_MD5SIG_MAXKEYLEN 80 diff --git a/include/sys/socket.h b/include/sys/socket.h index 8664779a..acb6ee0b 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -224,6 +224,7 @@ struct linger { #define SO_ATTACH_REUSEPORT_CBPF 51 #define SO_ATTACH_REUSEPORT_EBPF 52 #define SO_CNX_ADVICE 53 +#define SCM_TIMESTAMPING_OPT_STATS 54 #ifndef SOL_SOCKET #define SOL_SOCKET 1 From 013696918bc9e8b879ddb6f1fa7b3686eef6e702 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 5 Mar 2017 22:58:13 +0000 Subject: [PATCH 377/412] add IP_RECVFRAGSIZE and IPV6_RECVFRAGSIZE from linux v4.10 added in linux commit 70ecc24841326396a827deb55c3fefac582a729d --- include/netinet/in.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/netinet/in.h b/include/netinet/in.h index 84982f5e..f18b478d 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -200,6 +200,7 @@ uint16_t ntohs(uint16_t); #define IP_NODEFRAG 22 #define IP_CHECKSUM 23 #define IP_BIND_ADDRESS_NO_PORT 24 +#define IP_RECVFRAGSIZE 25 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 @@ -361,6 +362,7 @@ struct ip6_mtuinfo { #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR #define IPV6_TRANSPARENT 75 #define IPV6_UNICAST_IF 76 +#define IPV6_RECVFRAGSIZE 77 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP From f5638c22e3599a720f80da76f2827e5b0f6383ae Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 5 Mar 2017 23:21:30 +0000 Subject: [PATCH 378/412] add ETH_MIN_MTU and ETH_MAX_MTU from linux v4.10 min max mtu size definitions mostly for drivers. new in linux commits a52ad514fdf3b8a57ca4322c92d2d8d5c6182485 and d894be57ca92c8a8819ab544d550809e8731137b --- include/netinet/if_ether.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 11ee6582..c52514c5 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -10,6 +10,8 @@ #define ETH_DATA_LEN 1500 #define ETH_FRAME_LEN 1514 #define ETH_FCS_LEN 4 +#define ETH_MIN_MTU 68 +#define ETH_MAX_MTU 0xFFFFU #define ETH_P_LOOP 0x0060 #define ETH_P_PUP 0x0200 From d800403032b17b266430f0679c71f032de430197 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 5 Mar 2017 23:54:52 +0000 Subject: [PATCH 379/412] add TFD_TIMER_CANCEL_ON_SET that timerfd.h was missing linux commit 575b1967e10a1f3038266244d2c7a3ca6b99fed8 moved timerfd apis to a new uapi header which showed musl was missing this flag. --- include/sys/timerfd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/timerfd.h b/include/sys/timerfd.h index 9724d903..2794d36a 100644 --- a/include/sys/timerfd.h +++ b/include/sys/timerfd.h @@ -12,6 +12,7 @@ extern "C" { #define TFD_CLOEXEC O_CLOEXEC #define TFD_TIMER_ABSTIME 1 +#define TFD_TIMER_CANCEL_ON_SET (1 << 1) struct itimerspec; From 8f5695571322868d89620fca0dc05ffc37bbc040 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 6 Mar 2017 00:18:37 +0000 Subject: [PATCH 380/412] add microblaze syscall numbers from linux v4.10 missing syscalls got allocated on microblaze. --- arch/microblaze/bits/syscall.h.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index e5f928e3..251c2f61 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -386,4 +386,10 @@ #define __NR_userfaultfd 389 #define __NR_membarrier 390 #define __NR_mlock2 391 +#define __NR_copy_file_range 392 +#define __NR_preadv2 393 +#define __NR_pwritev2 394 +#define __NR_pkey_mprotect 395 +#define __NR_pkey_alloc 396 +#define __NR_pkey_free 397 From cee73f0c10535f87e3e108697a4af5453f5f04c0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 6 Mar 2017 00:28:33 +0000 Subject: [PATCH 381/412] add kexec_file_load syscall number on powerpc from linux v4.10 added in linux commit 80f60e509a03ff9ff2bdbf9cd1e935c6360b8bd9 --- arch/powerpc/bits/syscall.h.in | 1 + arch/powerpc64/bits/syscall.h.in | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index 35f7033e..d537a1dc 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -366,4 +366,5 @@ #define __NR_copy_file_range 379 #define __NR_preadv2 380 #define __NR_pwritev2 381 +#define __NR_kexec_file_load 382 diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in index c9880fa2..9907ae9b 100644 --- a/arch/powerpc64/bits/syscall.h.in +++ b/arch/powerpc64/bits/syscall.h.in @@ -357,4 +357,5 @@ #define __NR_copy_file_range 379 #define __NR_preadv2 380 #define __NR_pwritev2 381 +#define __NR_kexec_file_load 382 From bd1560f6eb5127501ad6b7905479b4135c3d1a02 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 17 Jun 2017 21:23:57 +0000 Subject: [PATCH 382/412] update aarch64 hwcap.h for linux v4.11 new hwcap bits were added in kernel commits 77c97b4ee21290f5f083173d957843b615abbff2 f92f5ce01ee6a6a86cbfc4e3b0d18529c302b1ea --- arch/aarch64/bits/hwcap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/aarch64/bits/hwcap.h b/arch/aarch64/bits/hwcap.h index 2b923f71..26c14545 100644 --- a/arch/aarch64/bits/hwcap.h +++ b/arch/aarch64/bits/hwcap.h @@ -9,3 +9,5 @@ #define HWCAP_ATOMICS (1 << 8) #define HWCAP_FPHP (1 << 9) #define HWCAP_ASIMDHP (1 << 10) +#define HWCAP_CPUID (1 << 11) +#define HWCAP_ASIMDRDM (1 << 12) From 3eb82f7338e74a5b2f1de6a62a72927452b327a2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 17 Jun 2017 21:40:15 +0000 Subject: [PATCH 383/412] add ETH_P_IBOE from linux v4.11 new in linux commit 69ae543969abeba48e04dd93277684c8c0895f3b --- include/netinet/if_ether.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index c52514c5..d9a131aa 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -63,6 +63,7 @@ #define ETH_P_FCOE 0x8906 #define ETH_P_TDLS 0x890D #define ETH_P_FIP 0x8914 +#define ETH_P_IBOE 0x8915 #define ETH_P_80221 0x8917 #define ETH_P_HSR 0x892F #define ETH_P_LOOPBACK 0x9000 From ee3ae7827b00c734a3c32839fb1427015900e598 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 17 Jun 2017 21:45:03 +0000 Subject: [PATCH 384/412] add TCP_FASTOPEN_CONNECT tcp socket option from linux v4.11 new in linux commit 19f6d3f3c8422d65b5e3d2162e30ef07c6e21ea2 --- include/netinet/tcp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 935107a5..b85844c8 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -31,6 +31,7 @@ #define TCP_SAVE_SYN 27 #define TCP_SAVED_SYN 28 #define TCP_REPAIR_WINDOW 29 +#define TCP_FASTOPEN_CONNECT 30 #define TCP_ESTABLISHED 1 #define TCP_SYN_SENT 2 From c519658ceaf19e1e080ae337a79b56d37dae271c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 17 Jun 2017 21:50:03 +0000 Subject: [PATCH 385/412] add TCP_NLA_* enums from linux v4.11 two new stats for SCM_TIMESTAMPING_OPT_STATS, added in linux commit 7e98102f489775d8c000884fca8a0d995ea688a9 --- include/netinet/tcp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index b85844c8..652418be 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -50,6 +50,8 @@ enum { TCP_NLA_BUSY, TCP_NLA_RWND_LIMITED, TCP_NLA_SNDBUF_LIMITED, + TCP_NLA_DATA_SEGS_OUT, + TCP_NLA_TOTAL_RETRANS, }; #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) From 9864f60e929100e253fc813bd4105d6dd7652787 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Jul 2017 19:22:31 +0000 Subject: [PATCH 386/412] add statx syscall numbers from linux v4.11 statx was added in linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (there is no libc wrapper yet and microblaze and sh misses the number). --- arch/aarch64/bits/syscall.h.in | 1 + arch/arm/bits/syscall.h.in | 1 + arch/i386/bits/syscall.h.in | 1 + arch/mips/bits/syscall.h.in | 1 + arch/mips64/bits/syscall.h.in | 1 + arch/mipsn32/bits/syscall.h.in | 1 + arch/or1k/bits/syscall.h.in | 1 + arch/powerpc/bits/syscall.h.in | 1 + arch/powerpc64/bits/syscall.h.in | 1 + arch/s390x/bits/syscall.h.in | 1 + arch/x32/bits/syscall.h.in | 1 + arch/x86_64/bits/syscall.h.in | 1 + 12 files changed, 12 insertions(+) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index 8b56afff..0d4a9bca 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -273,4 +273,5 @@ #define __NR_pkey_mprotect 288 #define __NR_pkey_alloc 289 #define __NR_pkey_free 290 +#define __NR_statx 291 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index 0096fe7c..c594152e 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -352,6 +352,7 @@ #define __NR_pkey_mprotect 394 #define __NR_pkey_alloc 395 #define __NR_pkey_free 396 +#define __NR_statx 397 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index 1217f89a..b556d83b 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -380,4 +380,5 @@ #define __NR_pkey_mprotect 380 #define __NR_pkey_alloc 381 #define __NR_pkey_free 382 +#define __NR_statx 383 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index 1a2147a7..c1e23635 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -363,4 +363,5 @@ #define __NR_pkey_mprotect 4363 #define __NR_pkey_alloc 4364 #define __NR_pkey_free 4365 +#define __NR_statx 4366 diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in index a207133c..b0fe49b5 100644 --- a/arch/mips64/bits/syscall.h.in +++ b/arch/mips64/bits/syscall.h.in @@ -323,4 +323,5 @@ #define __NR_pkey_mprotect 5323 #define __NR_pkey_alloc 5324 #define __NR_pkey_free 5325 +#define __NR_statx 5326 diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index cd843a76..70c5d0b8 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -327,4 +327,5 @@ #define __NR_pkey_mprotect 6327 #define __NR_pkey_alloc 6328 #define __NR_pkey_free 6329 +#define __NR_statx 6330 diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index 54581fb4..03735e88 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -275,4 +275,5 @@ #define __NR_pkey_mprotect 288 #define __NR_pkey_alloc 289 #define __NR_pkey_free 290 +#define __NR_statx 291 diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index d537a1dc..20833915 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -367,4 +367,5 @@ #define __NR_preadv2 380 #define __NR_pwritev2 381 #define __NR_kexec_file_load 382 +#define __NR_statx 383 diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in index 9907ae9b..936f43c0 100644 --- a/arch/powerpc64/bits/syscall.h.in +++ b/arch/powerpc64/bits/syscall.h.in @@ -358,4 +358,5 @@ #define __NR_preadv2 380 #define __NR_pwritev2 381 #define __NR_kexec_file_load 382 +#define __NR_statx 383 diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in index 1b8fdf0c..bb1c0f4d 100644 --- a/arch/s390x/bits/syscall.h.in +++ b/arch/s390x/bits/syscall.h.in @@ -320,4 +320,5 @@ #define __NR_copy_file_range 375 #define __NR_preadv2 376 #define __NR_pwritev2 377 +#define __NR_statx 379 diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index de6cffe0..23ef4472 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -283,6 +283,7 @@ #define __NR_pkey_mprotect (0x40000000 + 329) #define __NR_pkey_alloc (0x40000000 + 330) #define __NR_pkey_free (0x40000000 + 331) +#define __NR_statx (0x40000000 + 332) #define __NR_rt_sigaction (0x40000000 + 512) #define __NR_rt_sigreturn (0x40000000 + 513) diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in index 6e743dfb..bffcc4ee 100644 --- a/arch/x86_64/bits/syscall.h.in +++ b/arch/x86_64/bits/syscall.h.in @@ -330,4 +330,5 @@ #define __NR_pkey_mprotect 329 #define __NR_pkey_alloc 330 #define __NR_pkey_free 331 +#define __NR_statx 332 From 54f04d9991c000c7f46eed3dd85b741d840e7164 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Jul 2017 18:39:21 +0000 Subject: [PATCH 387/412] add new SO_ socket options from linux v4.12 SO_MEMINFO added in linux commit a2d133b1d465016d0d97560b11f54ba0ace56d3e SO_INCOMING_NAPI_ID added in 6d4339028b350efbf87c61e6d9e113e5373545c9 SO_COOKIE added in 5daab9db7b65df87da26fd8cfa695fb9546a1ddb --- include/sys/socket.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index acb6ee0b..bcaf87f9 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -225,6 +225,9 @@ struct linger { #define SO_ATTACH_REUSEPORT_EBPF 52 #define SO_CNX_ADVICE 53 #define SCM_TIMESTAMPING_OPT_STATS 54 +#define SO_MEMINFO 55 +#define SO_INCOMING_NAPI_ID 56 +#define SO_COOKIE 57 #ifndef SOL_SOCKET #define SOL_SOCKET 1 From 4c811227110ddeb1ccd03ce295a6e8f6ccb905ea Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 9 Jul 2017 18:51:36 +0000 Subject: [PATCH 388/412] add ARPHDR_VSOCKMON from linux v4.12 new in linux commit 531b374834c891ae2abf800693074df35a7d1a36 --- include/net/if_arp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/if_arp.h b/include/net/if_arp.h index 361ecfc9..c832ff95 100644 --- a/include/net/if_arp.h +++ b/include/net/if_arp.h @@ -92,6 +92,7 @@ struct arphdr { #define ARPHRD_IP6GRE 823 #define ARPHRD_NETLINK 824 #define ARPHRD_6LOWPAN 825 +#define ARPHRD_VSOCKMON 826 #define ARPHRD_VOID 0xFFFF #define ARPHRD_NONE 0xFFFE From 840d45bebd3558cf72ebab6368620a7919641e1d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 9 Sep 2017 09:13:27 +0000 Subject: [PATCH 389/412] aarch64: add new HWCAP_* flags from linux v4.12 hwcap bits for armv8.3 extensions, added in linux commits c8c3798d2369e4285da44b244638eafe446a8f8a cb567e79fa504575cb97fb2f866d2040ed1c92e7 c651aae5a7732287c1c9bc974ece4ed798780544 --- arch/aarch64/bits/hwcap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/aarch64/bits/hwcap.h b/arch/aarch64/bits/hwcap.h index 26c14545..11396d31 100644 --- a/arch/aarch64/bits/hwcap.h +++ b/arch/aarch64/bits/hwcap.h @@ -11,3 +11,6 @@ #define HWCAP_ASIMDHP (1 << 10) #define HWCAP_CPUID (1 << 11) #define HWCAP_ASIMDRDM (1 << 12) +#define HWCAP_JSCVT (1 << 13) +#define HWCAP_FCMA (1 << 14) +#define HWCAP_LRCPC (1 << 15) From 2dc6760f3c1013796e4d05798aff824c85bc5265 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 10 Sep 2017 11:12:29 +0000 Subject: [PATCH 390/412] i386: add arch_prctl syscall number from linux v4.12 syscall for i386 compat mode on x86_64 for non-x86_64 prctls. new in linux commit 79170fda313ed5be2394f87aa2a00d597f8ed4a1 --- arch/i386/bits/syscall.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index b556d83b..27e72fec 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -381,4 +381,5 @@ #define __NR_pkey_alloc 381 #define __NR_pkey_free 382 #define __NR_statx 383 +#define __NR_arch_prctl 384 From 5daaed6a0efd8a2b1410ff5395a6b3bb0e1a907e Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 11 Sep 2017 19:30:08 +0000 Subject: [PATCH 391/412] s390x: add syscall number for s390_guarded_storage from linux v4.12 new syscall in linux commit 916cda1aa1b412d7cf2991c3af7479544942d121 --- arch/s390x/bits/syscall.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in index bb1c0f4d..4fe1a64f 100644 --- a/arch/s390x/bits/syscall.h.in +++ b/arch/s390x/bits/syscall.h.in @@ -320,5 +320,6 @@ #define __NR_copy_file_range 375 #define __NR_preadv2 376 #define __NR_pwritev2 377 +#define __NR_s390_guarded_storage 378 #define __NR_statx 379 From c35a8bf456ca6ef74e3cc7c4d8f63572bc1e1167 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 11 Sep 2017 20:50:40 +0000 Subject: [PATCH 392/412] add SO_ getsockopt options from linux v4.13 SCM_TIMESTAMPING_PKTINFO is new in aad9c8c470f2a8321a99eb053630ce0e199558d6 SO_PEERGROUPS is new in 28b5ba2aa0f55d80adb2624564ed2b170c19519e --- include/sys/socket.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index bcaf87f9..051d20e0 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -228,6 +228,8 @@ struct linger { #define SO_MEMINFO 55 #define SO_INCOMING_NAPI_ID 56 #define SO_COOKIE 57 +#define SCM_TIMESTAMPING_PKTINFO 58 +#define SO_PEERGROUPS 59 #ifndef SOL_SOCKET #define SOL_SOCKET 1 From 754f66afb76f59bb4c43f303fb9406a3841a448f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 11 Sep 2017 22:38:05 +0000 Subject: [PATCH 393/412] ioctl TIOCGPTPEER from linux v4.13 added for safe opening of peer end of pty in a mount namespace. new in linux commit c6325179238f1d4683edbec53d8322575d76d7e2 --- arch/generic/bits/ioctl.h | 1 + arch/mips/bits/ioctl.h | 1 + arch/mips64/bits/ioctl.h | 1 + arch/mipsn32/bits/ioctl.h | 1 + arch/powerpc/bits/ioctl.h | 1 + arch/powerpc64/bits/ioctl.h | 1 + arch/sh/bits/ioctl.h | 1 + 7 files changed, 7 insertions(+) diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h index 44deb11a..42a8f1a2 100644 --- a/arch/generic/bits/ioctl.h +++ b/arch/generic/bits/ioctl.h @@ -63,6 +63,7 @@ #define TIOCGPKT 0x80045438 #define TIOCGPTLCK 0x80045439 #define TIOCGEXCL 0x80045440 +#define TIOCGPTPEER 0x5441 #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h index 71394449..b8f77cb5 100644 --- a/arch/mips/bits/ioctl.h +++ b/arch/mips/bits/ioctl.h @@ -68,6 +68,7 @@ #define TIOCGPKT _IOR('T', 0x38, int) #define TIOCGPTLCK _IOR('T', 0x39, int) #define TIOCGEXCL _IOR('T', 0x40, int) +#define TIOCGPTPEER _IO('T', 0x41) #define TIOCSCTTY 0x5480 #define TIOCGSOFTCAR 0x5481 diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h index 71394449..b8f77cb5 100644 --- a/arch/mips64/bits/ioctl.h +++ b/arch/mips64/bits/ioctl.h @@ -68,6 +68,7 @@ #define TIOCGPKT _IOR('T', 0x38, int) #define TIOCGPTLCK _IOR('T', 0x39, int) #define TIOCGEXCL _IOR('T', 0x40, int) +#define TIOCGPTPEER _IO('T', 0x41) #define TIOCSCTTY 0x5480 #define TIOCGSOFTCAR 0x5481 diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h index 71394449..b8f77cb5 100644 --- a/arch/mipsn32/bits/ioctl.h +++ b/arch/mipsn32/bits/ioctl.h @@ -68,6 +68,7 @@ #define TIOCGPKT _IOR('T', 0x38, int) #define TIOCGPTLCK _IOR('T', 0x39, int) #define TIOCGEXCL _IOR('T', 0x40, int) +#define TIOCGPTPEER _IO('T', 0x41) #define TIOCSCTTY 0x5480 #define TIOCGSOFTCAR 0x5481 diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h index d3771dd3..47586234 100644 --- a/arch/powerpc/bits/ioctl.h +++ b/arch/powerpc/bits/ioctl.h @@ -104,6 +104,7 @@ #define TIOCGPKT _IOR('T', 0x38, int) #define TIOCGPTLCK _IOR('T', 0x39, int) #define TIOCGEXCL _IOR('T', 0x40, int) +#define TIOCGPTPEER _IO('T', 0x41) #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff --git a/arch/powerpc64/bits/ioctl.h b/arch/powerpc64/bits/ioctl.h index d3771dd3..47586234 100644 --- a/arch/powerpc64/bits/ioctl.h +++ b/arch/powerpc64/bits/ioctl.h @@ -104,6 +104,7 @@ #define TIOCGPKT _IOR('T', 0x38, int) #define TIOCGPTLCK _IOR('T', 0x39, int) #define TIOCGEXCL _IOR('T', 0x40, int) +#define TIOCGPTPEER _IO('T', 0x41) #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h index 15256c51..3c7ab4bb 100644 --- a/arch/sh/bits/ioctl.h +++ b/arch/sh/bits/ioctl.h @@ -95,6 +95,7 @@ #define TIOCGPKT _IOR('T', 56, int) #define TIOCGPTLCK _IOR('T', 57, int) #define TIOCGEXCL _IOR('T', 64, int) +#define TIOCGPTPEER _IO('T', 0x41) #define TIOCSERCONFIG _IO('T', 83) #define TIOCSERGWILD _IOR('T', 84, int) From 14ced22830ef6cbf8e2526d3131c2b443c3f57dd Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 22:04:20 +0000 Subject: [PATCH 394/412] add new fcntl.h macros from linux v4.13 for getting/setting write lifetime hints fcntl commands were added in linux commit c75b1d9421f80f4143e389d2d50ddfc8a28c8c35 added under _GNU_SOURCE || _BSD_SOURCE, since RWH_* life time hints are not in the POSIX reserved namespace. --- include/fcntl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/fcntl.h b/include/fcntl.h index 0e165ca3..6d8edcd1 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -127,6 +127,18 @@ int posix_fallocate(int, off_t, off_t); #define F_SEAL_GROW 0x0004 #define F_SEAL_WRITE 0x0008 +#define F_GET_RW_HINT 1035 +#define F_SET_RW_HINT 1036 +#define F_GET_FILE_RW_HINT 1037 +#define F_SET_FILE_RW_HINT 1038 + +#define RWF_WRITE_LIFE_NOT_SET 0 +#define RWH_WRITE_LIFE_NONE 1 +#define RWH_WRITE_LIFE_SHORT 2 +#define RWH_WRITE_LIFE_MEDIUM 3 +#define RWH_WRITE_LIFE_LONG 4 +#define RWH_WRITE_LIFE_EXTREME 5 + #define DN_ACCESS 0x00000001 #define DN_MODIFY 0x00000002 #define DN_CREATE 0x00000004 From 6651ef1f060738ee1f50cac1fe6d8ce64c359022 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 22:14:24 +0000 Subject: [PATCH 395/412] add new tcp.h socket options from linux v4.13 TCP_ULP is new in linux commit 734942cc4ea6478eed125af258da1bdbb4afe578 TCP_MD5SIG_EXT is new in 8917a777be3ba566377be05117f71b93a5fd909d --- include/netinet/tcp.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 652418be..4d20936a 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -32,6 +32,8 @@ #define TCP_SAVED_SYN 28 #define TCP_REPAIR_WINDOW 29 #define TCP_FASTOPEN_CONNECT 30 +#define TCP_ULP 31 +#define TCP_MD5SIG_EXT 32 #define TCP_ESTABLISHED 1 #define TCP_SYN_SENT 2 @@ -207,11 +209,14 @@ struct tcp_info { #define TCP_MD5SIG_MAXKEYLEN 80 +#define TCP_MD5SIG_FLAG_PREFIX 1 + struct tcp_md5sig { struct sockaddr_storage tcpm_addr; - uint16_t __tcpm_pad1; + uint8_t tcpm_flags; + uint8_t tcpm_prefixlen; uint16_t tcpm_keylen; - uint32_t __tcpm_pad2; + uint32_t __tcpm_pad; uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; }; From ffd048a07b4bc3bd01bef71a77b49aa9cee947cf Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 22:32:11 +0000 Subject: [PATCH 396/412] aarch64: add extra_context struct from linux v4.13 allows expanding the signal frame beyond the 4k reserved space. new in linux commit 33f082614c3443d937f50fe936f284f62bbb4a1b --- arch/aarch64/bits/signal.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h index 00fb5f33..5eb3d91f 100644 --- a/arch/aarch64/bits/signal.h +++ b/arch/aarch64/bits/signal.h @@ -24,6 +24,7 @@ typedef struct sigcontext { #define FPSIMD_MAGIC 0x46508001 #define ESR_MAGIC 0x45535201 +#define EXTRA_MAGIC 0x45585401 struct _aarch64_ctx { unsigned int magic; unsigned int size; @@ -38,6 +39,12 @@ struct esr_context { struct _aarch64_ctx head; unsigned long esr; }; +struct extra_context { + struct _aarch64_ctx head; + unsigned long datap; + unsigned int size; + unsigned int __reserved[3]; +}; #else typedef struct { long double __regs[18+256]; From 4dc44ce8e2948aae55bc7dd6eda517167af7da32 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 22:37:38 +0000 Subject: [PATCH 397/412] microblaze: add statx syscall from linux v4.13 statx number is allocated for microblaze in linux commit f5ef419630e85e80284cd0256cb5a13a66bbd6c5 --- arch/microblaze/bits/syscall.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index 251c2f61..dda5218d 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -392,4 +392,5 @@ #define __NR_pkey_mprotect 395 #define __NR_pkey_alloc 396 #define __NR_pkey_free 397 +#define __NR_statx 398 From 13935337f3e9bbf9db9e6403d761bc670ea1a6d5 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 00:45:45 +0200 Subject: [PATCH 398/412] s390x: use generic ioctl.h s390 can use the generic ioctls definitions other than FIOQSIZE (like arm). this fixes some missing ioctls and two incorrect ones: TIOCTTYGSTRUCT and TIOCM_MODEM_BITS seem to be defined on frv target only in linux. --- arch/s390x/bits/ioctl.h | 196 ------------------------------------ arch/s390x/bits/ioctl_fix.h | 2 + 2 files changed, 2 insertions(+), 196 deletions(-) delete mode 100644 arch/s390x/bits/ioctl.h create mode 100644 arch/s390x/bits/ioctl_fix.h diff --git a/arch/s390x/bits/ioctl.h b/arch/s390x/bits/ioctl.h deleted file mode 100644 index 0ebac590..00000000 --- a/arch/s390x/bits/ioctl.h +++ /dev/null @@ -1,196 +0,0 @@ -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 -#define TIOCTTYGSTRUCT 0x5426 -#define TIOCSBRK 0x5427 -#define TIOCCBRK 0x5428 -#define TIOCGSID 0x5429 -#define TIOCGPTN 0x80045430 -#define TIOCSPTLCK 0x40045431 -#define TCGETX 0x5432 -#define TCSETX 0x5433 -#define TCSETXF 0x5434 -#define TCSETXW 0x5435 - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 -#define TIOCSERGETLSR 0x5459 -#define TIOCSERGETMULTI 0x545A -#define TIOCSERSETMULTI 0x545B - -#define TIOCMIWAIT 0x545C -#define TIOCGICOUNT 0x545D -#define FIOQSIZE 0x545E - -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 -#define TIOCPKT_IOCTL 64 - -#define TIOCSER_TEMT 0x01 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 -#define TIOCM_MODEM_BITS TIOCM_OUT2 - -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 -#define N_6PACK 7 -#define N_MASC 8 -#define N_R3964 9 -#define N_PROFIBUS_FDL 10 -#define N_IRDA 11 -#define N_SMSBLOCK 12 -#define N_HDLC 13 -#define N_SYNC_PPP 14 -#define N_HCI 15 - -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 - -#define SIOCADDRT 0x890B -#define SIOCDELRT 0x890C -#define SIOCRTMSG 0x890D - -#define SIOCGIFNAME 0x8910 -#define SIOCSIFLINK 0x8911 -#define SIOCGIFCONF 0x8912 -#define SIOCGIFFLAGS 0x8913 -#define SIOCSIFFLAGS 0x8914 -#define SIOCGIFADDR 0x8915 -#define SIOCSIFADDR 0x8916 -#define SIOCGIFDSTADDR 0x8917 -#define SIOCSIFDSTADDR 0x8918 -#define SIOCGIFBRDADDR 0x8919 -#define SIOCSIFBRDADDR 0x891a -#define SIOCGIFNETMASK 0x891b -#define SIOCSIFNETMASK 0x891c -#define SIOCGIFMETRIC 0x891d -#define SIOCSIFMETRIC 0x891e -#define SIOCGIFMEM 0x891f -#define SIOCSIFMEM 0x8920 -#define SIOCGIFMTU 0x8921 -#define SIOCSIFMTU 0x8922 -#define SIOCSIFHWADDR 0x8924 -#define SIOCGIFENCAP 0x8925 -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 -#define SIOCGIFSLAVE 0x8929 -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 -#define SIOGIFINDEX SIOCGIFINDEX -#define SIOCSIFPFLAGS 0x8934 -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 -#define SIOCSIFHWBROADCAST 0x8937 -#define SIOCGIFCOUNT 0x8938 - -#define SIOCGIFBR 0x8940 -#define SIOCSIFBR 0x8941 - -#define SIOCGIFTXQLEN 0x8942 -#define SIOCSIFTXQLEN 0x8943 - -#define SIOCDARP 0x8953 -#define SIOCGARP 0x8954 -#define SIOCSARP 0x8955 - -#define SIOCDRARP 0x8960 -#define SIOCGRARP 0x8961 -#define SIOCSRARP 0x8962 - -#define SIOCGIFMAP 0x8970 -#define SIOCSIFMAP 0x8971 - -#define SIOCADDDLCI 0x8980 -#define SIOCDELDLCI 0x8981 - -#define SIOCDEVPRIVATE 0x89F0 -#define SIOCPROTOPRIVATE 0x89E0 diff --git a/arch/s390x/bits/ioctl_fix.h b/arch/s390x/bits/ioctl_fix.h new file mode 100644 index 00000000..ebb383da --- /dev/null +++ b/arch/s390x/bits/ioctl_fix.h @@ -0,0 +1,2 @@ +#undef FIOQSIZE +#define FIOQSIZE 0x545e From 67b29947893cd5991a8cbab8aef4f3b2ebfa73fe Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 9 Nov 2017 19:56:26 -0500 Subject: [PATCH 399/412] fix mismatched type of __pthread_tsd_run_dtors weak definition commit a6054e3c94aa0491d7366e4b05ae0d73f661bfe2 changed this function not to take an argument, but the weak definition used by timer_create was not updated to match. reported by Pascal Cuoq. --- src/time/timer_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/time/timer_create.c b/src/time/timer_create.c index b54a524c..16432bec 100644 --- a/src/time/timer_create.c +++ b/src/time/timer_create.c @@ -14,10 +14,10 @@ struct start_args { struct sigevent *sev; }; -static void dummy_1(pthread_t self) +static void dummy_0() { } -weak_alias(dummy_1, __pthread_tsd_run_dtors); +weak_alias(dummy_0, __pthread_tsd_run_dtors); void __reset_tls(); From 30fdda6c998d9fc87601b50c7fea4447d52f8d12 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 14 Sep 2017 15:53:21 -0500 Subject: [PATCH 400/412] fix getaddrinfo error code for non-numeric service with AI_NUMERICSERV If AI_NUMERICSERV is specified and a numeric service was not provided, POSIX mandates getaddrinfo return EAI_NONAME. EAI_SERVICE is only for services that cannot be used on the specified socket type. --- src/network/lookup_serv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/lookup_serv.c b/src/network/lookup_serv.c index 66ebaea2..403b12ae 100644 --- a/src/network/lookup_serv.c +++ b/src/network/lookup_serv.c @@ -64,7 +64,7 @@ int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int pro return cnt; } - if (flags & AI_NUMERICSERV) return EAI_SERVICE; + if (flags & AI_NUMERICSERV) return EAI_NONAME; size_t l = strlen(name); From 79f49effa0a82d88a9bb0b1992ed2e5fa807f900 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 00:13:16 -0500 Subject: [PATCH 401/412] refactor iconv conversion descriptor encoding/decoding this change is made to avoid having assumptions about the encoding spread out across the file, and to facilitate future change to a form that can accommodate allocted, stateful descriptors when needed. this commit should not produce any functional changes; with the compiler tested the only change to code generation was minor reordering of local variables on stack. --- src/locale/iconv.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index fd2f2e01..5f1b0a3e 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -100,6 +100,21 @@ static size_t find_charmap(const void *name) return -1; } +static iconv_t combine_to_from(size_t t, size_t f) +{ + return (void *)(f<<16 | t); +} + +static size_t extract_from(iconv_t cd) +{ + return (size_t)cd >> 16; +} + +static size_t extract_to(iconv_t cd) +{ + return (size_t)cd & 0xffff; +} + iconv_t iconv_open(const char *to, const char *from) { size_t f, t; @@ -111,7 +126,7 @@ iconv_t iconv_open(const char *to, const char *from) return (iconv_t)-1; } - return (void *)(f<<16 | t); + return combine_to_from(t, f); } int iconv_close(iconv_t cd) @@ -159,12 +174,11 @@ static unsigned legacy_map(const unsigned char *map, unsigned c) return x ? x : c; } -size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) +size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) { size_t x=0; - unsigned long cd = (unsigned long)cd0; - unsigned to = cd & 0xffff; - unsigned from = cd >> 16; + unsigned to = extract_to(cd); + unsigned from = extract_from(cd); const unsigned char *map = charmaps+from+1; const unsigned char *tomap = charmaps+to+1; mbstate_t st = {0}; @@ -322,7 +336,7 @@ size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restr if (totype-0300U > 8) k = 2; else k = "\10\4\4\10\4\4\10\2\4"[totype-0300]; if (k > *outb) goto toobig; - x += iconv((iconv_t)(uintptr_t)to, + x += iconv(combine_to_from(to, 0), &(char *){"\303\212\314\204" "\303\212\314\214" "\303\252\314\204" From bff59d13a82cd4c02792fd73da0e7c79bda022ff Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 00:27:34 -0500 Subject: [PATCH 402/412] move iconv_close to its own translation unit this is in preparation to support stateful conversion descriptors, which are necessarily allocated and thus must be freed in iconv_close. putting it in a separate TU will avoid pulling in free if iconv_close is not referenced. --- src/locale/iconv.c | 5 ----- src/locale/iconv_close.c | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 src/locale/iconv_close.c diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 5f1b0a3e..c64bcf35 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -129,11 +129,6 @@ iconv_t iconv_open(const char *to, const char *from) return combine_to_from(t, f); } -int iconv_close(iconv_t cd) -{ - return 0; -} - static unsigned get_16(const unsigned char *s, int e) { e &= 1; diff --git a/src/locale/iconv_close.c b/src/locale/iconv_close.c new file mode 100644 index 00000000..fac681cc --- /dev/null +++ b/src/locale/iconv_close.c @@ -0,0 +1,6 @@ +#include + +int iconv_close(iconv_t cd) +{ + return 0; +} From 9eb6dd5165b803715f82b9f5d4b557878f77a580 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 13:34:21 -0500 Subject: [PATCH 403/412] handle ascii range individually in each iconv case short-circuiting low bytes before the switch precluded support for character encodings that don't coincide with ascii in this range. this limitation affected iso-2022 encodings, which use the esc byte to introduce a shift sequence, and things like ebcdic. --- src/locale/iconv.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index c64bcf35..af0d8283 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -193,8 +193,9 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri c = *(unsigned char *)*in; l = 1; - if (c >= 128 || type-UTF_32BE < 7U) switch (type) { + switch (type) { case UTF_8: + if (c < 128) break; // optimization l = mbrtowc_utf8(&wc, *in, *inb, &st); if (!l) l++; else if (l == (size_t)-1) goto ilseq; @@ -202,7 +203,8 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri c = wc; break; case US_ASCII: - goto ilseq; + if (c >= 128) goto ilseq; + break; case WCHAR_T: l = sizeof(wchar_t); if (*inb < l) goto starved; @@ -234,6 +236,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri } break; case SHIFT_JIS: + if (c < 128) break; if (c-0xa1 <= 0xdf-0xa1) { c += 0xff61-0xa1; break; @@ -257,6 +260,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri if (!c) goto ilseq; break; case EUC_JP: + if (c < 128) break; l = 2; if (*inb < 2) goto starved; d = *((unsigned char *)*in + 1); @@ -273,9 +277,11 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri if (!c) goto ilseq; break; case GB2312: + if (c < 128) break; if (c < 0xa1) goto ilseq; case GBK: case GB18030: + if (c < 128) break; c -= 0x81; if (c >= 126) goto ilseq; l = 2; @@ -311,6 +317,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri c = gb18030[c][d]; break; case BIG5: + if (c < 128) break; l = 2; if (*inb < 2) goto starved; d = *((unsigned char *)*in + 1); @@ -348,6 +355,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri if (!c) goto ilseq; break; case EUC_KR: + if (c < 128) break; l = 2; if (*inb < 2) goto starved; d = *((unsigned char *)*in + 1); From 0df5b39a1e9c8aaf480e3f8667d7967e08bbef2b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 13:40:12 -0500 Subject: [PATCH 404/412] simplify/optimize iconv utf-8 case the special case where mbrtowc returns 0 but consumed 1 byte of input does not need to be considered, because the short-circuit for low bytes already covered that case. --- src/locale/iconv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index af0d8283..fd51b73e 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -195,11 +195,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri switch (type) { case UTF_8: - if (c < 128) break; // optimization + if (c < 128) break; l = mbrtowc_utf8(&wc, *in, *inb, &st); - if (!l) l++; - else if (l == (size_t)-1) goto ilseq; - else if (l == (size_t)-2) goto starved; + if (l == (size_t)-1) goto ilseq; + if (l == (size_t)-2) goto starved; c = wc; break; case US_ASCII: From 5b546faa67544af395d6407553762b37e9711157 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 15:06:42 -0500 Subject: [PATCH 405/412] add iconv framework for decoding stateful encodings assuming pointers obtained from malloc have some nonzero alignment, repurpose the low bit of iconv_t as an indicator that the descriptor is a stateless value representing the source and destination character encodings. --- src/locale/iconv.c | 25 ++++++++++++++++++++++--- src/locale/iconv_close.c | 2 ++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index fd51b73e..0696b555 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -100,9 +100,14 @@ static size_t find_charmap(const void *name) return -1; } +struct stateful_cd { + iconv_t base_cd; + unsigned state; +}; + static iconv_t combine_to_from(size_t t, size_t f) { - return (void *)(f<<16 | t); + return (void *)(f<<16 | t<<1 | 1); } static size_t extract_from(iconv_t cd) @@ -112,7 +117,7 @@ static size_t extract_from(iconv_t cd) static size_t extract_to(iconv_t cd) { - return (size_t)cd & 0xffff; + return (size_t)cd >> 1 & 0x7fff; } iconv_t iconv_open(const char *to, const char *from) @@ -125,8 +130,17 @@ iconv_t iconv_open(const char *to, const char *from) errno = EINVAL; return (iconv_t)-1; } + iconv_t cd = combine_to_from(t, f); - return combine_to_from(t, f); + if (0) { + struct stateful_cd *scd = malloc(sizeof *scd); + if (!scd) return (iconv_t)-1; + scd->base_cd = cd; + scd->state = 0; + cd = (iconv_t)scd; + } + + return cd; } static unsigned get_16(const unsigned char *s, int e) @@ -172,6 +186,11 @@ static unsigned legacy_map(const unsigned char *map, unsigned c) size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) { size_t x=0; + struct stateful_cd *scd=0; + if (!((size_t)cd & 1)) { + scd = (void *)cd; + cd = scd->base_cd; + } unsigned to = extract_to(cd); unsigned from = extract_from(cd); const unsigned char *map = charmaps+from+1; diff --git a/src/locale/iconv_close.c b/src/locale/iconv_close.c index fac681cc..28b29565 100644 --- a/src/locale/iconv_close.c +++ b/src/locale/iconv_close.c @@ -1,6 +1,8 @@ #include +#include int iconv_close(iconv_t cd) { + if (!((size_t)cd & 1)) free((void *)cd); return 0; } From a39f20bf9f8e59573a479bff23df345b2b4d2345 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 17:06:32 -0500 Subject: [PATCH 406/412] add iso-2022-jp support (decoding only) to iconv this implementation aims to match the baseline defined by rfc1468 (the original mime charset definition) plus the halfwidth katakana extension included in the whatwg definition of the charset. rejection of si/so controls and newlines in doublebyte state are not currently enforced. the jis x 0201 mode is currently interpreted as having the yen sign and overline character in place of backslash and tilde; ascii mode has the standard ascii characters in those slots. --- src/locale/iconv.c | 47 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 0696b555..2107b055 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -18,6 +18,7 @@ #define UTF_8 0310 #define EUC_JP 0320 #define SHIFT_JIS 0321 +#define ISO2022_JP 0322 #define GB18030 0330 #define GBK 0331 #define GB2312 0332 @@ -41,6 +42,7 @@ static const unsigned char charmaps[] = "ascii\0usascii\0iso646\0iso646us\0\0\307" "eucjp\0\0\320" "shiftjis\0sjis\0\0\321" +"iso2022jp\0\0\322" "gb18030\0\0\330" "gbk\0\0\331" "gb2312\0\0\332" @@ -123,6 +125,7 @@ static size_t extract_to(iconv_t cd) iconv_t iconv_open(const char *to, const char *from) { size_t f, t; + struct stateful_cd *scd; if ((t = find_charmap(to))==-1 || (f = find_charmap(from))==-1 @@ -132,8 +135,9 @@ iconv_t iconv_open(const char *to, const char *from) } iconv_t cd = combine_to_from(t, f); - if (0) { - struct stateful_cd *scd = malloc(sizeof *scd); + switch (charmaps[f]) { + case ISO2022_JP: + scd = malloc(sizeof *scd); if (!scd) return (iconv_t)-1; scd->base_cd = cd; scd->state = 0; @@ -294,6 +298,45 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri c = jis0208[c][d]; if (!c) goto ilseq; break; + case ISO2022_JP: + if (c >= 128) goto ilseq; + if (c == '\033') { + l = 3; + if (*inb < 3) goto starved; + c = *((unsigned char *)*in + 1); + d = *((unsigned char *)*in + 2); + if (c != '(' && c != '$') goto ilseq; + switch (128*(c=='$') + d) { + case 'B': scd->state=0; continue; + case 'J': scd->state=1; continue; + case 'I': scd->state=4; continue; + case 128+'@': scd->state=2; continue; + case 128+'B': scd->state=3; continue; + } + goto ilseq; + } + switch (scd->state) { + case 1: + if (c=='\\') c = 0xa5; + if (c=='~') c = 0x203e; + break; + case 2: + case 3: + l = 2; + if (*inb < 2) goto starved; + d = *((unsigned char *)*in + 1); + c -= 0x21; + d -= 0x21; + if (c >= 84 || d >= 94) goto ilseq; + c = jis0208[c][d]; + if (!c) goto ilseq; + break; + case 4: + if (c-0x60 < 0x1f) goto ilseq; + if (c-0x21 < 0x5e) c += 0xff61-0x21; + break; + } + break; case GB2312: if (c < 128) break; if (c < 0xa1) goto ilseq; From c21051e90cd27a0b26be0ac66950b7396a156ba1 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Fri, 10 Nov 2017 18:15:43 -0600 Subject: [PATCH 407/412] prevent fork's errno from being clobbered by atfork handlers If the syscall fails, errno must be set correctly for the caller. There's no guarantee that the handlers registered with pthread_atfork won't clobber errno, so we need to ensure it gets set after they are called. --- src/process/fork.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/process/fork.c b/src/process/fork.c index b96f0024..da074ae9 100644 --- a/src/process/fork.c +++ b/src/process/fork.c @@ -18,9 +18,9 @@ pid_t fork(void) __fork_handler(-1); __block_all_sigs(&set); #ifdef SYS_fork - ret = syscall(SYS_fork); + ret = __syscall(SYS_fork); #else - ret = syscall(SYS_clone, SIGCHLD, 0); + ret = __syscall(SYS_clone, SIGCHLD, 0); #endif if (!ret) { pthread_t self = __pthread_self(); @@ -31,5 +31,5 @@ pid_t fork(void) } __restore_sigs(&set); __fork_handler(!ret); - return ret; + return __syscall_ret(ret); } From d060edf6c569ba9df4b52d6bcd93edde812869c9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 11 Nov 2017 01:32:30 -0500 Subject: [PATCH 408/412] reformat cjk iconv tables to be diff-friendly, match tool output the new version of the code used to generate these tables forces a newline every 256 entries, whereas at the time these files were originally generated and committed, it only wrapped them at 80 columns. the new behavior ensures that localized changes to the tables, if they are ever needed, will produce localized diffs. other tables including hkscs were already committed in the new format. binary comparison of the generated object files was performed to confirm that no spurious changes slipped in. --- src/locale/gb18030.h | 3400 +++++++++++++++++++++--------------------- src/locale/jis0208.h | 997 +++++++------ src/locale/ksc.h | 1168 ++++++++------- 3 files changed, 2809 insertions(+), 2756 deletions(-) diff --git a/src/locale/gb18030.h b/src/locale/gb18030.h index 5aceb329..8f300e9b 100644 --- a/src/locale/gb18030.h +++ b/src/locale/gb18030.h @@ -17,46 +17,47 @@ 20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437, 20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468, 20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484, -20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502, -20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529, -20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545, -20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564, -20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580, -20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595, -20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615, -20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630, -20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644, -20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663, -20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678, -20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692, -20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707, -20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727, -20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741, -20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758, -20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772, -20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785, -20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798, -20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827, -20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850, -20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881, -20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905, -20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933, -20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953, -20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972, -20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008, -21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034, -21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064, -21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085, -21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105, -21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123, -21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138, -21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166, -21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184, -21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203, -21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219, -21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234, -21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252, -21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276, +20485,20486,20487,20488,20489,20490,20491,20494, +20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516, +20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537, +20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557, +20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575, +20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590, +20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609, +20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625, +20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638, +20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657, +20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673, +20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686, +20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702, +20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720, +20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736, +20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752, +20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766, +20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780, +20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793, +20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818, +20819,20823,20824,20825,20827,20829,20830,20831,20832, +20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867, +20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890, +20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916, +20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942, +20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959, +20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980, +20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020, +21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042, +21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071, +21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091, +21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110, +21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127, +21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143, +21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173, +21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189, +21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209, +21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224, +21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238, +21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259, +21260,21262,21265,21266,21267,21268,21272,21275,21276, 21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296, 21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316, 21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354, @@ -76,243 +77,247 @@ 21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760, 21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781, 21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800, -21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824, -21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844, -21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865, -21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894, -21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920, -21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934, -21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955, -21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978, -21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008, -22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027, -22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045, -22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067, -22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085, -22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102, -22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126, -22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143, -22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160, -22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174, -22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188, -22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203, -22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217, -22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233, -22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259, -22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285, -22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298, -22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322, -22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342, -22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373, -22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398, -22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420, -22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442, -22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461, -22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477, -22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502, -22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518, -22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540, -22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557, -22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575, -22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590, -22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606, -22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623, -22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639, -22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652, -22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671, -22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690, -22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705, -22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719, -22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734, -22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749, -22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765, -22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783, -22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801, -22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824, -22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853, -22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879, -22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895, -22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921, -22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941, -22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965, -22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981, -22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007, -23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024, -23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040, -23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065, -23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084, -23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102, -23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119, -23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134, -23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150, -23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169, -23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182, -23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198, -23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212, -23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229, -23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247, -23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268, -23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285, -23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298, -23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312, -23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327, -23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340, -23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356, -23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370, -23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403, -23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423, -23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464, -23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489, -23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511, -23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531, -23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552, -23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575, -23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597, -23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628, -23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650, -23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669, -23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687, -23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713, -23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737, -23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754, -23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770, -23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790, -23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805, -23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823, -23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840, -23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859, -23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875, -23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892, -23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908, -23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926, -23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940, -23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953, -23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968, -23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981, -23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995, -23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009, -24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023, -24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053, -24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075, -24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101, -24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121, -24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141, -24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157, -24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173, -24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200, -24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232, -24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252, -24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268, -24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286, -24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301, -24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325, -24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348, -24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371, -24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388, -24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404, -24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430, -24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461, -24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482, -24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499, -24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520, -24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547, -24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569, -24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602, -24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628, -24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648, -24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668, -24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702, -24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721, -24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745, -24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768, -24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786, -24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810, -24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836, -24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856, -24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877, -24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890, -24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905, -24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923, -24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940, -24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956, -24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969, -24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985, -24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002, -25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017, -25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033, -25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051, -25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065, -25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079, -25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093, -25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128, -25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147, -25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178, -25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204, -25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224, -25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254, -25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272, -25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313, -25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348, -25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367, -25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396, -25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416, -25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437, -25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460, -25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483, -25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503, -25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535, -25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556, -25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574, -25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594, -25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617, -25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637, -25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655, -25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678, -25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695, -25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711, -25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727, -25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744, -25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763, -25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785, -25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803, -25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823, -25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839, -25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852, -25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867, -25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882, -25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896, -25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920, -25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939, -25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961, -25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980, -25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994, -25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018, -26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039, -26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064, -26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081, -26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109, -26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130, -26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153, -26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173, -26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192, -26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217, -26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237, -26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255, -26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272, -26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288, -26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304, -26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317, -26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334, -26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349, -26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372, -26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394, -26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418, -26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439, -26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466, -26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490, -26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511, -26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537, -26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560, +21801,21803,21805,21810,21812,21813,21814,21816,21817, +21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839, +21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856, +21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882, +21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911, +21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930, +21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951, +21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973, +21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000, +22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021, +22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039, +22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059, +22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081, +22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097, +22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117, +22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137, +22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154, +22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170, +22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184, +22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198, +22200,22201,22202,22203,22205,22206,22207,22208,22209, +22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223, +22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247, +22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268, +22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290, +22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305, +22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328, +22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355, +22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385, +22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408, +22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425, +22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451, +22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468, +22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487, +22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507, +22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527, +22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547, +22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566, +22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582, +22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595, +22597,22598,22599,22600,22601,22602,22603,22606,22607, +22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624, +22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640, +22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653, +22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672, +22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691, +22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706, +22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720, +22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735, +22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750, +22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767, +22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784, +22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802, +22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828, +22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854, +22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881, +22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896, +22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923, +22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943, +22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966, +22967,22968,22970,22972,22973,22975,22976,22977,22978, +22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001, +23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021, +23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036, +23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061, +23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080, +23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098, +23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116, +23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131, +23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147, +23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165, +23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179, +23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193, +23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208, +23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226, +23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243, +23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262, +23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282, +23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295, +23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309, +23310,23311,23312,23313,23314,23315,23316,23317,23320, +23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333, +23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347, +23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363, +23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378, +23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414, +23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440, +23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473, +23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501, +23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520, +23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539, +23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563, +23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585, +23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605, +23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639, +23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659, +23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677, +23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698, +23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722, +23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746, +23747,23749,23750,23751,23752,23753,23754,23756,23757, +23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772, +23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793, +23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807, +23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825, +23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842, +23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862, +23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877, +23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894, +23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910, +23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928, +23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942, +23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955, +23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970, +23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983, +23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997, +23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011, +24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025, +24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056, +24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078, +24082,24083,24087,24094,24095,24096,24097,24098,24099, +24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117, +24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138, +24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154, +24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171, +24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195, +24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227, +24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250, +24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264, +24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284, +24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299, +24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316, +24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345, +24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368, +24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386, +24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399, +24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424, +24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451, +24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479, +24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497, +24498,24499,24500,24502,24504,24505,24506,24507,24510, +24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538, +24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560, +24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588, +24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621, +24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638, +24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659, +24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686, +24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712, +24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734, +24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759, +24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777, +24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798, +24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828, +24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849, +24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866, +24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884, +24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898, +24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916, +24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932, +24933,24934,24937,24938,24939,24940,24941,24942,24943, +24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959, +24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973, +24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988, +24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006, +25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020, +25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038, +25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054, +25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068, +25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082, +25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107, +25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133, +25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156, +25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182, +25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208, +25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229, +25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258, +25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280, +25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323, +25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354, +25355,25356,25357,25359,25360,25362,25363,25364,25365, +25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395, +25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415, +25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436, +25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459, +25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478, +25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502, +25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533, +25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555, +25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573, +25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593, +25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614, +25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636, +25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654, +25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677, +25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693, +25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710, +25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726, +25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743, +25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762, +25763,25765,25766,25767,25768,25770,25771,25775,25777, +25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798, +25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817, +25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834, +25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847, +25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861, +25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876, +25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890, +25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907, +25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931, +25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953, +25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974, +25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988, +25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008, +26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034, +26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055, +26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075, +26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101, +26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121, +26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145, +26146,26147,26148,26150,26153,26154,26155,26156,26158, +26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180, +26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203, +26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221, +26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243, +26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260, +26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276, +26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293, +26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308, +26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321, +26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338, +26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357, +26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380, +26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401, +26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424, +26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450, +26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471, +26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498, +26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516, +26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546, +26548,26553,26554,26555,26556,26557,26558,26559,26560, 26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582, 26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606, 26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627, @@ -332,221 +337,225 @@ 26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906, 26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922, 26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939, -26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955, -26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971, -26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991, -26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011, -27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033, -27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050, -27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069, -27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085, -27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102, -27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118, -27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132, -27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148, -27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163, -27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180, -27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196, -27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213, -27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230, -27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245, -27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261, -27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276, -27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293, -27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310, -27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323, -27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336, -27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349, -27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362, -27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375, -27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388, -27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401, -27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414, -27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433, -27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448, -27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469, -27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483, -27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503, -27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519, -27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545, -27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561, -27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579, -27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598, -27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621, -27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639, -27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657, -27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691, -27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715, -27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736, -27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761, -27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787, -27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808, -27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842, -27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866, -27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903, -27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923, -27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942, -27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968, -27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001, -28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021, -28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039, -28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066, -28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092, -28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114, -28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136, -28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158, -28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178, -28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202, -28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222, -28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239, -28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258, -28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273, -28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288, -28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307, -28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324, -28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348, -28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366, -28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396, -28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411, -28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427, -28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444, -28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464, -28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481, -28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498, -28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515, -28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533, -28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550, -28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568, -28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584, -28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599, -28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615, -28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631, -28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647, -28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662, -28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675, -28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688, -28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704, -28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718, -28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733, -28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746, -28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761, -28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775, -28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797, -28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817, -28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837, -28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863, -28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882, -28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899, -28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923, -28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939, -28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959, -28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973, -28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990, -28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007, -29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021, -29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040, -29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058, -29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074, -29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092, -29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108, -29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124, -29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138, -29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154, -29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170, -29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184, -29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198, -29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211, -29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227, -29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251, -29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269, -29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292, -29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315, -29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334, -29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348, -29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370, -29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388, -29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569, -58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582, -58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595, -58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608, -58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621, -58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634, -58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647, -58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660, -58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216, -8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303, -12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712, -8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800, -8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164, -65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651, -9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668, -58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681, -58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694, -58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707, -58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720, -58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733, -58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746, -58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561, -8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243, -9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366, -9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341, -9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316, -9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838, -12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552, -8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765, -58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778, -58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791, -58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804, -58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817, -58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830, -58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843, -58844,58845,58846,58847,58848,58849,58850,58851,58852,58853,65281,65282,65283, -65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296, -65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309, -65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322, -65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335, -65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348, -65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361, -65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507, -58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866, -58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879, -58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892, -58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905, -58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918, -58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931, -58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944, -58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360, -12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373, -12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386, -12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399, -12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412, -12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425, -12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252, -59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954, -58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967, -58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980, -58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993, -58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006, -59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019, -59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032, -59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045, -12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461, -12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474, -12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487, -12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500, -12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513, -12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526, -12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265, -59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055, -59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068, -59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081, -59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094, -59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107, -59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120, -59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133, -59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919, -920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269, -59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953, +26940,26942,26944,26945,26947,26948,26949,26950,26951, +26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965, +26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985, +26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005, +27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026, +27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044, +27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064, +27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079, +27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097, +27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113, +27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128, +27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143, +27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157, +27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174, +27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192, +27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209, +27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223, +27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241, +27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255, +27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272, +27273,27274,27275,27276,27277,27279,27282,27283,27284, +27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299, +27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315, +27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328, +27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341, +27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354, +27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367, +27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380, +27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393, +27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406, +27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419, +27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438, +27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456, +27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474, +27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488, +27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508, +27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534, +27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552, +27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567, +27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587, +27588,27590,27591,27592,27593,27594,27596,27598,27600, +27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622, +27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640, +27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658, +27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692, +27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716, +27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737, +27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763, +27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789, +27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810, +27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843, +27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868, +27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904, +27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924, +27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944, +27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970, +27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002, +28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022, +28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042, +28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069, +28076,28077,28080,28081,28083,28084,28086,28087,28089, +28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110, +28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131, +28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152, +28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169, +28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198, +28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219, +28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234, +28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254, +28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269, +28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283, +28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302, +28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320, +28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341, +28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362, +28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391, +28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407, +28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423, +28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441, +28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456, +28460,28462,28464,28466,28468,28469,28471,28472,28473, +28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489, +28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505, +28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522, +28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542, +28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561, +28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575, +28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590, +28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606, +28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622, +28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637, +28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653, +28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668, +28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681, +28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695, +28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711, +28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724, +28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739, +28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754, +28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768, +28769,28770,28771,28772,28773,28774,28775,28776,28777, +28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802, +28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823, +28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839, +28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869, +28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884, +28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906, +28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926, +28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941, +28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961, +28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978, +28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992, +28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009, +29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024, +29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044, +29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061, +29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077, +29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094, +29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111, +29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126, +29127,29128,29129,29130,29131,29132,29133,29135,29136, +29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151, +29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168, +29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182, +29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196, +29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209, +29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223, +29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249, +29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267, +29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290, +29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309, +29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332, +29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346, +29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363, +29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386, +29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567, +58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580, +58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593, +58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606, +58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619, +58620,58621,58622,58623,58624,58625,58626,58627,58628, +58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641, +58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654, +58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168, +12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297, +12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758, +8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747, +8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794, +9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675, +9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662, +58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675, +58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688, +58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701, +58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714, +58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727, +58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740, +58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753, +58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569, +59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359, +9360,9361,9362,9363,9364,9365,9366,9367,9368, +9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343, +9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318, +9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839, +12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553, +8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766, +58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779, +58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792, +58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805, +58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818, +58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831, +58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844, +58845,58846,58847,58848,58849,58850,58851,58852,58853,65281,65282,65283,65509, +65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297, +65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310, +65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323, +65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336, +65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349, +65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362, +65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854, +58855,58856,58857,58858, +58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871, +58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884, +58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897, +58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910, +58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923, +58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936, +58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949, +12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365, +12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378, +12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391, +12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404, +12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417, +12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430, +12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257, +59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959, +58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972, +58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985, +58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998, +58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011, +59012,59013,59014,59015,59016,59017,59018,59019,59020, +59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033, +59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449, +12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462, +12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475, +12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488, +12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501, +12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514, +12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527, +12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266, +59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056, +59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069, +59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082, +59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095, +59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108, +59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121, +59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134, +59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921, +922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271, +59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953, 954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279, 59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089, 65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076, @@ -565,280 +574,285 @@ 1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093, 1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314, 59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213, -8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895, -9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566, -9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581, -9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609, -9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701, -9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331, -59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466, -242,363,250,468,249,470,472,474,476,252,234,593,59335,324,328,505,609,59337, -59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558, -12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571, -12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584, -12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352, -59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324, -12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252, -13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364, -59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099, -65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114, -65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128, -65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280, -12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388, -59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481, -9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496, -9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511, -9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526, -9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541, -9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400, -59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412, -29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442, -29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458, -29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487, -29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507, -29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523, -29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538, -29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344, -57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357, -57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370, -57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383, -57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396, -57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409, -57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422, -57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435, -57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564, -29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583, -29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600, -29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621, -29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639, -29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660, -29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679, -29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443, -57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456, -57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469, -57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482, -57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495, -57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508, -57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521, -57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690, -29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708, -29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725, -29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746, -29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765, -29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778, -29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799, -29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816, -29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542, -57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555, -57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568, -57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581, -57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594, -57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607, -57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620, -57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830, -29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847, -29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862, -29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878, -29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892, -29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905, -29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925, -29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628, -57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641, -57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654, -57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667, -57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680, -57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693, -57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706, -57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719, -29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955, -29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973, -29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994, -29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023, -30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046, -30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062, -30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080, -30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727, -57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740, -57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753, -57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766, -57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779, -57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792, -57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805, -57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093, -30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121, -30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158, -30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181, -30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203, -30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225, -30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252, -30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276, -57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826, -57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839, -57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852, -57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865, -57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878, -57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891, -57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904, -57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288, -30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305, -30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321, -30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339, -30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362, -30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376, -30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393, -30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710, -21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433, -20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753, -34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116, -24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334, -25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256, -25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465, -26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407, -30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434, -30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453, -30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476, -30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492, -30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513, -30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536, -30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551, -30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961, -40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384, -22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454, -36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606, -24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829, -36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426, -33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853, -20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569, -30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584, -30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607, -30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622, -30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646, -30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662, -30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676, -30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182, -29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091, -33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067, -27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319, -24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179, -27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618, -36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286, -26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124, -29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714, -30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736, -30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766, -30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790, -30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811, -30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825, -30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845, -30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378, -25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818, -36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785, -38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548, -35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536, -32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456, -25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021, -20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856, -30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882, -30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903, -30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920, -30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940, -30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954, -30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972, -30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987, -30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337, -21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402, -26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604, -36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174, -19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030, -30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169, -25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195, -36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998, -30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013, -31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026, -31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047, -31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065, -31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091, -31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111, -31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025, -21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403, -25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291, -24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011, -22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320, -33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747, -22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939, -20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123, -31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137, -31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151, -31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173, -31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194, -31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217, -31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236, -31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254, -31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746, -20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238, -26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585, -36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526, -22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929, -25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558, -23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681, -32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269, -31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282, -31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303, -31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317, -31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331, -31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345, -31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371, -31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144, -21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146, -30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346, -33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857, -39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675, -20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553, -26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964, -20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239, -20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410, -31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425, -31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439, -31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457, -31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475, -31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495, -31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517, -31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995, -25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171, -22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648, -22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487, -32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703, -28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733, -27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548, -38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538, -31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556, -31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585, -31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600, -31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622, -31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640, -31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666, -31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682, -31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844, -23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434, -26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476, -34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346, -35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815, -28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712, -39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101, -22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695, -31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714, -31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732, -31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748, -31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765, -31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780, -31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796, -31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023, -27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898, -32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322, -22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743, -26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548, -36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720, -21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402, +8229,8245,8453,8457,8598,8599,8600,8601, +8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559, +9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574, +9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602, +9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620, +9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325, +59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233, +283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252, +234,593,59335,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552, +12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565, +12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578, +12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346, +59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359, +59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198, +13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508, +59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542, +12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106, +65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121, +65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274, +12275,12276,12277, +12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385, +59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478, +9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493, +9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508, +9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523, +9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538, +9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397, +59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407, +29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438, +29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455, +29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479, +29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504, +29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518, +29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534, +29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550, +29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354, +57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367, +57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380, +57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392, +57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405, +57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418, +57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431, +57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560, +29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576, +29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594, +29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612, +29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635, +29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655, +29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674, +29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439, +57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452, +57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465, +57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478, +57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491, +57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504, +57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517, +57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530, +57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700, +29703,29704,29707,29708,29709,29710,29713,29714,29715, +29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731, +29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755, +29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770, +29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789, +29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804, +29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534, +57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547, +57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560, +57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573, +57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586, +57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599, +57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612, +57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625, +29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837, +29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853, +29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870, +29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884, +29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897, +29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911, +29912,29913,29914,29915,29917,29919,29921,29925,29927, +29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629, +57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642, +57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655, +57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668, +57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681, +57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694, +57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707, +57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939, +29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957, +29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974, +29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998, +30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025, +30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047, +30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063, +30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081, +30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728, +57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741, +57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754, +57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767, +57768,57769,57770,57771,57772,57773,57774,57775,57776, +57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789, +57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802, +57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089, +30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118, +30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150, +30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175, +30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199, +30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221, +30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243, +30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269, +30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823, +57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836, +57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849, +57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862, +57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875, +57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888, +57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901, +57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283, +30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301, +30303,30304,30305,30306,30308,30309,30310,30311,30312, +30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327, +30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351, +30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368, +30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383, +30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400, +30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702, +33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696, +32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453, +25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793, +22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001, +29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150, +32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876, +33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425, +30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441, +30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463, +30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483, +30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501, +30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525, +30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542, +30543,30546,30547,30548,30549,30550,30551,30552,30553, +30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190, +26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811, +28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924, +40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199, +30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534, +36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920, +40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564, +19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573, +30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587, +30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611, +30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627, +30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648, +30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664, +30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678, +30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760, +25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046, +33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807, +37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756, +34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255, +25805,31961,27133,26361,33609,21397,31574,20391,20876, +27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046, +35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416, +39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711, +30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734, +30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762, +30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787, +30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809, +30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823, +30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842, +30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607, +32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034, +21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216, +24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243, +24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831, +24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411, +23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985, +33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853, +30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878, +30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901, +30902,30903,30904,30906,30907,30908,30909,30911,30912, +30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931, +30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947, +30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963, +30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980, +30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788, +25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383, +21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850, +25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176, +27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479, +31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544, +30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574, +27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991, +30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005, +31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020, +31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037, +31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056, +31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083, +31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101, +31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120, +31121,31122,24608,32829,25285,20025,21333,37112,25528, +32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633, +26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423, +24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404, +36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093, +24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291, +30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514, +38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126, +31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140, +31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154, +31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178, +31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197, +31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220, +31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240, +31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259, +31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908, +33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910, +36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208, +32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431, +23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810, +22842,22427,36530,26421,36346,33333,21057,24816,22549, +34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295, +24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268, +31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281, +31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301, +31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316, +31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330, +31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343, +31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370, +31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394, +36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763, +27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867, +22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750, +21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545, +27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016, +23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857, +20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526, +20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409, +31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424, +31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438, +31439,31440,31441,31442,31443,31444,31445,31447,31448, +31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468, +31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486, +31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510, +31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014, +28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220, +33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500, +35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297, +24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018, +38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957, +25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761, +33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356, +24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551, +31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575, +31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594, +31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615, +31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631, +31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652, +31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676, +31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151, +24685,40858,20379,36524,20844,23467,24339,24041,27742, +25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764, +33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929, +25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618, +26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191, +36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690, +26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807, +21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701, +31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720, +31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737, +31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753, +31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770, +31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787, +31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801, +31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559, +37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421, +26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627, +37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309, +21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165, +24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511, +27946,23439,24344,32418,21897,20399,29492,21564,21402, 20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246, 31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824, 31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837, @@ -858,243 +872,247 @@ 31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963, 31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980, 31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996, -31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009, -32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023, -32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038, -32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054, -32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753, -31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049, -34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760, -26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626, -39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362, -23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897, -30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265, -38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064, -32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077, -32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090, -32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103, -32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117, -32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131, -32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144, -32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176, -28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762, -21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047, -22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945, -37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163, -33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445, -30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167, -32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154, -32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168, -32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182, -32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195, -32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208, -32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221, -32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234, -32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247, -32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778, -31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153, -38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792, -20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401, -30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040, -20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518, -30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477, -22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257, -32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270, -32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283, -32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296, -32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309, -32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324, -32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338, -32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459, -27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002, -22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771, -25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487, -28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656, -23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044, -22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568, -29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745, -20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361, -32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374, -32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388, -32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401, -32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430, -32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571, -32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587, -32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256, -25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469, -36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042, -32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282, -32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047, -20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654, -31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647, -20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604, -32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624, -32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643, -32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659, -32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680, -32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698, -32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719, -32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738, -32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830, -38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937, -26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103, -29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155, -29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294, -29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478, -20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857, -32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754, -32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776, -32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803, -32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830, -32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853, -32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868, -32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884, -32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471, -27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348, -34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134, -39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388, -32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177, -27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931, -39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080, -40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894, -32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917, -32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952, -32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979, -32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019, -33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047, -33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063, -33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082, -33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541, -38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522, -26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969, -23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511, -37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130, -26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256, -31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126, -34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093, -33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118, -33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139, -33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164, -33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183, -33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200, -33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220, -33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721, -34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448, -23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149, -21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068, -32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700, -38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311, -20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064, -37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406, -20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246, -33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264, -33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288, -33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306, -33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343, -33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361, -33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377, -33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445, -33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062, -31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228, -24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928, -30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846, -34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943, -30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527, -25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388, -33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414, -33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442, -33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477, -33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516, -33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535, -33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567, -33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591, -33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559, -29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856, -20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110, -30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484, -26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971, -20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071, -31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804, -24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610, -33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648, -33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666, -33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685, -33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703, -33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736, -33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755, -33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301, -25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069, -28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681, -34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808, -25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146, -31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375, -28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041, -29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192, -33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792, -33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815, -33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836, -33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851, -33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867, -33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886, -33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906, -33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435, -37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522, -27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199, -35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748, -20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342, -23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083, -27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746, -27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921, -33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941, -33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958, -33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974, -33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996, -33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017, -34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035, -34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050, -20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862, -20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642, -33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733, -25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245, -28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293, -36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145, -23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989, -29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061, -34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078, -34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095, -34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116, -34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132, -34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149, -34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165, -34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307, -24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160, -39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763, -19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365, -37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551, -25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298, -28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736, -23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179, -34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196, -34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211, -34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230, -34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246, -34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264, -34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279, -34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293, -34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684, -21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388, -28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235, -20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628, -33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487, -35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319, -36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145, -25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305, -34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319, -34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334, -34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349, -34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363, -34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377, -34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397, +31997,31998,31999,32000,32001,32002,32003,32004,32005, +32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019, +32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033, +32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050, +32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521, +21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423, +25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982, +23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841, +20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550, +23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516, +33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099, +37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060, +32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073, +32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086, +32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099, +32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113, +32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127, +32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140, +32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581, +33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086, +33931,26728,22870,35762,21280,37233,38477,34121,26898, +30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389, +33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382, +25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571, +31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819, +23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827, +38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159, +32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173, +32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187, +32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200, +32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213, +32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226, +32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239, +32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170, +33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686, +26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847, +31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087, +33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616, +21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465, +21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899, +25225,25496,20500,29237,35273,20915,35776,32477,22343, +33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258, +32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271, +32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284, +32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297, +32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310, +32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325, +32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339, +32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994, +37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570, +21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335, +28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212, +20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380, +25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840, +22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378, +26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608, +32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362, +32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375, +32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389, +32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402, +32403,32404,32405,32406,32407,32408,32409,32410,32412, +32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542, +32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584, +32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372, +26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771, +21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888, +25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010, +25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253, +34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400, +26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673, +33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598, +32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620, +32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639, +32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656, +32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675, +32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693, +32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713, +32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732, +32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457, +32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860, +32451,31918,20937,26753,31921,33391,20004,36742,37327, +26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730, +38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020, +37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278, +32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311, +30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743, +32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761, +32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787, +32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815, +32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840, +32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861, +32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876, +32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890, +32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475, +33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335, +36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653, +23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365, +20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599, +36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721, +34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314, +34542,28385,34067,26364,24930,28459,32894,32897,32898, +32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921, +32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955, +32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981, +32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023, +33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051, +33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065, +33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084, +33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611, +30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238, +38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376, +38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753, +31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496, +32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218, +24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483, +38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097, +33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121, +33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142, +33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166, +33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185, +33186,33188,33189,33191,33193,33195,33196,33197,33198, +33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214, +33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234, +33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664, +27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675, +26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048, +37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376, +33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877, +23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467, +24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744, +26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244, +33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262, +33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283, +33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304, +33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340, +33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358, +33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374, +33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197, +38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111, +25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866, +36276,29228,24085,24597,29750,25293,25490,29260,24472, +28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049, +32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060, +36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028, +26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259, +21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403, +33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429, +33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467, +33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501, +33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526, +33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555, +33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574, +33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305, +30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735, +30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942, +35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138, +20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689, +26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855, +27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225, +21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599, +33601,33602,33604,33605,33608,33610,33611,33612,33613, +33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651, +33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671, +33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689, +33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710, +33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741, +33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763, +33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085, +21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973, +35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250, +27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789, +20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220, +33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228, +27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234, +37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779, +33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799, +33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819, +33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839, +33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856, +33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870, +33871,33872,33874,33875,33876,33877,33878,33880,33885, +33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904, +33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079, +26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364, +40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880, +22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219, +35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076, +28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785, +20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369, +25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920, +33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940, +33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957, +33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973, +33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995, +33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014, +34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034, +34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049, +34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073, +26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194, +29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892, +27733,25159,32558,22674,20260,21830,36175,26188,19978, +23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461, +22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775, +30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958, +24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055, +34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072, +34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088, +34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110, +34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127, +34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143, +34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158, +34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177, +30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417, +21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630, +39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159, +21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797, +25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803, +27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257, +26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661, +24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190, +34192,34193,34194,34195,34196,34197,34198,34199,34200, +34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217, +34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236, +34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251, +34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269, +34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284, +34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661, +21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700, +30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070, +24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051, +26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487, +37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948, +31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385, +25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427, +22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310, +34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324, +34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338, +34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353, +34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368, +34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386, +34387,34389,34390,34391,34392,34393,34395,34396,34397, 34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374, 36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674, 36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899, @@ -1114,243 +1132,247 @@ 36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171, 20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303, 21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216, -25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703, -34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024, -28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579, -20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591, -34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611, -34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629, -34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650, -34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667, -34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688, -34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708, -34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723, -34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500, -33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890, -39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441, -21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017, -21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791, -21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654, -26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224, -22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738, -34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756, -34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775, -34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791, -34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806, -34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822, -34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839, -34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713, -33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219, -21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247, -23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420, -21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439, -33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140, -28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521, -35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852, -34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865, -34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882, -34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899, -34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922, -34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944, -34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965, -34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982, -34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123, -27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368, -34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571, -24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892, -37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241, -20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040, -39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490, -32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995, -34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012, -35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034, -35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053, -35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075, -35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092, -35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110, -35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873, -30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092, -35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486, -40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766, -28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068, -38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746, -38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196, -20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136, -22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139, -35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153, -35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168, -35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182, -35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196, -35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213, -35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226, -35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002, -21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029, -25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381, -20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413, -26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159, -24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322, -35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899, -38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236, -35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249, -35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262, -35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295, -35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313, -35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327, -35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342, -35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355, -35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639, -34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152, -24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248, -24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491, -20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286, -20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679, -31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481, -24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365, -35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378, -35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392, -35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406, -35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419, -35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432, -35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445, -35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029, -39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253, -21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234, -36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801, -36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472, -36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991, -34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321, -21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711, -35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471, -35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485, -35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498, -35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511, -35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524, -35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537, -35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550, -35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856, -35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415, -26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456, -24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556, -25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746, -34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275, -36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529, -24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560, -35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573, -35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586, -35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600, -35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613, -35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627, -35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640, -35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653, -24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713, -20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286, -21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234, -31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935, -32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724, -32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832, -35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496, -36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663, -35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676, -35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690, -35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704, -35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717, -35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730, -35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743, -35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235, -29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758, -22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331, -26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363, -28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394, -23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062, -35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038, -20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897, -35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914, -35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929, -35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945, -35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964, -35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982, -35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997, -35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010, -36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730, -23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996, -39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868, -22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294, -21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086, -21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169, -20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233, -20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020, -36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033, -36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046, -36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059, -36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072, -36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085, -36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098, -36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311, -20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396, -20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556, -20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565, -20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710, -20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061, -40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822, -20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925, -20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121, -36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204, -36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224, -36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243, -36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258, -36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272, -36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297, -36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751, -35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798, -35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833, -35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862, -35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887, -35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460, -38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015, -37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316, -36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340, -36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363, -36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379, -36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403, -36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429, -36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445, -36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462, -36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084, -37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187, -37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166, -30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654, -22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338, -22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412, -22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516, -22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478, -36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497, -36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513, -36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529, -36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544, -36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557, -36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571, -36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509, -22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729, -25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451, -33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449, -33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543, -33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504, -33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583, -33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581, -36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594, -36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607, -36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620, -36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633, -36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646, -36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659, -36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672, -36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656, -33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659, -33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757, -33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770, -33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914, -33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000, -34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019, +25302,25176,33073,40501,38464,39534,39548,26925,22949, +25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367, +28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113, +19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041, +34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605, +34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625, +34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644, +34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663, +34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680, +34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703, +34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718, +34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807, +24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074, +21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201, +34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583, +28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820, +23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237, +20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512, +35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730, +34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751, +34753,34754,34755,34756,34757,34759,34760,34761,34764, +34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781, +34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797, +34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812, +34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828, +34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845, +34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911, +28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553, +25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414, +22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386, +28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519, +38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814, +24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066, +21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857, +34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871, +34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889, +34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907, +34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932, +34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954, +34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971, +34973,34974,34975,34976,34977,34979,34981,34982,34983, +34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463, +34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809, +25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515, +20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266, +24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462, +32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035, +24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493, +36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996, +34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015, +35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035, +35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054, +35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076, +35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093, +35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111, +35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307, +30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810, +23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493, +21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937, +21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414, +28814,27839,22852,25513,30524,34893,28436,33395,22576, +29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495, +31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679, +28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135, +35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150, +35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163, +35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179, +35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192, +35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210, +35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223, +35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965, +31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326, +20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307, +25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778, +23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131, +37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518, +20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643, +22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544, +35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246, +35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259, +35260,35261,35262,35263,35264,35267,35277,35283,35284, +35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304, +35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320, +35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334, +35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348, +35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156, +40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062, +30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891, +28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080, +29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802, +28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189, +28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495, +33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358, +35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371, +35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384, +35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398, +35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412, +35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425, +35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438, +35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452, +35453,35454,35455,35456,28020,23507,35029,39044,35947, +39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278, +29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053, +23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164, +37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877, +22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531, +26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901, +36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458, +35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473, +35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487, +35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500, +35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513, +35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526, +35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539, +35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552, +35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688, +25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759, +23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467, +24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157, +25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761, +32773,38167,34071,36825,27993,29645,26015,30495,29956, +30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976, +25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558, +35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571, +35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584, +35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598, +35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611, +35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625, +35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638, +35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651, +35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930, +33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351, +27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769, +21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544, +38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788, +31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417, +29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609, +21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661, +35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674, +35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688, +35689,35690,35691,35693,35694,35695,35696,35697,35698, +35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711, +35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724, +35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737, +35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849, +35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186, +31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368, +32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796, +27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376, +33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863, +25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257, +26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408, +59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904, +35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922, +35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939, +35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954, +35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972, +35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990, +35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004, +36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984, +24319,21317,19989,20120,19998,39730,23404,22121,20008, +31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590, +40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389, +21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350, +21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967, +21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193, +20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327, +25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023, +36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036, +36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049, +36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062, +36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075, +36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088, +36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101, +36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342, +20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456, +20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495, +20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588, +20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747, +20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865, +22804,21241,21261,35335,21264,20971,22809,20821,20128, +20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913, +20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120, +36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202, +36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223, +36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242, +36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257, +36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271, +36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296, +36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750, +35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796, +35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830, +35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861, +35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886, +35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461, +38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576, +37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313, +36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338, +36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360, +36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378, +36379,36380,36384,36385,36388,36389,36390,36391,36392, +36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415, +36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439, +36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453, +36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060, +37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150, +37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759, +21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042, +24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329, +22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381, +22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488, +22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472, +36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490, +36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506, +36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521, +36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539, +36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552, +36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566, +36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579, +36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657, +22665,22682,22656,39336,40729,25087,33401,33405,33407, +33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480, +33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439, +33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496, +33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627, +33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631, +33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585, +36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598, +36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611, +36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624, +36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637, +36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650, +36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663, +36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676, +33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706, +33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722, +33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848, +33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776, +33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862, +33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994, +33983,33978,34016,33953,33977,33972,33943,34021,34019, 34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682, 36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695, 36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708, @@ -1370,243 +1392,247 @@ 36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933, 36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956, 36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975, -36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993, -36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012, -37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035, -37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792, -25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489, -21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571, -21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636, -21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618, -21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711, -21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802, -21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062, -37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086, -37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107, -37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126, -37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139, -37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156, -37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171, -37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185, -37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891, -21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908, -21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999, -21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017, -22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105, -22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228, -22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089, -24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206, -37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242, -37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267, -37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284, -37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303, -37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317, -37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338, -37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148, -24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706, -23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780, -23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870, -23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961, -23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476, -24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377, -29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434, -37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362, -37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375, -37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388, -37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401, -37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414, -37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427, -37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440, -37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461, -29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566, -33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284, -39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192, -24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283, -24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574, -24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619, -24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450, -37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463, -37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476, -37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489, -37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503, -37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516, -37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530, -37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543, -24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753, -24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875, -24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385, -38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413, -38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740, -27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856, -27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825, -27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554, -37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567, -37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581, -37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594, -37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607, -37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620, -37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633, -37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976, -27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955, -28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103, -28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078, -28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383, -28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367, -28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532, -28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643, -37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656, -37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669, -37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682, -37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696, -37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709, -37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722, -37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735, -37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655, -28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480, -29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837, -36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886, -36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955, -26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675, -23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662, -22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746, -37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759, -37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772, -37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786, -37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799, -37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812, -37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825, -37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986, -22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011, -23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125, -23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252, -23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351, -23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546, -39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579, -39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424, -32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850, -37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863, -37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876, -37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889, -37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902, -37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915, -37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928, -37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457, -32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497, -32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524, -32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549, -32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186, -30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623, -29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682, -29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938, -37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952, -37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965, -37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978, -37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991, -37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005, -38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018, -38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172, -38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838, -29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891, -38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485, -26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636, -26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674, -26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727, -26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990, -26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240, -38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273, -38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286, -38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299, -38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312, -38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325, -38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338, -38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881, -26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000, -26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051, -27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159, -27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176, -27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524, -27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725, -36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348, -38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361, -38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374, -38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438, -38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462, -38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490, -38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513, -38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531, -38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115, -25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971, -25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141, -26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231, -26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155, -36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275, -35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316, -29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549, -38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566, -38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583, -38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612, -38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627, -38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645, -38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672, -38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663, -25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672, -27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270, -29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948, -32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989, -33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054, -33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148, -33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406, -33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700, -38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719, -38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732, -38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751, -38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769, -38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786, -38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805, -38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459, -27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000, -40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822, -28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977, -29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088, -29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155, -25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072, -31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817, -38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835, -38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849, -38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862, -38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875, -38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895, -38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911, -38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924, -38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925, -25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720, -30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780, -30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826, -30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921, -30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449, -30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544, -30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934, -38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947, -38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960, -38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973, -38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986, -38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999, -39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012, -39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591, -30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030, -30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625, -32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029, -38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061, -38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079, -38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102, -38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122, -39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080, -39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093, -39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106, -39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120, -39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142, -39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157, -39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170, +36976,36977,36978,36979,36982,36983,36984,36985,36986, +36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006, +37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029, +37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783, +25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530, +29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586, +21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617, +21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671, +21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673, +21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795, +21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840, +21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078, +37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102, +37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120, +37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135, +37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149, +37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165, +37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181, +37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808, +21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883, +21983,21949,21950,21908,21913,21994,22007,21961,22047, +21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965, +21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055, +22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116, +22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251, +22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124, +37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215, +37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250, +37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272, +37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289, +37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309, +37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330, +37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344, +37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674, +23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724, +23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847, +23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919, +23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435, +24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914, +24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423, +29417,29426,29428,29431,29441,29427,29443,29434,37350, +37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363, +37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376, +37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389, +37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402, +37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415, +37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428, +37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441, +37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474, +29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307, +22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287, +39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209, +24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296, +24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581, +24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586, +24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451, +37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464, +37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477, +37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490, +37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504, +37505,37506,37507,37508,37509,37510,37511,37512,37513, +37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527, +37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540, +37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731, +24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820, +24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579, +38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410, +38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109, +27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766, +27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898, +27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551, +37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564, +37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578, +37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591, +37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604, +37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617, +37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630, +37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943, +27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983, +27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028, +28003,28186,28103,28101,28126,28174,28095,28128,28177, +28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255, +28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325, +28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487, +28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556, +28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649, +37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662, +37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675, +37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688, +37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702, +37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715, +37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728, +37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601, +28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751, +28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120, +23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840, +36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932, +36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995, +37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700, +24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947, +37740,37741,37742,37743,37744,37745,37746,37747,37748, +37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761, +37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774, +37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788, +37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801, +37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814, +37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827, +37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942, +22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033, +23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138, +23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264, +23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573, +23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549, +39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581, +39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838, +37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852, +37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865, +37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878, +37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891, +37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904, +37905,37906,37907,37908,37909,37910,37911,37912,37913, +37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926, +37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449, +32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494, +32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520, +32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547, +32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563, +32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634, +29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662, +29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936, +37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949, +37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963, +37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976, +37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989, +37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003, +38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016, +38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118, +38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822, +29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882, +38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520, +26535,26485,26536,26526,26541,26507,26487,26492,26608, +26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563, +26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724, +26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767, +26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205, +38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266, +38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280, +38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293, +38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306, +38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319, +38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332, +38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345, +38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946, +26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982, +26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029, +27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216, +27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307, +29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562, +36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734, +36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355, +38356,38357,38358,38359,38360,38361,38362,38363,38364, +38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399, +38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441, +38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474, +38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494, +38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521, +38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537, +38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121, +25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095, +26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166, +26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279, +26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165, +36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279, +35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327, +29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555, +38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570, +38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587, +38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616, +38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630, +38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651, +38652,38653,38655,38658,38659,38661,38666,38667,38668, +38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688, +25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669, +27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266, +29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941, +32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384, +32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078, +33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129, +33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228, +26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699, +38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717, +38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731, +38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749, +38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768, +38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785, +38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803, +38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449, +27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315, +26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828, +28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975, +28977,29043,29020,29032,28997,29042,29002,29048,29050, +29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952, +29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068, +31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155, +24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826, +38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844, +38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857, +38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870, +38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883, +38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906, +38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919, +38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665, +24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795, +27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749, +30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807, +30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898, +30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028, +40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489, +30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929, +38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942, +38943,38944,38945,38946,38947,38948,38949,38950,38951, +38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964, +38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977, +38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990, +38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003, +39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016, +39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604, +30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066, +30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413, +30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039, +38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066, +38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090, +38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107, +38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026, +39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084, +39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097, +39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110, +39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131, +39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148, +39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161, +39162,39163,39164,39165,39166,39167,39168,39169,39170, 39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135, 38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159, 38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187, @@ -1626,211 +1652,215 @@ 29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503, 40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526, 40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554, -40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131, -30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180, -30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245, -30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329, -39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344, -39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357, -39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370, -39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383, -39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396, -39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409, -39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272, -30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315, -30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400, -31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017, -35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091, -35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684, -32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779, -32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419, -39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432, -39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445, -39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458, -39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471, -39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484, -39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497, -39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510, -39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073, -39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445, -34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480, -34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579, -34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595, -34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690, -34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660, -34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520, -39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555, -39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598, -39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622, -39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639, -39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656, -39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672, -39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696, -34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769, -34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873, -34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498, -31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550, -31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601, -31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668, -31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766, -31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701, -39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716, -39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731, -39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754, -39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771, -39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784, -39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797, -39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278, -33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336, -33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949, -34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889, -31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941, -31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755, -31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273, -36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807, -39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820, -39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833, -39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846, -39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859, -39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872, -39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885, -39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898, -39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253, -37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925, -40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311, -36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324, -36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405, -36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468, -36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011, -35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908, -39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921, -39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934, -39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947, -39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960, -39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973, -39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986, -39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390, -35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704, -38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717, -38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834, -37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080, -40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101, -40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117, -40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996, -39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009, -40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022, -40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035, -40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048, -40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062, -40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093, -40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146, -40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151, -40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827, -38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621, -39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181, -39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695, -39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605, -40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738, -40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168, -40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181, -40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194, -40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207, -40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220, -40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233, -40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246, -40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908, -57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921, -57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934, -57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947, -57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960, -57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973, -57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986, -57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999, -58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269, -40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282, -40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295, -40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308, -40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321, -40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334, -40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347, -40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007, -58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020, -58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033, -58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046, -58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059, -58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072, -58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085, -58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357, -40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370, -40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383, -40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396, -40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409, -40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422, -40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435, -40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448, -40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106, -58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119, -58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132, -58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145, -58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158, -58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171, -58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184, -58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458, -40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471, -40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507, -40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545, -40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571, -40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590, -40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606, -40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192, -58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205, -58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218, -58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231, -58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244, -58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257, -58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270, -58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283, -40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633, -40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651, -40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676, -40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694, -40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711, -40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731, -40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746, -40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291, -58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304, -58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317, -58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330, -58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343, -58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356, -58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369, -58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758, -40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777, -40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792, -40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805, -40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818, -40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833, -40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856, -40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985, -58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390, -58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403, -58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416, -58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429, -58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442, -58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455, -58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468, -58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032, -64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383, -11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815, -14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735, -11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996, -59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822, -18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731, -19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476, -58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489, -58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502, -58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515, -58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528, -58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541, -58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554, -58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565, +40555,40556,40561,40557,40563,30098,30100,30102,30112, +30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157, +30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213, +30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325, +39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340, +39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353, +39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366, +39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379, +39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392, +39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405, +39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235, +30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302, +30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381, +31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978, +35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070, +35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091, +32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807, +32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032, +39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428, +39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441, +39442,39443,39444,39445,39446,39447,39448,39449,39450, +39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463, +39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476, +39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489, +39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502, +39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052, +39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388, +34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467, +34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511, +34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513, +34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586, +34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656, +34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728, +34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525, +39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573, +39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605, +39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629, +39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645, +39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664, +39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679, +39680,39681,39682,39684,39685,39686,34758,34696,34693, +34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752, +34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876, +32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531, +31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518, +31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632, +31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697, +31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755, +39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702, +39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717, +39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732, +39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755, +39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772, +39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785, +39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798, +39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281, +33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339, +33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952, +35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901, +31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959, +31976,33390,26280,32703,32718,32725,32741,32737,32742, +32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228, +36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804, +39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817, +39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830, +39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843, +39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856, +39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869, +39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882, +39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895, +39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236, +37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301, +37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282, +36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323, +36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410, +36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470, +36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973, +35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905, +39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918, +39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931, +39932,39933,39934,39935,39936,39937,39938,39939,39940, +39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953, +39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966, +39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979, +39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992, +39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662, +38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839, +40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655, +38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069, +40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091, +40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109, +40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125, +40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002, +40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015, +40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028, +40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041, +40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054, +40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076, +40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127, +40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141, +40142,40143,40144,40147,40148,40149,40151,40152,40153, +40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834, +38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627, +39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253, +39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711, +39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667, +40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751, +40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170, +40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183, +40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196, +40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209, +40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222, +40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235, +40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248, +40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910, +57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923, +57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936, +57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949, +57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962, +57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975, +57976,57977,57978,57979,57980,57981,57982,57983,57984, +57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997, +57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267, +40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280, +40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293, +40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306, +40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319, +40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332, +40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345, +40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005, +58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018, +58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031, +58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044, +58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057, +58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070, +58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083, +58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355, +40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368, +40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381, +40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394, +40395,40396,40397,40398,40399,40400,40401,40402,40403, +40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416, +40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429, +40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442, +40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100, +58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113, +58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126, +58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139, +58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152, +58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165, +58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178, +58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452, +40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465, +40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478, +40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532, +40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565, +40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581, +40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599, +40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615, +40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199, +58200,58201,58202,58203,58204,58205,58206,58207,58208, +58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221, +58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234, +58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247, +58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260, +58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273, +58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621, +40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639, +40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658, +40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683, +40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698, +40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714, +40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734, +40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750, +40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294, +58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307, +58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320, +58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333, +58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346, +58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359, +58360,58361,58362,58363,58364,58365,58366,58367,58368, +58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757, +40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776, +40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791, +40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804, +40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817, +40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830, +40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855, +40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975, +63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389, +58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402, +58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415, +58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428, +58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441, +58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454, +58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467, +58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031, +64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427, +13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799, +14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470, +16735,11950,17207,11955,11958,11959,59451,17329,17324, +11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810, +18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615, +19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492, +58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484, +58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497, +58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510, +58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523, +58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536, +58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549, +58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562, +58563,58564,58565, diff --git a/src/locale/jis0208.h b/src/locale/jis0208.h index f465b9d8..de9c5f26 100644 --- a/src/locale/jis0208.h +++ b/src/locale/jis0208.h @@ -13,159 +13,163 @@ 65299,65300,65301,65302,65303,65304,65305,0,0,0,0,0,0,0,65313,65314,65315, 65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328, 65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,0,0,0,0,0,0,65345, -65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358, -65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,0,0,0, -0,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364, -12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377, -12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390, -12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403, -12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416, -12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429, -12430,12431,12432,12433,12434,12435,0,0,0,0,0,0,0,0,0,0,0,12449,12450,12451, -12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464, -12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477, -12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490, -12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503, -12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516, -12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529, -12530,12531,12532,12533,12534,0,0,0,0,0,0,0,0,913,914,915,916,917,918,919,920, -921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,0,0,0,0,0,0,0, -0,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964, -965,966,967,968,969,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050, -1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065, -1066,1067,1068,1069,1070,1071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1072,1073,1074, -1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088, -1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,0, -0,0,0,0,0,0,0,0,0,0,0,0,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524, -9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512, -9527,9535,9501,9520,9509,9528,9538,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +65346,65347, +65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360, +65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,0,0,0,0,12353, +12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366, +12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379, +12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392, +12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405, +12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418, +12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431, +12432,12433,12434,12435,0,0,0,0,0,0,0,0,0,0,0,12449,12450,12451,12452,12453, +12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466, +12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479, +12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492, +12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505, +12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518, +12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531, +12532,12533,12534,0,0,0,0,0,0,0,0,913,914,915,916,917,918,919,920,921,922,923, +924,925,926,927,928,929,931,932,933,934,935,936,937,0,0,0,0,0,0,0,0,945,946, +947,948,949,950,951,952,953, +954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1040,1041,1042,1043, +1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057, +1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081, +1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096, +1097,1098,1099,1100,1101,1102,1103,0,0,0,0,0,0,0,0,0,0,0,0,0,9472,9474,9484, +9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507, +9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20124, -21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569, -28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156, -32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797, -26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847, -24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586, -36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920, -31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139, -32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632, -21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013, -21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344, -24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907, -35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870, -22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017, -29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989, -20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158, -40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057, -20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339, -21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827, -28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662, -35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253, -33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315, -24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784, -30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475, -23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521, -22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579, -29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731, -27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688, -25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788, -26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000, -33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014, -23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707, -26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649, -31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291, -38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524, -23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522, -22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827, -26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215, -35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452, -25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738, -38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050, -34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429, -27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275, -21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142, -39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281, -21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211, -27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514, -20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220, -22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740, -34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590, -30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507, -36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402, -29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557, -37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865, -24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054, -31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605, -38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424, -27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048, -21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309, -29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749, -38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694, -32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049, -24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382, -35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087, -24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881, -20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521, -21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195, -24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477, -26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968, -32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892, -34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321, -39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811, -21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794, -39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127, -26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919, -24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661, -20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168, -28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092, -22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524, -30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679, -26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217, -38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808, -25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184, -26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763, -22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031, -26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930, -33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503, -20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246, -29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672, -40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287, -28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294, -20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503, -37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369, -24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202, -39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447, -23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311, -33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303, -20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809, -23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149, -30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462, -32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210, -32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500, -20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100, -23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484, -25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248, -28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057, -32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284, -37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580, -22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,20124,21782,23043,38463,21696,24859,25384,23030, +36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311, +26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433, +24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258, +22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227, +32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946, +37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693, +21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515, +21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198, +22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939, +38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945, +29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742, +35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513, +25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960, +37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106, +27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740, +23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979, +21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521, +31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457, +33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442, +20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171, +20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296, +25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542, +35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903, +35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508, +24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611, +37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263, +26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676, +19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107, +40232,26658,33541,33841,31909,21000,33477,29926,20094, +20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515, +24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475, +27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566, +32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501, +38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107, +38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492, +23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112, +27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215, +36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836, +27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507, +21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992, +20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875, +28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040, +25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139, +20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932, +22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421, +30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597, +26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670, +26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641, +36817,37329,21535,37504,20061,20534,21477,21306,29399, +29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598, +23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705, +31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676, +36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411, +22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179, +30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686, +36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625, +27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860, +21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177, +29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963, +37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572, +29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396, +24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776, +34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566, +23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062, +39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475, +21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184, +24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356, +26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295, +31968,32005,32024,32094,32177,32789,32771,32943,32945, +33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783, +37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335, +28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508, +28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372, +22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746, +20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782, +35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425, +25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048, +33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586, +27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388, +26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334, +25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194, +19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386, +34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050, +21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535, +24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049, +31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566, +36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345, +26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940, +36766,27728,40575,24335,35672,40235,31482,36600,23437, +38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455, +34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198, +26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610, +26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432, +25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610, +23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833, +25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728, +36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102, +26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302, +31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423, +20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255, +38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295, +35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280, +21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569, +23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157, +26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151, +30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121, +34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556, +38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773, +25854,26465,26454,27972,29366,30067,31331,33976,35698, 37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302, 39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910, 25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051, @@ -185,359 +189,365 @@ 21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514, 26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311, 35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245, -23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035, -27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609, -33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679, -24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204, -36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403, -23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816, -25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111, -24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864, -36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711, -21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582, -33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799, -26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086, -27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723, -22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347, -24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481, -31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277, -26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511, -33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427, -24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678, -35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784, -29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618, -26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378, -22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998, -21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799, -27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336, -40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505, -25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028, -36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956, -23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778, -21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616, -22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120, -28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040, -33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472, -38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796, -36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602, -29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702, -22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027, -20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335, -26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319, -26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074, -23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043, -22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226, -25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259, -25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186, -26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833, -20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333, -28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368, -24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244, -31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070, -25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009, -31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290, -21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130, -30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147, -31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305, -30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019, -23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413, -35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428, -25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142, -23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104, -33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889, -34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119, -33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132, -22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341, -20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731, -22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794, -36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497, -29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515, -20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918, -26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090, -35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952, -24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584, -35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287, -30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406, -25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180, -26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397, -32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724, -23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961, -29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855, -37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169, -33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446, -26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063, -20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493, -38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778, -21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495, -30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982, -35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954, -27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362, -36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746, -35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396, -28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023, -35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316, -29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142, -20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391, -35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747, -33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363, -20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802, -26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244, -32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105, -24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635, -37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031, -24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056, -20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147, -20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314, -20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369, -20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452, -20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478, -20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600, -20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717, -20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794, -20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846, -20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898, -20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960, -34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038, -21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119, -21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173, -21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254, -21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312, -21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378, -21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166, -21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545, -21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622, -21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698, -21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730, -21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913, -21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895, -21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013, -22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124, -22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204, -22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276, -22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350, -22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436, -22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557, -22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699, -22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748, -22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790, -22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882, -22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016, -23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113, -23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270, -23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363, -23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992, -23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522, -23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586, -23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066, -23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742, -23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839, -23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923, -23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009, -24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091, -24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181, -24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285, -24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318, -24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396, -24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447, -24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571, -24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625, -24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646, -24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730, -24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560, -24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835, -24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876, -24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933, -24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977, -25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037, -25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101, -25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182, -25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219, -25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282, -25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406, -25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525, -25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652, -25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898, -25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794, -25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850, -25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912, -30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722, -26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080, -26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180, -26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254, -26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330, -26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712, -26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505, -26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604, -26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292, -26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751, -26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810, -26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836, -26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922, -26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937, -26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071, -27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040, -27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141, -27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250, -27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268, -27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359, -27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447, -30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512, -27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567, -27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631, -40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789, -27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863, -27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958, -27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025, -27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102, -28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205, -28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227, -28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349, -28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396, -28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538, -28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610, -28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632, -28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532, -28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844, -28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013, -29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143, -29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183, -29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254, -29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362, -29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450, -29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546, -29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678, -29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761, -29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908, -29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955, -29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026, -30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087, -30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133, -30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204, -30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242, -30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313, -30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350, -30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418, -30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494, -30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590, -30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651, -30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018, -30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918, -30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994, -30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103, -31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212, -31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287, -31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381, -31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437, -31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503, -31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565, -31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640, -31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695, -31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731, -31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811, -31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888, -31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936, -31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006, -32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086, -32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186, -32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176, -32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305, -32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314, -32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213, -32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411, -32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607, -32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670, -32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714, -32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792, -32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866, -32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915, -32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007, -33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137, -33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187, -33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229, -33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282, -33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368, -33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406, -33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530, -33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586, -33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695, -33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704, -33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778, -33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911, -33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977, -33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047, -34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113, -34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282, -34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277, -34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381, -20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479, -34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543, -34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623, -34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664, -34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752, -34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829, -34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873, -34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933, -34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007, -34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058, -35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126, -35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198, -35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261, -35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355, -35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461, -35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546, -35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591, -35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649, -35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709, -35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916, -35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982, -35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033, -36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112, -40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286, -36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360, -36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425, -36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481, -36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528, -36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618, -36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665, -36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764, -36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869, -36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921, -36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975, -36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041, -37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208, -37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301, -37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365, -37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448, -37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609, -37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728, -37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848, -37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931, -37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000, -38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294, -38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339, -38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447, -38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541, -38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606, -38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670, -38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728, -38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780, -38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851, -38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968, -38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027, -39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188, -39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237, -39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391, -39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429, -39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511, -39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633, -39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671, -39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726, -39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825, -39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890, -39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955, -39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007, +23435,23652,21277,24803,24819,25436,25475,25407,25531, +25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967, +32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783, +38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363, +24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966, +20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409, +21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534, +23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151, +33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261, +38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730, +35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890, +33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022, +22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829, +32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527, +20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933, +39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013, +20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376, +27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115, +24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522, +32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189, +25431,30452,26389,27784,29645,36035,37806,38515,27941, +22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460, +26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514, +37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213, +24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224, +33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973, +28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856, +22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583, +28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193, +30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594, +20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764, +25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403, +30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588, +35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530, +23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311, +24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984, +31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788, +35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598, +28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108, +23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615, +38894,20219,22922,24525,35469,28641,31152,31074,23527, +33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492, +22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773, +35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309, +25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757, +26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271, +21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448, +29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161, +32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567, +38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644, +26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684, +37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329, +21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382, +30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800, +20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091, +39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195, +32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961, +24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996, +27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500, +20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178, +33433,35676,36000,36070,36212,38428,38468,20398,25771, +27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489, +24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826, +20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991, +32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491, +31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255, +31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610, +22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597, +31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214, +25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804, +34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621, +21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033, +32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696, +25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412, +32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737, +27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411, +27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749, +24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496, +21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629, +26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754, +40634,25720,27169,33538,22916,23391,27611,29467,30450, +32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870, +36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357, +30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840, +27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962, +25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009, +37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934, +23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407, +32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442, +27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931, +32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519, +23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575, +31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452, +40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753, +28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147, +32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792, +22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036, +33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010, +24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791, +27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010, +28431,29282,29436,31725,32769,32894,34635,37070,20845, +40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528, +40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101, +35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174, +20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315, +20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358, +20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506, +20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497, +20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634, +20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718, +20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796, +20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866, +22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906, +20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969, +20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049, +21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133, +21140,21138,21105,21128,21137,36776,36775, +21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235, +21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295, +21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358, +22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762, +38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549, +21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616, +21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700, +21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757, +21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847, +21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934, +21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036, +22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072, +22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190, +22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254, +22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300, +22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409, +22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486, +22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649, +22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743, +22745,22744,22757,22748,22756,22751,22767,22778,22777, +22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840, +22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904, +22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077, +23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194, +23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308, +23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386, +23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480, +23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542, +23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622, +23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700, +22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802, +23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834, +23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970, +23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027, +24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128, +24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224, +24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296, +24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331, +24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407, +24409,24417,24429,24435,24439,24451,24450,24447,24458, +24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548, +24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603, +24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653, +24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708, +24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765, +24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865, +24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884, +24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945, +24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003, +25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062, +25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100, +25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187, +25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236, +25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287, +25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421, +25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451, +25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606, +25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749, +25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841, +25831,33289,25824,25825,25260,25827,25839,25900,25846, +25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909, +25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976, +25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066, +26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164, +26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224, +26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308, +26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398, +26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457, +26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551, +26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574, +26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713, +26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740, +26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849, +26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848, +26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964, +27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058, +27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047, +27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129, +27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155, +27204,27148,27250,27190,27256,27207,27234,27225,27238, +27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331, +27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326, +27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465, +27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533, +27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590, +27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684, +27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763, +27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834, +27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955, +27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153, +28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101, +28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222, +28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216, +28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303, +28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399, +28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659, +28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601, +28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666, +28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722, +28753,28771,28825,28818,28847,28913,28844,28856,28851, +28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030, +29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118, +29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200, +29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272, +29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382, +29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462, +29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552, +29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858, +29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801, +29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920, +29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964, +29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043, +30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090, +30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136, +30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192, +30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260, +30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311, +30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355, +30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433, +30437,30439,30442,34351,30459,30472,30471,30468,30505, +30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565, +30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652, +30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014, +30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895, +30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964, +30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059, +31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189, +31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291, +31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368, +31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431, +31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472, +31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610, +31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598, +31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681, +31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751, +31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805, +31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861, +31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929, +31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990, +31994,32006,32002,32028,32021,32010,32069,32075,32046, +32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147, +32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317, +32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225, +32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315, +32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377, +32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402, +32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590, +32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646, +32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686, +32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761, +39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842, +32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893, +32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985, +32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539, +33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162, +33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208, +33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248, +33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321, +33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386, +33387,33326,33393,33399,33400,33406,33421,33426,33451, +33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531, +33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593, +33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571, +33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771, +33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824, +33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902, +33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009, +33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072, +34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133, +34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167, +34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314, +34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399, +34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480, +34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568, +34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597, +34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643, +34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731, +34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807, +34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884, +34882,34898,34905,34910,34914,34923,34945,34942,34974, +34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992, +35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048, +35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131, +35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191, +35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258, +35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340, +35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426, +35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522, +35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596, +35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624, +35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700, +35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912, +35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981, +35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040, +36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109, +36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290, +36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348, +36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423, +36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476, +36481,36487,36485,36484,36491,36490,36499,36497,36500, +36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579, +36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635, +36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695, +36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834, +36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886, +36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926, +36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002, +37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145, +37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250, +37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334, +37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470, +37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531, +37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667, +37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817, +37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907, +37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984, +37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015, +38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331, +38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373, +38370,38433,38440,38446,38447,38466,38476,38479,38475, +38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570, +38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149, +38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681, +38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752, +38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795, +38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876, +38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973, +38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094, +39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198, +39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250, +39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377, +39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479, +39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524, +39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647, +39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706, +39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747, +39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840, +39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892, +39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954, +39946,39940,39982,39963,39973,39972,39969,39984,40007, 39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200, 40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255, 40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363, @@ -547,4 +557,7 @@ 40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680, 40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737, 40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810, -40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081, +40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0, diff --git a/src/locale/ksc.h b/src/locale/ksc.h index 8f6eca4b..cf2ec689 100644 --- a/src/locale/ksc.h +++ b/src/locale/ksc.h @@ -14,351 +14,357 @@ 65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312, 65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325, 65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338, -65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351, -65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364, -65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,12593,12594,12595, -12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608, -12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621, -12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634, -12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647, -12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660, -12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673, -12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686, -8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,0,0,0,0,0,8544,8545,8546, -8547,8548,8549,8550,8551,8552,8553,0,0,0,0,0,0,0,913,914,915,916,917,918,919, -920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,0,0,0,0,0, -0,0,0,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963, -964,965,966,967,968,969,0,0,0,0,0,0,9472,9474,9484,9488,9496,9492,9500,9516, -9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504, -9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493, -9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525, -9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13205,13206,13207,8467, -13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215, -13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224, -13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186, -13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204, -8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225, -13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,198,208,170,294,0,306,0,319,321,216,338,186,222,358,330,0,12896, -12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909, -12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922, -12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437, -9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314, -9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188, -190,8539,8540,8541,8542,230,273,240,295,305,307,312,320,322,248,339,223,254, -359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810, -12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823, -12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381, -9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396, -9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345, -9346,185,178,179,8308,8319,8321,8322,8323,8324,12353,12354,12355,12356,12357, -12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370, -12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383, -12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396, -12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409, -12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422, -12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435, -0,0,0,0,0,0,0,0,0,0,0,12449,12450,12451,12452,12453,12454,12455,12456,12457, -12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470, -12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483, -12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496, -12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509, -12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522, -12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,0,0,0, -0,0,0,0,0,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051, -1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066, -1067,1068,1069,1070,1071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1072,1073,1074,1075, -1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089, -1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,0,0,0,0, +65339,65510,65341,65342,65343,65344,65345,65346,65347, +65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360, +65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373, +65507,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604, +12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617, +12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630, +12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643, +12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656, +12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669, +12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682, +12683,12684,12685,12686,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,0,0, +0,0,0,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,0,0,0,0,0,0,0,913,914, +915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934, +935,936,937,0,0,0,0,0,0,0,0,945,946,947,948,949,950,951,952,953,954,955,956, +957,958,959,960,961,963,964,965,966,967,968,969,0,0,0,0,0,0,9472,9474,9484, +9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507, +9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490, +9489,9498,9497,9494,9493,9486,9485,9502, +9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530, +9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13205,13206,13207,8467,13208,13252,13219, +13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218, +13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234, +13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242, +13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249, +13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228, +13277,13264,13267,13251,13257,13276,13254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198, +208,170,294,0,306,0,319,321,216,338,186,222,358,330,0,12896,12897,12898,12899, +12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912, +12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425, +9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440, +9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317, +9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540, +8541,8542,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331, +329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811, +12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824, +12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383, +9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332, +9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178, +179,8308,8319,8321,8322,8323,8324,12353,12354,12355,12356,12357,12358,12359, +12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372, +12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385, +12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398, +12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411, +12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424, +12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,0,0,0,0,0,0, +0,0,0,0,0,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459, +12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472, +12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485, +12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498, +12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511, +12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524, +12525,12526,12527,12528,12529,12530,12531, +12532,12533,12534,0,0,0,0,0,0,0,0,1040,1041,1042,1043,1044,1045,1025,1046, +1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061, +1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085, +1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100, +1101,1102,1103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,44032,44033,44036,44039,44040,44041,44042,44048, +44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064, +44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116, +44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165, +44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200, +44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232, +44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273, +44275,44277,44278,44284,44285,44288,44292,44294,44300,44301,44303,44305,44312, +44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361, +44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411, +44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471, +44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540, +44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600, +44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630, +44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,44665,44667, +44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751, +44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808, +44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867, +44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945, +44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012, +45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076, +45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143, +45145,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210, +45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233, +45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268, +45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339, +45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376, +45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436, +45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516, +45520,45524,45532,45533,45535,45544,45545,45548,45552, +45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600, +45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705, +45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740, +45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796, +45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816, +45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845, +45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,45927,45929, +45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968, +45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036, +46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112, +46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188, +46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288, +46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356, +46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388, +46392,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429, +46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516, +46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572, +46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752, +46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889, +46892,46895,46896,46904,46905,46907,46916,46920,46924, +46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980, +46988,46989,46991,46992,46993,46994,46998,46999,47000,47001,47004,47008,47016, +47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092, +47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131, +47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185, +47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272, +47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329, +47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421, +47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,47467,47469, +47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533, +47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569, +47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604, +47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680, +47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717, +47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784, +47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833, +47868,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925, +47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952, +47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055, +48064,48068,48072,48080,48083,48120,48121,48124,48127, +48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151, +48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177, +48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260, +48261,48264,48267,48268,48270,48276,48277,48279,48281,48282,48288,48289,48292, +48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335, +48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391, +48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484, +48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537, +48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632, +48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712, +48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,48744,48746, +48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783, +48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868, +48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964, +48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119, +49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312, +49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341, +49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373, +49380,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429, +49436,49437,49438,49439,49440,49443,49444,49446,49447, +49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483, +49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524, +49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573, +49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636, +49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688, +49689,49692,49695,49696,49704,49705,49707,49709,49711,49713,49714,49716,49736, +49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791, +49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844, +49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905, +49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941, +49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040, +50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146, +50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,50228,50236, +50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360, +50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452, +50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505, +50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528, +50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567, +50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616, +50617,50619,50620,50621,50622,50628,50629,50630,50631, +50632,50633,50634,50636,50638,50640,50641,50644,50648,50656,50657,50659,50661, +50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689, +50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728, +50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756, +50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808, +50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853, +50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892, +50893,50896,50900,50908,50909,50912,50913,50920,50921,50924,50928,50936,50937, +50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984, +50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023, +51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060, +51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086, +51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110, +51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150, +51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,51216,51217, +51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260, +51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329, +51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388, +51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452, +51453,51456,51460,51461,51462,51468,51469,51471,51473, +51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572, +51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655, +51656,51658,51664,51665,51667,51669,51670,51673,51674,51676,51677,51680,51682, +51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721, +51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807, +51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919, +51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001, +52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152, +52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263, +52264,52265,52268,52270,52272,52280,52281,52283,52284,52285,52286,52292,52293, +52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341, +52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412, +52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492, +52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588, +52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649, +52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744, +52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,52824,52825, +52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868, +52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908, +52909,52929,52964,52965,52968,52971,52972,52980,52981, +52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024, +53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093, +53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188, +53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272, +53293,53300,53301,53304,53308,53316,53317,53319,53321,53328,53332,53336,53344, +53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429, +53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468, +53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556, +53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597, +53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681, +53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805, +53808,53812,53820,53821,53823,53825,53832,53852,53860,53888,53889,53892,53896, +53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952, +53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008, +54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047, +54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084, +54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172, +54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224, +54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,54280,54301, +54336,54340,54364,54368,54372,54381,54383,54392,54393, +54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484, +54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549, +54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624, +54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664, +54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756, +54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801, +54803,54804,54805,54812,54816,54820,54829,54840,54841,54844,54848,54853,54856, +54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900, +54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969, +54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024, +55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083, +55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127, +55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169, +55176,55177,55180,55184,55192,55193,55195,55197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44032,44033,44036,44039,44040,44041,44042, -44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061, -44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109, -44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164, -44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193, -44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228, -44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272, -44273,44275,44277,44278,44284,44285,44288,44292,44294,44300,44301,44303,44305, -44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359, -44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406, -44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452, -44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537, -44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599, -44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628, -44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,44665, -44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749, -44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807, -44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866, -44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944, -44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006, -45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072, -45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141, -45143,45145,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209, -45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231, -45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265, -45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337, -45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369, -45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433, -45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480, -45516,45520,45524,45532,45533,45535,45544,45545,45548,45552,45561,45563,45565, -45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656, -45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716, -45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768, -45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800, -45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819, -45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909, -45910,45912,45915,45916,45918,45919,45924,45925,45927,45929,45931,45934,45936, -45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985, -45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041, -46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123, -46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237, -46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301, -46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363, -46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,46400,46401, -46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433, -46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524, -46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612, -46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764, -46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896, -46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961, -46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998, -46999,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032, -47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112, -47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157, -47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213, -47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301, -47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355, -47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449, -47452,47456,47464,47465,47467,47469,47476,47477,47480,47484,47492,47493,47495, -47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560, -47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585, -47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617, -47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699, -47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736, -47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801, -47803,47805,47812,47816,47832,47833,47868,47872,47876,47885,47887,47889,47896, -47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940, -47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012, -48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121, -48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149, -48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173, -48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208, -48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,48281,48282,48288, -48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324, -48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388, -48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472, -48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531, -48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624, -48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708, -48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740, -48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780, -48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864, -48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960, -48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108, -49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300, -49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334, -49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371, -49372,49373,49380,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416, -49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453, -49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485, -49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541, -49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577, -49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648, -49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692, -49695,49696,49704,49705,49707,49709,49711,49713,49714,49716,49736,49744,49745, -49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800, -49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847, -49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912, -49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948, -49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044, -50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153, -50157,50164,50165,50168,50184,50192,50212,50220,50224,50228,50236,50237,50248, -50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409, -50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472, -50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508, -50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532, -50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573, -50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619, -50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,50640, -50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678, -50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704, -50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740, -50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773, -50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827, -50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872, -50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912, -50913,50920,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964, -50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004, -51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030, -51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075, -51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096, -51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133, -51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180, -51200,51201,51204,51208,51210,51216,51217,51219,51221,51222,51228,51229,51232, -51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284, -51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340, -51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413, -51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468, -51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555, -51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648, -51649,51652,51655,51656,51658,51664,51665,51667,51669,51670,51673,51674,51676, -51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708, -51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796, -51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908, -51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988, -51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088, -52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253, -52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,52284,52285, -52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326, -52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404, -52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481, -52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572, -52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644, -52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731, -52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787, -52789,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853, -52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899, -52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983, -52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028, -53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095, -53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216, -53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293, -53300,53301,53304,53308,53316,53317,53319,53321,53328,53332,53336,53344,53356, -53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431, -53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469, -53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560, -53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599, -53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683, -53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808, -53812,53820,53821,53823,53825,53832,53852,53860,53888,53889,53892,53896,53904, -53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954, -53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016, -54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048, -54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085, -54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176, -54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232, -54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,54280,54301,54336, -54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408, -54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512, -54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596, -54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637, -54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729, -54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773, -54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816, -54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868, -54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928, -54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988, -54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044, -55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100, -55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139, -55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192, -55193,55195,55197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20285,20339,20551,20729, -21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634, -30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051, -21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718, -22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965, -31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883, -31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954, -26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,21283, -23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394, -24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611, -37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114, -28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353, -63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192, -28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314, -24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133, -21138,27298,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684, -27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211, -35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609, -37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218, -24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855, -29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686, -35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395, -23622,24760,25106,26690,26800,26856,28330,30028,30328,30926,31293,31995,32363, -32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396, -23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590, -31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747, -36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288, -22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592, -20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354, -34467,36002,38799,20018,23521,25096,26524,29916,31185,33747,35463,35506,36328, -36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874, -27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669, -25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568, -33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088, -39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898, -25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686, -37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,21312,21475, -21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601, -27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350, -32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476, -37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531, -31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406, -33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413, -29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512, -36020,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998, -33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224, -20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681, -27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810, -26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450, -24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864, -21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190, -24524,25216,26071,26083,26398,26399,26462,26827,26820,27231,27450,27683,27773, -27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047, -31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215, -37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708, -37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760, -63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771, -63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511, -26976,28275,63778,30007,63779,63780,63781,32013,63782,63783,34930,22218,23064, -63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899, -24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361, -24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801, -63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813, -33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821, -63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830, -63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,20025,20150,20294, -21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222, -34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812, -26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663, -27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070, -31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825, -29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294, -22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691, -26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241, -36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272, -29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788, -28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481, -26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460, -26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975, -37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078, -63835,30313,32645,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853, -63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068, -36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240, -34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802, -20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391, -35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670, -31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019, -36706,38722,24976,25088,25891,28451,29001,29833,32244,32879,34030,36646,36899, -37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557, -20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894, -37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736, -25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791, -40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407, -28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102, -20698,23534,24278,26009,29134,30274,30637,32842,34044,36988,39719,40845,22744, -23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129, -26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006, -20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20285,20339,20551,20729,21152,21487,21621,21733, +22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540, +34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932, +27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185, +25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925, +33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638, +38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976, +30131,30435,30640,32058,37039,37969,37970,40853,21283,23724,30002,32987,37440, +38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086, +31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171, +20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422, +31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301, +20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382, +63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388, +36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,30652,37392, +40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233, +38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225, +27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435, +20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004, +25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169, +30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885, +37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106, +26690,26800,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489, +35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335, +25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771, +32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599, +39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825, +26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849, +21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799, +20018,23521,25096,26524,29916,31185,33747,35463,35506,36328,36942,37707,38982, +24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743, +29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362, +20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350, +25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024, +32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211, +29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509, +39851,19992,20037,20061,20167,20465,20855,21246,21312,21475,21477,21646,22036, +22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590, +27628,27714,28317,28792,29399,29590,29699,30655,30697, +31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041, +37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628, +21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353, +31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519, +21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231, +27512,36020,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429, +31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752, +27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020, +26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935, +25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235, +21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854, +20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049, +24190,24524,25216,26071,26083,26398,26399,26462,26827,26820,27231,27450,27683, +27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041, +31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912, +36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326, +26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759, +63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770, +63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777, +26511,26976,28275,63778,30007,63779,63780,63781,32013, +63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839, +22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527, +23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797, +63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809, +63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817, +23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016, +63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346, +22810,33590,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573, +28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136, +36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213, +34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616, +24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565, +23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503, +24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466, +24764,25361,25481,25623,26691,26873,27330,28120,28193,28372,28644,29182,30428, +30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709, +38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697, +24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908, +20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012, +33891,37509,20828,26007,26460,26515,30168,31431,33651, +63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225, +29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,34367, +34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838, +20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900, +27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010, +29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142, +20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406, +20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317, +39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088, +25891,28451,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155, +27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839, +23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936, +40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696, +29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103, +32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894, +20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009, +29134,30274,30637,32842,34044,36988,39719,40845,22744,23105,23650,27155,28122, +28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969, +28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374, +20523,23833,28138,32184,36650,24459,24900,26647,63841, 38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400, 21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178, 31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136, @@ -378,243 +384,247 @@ 33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595, 28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664, 20497,21006,21563,21839,25991,27766,32010,32011,32862,34442,38272,38639,21247, -27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228, -30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935, -26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338, -25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334, -34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075, -27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784, -36820,38930,39151,21187,25300,25765,28196,28497,30332,36299,37297,37474,39662, -39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121, -26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607, -37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953, -30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091, -26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115, -34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359, -31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,30887,34327, -38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712, -19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177, -31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541, -29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489, -26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086, -20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562, -36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827, -23142,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526, -31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212, -36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868, -22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033, -38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989, -20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503, -27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192, -31875,32203,32737,32933,33086,33218,33778,34586,35048,35513,35692,36027,37145, -38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277, -29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282, -20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531, -23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515, -27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114, -32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034, -39164,39391,40605,21066,63849,26388,63850,20632,21034,23665,25955,27733,29642, -29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851, -26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687, -20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705, -27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937, -36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989, -63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257, -26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,32997,33298,34223, -35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512, -27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307, -23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218, -32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245, -39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634, -40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854, -22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596, -32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855, -36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803, -27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787, -32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439, -23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956, -39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753, -30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723, -23744,24101,24833,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929, -28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143, -32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930, -36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706, -21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033, -24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636, -31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348, -25100,34899,36848,37477,23815,23847,23913,29791,33181,34664,28629,25342,32722, -35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365, -21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178, -26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925, -35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672, -36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180, -30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857, -36805,22833,23460,23526,24713,23529,23563,24515,27777,63858,28145,28683,29978, -33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784, -25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538, -23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823, -23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555, -38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232, -20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326, -28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,27387, -32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860, -37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864, -63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673, -29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525, -63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740, -25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474, -20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873, -22914,63874,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671, -36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884, -30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310, -63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890, -28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894, -32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902, -24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909, -28814,28976,29744,33398,33490,63910,38331,39653,40573,26308,63911,29121,33865, -63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704, -27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908, -30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923, -63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454, -34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116, -20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735, -63929,25034,25942,26111,26212,26791,27738,28595,28879,29100,29522,31613,34568, -35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277, -34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926, -31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609, -29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448, -26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031, -63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303, -25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,31368,31407, -32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958, -27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248, -24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362, -37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588, -24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419, -34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161, -26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464, -34131,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729, -22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304, -29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234, -37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234, -29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759, -20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736, -24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833, -27943,63946,28216,63947,28641,29494,29495,63948,29788,30001,63949,30290,63950, -63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986, -37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801, -22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961, -63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518, -37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957, -25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097, -30691,32681,33380,34191,34811,34915,35516,35696,37291,20108,20197,20234,63965, -63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246, -29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975, -63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714, -32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341, -24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986, -63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922, -23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,63991,63992,63993, -20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675, -24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071, -34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189, -33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668, -31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196, -24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456, -31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263, -38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289, -35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632, -22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053, -33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514, -23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735, -33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659, -20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643, -27583,27656,28593,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686, -32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999, -25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896, -38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979, -23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622, -26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010, -30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194, -37336,37478,37580,37664,38662,38742,38748,38914,40718,21046,21137,21884,22564, -24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420, -37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427, -25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031, -29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368, -32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165, -26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752, -24939,26837,28121,29742,31278,32066,32156,32305,33131,36394,36405,37758,37912, -20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610, -21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234, -28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208, -36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472, -23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981, -38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686, -24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,21675, -22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744, -27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584, -35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645, -25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043, -30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587, -36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894, -30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503, -32221,36655,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919, -24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364, -37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408, -35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649, -24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288, -24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081, -33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081, -37319,37365,20874,26613,31574,36012,20932,22971,24765,34389,20508,63999,21076, -23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191, -21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368, -36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639, -36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558, -22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893, -33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958, -39636,21021,21119,21736,24980,25220,25307,26786,26898,26970,27189,28818,28966, -30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218, -37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474, -22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368, -22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264, -36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069, -31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986, -26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,36101,21462, -21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434, -20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772, -27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473, -36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522, -26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668, -21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524, -21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752, -35351,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890, -33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153, -20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040, -39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005, -30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956, -25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487, -27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256, -29923,36009,36774,37393,38442,20843,21485,25420,20329,21764,24726,25943,27803, -28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559, -25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805, -35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253, -21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006, -30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825, -24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418, -29922,31080,34920,35961,39111,39108,39491,21697,31263,26963,35575,35914,39080, -39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644, -30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160, -27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372, -23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480, -38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532, -38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270, -24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,64008,64009,38917, -20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299, -35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139, -21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010, -27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358, -25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335, -34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846, +27797,29289,21619,23194,23614,23883,24396,24494,26410, +26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735, +24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494, +34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636, +31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292, +25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971, +31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,30332, +36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151, +25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459, +33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308, +25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197, +38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140, +30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805, +27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287, +29863,30294,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002, +21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821, +28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222, +27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693, +21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667, +39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090, +29739,32299,34028,34562,36898,37586,40179,19981,20184, +20463,20613,21078,21103,21542,21648,22496,22827,23142,23386,23413,23500,24220, +63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178, +33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468, +39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128, +27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447, +25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915, +23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608, +27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,33086, +33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338, +24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977, +27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490, +21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473, +24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509, +30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503, +35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849, +26388,63850,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240, +38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072, +34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360, +23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376, +30456,31077,31665,32724,35059,35316,35443,35937,36062, +38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853, +31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329, +26360,26646,26866,29312,29790,31598,32110,32214,32626,32997,33298,34223,35199, +35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728, +28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459, +25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341, +32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854, +21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807, +21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478, +22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,32854, +32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016, +21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836, +28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032, +32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660, +26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137, +29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862, +37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744, +24101,24833,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465, +29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172, +32353,32670,33065,33585,33936,34010,34282,34966,35504, +35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920, +39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881, +32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147, +29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255, +37662,38918,39348,25100,34899,36848,37477,23815,23847,23913,29791,33181,34664, +28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361, +34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643, +26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430, +35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060, +31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892, +26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338, +36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,63858, +28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818, +21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187, +40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716, +38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839, +26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739, +25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467, +23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266, +33099,38989,27387,32588,40367,40474,20063,20539,20918, +22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509, +33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880, +25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867, +32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417, +30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576, +24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978, +26989,20870,20104,20313,63871,63872,63873,22914,63874,63875,27487,27741,63876, +29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881, +20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515, +22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941, +27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141, +63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897, +63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905, +38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,63910, +38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992, +24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719, +29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521, +35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473, +26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709, +35947,63927,37555,63928,38675,38928,20116,20237,20425, +20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034, +25942,26111,26212,26791,27738,28595,28879,29100,29522,31613,34568,35492,39986, +40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800, +22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402, +33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740, +30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505, +27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931, +20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747, +25854,63934,26332,63935,27208,63936,29183,29796,63937,31368,31407,32327,32350, +32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020, +32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029, +28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854, +63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962, +26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398, +36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020, +31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,36939, +38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290, +22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503, +29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301, +20553,20702,21361,22285,22996,23041,23561,24944,26256, +28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949, +38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189, +24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977, +26978,27833,27943,63946,28216,63947,28641,29494,29495,63948,29788,30001,63949, +30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938, +36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955, +63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287, +63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903, +27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875, +37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885, +27589,30097,30691,32681,33380,34191,34811,34915,35516,35696,37291,20108,20197, +20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970, +63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505, +33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727, +30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035, +23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765, +38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219, +22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,63991, +63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383, +23388,24675,24904,28363,28825,29038,29574,29943,30133, +30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204, +26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544, +28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580, +22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404, +28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083, +34196,34255,35037,36115,37292,38263,38556,20877,21705,22312,23472,25165,26448, +26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631, +35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822, +28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487, +36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995, +30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842, +36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880, +23560,23637,24283,24731,25136,26643,27583,27656,28593,29006,29728,30000,30008, +30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666, +37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118, +21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969, +20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402, +25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191, +28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142, +33351,35330,35562,35998,37165,37194,37336,37478,37580, +37664,38662,38742,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716, +25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555, +38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089, +26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866, +30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468, +35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275, +37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121, +29742,31278,32066,32156,32305,33131,36394,36405,37758,37912,20304,22352,24038, +24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863, +23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664, +30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913, +37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201, +27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537, +20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327, +28893,29969,30151,32338,33976,35657,36104,20043,21482,21675,22320,22336,24535, +25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693, +30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100, +36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185, +26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494, +30603,31206,32265,32285,33275,34095,34967,35386,36049, +36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702, +29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519, +28503,32221,36655,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983, +23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528, +31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922, +32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443, +22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100, +24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379, +33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756, +34081,37319,37365,20874,26613,31574,36012,20932,22971,24765,34389,20508,63999, +21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587, +20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068, +36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180, +36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522, +22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152, +32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910, +36958,39636,21021,21119,21736,24980,25220,25307,26786,26898,26970,27189,28818, +28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229, +37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032, +21474,22618,23541,24740,24961,25696,32317,32880,34085, +37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394, +31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619, +39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600, +36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935, +24756,33205,33795,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030, +33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516, +21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305, +32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242, +19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756, +31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965, +33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219, +26589,28609,28655,29730,29752,35351,37944,21585,22022,22374,24392,24986,27470, +28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067, +23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888, +31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520, +22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114, +36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110, +24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315, +38935,21028,22338,26495,29256,29923,36009,36774,37393,38442,20843,21485,25420, +20329,21764,24726,25943,27803,28031,29260,29437,31255, +35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232, +32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163, +24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754, +22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071, +33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689, +29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961, +39111,39108,39491,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130, +30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534, +39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662, +36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097, +27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989, +21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704, +30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477, +26689,27782,28207,32568,32923,33322,64008,64009,38917,20133,20565,21683,22419, +22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405, +39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141, +38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463, +38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843, +29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449, +39023,23377,31348,34880,38913,23244,20448,21332,22846, 23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411, 24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872, 37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046, @@ -634,7 +644,7 @@ 21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628, 22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321, 21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875, -30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427, -28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725, -33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206, -26342,29081,29113,29114,29351,31143,31232,32690,35440, +30054,34407,24676,35662,40440,20807,20982,21256,27958, +33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462, +21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076, +24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440, From a71b46cfd289aa0ff829fc9a436c59c398f8326d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 13 Nov 2017 15:27:10 -0500 Subject: [PATCH 409/412] fix malloc state corruption when ldso rejects loading a second libc commit c49d3c8adadfa24235fcf4779bb722b1aa6f480b added logic to detect attempts to load libc.so via another name and instead redirect to the existing libc, rather than loading two and producing dangerously inconsistent state. however, the check for and unmapping of the duplicate libc happened after reclaim_gaps was already called, donating the slack space around the writable segment to malloc. subsequent unmapping of the library then invalidated malloc's free lists. fix the issue by moving the call to reclaim_gaps out of map_library into load_library, after the duplicate libc check but before the first call to calloc, so that the gaps can still be used to satisfy the allocation of struct dso. this change also eliminates the need for an ugly hack (temporarily setting runtime=1) to avoid reclaim_gaps when loading the main program via map_library, which happens when ldso is invoked as a command. only programs/libraries erroneously containing a DT_NEEDED reference to libc.so via an absolute pathname or symlink were affected by this issue. --- ldso/dynlink.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 35a90aef..4b4841f9 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -725,7 +725,6 @@ done_mapping: dso->base = base; dso->dynv = laddr(dso, dyn); if (dso->tls.size) dso->tls.image = laddr(dso, tls_image); - if (!runtime) reclaim_gaps(dso); free(allocated_buf); return map; noexec: @@ -1044,6 +1043,10 @@ static struct dso *load_library(const char *name, struct dso *needed_by) unmap_library(&temp_dso); return load_library("libc.so", needed_by); } + /* Past this point, if we haven't reached runtime yet, ldso has + * committed either to use the mapped library or to abort execution. + * Unmapping is not possible, so we can safely reclaim gaps. */ + if (!runtime) reclaim_gaps(&temp_dso); /* Allocate storage for the new DSO. When there is TLS, this * storage must include a reservation for all pre-existing @@ -1545,13 +1548,11 @@ _Noreturn void __dls3(size_t *sp) dprintf(2, "%s: cannot load %s: %s\n", ldname, argv[0], strerror(errno)); _exit(1); } - runtime = 1; Ehdr *ehdr = (void *)map_library(fd, &app); if (!ehdr) { dprintf(2, "%s: %s: Not a valid dynamic program\n", ldname, argv[0]); _exit(1); } - runtime = 0; close(fd); ldso.name = ldname; app.name = argv[0]; From 105eff9dec51bc4898a74af2854ab71f927a5c3b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 13 Nov 2017 18:34:27 -0500 Subject: [PATCH 410/412] generalize iconv framework for 8-bit codepages previously, 8-bit codepages could only remap the high 128 bytes; the low range was assumed/forced to agree with ascii. interpretation of codepage table headers has been changed so that it's possible to represent mappings for up to 256 slots (fewer if the initial portion of the map is elided because it coincides with unicode codepoints). this requires consuming a bit more of the 10-bit space of characters that can be represented in 8-bit codepages, but there's still a plenty left. the size of the legacy_chars table is actually reduced now by eliding the first 256 entries and considering them to map implicitly via the identity map. before these changes, there seem to have been minor bugs/omissions in codepage table generation, so it's likely that some actual bug fixes are silently included in this commit. round-trip testing of a few codepages was performed on the new version of the code, but no differential testing against the old version was done. --- src/locale/codepages.h | 417 +++++++++++++++++++++------------------ src/locale/iconv.c | 27 +-- src/locale/legacychars.h | 75 ++++--- 3 files changed, 273 insertions(+), 246 deletions(-) diff --git a/src/locale/codepages.h b/src/locale/codepages.h index ab146e89..626d1433 100644 --- a/src/locale/codepages.h +++ b/src/locale/codepages.h @@ -1,265 +1,288 @@ "iso88591\0" "latin1\0" -"\0\200" +"\0\100" "iso88592\0" -"\0\40" -"\0\330\20\313\32\0\244\21\10\0\0\34\122\310\42\240\0\100\212\50\0\334\60\13\33" -"\0\250\41\10\54\0\40\142\10\43\241\324\122\312\50\173\0\0\0\15\0\224\201\3\0" -"\76\0\200\4\0\112\0\0\0\20\102\264\21\7\0\0\334\1\0\0\177\124\2\300\45" -"\0\0\220\10\0\174\0\0\100\15\0\230\221\3\0\77\0\220\4\0\113\0\0\100\20" -"\103\270\41\7\0\0\340\1\0\0\200\130\2\0\46\0\0\240\210\54" +"\0\50" +"\240\20\364\127\116\244\334\364\324\51\250\124\65\125\126\156\265\42\27\134" +"\260\24\24\230\116\264\340\4\225\137\270\130\105\225\126\157\15\66\127\134" +"\111\5\43\214\100\304\314\144\320\61\14\45\143\321\62\30\65\343\214\103" +"\20\355\364\323\64\324\24\145\315\65\115\215\245\115\131\334\164\163\325\67" +"\112\205\43\316\100\344\320\164\320\71\15\245\163\321\72\31\265\343\316\103" +"\21\361\4\324\74\364\30\145\317\75\116\221\245\217\131\374\364\203\25\140" "iso88593\0" -"\0\40" -"\0\130\21\13\0\0\4\100\5\0\0\170\121\210\23\140\0\20\200\50\0\134\1\0\0" -"\0\0\120\5\0\0\174\141\310\23\141\0\20\300\50\0\0\0\100\0\0\360\240\3\0" -"\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\100\1\0\0\114\0\0\0\0\0\114\62\10\0" -"\0\0\0\100\0\0\364\260\3\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\104\1\0\0" -"\115\0\0\0\0\0\120\102\210\54" +"\0\50" +"\240\220\364\327\50\244\0\40\322\51\250\260\64\25\107\56\265\2\0\134" +"\260\224\44\313\54\264\324\62\322\55\270\264\104\125\107\57\365\2\100\134" +"\300\4\43\14\0\304\50\204\320\61\310\44\243\314\62\314\64\343\314\63" +"\0\104\43\315\64\324\170\144\315\65\32\145\243\315\66\334\204\25\325\67" +"\340\204\43\16\0\344\54\224\320\71\350\244\243\316\72\354\264\343\316\73" +"\0\304\43\317\74\364\174\144\317\75\33\345\243\317\76\374\210\45\25\140" "iso88594\0" -"\0\40" -"\0\330\100\106\37\0\140\161\6\0\0\34\102\204\24\215\0\100\12\0\0\334\60\213\37" -"\0\144\201\6\54\0\40\122\304\24\216\314\121\12\35\62\0\0\0\0\0\0\0\0\27" -"\76\0\200\4\0\106\0\0\200\26\102\274\121\207\30\0\0\0\0\0\0\144\2\0\0" -"\0\74\22\11\0\63\0\0\0\0\0\0\0\100\27\77\0\220\4\0\107\0\0\300\26" -"\103\300\141\307\30\0\0\0\0\0\0\150\2\0\0\0\100\42\211\54" +"\0\50" +"\240\20\44\323\122\244\230\124\323\51\250\124\45\21\110\133\265\42\327\53" +"\260\24\24\30\123\264\234\144\223\137\270\130\65\121\110\134\5\65\227\120" +"\0\5\43\314\60\304\24\143\214\112\14\45\143\321\62\24\65\343\14\112" +"\20\365\64\24\114\324\124\143\315\65\330\234\245\315\66\334\164\365\325\67" +"\1\205\43\316\70\344\224\143\316\112\15\245\163\321\72\25\265\343\116\112" +"\21\371\104\124\114\364\324\143\317\75\370\240\245\317\76\374\170\5\26\140" "iso88595\0" -"\0\40" -"\0\14\104\120\101\6\35\204\120\102\12\55\304\120\103\16\1\360\20\104" -"\21\111\64\21\105\25\131\164\21\106\31\151\264\21\107\35\171\364\21\110" -"\41\211\64\22\111\45\231\164\22\112\51\251\264\22\113\55\271\364\22\114" -"\61\311\64\23\115\65\331\164\23\116\71\351\264\23\117\75\371\364\23\120" -"\101\11\65\24\121\105\31\165\24\122\111\51\265\24\123\115\71\365\24\124" -"\127\106\45\325\124\124\125\145\325\125\130\145\245\325\126\134\15\320\225\127" +"\0\50" +"\240\104\47\335\164\324\125\147\335\165\330\145\247\335\166" +"\334\265\322\235\167\337\201\27\236\170\343\221\127\236\171" +"\347\241\227\236\172\353\261\327\236\173\357\301\27\237\174" +"\363\321\127\237\175\367\341\227\237\176\373\361\327\237\177\377\1\30\240\200" +"\3\22\130\240\201\7\42\230\240\202\13\62\330\240\203\17\102\30\241\204" +"\23\122\130\241\205\27\142\230\241\206\33\162\330\241\207\46\177\10\142\210" +"\42\216\110\142\211\46\236\210\142\212\52\236\262\42\213" "iso88596\0" -"\0\40" -"\0\4\20\100\0\0\4\20\100\0\1\4\20\100\0\224\1\20\100\0\1\4\20\100\0" -"\1\4\20\100\0\1\4\20\100\145\1\4\20\200\145\1\134\206\131\146" -"\232\155\306\131\147\236\175\6\132\150\242\215\106\132\151\246\235\206\132\152" -"\252\255\306\132\153\256\275\6\133\0\1\4\20\100\0\261\311\66\33\155" -"\265\331\166\33\156\271\351\266\33\157\275\371\366\33\160\301\11\67\134\0" -"\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0" +"\0\50" +"\240\0\0\0\0\244\0\0\0\0\0\0\0\0\0\142\266\2\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\300\230\0\0\0\0\231\0\224\151\346\231\150\246\251\346\232" +"\154\266\351\346\233\160\306\51\347\234\164\326\151\347\235" +"\170\346\251\347\236\174\366\351\47\0\0\0\0\0\0\177\2\32\250\240" +"\203\22\132\250\241\207\42\232\250\242\213\62\332\250\243\217\102\32\51\0" +"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "iso88597\0" -"\0\40" -"\0\24\151\44\0\124\126\11\0\0\0\0\260\13\0\0\0\20\300\220\0\0\0\0\0" -"\274\364\342\13\0\277\0\23\14\0\302\0\60\14\61\305\30\163\14\62" -"\311\50\263\14\63\315\70\363\14\64\321\110\63\15\65\325\130\23\300\65" -"\330\144\243\315\66\334\164\343\315\67\340\204\43\316\70\344\224\143\316\71" -"\350\244\243\316\72\354\264\343\316\73\360\304\43\317\74\364\324\143\317\75" -"\370\344\243\317\76\374\364\343\317\77\0\5\44\120\0" +"\0\50" +"\240\114\114\361\50\44\227\154\312\51\250\244\222\330\52\254\264\2\100\304" +"\260\304\42\313\54\212\55\306\330\55\215\71\366\330\56\220\365\22\231\144" +"\223\121\126\231\145\227\141\226\231\146\233\161\326\231\147" +"\237\201\26\232\150\243\221\6\100\151\246\235\206\132\152\252\255\306\132\153" +"\256\275\6\133\154\262\315\106\133\155\266\335\206\133\156\272\355\306\133\157" +"\276\375\6\134\160\302\15\107\134\161\306\35\207\134\162\312\55\307\134\163" +"\316\75\7\35\0" "iso88598\0" -"\0\40" -"\0\4\0\0\0\0\0\0\0\0\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0" -"\0\0\0\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0" -"\1\4\20\100\0\1\4\20\100\0\1\4\20\0\221\164\325\145\327\135" -"\170\345\245\327\136\174\365\345\327\137\200\5\46\330\140\204\25\146\330\141" -"\210\45\246\330\142\214\65\346\130\0\1\374\10\144\0" +"\0\50" +"\240\0\40\312\50\244\224\142\312\51\250\244\162\315\52\254\264\342\312\53" +"\260\304\42\313\54\264\324\142\313\55\270\344\162\317\56\274\364\342\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\0\0\0\0\0\0\0\0" +"\0\0\0\200\304\102\16\111\144\221\106\36\211\144\222\112\56\311\144\223" +"\116\76\11\145\224\122\116\111\145\225\126\136\211\145\226\132\156\311\45\0" +"\0\64\354\60\0" "iso88599\0" -"\0\120" -"\116\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\170\121\10\0\0\0\0\0\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\174\141\10\0" +"\0\64" +"\34\105\43\315\64\324\124\143\315\65\330\144\243\315\66\334\260\64\325\67" +"\340\204\43\316\70\344\224\143\316\71\350\244\243\316\72\354\264\343\316\73" +"\35\305\43\317\74\364\324\143\317\75\370\344\243\317\76\374\264\104\325\77" "iso885910\0" -"\0\40" -"\0\330\100\204\24\132\140\41\6\0\147\10\161\110\43\244\0\20\311\34" -"\0\334\120\304\24\133\144\61\6\0\150\14\201\210\43\245\14\51\11\35\62\0\0\0\0" -"\0\0\0\0\27\76\0\200\4\0\106\0\0\0\0\0\274\121\7\0\0\0\0\300\43\0\144\2\0\0" -"\0\0\0\0\0\63\0\0\0\0\0\0\0\100\27\77\0\220\4\0\107\0\0\0\0\0\300\141\7\0" -"\0\0\0\0\44\0\150\2\0\0\0\0\0\0\31" +"\0\50" +"\240\20\44\21\110\50\231\4\323\51\65\101\124\325\126\162\265\362\125\120" +"\260\24\64\121\110\51\235\24\323\55\66\105\144\25\127\163\105\14\226\120" +"\0\5\43\314\60\304\24\143\214\112\14\45\143\321\62\24\65\343\314\63" +"\320\364\64\324\64\324\124\143\115\127\330\234\245\315\66\334\164\343\315\67" +"\1\205\43\316\70\344\224\143\316\112\15\245\163\321\72\25\265\343\316\73" +"\360\370\104\324\74\364\324\143\217\127\370\240\245\317\76\374\364\343\217\114" "iso885911\0" "tis620\0" -"\0\40" -"\0\100\27\235\164\323\121\127\235\165\327\141\227\235\166\333\161\327\235\167" -"\337\201\27\236\170\343\221\127\236\171\347\241\227\236\172" -"\353\261\327\236\173\357\301\27\237\174\363\321\127\237\175" -"\367\341\227\237\176\373\361\327\237\177\377\1\30\240\200\3\22\130\240\201" -"\7\42\230\140\0\1\4\20\200\202\13\62\330\240\203\17\102\30\241\204" -"\23\122\130\241\205\27\142\230\241\206\33\162\330\241\207\37\202\30\242\210" -"\43\222\130\242\211\1\4\20\100\0" +"\0\50" +"\240\170\372\51\250\241\212\72\52\251\245\232\172\52\252\251\252\272\52\253" +"\255\272\372\52\254\261\312\72\53\255\265\332\172\53\256\271\352\272\53\257" +"\275\372\372\53\260\301\12\73\54\261\305\32\173\54\262\311\52\273\54\263" +"\315\72\373\54\264\321\112\73\55\265\325\132\173\55\0\0\0\0\0\266" +"\331\152\273\55\267\335\172\373\55\270\341\212\73\56\271\345\232\173\56\272" +"\351\252\273\56\273\355\272\373\56\274\361\312\73\57\275\0\0\0\0\0" "iso885913\0" -"\0\40" -"\0\44\11\0\0\0\50\11\0\0\15\0\320\7\0\0\0\0\300\2\0\0\0\0\0\110\2\0\0\0" -"\20\0\340\7\0\0\0\0\200\3\66\160\41\3\16\0\0\200\4\21\76\0\0\212\21" -"\122\210\241\305\31\207\264\361\6\0\165\0\0\0\0\231\254\21\110\44" -"\0\210\102\12\0\67\164\61\103\16\0\0\220\104\21\77\0\20\312\21" -"\123\214\261\5\32\210\270\1\7\0\166\0\0\0\0\232\260\41\210\44" -"\0\214\122\212\221" +"\0\50" +"\240\134\54\312\50\244\140\154\312\51\330\244\262\324\52\254\264\342\212\61" +"\260\304\42\313\54\26\327\142\313\55\370\344\302\324\56\274\364\342\213\71" +"\4\251\4\220\101\304\24\143\221\104\14\45\343\26\105\40\301\204\122\115" +"\125\355\324\323\64\103\125\143\315\65\147\345\364\324\127\334\300\45\327\67" +"\5\255\24\320\101\344\224\163\321\104\15\245\363\126\105\41\305\224\222\115" +"\126\361\344\323\74\104\325\143\317\75\150\351\4\25\130\374\304\65\27\305" "iso885914\0" -"\0\40" -"\0\234\210\42\0\74\364\220\42\0\65\2\160\243\212\73\2\0\300\47" -"\53\262\10\105\24\55\272\10\300\213\66\302\210\143\214\74\346\250\243\214" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\233\0\0\0\0\0\0\0\300\214\0\0\0\0\0" -"\0\0\320\11\0\0\0\0\0\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\215" -"\0\0\0\0\0\0\0\340\11\0" +"\0\50" +"\240\324\153\357\50\12\55\164\357\51\3\247\122\60\276\11\267\342\112\133" +"\371\352\353\321\107\373\362\153\113\277\4\373\153\360\277\12\37\214\60\300" +"\300\4\43\314\60\304\24\143\314\61\310\44\243\314\62\314\64\343\314\63" +"\151\105\43\315\64\324\124\143\115\300\330\144\243\315\66\334\164\263\326\67" +"\340\204\43\316\70\344\224\143\316\71\350\244\243\316\72\354\264\343\316\73" +"\152\305\43\317\74\364\324\143\217\300\370\344\243\317\76\374\364\303\326\77" "iso885915\0" "latin9\0" -"\0\44" -"\124\2\160\10\0\210\0\0\0\0\0\0\0\0\0\0\0\0\0\0\244\0\0\0\0\245\0\0\0\0" -"\171\350\361\11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\51" +"\44\227\122\325\51\126\245\242\312\52\254\264\342\312\53\260\304\42\313\54" +"\162\325\142\313\55\163\345\242\313\56\107\41\325\326\57\300\4\43\314\60" +"\304\24\143\314\61\310\44\243\314\62\314\64\343\314\63\320\104\43\315\64" +"\324\124\143\315\65\330\144\243\315\66\334\164\343\315\67\340\204\43\316\70" +"\344\224\143\316\71\350\244\243\316\72\354\264\343\316\73\360\304\43\317\74" +"\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77" "iso885916\0" -"\0\40" -"\0\330\160\303\32\124\52\171\10\0\210\0\260\12\0\240\0\20\212\50\0\0\340\3\33" -"\244\44\11\0\0\245\374\300\12\0\171\350\361\311\50\0\0\0\0\15\0\340\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\102\264\1\0\0\0\334\1\100\40\227\0\0\0\0\0\40\321\12\0" -"\0\0\0\100\15\0\344\0\0\0\0\0\0\0\0\0\0\0\0\0\103\270\1\0\0\0\340\1\200\40" -"\230\0\0\0\0\0\44\341\12\0" +"\0\50" +"\240\20\124\120\116\44\143\134\325\51\126\245\222\327\52\156\265\362\26\134" +"\260\304\302\220\116\162\135\154\313\55\163\65\244\327\56\107\41\325\126\134" +"\300\4\43\214\100\304\30\144\314\61\310\44\243\314\62\314\64\343\314\63" +"\20\355\44\315\64\324\24\145\315\123\145\145\243\315\66\334\130\264\327\67" +"\340\204\43\316\100\344\34\144\316\71\350\244\243\316\72\354\264\343\316\73" +"\21\361\44\317\74\364\30\145\17\124\146\345\243\317\76\374\134\304\327\77" "cp1250\0" "windows1250\0" -"\0\0" -"\124\6\160\144\0\112\72\271\44\223\1\74\171\10\224\201\54\102\12\50" -"\1\24\151\44\222\111\66\31\244\220\1\140\211\110\224\202\60\122\112\50" -"\0\300\22\313\32\0\330\0\0\0\0\0\120\10\0\0\0\0\200\50\0\0\60\13\33\0\0\0\0\0" -"\0\334\140\10\0\151\324\242\306\50\173\0\0\0\15\0\224\201\3\0\76\0\200\4\0" -"\112\0\0\0\20\102\264\21\7\0\0\334\1\0\0\177\124\2\300\45\0\0\220\10\0" -"\174\0\0\100\15\0\230\221\3\0\77\0\220\4\0\113\0\0\100\20\103\270\41\7\0" -"\0\340\1\0\0\200\130\2\0\46\0\0\240\210\54" +"\0\40" +"\44\3\120\61\0\30\163\234\261\306\0\164\134\225\307\117\145\45\227\133" +"\0\114\114\261\305\27\157\374\60\304\0\234\154\325\307\120\151\65\327\133" +"\240\370\365\127\116\244\20\144\312\51\250\244\62\325\52\254\264\342\12\134" +"\260\304\22\230\116\264\324\142\313\55\270\24\104\325\56\67\15\206\123\134" +"\111\5\43\214\100\304\314\144\320\61\14\45\143\321\62\30\65\343\214\103" +"\20\355\364\323\64\324\24\145\315\65\115\215\245\115\131\334\164\163\325\67" +"\112\205\43\316\100\344\320\164\320\71\15\245\163\321\72\31\265\343\316\103" +"\21\361\4\324\74\364\30\145\317\75\116\221\245\217\131\374\364\203\25\140" "cp1251\0" "windows1251\0" -"\0\0" -"\4\25\164\344\124\112\72\271\44\223\124\76\271\20\224\14\71\324\20\104" -"\122\25\151\44\222\111\66\31\244\220\1\140\231\125\224\132\161\265\225\127" -"\0\74\324\225\102\0\174\5\0\0\3\1\140\20\0\0\0\0\100\102\0\0\200\220\125" -"\140\1\0\0\0\121\135\111\25\0\130\35\124\325\125\21\111\64\21\105" -"\25\131\164\21\106\31\151\264\21\107\35\171\364\21\110\41\211\64\22\111" -"\45\231\164\22\112\51\251\264\22\113\55\271\364\22\114\61\311\64\23\115" -"\65\331\164\23\116\71\351\264\23\117\75\371\364\23\120\101\11\65\24\121" -"\105\31\165\24\122\111\51\265\24\123\115\71\365\24\124" +"\0\40" +"\322\115\127\161\210\30\163\234\261\306\44\167\234\235\307\332\161\267\235\167" +"\40\116\114\261\305\27\157\374\60\304\0\234\174\342\307\50\252\230\42\213" +"\240\164\267\42\166\244\264\150\312\51\321\245\102\335\52\254\264\342\312\165" +"\260\304\142\35\211\56\326\142\313\55\37\232\54\342\56\46\126\67\142\211" +"\337\201\27\236\170\343\221\127\236\171\347\241\227\236\172" +"\353\261\327\236\173\357\301\27\237\174\363\321\127\237\175" +"\367\341\227\237\176\373\361\327\237\177\377\1\30\240\200\3\22\130\240\201" +"\7\42\230\240\202\13\62\330\240\203\17\102\30\241\204\23\122\130\241\205" +"\27\142\230\241\206\33\162\330\241\207" "cp1252\0" "windows1252\0" -"\0\0" -"\124\6\160\244\51\112\72\271\44\223\257\74\171\10\224\171\4\100\112\0" -"\1\24\151\44\222\111\66\31\244\220\264\140\211\110\224\172\4\120\312\47" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\40" +"\44\3\120\61\135\30\163\234\261\306\175\165\134\225\307\107\1\40\27\0" +"\0\114\114\261\305\27\157\374\60\304\202\235\154\325\307\110\1\60\127\133" +"\240\204\42\312\50\244\224\142\312\51\250\244\242\312\52\254\264\342\312\53" +"\260\304\42\313\54\264\324\142\313\55\270\344\242\313\56\274\364\342\313\57" +"\300\4\43\314\60\304\24\143\314\61\310\44\243\314\62\314\64\343\314\63" +"\320\104\43\315\64\324\124\143\315\65\330\144\243\315\66\334\164\343\315\67" +"\340\204\43\316\70\344\224\143\316\71\350\244\243\316\72\354\264\343\316\73" +"\360\304\43\317\74\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77" "cp1253\0" "windows1253\0" -"\0\0" -"\124\6\160\244\51\112\72\271\44\223\1\74\31\0\224\1\4\20\100\0\1\24\151\44\222" -"\111\66\31\244\220\1\140\31\100\224\1\4\20\100\0\0\364\342\13\0\0\0\0\0\0" -"\0\0\20\0\0\0\0\0\300\220\0\0\0\0\0\274\0\0\0\0\277\0\23\14\0\302\0\60\14\61" -"\305\30\163\14\62\311\50\263\14\63\315\70\363\14\64\321\110\63\15\65" -"\325\130\23\300\65\330\144\243\315\66\334\164\343\315\67\340\204\43\316\70" -"\344\224\143\316\71\350\244\243\316\72\354\264\343\316\73\360\304\43\317\74" -"\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77\0\5\44\120\0" +"\0\40" +"\44\3\120\61\135\30\163\234\261\306\0\164\14\200\307\0\0\0\0\0" +"\0\114\114\261\305\27\157\374\60\304\0\234\14\300\307\0\0\0\0\0" +"\240\54\306\330\50\244\224\142\312\51\250\244\2\300\52\254\264\342\112\304" +"\260\304\42\313\54\212\325\142\313\55\215\71\366\330\56\220\365\22\231\144" +"\223\121\126\231\145\227\141\226\231\146\233\161\326\231\147" +"\237\201\26\232\150\243\221\6\100\151\246\235\206\132\152\252\255\306\132\153" +"\256\275\6\133\154\262\315\106\133\155\266\335\206\133\156\272\355\306\133\157" +"\276\375\6\134\160\302\15\107\134\161\306\35\207\134\162\312\55\307\134\163" +"\316\75\7\35\0" "cp1254\0" "windows1254\0" -"\0\0" -"\124\6\160\244\51\112\72\271\44\223\257\74\171\10\224\171\4\20\100\0" -"\1\24\151\44\222\111\66\31\244\220\264\140\211\110\224\172\4\20\300\47" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\116\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\170\121\10\0\0\0\0\0\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\174\141\10\0" +"\0\40" +"\44\3\120\61\135\30\163\234\261\306\175\165\134\225\307\107\1\0\0\0" +"\0\114\114\261\305\27\157\374\60\304\202\235\154\325\307\110\1\0\100\133" +"\240\204\42\312\50\244\224\142\312\51\250\244\242\312\52\254\264\342\312\53" +"\260\304\42\313\54\264\324\142\313\55\270\344\242\313\56\274\364\342\313\57" +"\300\4\43\314\60\304\24\143\314\61\310\44\243\314\62\314\64\343\314\63" +"\34\105\43\315\64\324\124\143\315\65\330\144\243\315\66\334\260\64\325\67" +"\340\204\43\316\70\344\224\143\316\71\350\244\243\316\72\354\264\343\316\73" +"\35\305\43\317\74\364\324\143\317\75\370\344\243\317\76\374\264\104\325\77" "cp1255\0" "windows1255\0" -"\0\0" -"\124\6\160\244\51\112\72\271\44\223\257\74\31\0\224\1\4\20\100\0" -"\1\24\151\44\222\111\66\31\244\220\264\140\31\100\224\1\4\20\100\0\0\0\0\0\0" -"\122\2\0\0\0\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\0\0\0\0\0" -"\141\211\65\26\131\145\231\165\26\132\151\251\25\300\132\154\265\345\326\133" -"\160\305\45\327\134\217\101\26\231\144\223\5\20\100\0\1\4\20\100\0" -"\164\325\145\327\135\170\345\245\327\136\174\365\345\327\137\200\5\46\330\140" -"\204\25\146\330\141\210\45\246\330\142\214\65\346\130\0\1\374\10\144\0" +"\0\40" +"\44\3\120\61\135\30\163\234\261\306\175\165\14\200\307\0\0\0\0\0" +"\0\114\114\261\305\27\157\374\60\304\202\235\14\300\307\0\0\0\0\0" +"\240\204\42\312\50\42\227\142\312\51\250\244\162\315\52\254\264\342\312\53" +"\260\304\42\313\54\264\324\142\313\55\270\344\162\317\56\274\364\342\313\57" +"\57\302\30\243\214\63\322\130\243\215\67\342\10\100\216\72\356\310\143\217" +"\76\376\10\144\220\135\172\371\45\230\141\2\0\0\0\0\0\0\0\0\102\16\111\144\221" +"\106\36\211\144\222\112\56\311\144\223\116\76\11\145\224\122\116\111\145\225" +"\126\136\211\145\226\132\156\311\45\0\0\64\354\60\0" "cp1256\0" "windows1256\0" -"\0\0" -"\124\26\167\244\51\112\72\271\44\223\257\74\111\34\224\171\30\227\334\161" -"\313\25\151\44\222\111\66\31\244\220\312\141\211\134\224\172\364\350\43\163" -"\0\120\6\0\0\0\0\0\0\0\0\0\320\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\120\31\0" -"\0\0\0\200\145\316\135\206\131\146\232\155\306\131\147\236\175\6\132\150" -"\242\215\106\132\151\246\235\206\132\152\252\255\306\32\0\255\271\366\32\154" -"\261\311\66\33\155\0\324\6\200\155\267\341\226\33\0\0\0\0\0\0\272\355\6\0\0" -"\274\365\346\333\157\0\0\27\34\0\302\1\60\34\0\0\374\10\344\163" +"\0\40" +"\44\117\132\61\135\30\163\234\261\306\175\165\54\251\307\107\121\172\151\245" +"\231\116\114\261\305\27\157\374\60\304\230\236\154\351\307\110\55\314\260\246" +"\240\210\51\312\50\244\224\142\312\51\250\244\262\351\52\254\264\342\312\53" +"\260\304\42\313\54\264\324\142\313\55\270\344\62\346\56\274\364\342\13\231" +"\234\226\151\346\231\150\246\251\346\232\154\266\351\346\233" +"\160\306\51\347\234\164\326\151\347\235\170\346\251\347\65\173\362\331\247\237" +"\177\2\32\250\240\340\14\52\16\241\205\32\172\350\71\350\244\243\316\72" +"\210\46\352\316\73\212\56\312\150\243\364\70\372\350\75\220\346\23\351\76" +"\374\64\354\160\247" "cp1257\0" "windows1257\0" -"\0\0" -"\124\6\160\144\0\112\72\271\44\223\1\74\31\0\224\1\20\0\213\2\1\24\151\44\222" -"\111\66\31\244\220\1\140\31\100\224\1\30\60\113\0\0\4\0\0\0\0\4\0\0\0" -"\15\0\320\7\0\0\0\0\300\2\0\0\0\0\0\0\0\0\0\0\20\0\340\7\0\0\0\0\200\3" -"\66\160\41\3\16\0\0\200\4\21\76\0\0\212\21\122\210\241\305\31\207\264\361\6\0" -"\165\0\0\0\0\231\254\21\110\44\0\210\102\12\0\67\164\61\103\16\0\0\220\104\21" -"\77\0\20\312\21\123\214\261\5\32\210\270\1\7\0\166\0\0\0\0\232\260\41\210\44" -"\0\214\122\212\54" +"\0\40" +"\44\3\120\61\0\30\163\234\261\306\0\164\14\200\307\0\240\342\27\56" +"\0\114\114\261\305\27\157\374\60\304\0\234\14\300\307\0\274\22\30\0" +"\240\0\40\312\50\244\0\140\312\51\330\244\262\324\52\254\264\342\212\61" +"\260\304\42\313\54\264\324\142\313\55\370\344\302\324\56\274\364\342\213\71" +"\4\251\4\220\101\304\24\143\221\104\14\45\343\26\105\40\301\204\122\115" +"\125\355\324\323\64\103\125\143\315\65\147\345\364\324\127\334\300\45\327\67" +"\5\255\24\320\101\344\224\163\321\104\15\245\363\126\105\41\305\224\222\115" +"\126\361\344\323\74\104\325\143\317\75\150\351\4\25\130\374\304\65\27\140" "cp1258\0" "windows1258\0" -"\0\0" -"\124\6\160\244\51\112\72\271\44\223\257\74\31\0\224\171\4\20\100\0" -"\1\24\151\44\222\111\66\31\244\220\264\140\31\100\224\172\4\20\300\47" -"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -"\0\0\0\0\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0\266\0\0\0\0\102\0\220\13\0" -"\0\234\2\0\0\0\0\0\0\0\0\244\202\13\0\0\0\0\100\15\0\0\0\0\0\0\0\0\0\0" -"\267\0\0\0\0\103\0\240\13\0\0\240\2\0\0\0\0\0\0\0\0\250\62\45\0" +"\0\40" +"\44\3\120\61\135\30\163\234\261\306\175\165\14\200\307\107\1\0\0\0" +"\0\114\114\261\305\27\157\374\60\304\202\235\14\300\307\110\1\0\100\133" +"\240\204\42\312\50\244\224\142\312\51\250\244\242\312\52\254\264\342\312\53" +"\260\304\42\313\54\264\324\142\313\55\270\344\242\313\56\274\364\342\313\57" +"\300\4\43\214\100\304\24\143\314\61\310\44\243\314\62\204\65\343\314\63" +"\20\105\163\330\64\324\324\145\315\65\330\144\243\315\66\334\334\145\330\67" +"\340\204\43\316\100\344\224\143\316\71\350\244\243\316\72\205\265\343\316\73" +"\21\305\203\330\74\364\330\145\317\75\370\344\243\317\76\374\340\65\362\77" "koi8r\0" -"\0\0" -"\140\206\51\346\230\144\226\151\346\231\150\246\251\46\242\211\52\272\50\243" -"\215\72\372\250\227\220\146\251\345\226\134\166\51\300\227\7\40\220\300\3" -"\153\262\331\146\124\156\276\11\147\234\162\316\111\147\235" -"\166\336\211\147\236\172\356\311\347\100\175\372\371\47\240\201\12\72\50\241" -"\205\32\172\150\1\117\305\44\323\121\65\331\124\24\115\106\345\244\323\116" -"\74\365\344\323\117\100\101\25\224\120\103\21\165\323\114\115\61\205\123\122" -"\116\51\205\324\122\57\105\44\321\111\25\131\124\22\105\46\145\244\321\106" -"\34\165\344\321\107\40\301\24\222\110\43\221\164\321\104\55\261\204\121\112" -"\56\251\204\322\112" +"\0\40" +"\63\323\134\263\315\67\343\234\263\316\73\363\334\363\326\134\167\355\365\327" +"\140\207\55\166\314\143\243\234\62\313\56\277\14\212\314\260\310\162\313\75" +"\76\377\14\364\207\101\13\75\64\321\105\33\175\64\322\111\53\275\64\323" +"\115\73\375\164\164\120\107\55\365\324\124\127\155\365\325\130\147\255\165\52" +"\35\376\7\140\205\3\22\70\241\200\24\36\210\140\202\12\56\310\140\203" +"\16\172\370\40\204\21\112\130\140\200\33\152\150\340\205\34\142\150\141\206" +"\375\175\7\136\175\343\221\67\237\170\364\235\207\136\172\352\255\307\136\173" +"\356\371\367\36\174\361\311\127\136\170\373\351\147\336\175" +"\374\341\147\137\176" "koi8u\0" -"\0\0" -"\140\206\51\346\230\144\226\151\346\231\150\246\251\46\242\211\52\272\50\243" -"\215\72\372\250\227\220\146\251\345\226\134\166\51\300\227\7\40\220\300\3" -"\153\262\331\146\124\124\275\151\325\125\162\316\111\147\235" -"\166\202\205\147\236\172\356\311\347\100\6\371\211\120\102\201\12\72\50\241" -"\205\176\165\150\1\117\305\44\323\121\65\331\124\24\115\106\345\244\323\116" -"\74\365\344\323\117\100\101\25\224\120\103\21\165\323\114\115\61\205\123\122" -"\116\51\205\324\122\57\105\44\321\111\25\131\124\22\105\46\145\244\321\106" -"\34\165\344\321\107\40\301\24\222\110\43\221\164\321\104\55\261\204\121\112" -"\56\251\204\322\112" +"\0\40" +"\63\323\134\263\315\67\343\234\263\316\73\363\334\363\326\134\167\355\365\327" +"\140\207\55\166\314\143\243\234\62\313\56\277\14\212\314\260\310\162\313\75" +"\76\377\14\364\207\42\12\115\142\211\105\33\175\64\322\111\273\270\64\323" +"\115\73\375\164\164\324\105\155\335\165\124\127\155\365\325\130\267\250\165\52" +"\35\376\7\140\205\3\22\70\241\200\24\36\210\140\202\12\56\310\140\203" +"\16\172\370\40\204\21\112\130\140\200\33\152\150\340\205\34\142\150\141\206" +"\375\175\7\136\175\343\221\67\237\170\364\235\207\136\172\352\255\307\136\173" +"\356\371\367\36\174\361\311\127\136\170\373\351\147\336\175" +"\374\341\147\137\176" "cp437\0" -"\0\0" -"\27\300\100\202\7\37\164\0\202\10\45\230\60\102\12\50\234\100\101\5" -"\30\70\260\300\12\54\250\360\202\13\61\144\300\101\4\22\114\140\245\51" -"\221\106\32\151\244\221\106\32\151\244\221\106\32\151\244\221\106\32\151\244" -"\215\72\372\150\230\147\362\331\147\234\160\372\311\246\234" -"\170\336\151\347\230\144\246\211\246\231\140\252\231\247\236" -"\165\276\111\150\240\173\256\171\250\240\203\376\11\50\235\163\266\351\246\241" -"\205\226\51\246\242\211\56\312\50\242\345\104\212\14\75\327\334\23\51\76" -"\332\64\323\15\72\221\352\223\116\244\221\106\332\45\227\136\176\371\300\226" -"\7\144\231\200\226\221\42\0\251\0" +"\0\40" +"\307\360\223\216\70\344\200\123\316\71\352\254\203\316\73\356\260\103\114\61" +"\311\230\143\14\75\366\310\263\117\76\377\130\303\215\50\243\224\22\62\135" +"\341\264\63\217\76\361\104\243\212\56\277\300\314\112\57\274\204\262\312\56" +"\140\207\55\66\315\72\77\15\65\321\103\107\375\163\321\113\53\235\264\315" +"\67\363\274\163\316\63\367\314\164\323\110\13\175\65\325\116\373\254\165\325" +"\126\113\75\365\321\106\3\35\164\326\130\343\134\163\327\134\173\375\365\326" +"\263\175\143\231\160\245\25\127\213\161\250\155\266\232\155\52\43\167\333\312" +"\55\307\362\262\313\61\313\174\17\313\260\240\174\113\312\40\313\62\66\50" "cp850\0" -"\0\0" -"\27\300\100\202\7\37\164\0\202\10\45\230\60\102\12\50\234\100\101\5" -"\30\70\260\300\12\54\250\360\202\13\61\144\300\1\4\22\64\300\200\51" -"\221\106\32\151\244\221\106\32\151\244\221\106\32\151\244\221\106\32\151\244" -"\215\72\372\150\230\147\106\32\151\244\5\370\311\246\234\170\106\60\301\230" -"\144\246\211\246\231\140\252\31\151\244\165\276\111\150\240" -"\173\256\171\150\244\221\106\32\151\244\221\176\21\151\244\221\226\51\246\242" -"\211\106\32\51\242\221\106\32\151\244\221\106\32\151\244\221\106\32\151\244" -"\221\106\152\100\244\221\106\112\144\244\221\16\360\200\2\7\20\220\100\244" -"\221\42\0\251\0" +"\0\40" +"\307\360\223\216\70\344\200\123\316\71\352\254\203\316\73\356\260\103\114\61" +"\311\230\143\14\75\366\310\263\117\76\377\130\303\15\76\243\140\163\15\135" +"\341\264\63\217\76\361\104\243\212\56\277\270\302\112\57\274\204\262\312\56" +"\140\207\55\66\315\72\7\43\14\60\251\104\375\163\321\113\213\122\212\315" +"\67\363\274\163\316\63\367\74\316\60\110\13\175\65\325\116\373\254\65\51" +"\360\100\243\314\62\310\264\324\214\63\317\340\134\163\327\134\233\302\314\326" +"\323\174\103\215\64\365\124\123\213\77\336\150\263\115\66\375\164\363\12\55" +"\255\304\42\261\57\266\234\162\17\56\260\240\162\113\56\263\310\62\66\50" diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 2107b055..01f17521 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -27,8 +27,10 @@ /* Definitions of charmaps. Each charmap consists of: * 1. Empty-string-terminated list of null-terminated aliases. - * 2. Special type code or number of elided entries. - * 3. Character table (size determined by field 2). */ + * 2. Special type code or number of elided quads of entries. + * 3. Character table (size determined by field 2), consisting + * of 5 bytes for every 4 characters, interpreted as 10-bit + * indices into the legacy_chars table. */ static const unsigned char charmaps[] = "utf8\0char\0\0\310" @@ -51,6 +53,9 @@ static const unsigned char charmaps[] = #include "codepages.h" ; +/* Table of characters that appear in legacy 8-bit codepages, + * limited to 1024 slots (10 bit indices). The first 256 entries + * are elided since those characters are obviously all included. */ static const unsigned short legacy_chars[] = { #include "legacychars.h" }; @@ -96,7 +101,7 @@ static size_t find_charmap(const void *name) s += strlen((void *)s)+1; if (!*s) { if (s[1] > 0200) s+=2; - else s+=2+(128U-s[1])/4*5; + else s+=2+(64U-s[1])*5; } } return -1; @@ -181,10 +186,10 @@ static void put_32(unsigned char *s, unsigned c, int e) static unsigned legacy_map(const unsigned char *map, unsigned c) { - unsigned x = c - 128 - map[-1]; - x = legacy_chars[ map[x*5/4]>>2*x%8 | - map[x*5/4+1]<<8-2*x%8 & 1023 ]; - return x ? x : c; + if (c < 4*map[-1]) return c; + unsigned x = c - 4*map[-1]; + x = map[x*5/4]>>2*x%8 | map[x*5/4+1]<<8-2*x%8 & 1023; + return x < 256 ? x : legacy_chars[x-256]; } size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) @@ -449,9 +454,9 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri if (!c) goto ilseq; break; default: - if (c < 128+type) break; + if (!c) break; c = legacy_map(map, c); - if (c==1) goto ilseq; + if (!c) goto ilseq; } switch (totype) { @@ -475,14 +480,14 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri if (c > 0x7f) subst: x++, c='*'; default: if (*outb < 1) goto toobig; - if (c < 128+totype || (c<256 && c==legacy_map(tomap, c))) { + if (c<256 && c==legacy_map(tomap, c)) { revout: *(*out)++ = c; *outb -= 1; break; } d = c; - for (c=128+totype; c<256; c++) { + for (c=4*totype; c<256; c++) { if (d == legacy_map(tomap, c)) { goto revout; } diff --git a/src/locale/legacychars.h b/src/locale/legacychars.h index 914ad0d5..9639b4af 100644 --- a/src/locale/legacychars.h +++ b/src/locale/legacychars.h @@ -1,41 +1,40 @@ -0,1,160,167,168,169,175,176,178,183,184,198,215,216,230,247,248,162,163,165, -196,197,198,199,201,214,215,216,220,224,226,228,229,230,231,232,233,234,235, -236,238,239,242,244,246,248,249,251,252,255,256,257,258,259,260,261,262,263, -264,265,266,267,268,269,270,271,272,273,274,275,278,279,280,281,282,283,284, -285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,303,304,305, -308,309,310,311,312,313,314,315,316,317,318,321,322,323,324,325,326,327,328, -330,331,332,333,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350, -351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369, -370,371,372,373,374,375,376,377,378,379,380,381,382,402,416,417,431,432,536, -537,538,539,710,711,728,729,731,732,733,768,769,771,777,803,890,900,901,902, -904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924, -925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944, -945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963, -964,965,966,967,968,969,970, -971,972,973,974,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036, -1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052, -1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067, -1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082, -1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097, -1098,1099,1100,1101,1102,1103,1105,1106,1107,1108,1109,1110,1111,1112,1113, -1114,1115,1116,1118,1119,1168,1169,1456,1457,1458,1459,1460,1461,1462,1463, -1464,1465,1467,1468,1469,1470,1471,1472,1473,1474,1475,1488,1489,1490,1491, -1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506, -1507,1508,1509,1510,1511,1512,1513,1514,1520,1521,1522,1523,1524,1548,1563, -1567,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582, -1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1600,1601,1602, -1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617, -1618,1657,1662,1670,1672,1681,1688,1705,1711,1722,1726,1729,1746,3585,3586, -3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601, -3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616, -3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631, -3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3647,3648,3649,3650, -3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665, -3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,7682,7683,7690,7691,7710, -7711,7744,7745,7766,7767,7776,7777,7786,7787,7808,7809,7810,7811,7812,7813, -7922,7923,8204,8205,8206,8207,8211,8212,8213,8215,8216,8217,8218,8220,8221, -8222,8224,8225,8226,8230,8240,8249,8250,8362,8363,8364,8367,8359,8470,8482, -8729,8730,8776,8804,8805,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508, +256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274, +275,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295, +296,297,298,299,302,303,304,305,308,309,310,311,312,313,314,315,316,317,318, +321,322,323,324,325,326,327,328,330,331,332,333,336,337,338,339,340,341,342, +343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361, +362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380, +381,382,402,416,417,431,432,536,537,538,539,710,711,728,729,731,732,733,768, +769,771,777,803,890,900,901,902,904,905,906,908,910,911,912,913,914,915,916, +917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936, +937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955, +956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974, +1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,1040, +1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055, +1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070, +1071, +1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086, +1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101, +1102,1103,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118, +1119,1168,1169,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1467,1468, +1469,1470,1471,1472,1473,1474,1475,1488,1489,1490,1491,1492,1493,1494,1495, +1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510, +1511,1512,1513,1514,1520,1521,1522,1523,1524,1548,1563,1567,1569,1570,1571, +1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586, +1587,1588,1589,1590,1591,1592,1593,1594,1600,1601,1602,1603,1604,1605,1606, +1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1657,1662,1670, +1672,1681,1688,1705,1711,1722,1726,1729,1746,3585,3586,3587,3588,3589,3590, +3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605, +3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620, +3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635, +3636,3637,3638,3639,3640,3641,3642,3647,3648,3649,3650,3651,3652,3653,3654, +3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669, +3670,3671,3672,3673,3674,3675,7682,7683,7690,7691,7710,7711,7744,7745,7766, +7767, +7776,7777,7786,7787,7808,7809,7810,7811,7812,7813,7922,7923,8204,8205,8206, +8207,8211,8212,8213,8215,8216,8217,8218,8220,8221,8222,8224,8225,8226,8230, +8240,8249,8250,8319,8359,8362,8363,8364,8367,8470,8482,8729,8730,8734,8745, +8776,8801,8804,8805,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508, 9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563, 9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578, 9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632, From a223dbd27ae36fe53f9f67f86caf685b729593fc Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Nov 2017 23:47:05 -0500 Subject: [PATCH 411/412] add reverse iconv mappings for JIS-based encodings these encodings are still commonly used in messaging protocols and such. the reverse mapping is implemented as a binary search of a list of the jis 0208 characters in unicode order; the existing forward table is used to perform the comparison in the search. --- src/locale/iconv.c | 98 ++++++++- src/locale/revjis.h | 515 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 612 insertions(+), 1 deletion(-) create mode 100644 src/locale/revjis.h diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 01f17521..1784dc9d 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -80,6 +80,10 @@ static const unsigned short ksc[93][94] = { #include "ksc.h" }; +static const unsigned short rev_jis[] = { +#include "revjis.h" +}; + static int fuzzycmp(const unsigned char *a, const unsigned char *b) { for (; *a && *b; a++, b++) { @@ -134,7 +138,7 @@ iconv_t iconv_open(const char *to, const char *from) if ((t = find_charmap(to))==-1 || (f = find_charmap(from))==-1 - || (charmaps[t] >= 0320)) { + || (charmaps[t] >= 0330)) { errno = EINVAL; return (iconv_t)-1; } @@ -192,6 +196,25 @@ static unsigned legacy_map(const unsigned char *map, unsigned c) return x < 256 ? x : legacy_chars[x-256]; } +static unsigned uni_to_jis(unsigned c) +{ + unsigned nel = sizeof rev_jis / sizeof *rev_jis; + unsigned d, j, i, b = 0; + for (;;) { + i = nel/2; + j = rev_jis[b+i]; + d = jis0208[j/256][j%256]; + if (d==c) return j + 0x2121; + else if (nel == 1) return 0; + else if (c < d) + nel /= 2; + else { + b += i; + nel -= nel/2; + } + } +} + size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) { size_t x=0; @@ -493,6 +516,79 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri } } goto subst; + case SHIFT_JIS: + if (c < 128) goto revout; + if (c == 0xa5) { + x++; + c = '\\'; + goto revout; + } + if (c == 0x203e) { + x++; + c = '~'; + goto revout; + } + if (c-0xff61 <= 0xdf-0xa1) { + c += 0xa1 - 0xff61; + goto revout; + } + c = uni_to_jis(c); + if (!c) goto subst; + if (*outb < 2) goto toobig; + d = c%256; + c = c/256; + *(*out)++ = (c+1)/2 + (c<95 ? 112 : 176); + *(*out)++ = c%2 ? d + 31 + d/96 : d + 126; + *outb -= 2; + break; + case EUC_JP: + if (c < 128) goto revout; + if (c-0xff61 <= 0xdf-0xa1) { + c += 0x0e00 + 0x21 - 0xff61; + } else { + c = uni_to_jis(c); + } + if (!c) goto subst; + if (*outb < 2) goto toobig; + *(*out)++ = c/256 + 0x80; + *(*out)++ = c%256 + 0x80; + *outb -= 2; + break; + case ISO2022_JP: + if (c < 128) goto revout; + if (c-0xff61 <= 0xdf-0xa1 || c==0xa5 || c==0x203e) { + if (*outb < 7) goto toobig; + *(*out)++ = '\033'; + *(*out)++ = '('; + if (c==0xa5) { + *(*out)++ = 'J'; + *(*out)++ = '\\'; + } else if (c==0x203e) { + *(*out)++ = 'J'; + *(*out)++ = '~'; + } else { + *(*out)++ = 'I'; + *(*out)++ = c-0xff61+0x21; + } + *(*out)++ = '\033'; + *(*out)++ = '('; + *(*out)++ = 'B'; + *outb -= 7; + break; + } + c = uni_to_jis(c); + if (!c) goto subst; + if (*outb < 8) goto toobig; + *(*out)++ = '\033'; + *(*out)++ = '$'; + *(*out)++ = 'B'; + *(*out)++ = c/256; + *(*out)++ = c%256; + *(*out)++ = '\033'; + *(*out)++ = '('; + *(*out)++ = 'B'; + *outb -= 8; + break; case UCS2BE: case UCS2LE: case UTF_16BE: diff --git a/src/locale/revjis.h b/src/locale/revjis.h new file mode 100644 index 00000000..3ab369f6 --- /dev/null +++ b/src/locale/revjis.h @@ -0,0 +1,515 @@ +31,80,81,87,14,299,74,61,12,344,62,63,1280,1281,1282,1283,1284,1285,1286,1287, +1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302, +1303,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325, +1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1542,1536,1537,1538,1539, +1540,1541,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1555, +1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1584,1585, +1586,1587,1588,1589,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601, +1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616, +1590,29,28,33,37,38,39,40,342,343,36,35,338,75,76,263,77,337,266,267,265,268, +300,301,302,318,303,319,281,282,60,324,326,70,315,297,298,288,287,328,329,71, +327,325,321,65,320,68,69,322,323,285,286,283,284,316,317,1792,1803,1793,1804, +1794,1805,1795,1806,1797,1808,1796,1807,1798,1819,1814,1809,1800,1821,1816, +1811,1799,1815,1820,1810,1801,1817,1822,1812,1802,1818,1823,1813,258,257,260, +259,262,261,256,93,90,92,91,349,89,88,73,72,341,340,339,0,1,2,22,24,25,26,49, +50,51,52,53,54,55,56,57,58,264,269,43,44,32, +768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786, +787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805, +806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824, +825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843, +844,845,846,847,848,849,850,10,11,20,21,1024,1025,1026,1027,1028,1029,1030, +1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045, +1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060, +1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075, +1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090, +1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105, +1106,1107,1108,1109,5,27,18,19,3915,8793,6934,10843,7493,6671,7492,4379,10291, +11294,12033,4110,4685,12034,7939,12577,5173,10521,7494,11549,10529,12035,8773, +12036,5465,12037,4924,8719,6982,12038,12039,12040,9748,5174,9750,9538,5922, +10770,18472,12041,7495,12042,4372,5444,5967,11080,13573,11343,9564,4868,5140, +12043,12044,11546,11292,8263,12046,6741,9554,12049,4125,5950,5949,3909,11818, +11817,6418,3840,12050,12051,12052,10771,12053,5969,3910,10833,5211,5212,5213, +9025,11547,12054,12055,12056,7724,7193,7725,12061,12059,12060,5175,6402,4431, +12058,12057,10504,6693,6692,8477,12062,10292,8006,23,12063,12065,8516,11584, +3881,12064,4381,5411,8774,5710,12066,9731,4938,12067,3882,5951,4939,10329, +10001,5176,4432,12102,9248,9803,12069,10011,11585,7692,6694,6742,4383,9008, +8705,12073,3883,9026,7194,6419,11267,8493,4382,12072,11293,12068,12070,6477, +12071,13315,12079,12082,12080,4385,10522,12074,12078,5970,6695,4869,12083, +12075,11586,6743,12076,12081,12084,12077,5376,3884,5377,4384,13316,10840, +10317,5971,7694,11542,10551,5655,8452,4419,7218,12088,12093,12091,12086,8462, +12089,12092,12090,10556,12087,7693,10834,12094,12095,7171,12108,9775,10261, +12103,10575,4373,12107,12101,12110,8241,5923,9787,16166,12109,9276,12098,5973, +5972,12096,6969,12104,10574,8748,12100,5712,12097,12105,12099,11568,12106, +11808,5445,5711,12111,12112,12116,3885,10543,12115,12114,12118,12117,9027, +5713,12119,6948,8453,9028,5461,12120,5141,12121,12123,10772,5701,6672,10070, +12122,6436,11298,12125,12290,12124,6435,7260,5656,12291,5422,12288,12289,9486, +8283,5378,10796,12292,11548,12293,12296,12294,8237,12295,12297,12299,12298, +10535,5142,12301,12302,4366,12300,6995,12305,12304,12303,12085,12306,7261, +12307,11268,11064,12309,12308,12311,12310,12312,12313,3923,5908,5658,7195, +8794,5379,8007,5974,6221,12315,11047,9253,6744,12314,12316,9277,4692,12317, +9565,8211,12319,12320,9995,5975,11802,12321,5381,10523,8469,5456, +9236,5714,12322,12323,9537,4158,12326,6492,12325,6437,12327,17741,12328,10784, +12329,12330,12331,7496,6955,4870,12334,12332,11036,12333,10297,12335,12336, +12337,9278,12341,12339,12340,12338,6466,12342,11081,11587,12343,7943,12344, +7225,12345,8795,11550,9279,12580,12346,21252,5412,12347,10813,7239,8539,12349, +9539,12350,12351,4621,12352,5382,9515,4185,7215,9984,12353,9280,7726,12354, +10507,7993,4865,4872,12355,12357,5657,12356,11602,7240,10012,10539,12358, +11351,12359,12360,9309,12361,7944,6493,5715,12362,6696,6222,9029,12364,8454, +6478,12365,12366,8207,12363,12368,10773,6211,12367,5716,6461,9804,12371,12369, +10330,7497,12378,4675,12372,12370,8238,12374,12373,4643,5695,12379,11532, +12375,12380,12377,12376,11566,5976,4386,11603,7252,9271,6212,12545,12546, +11588,11786,12548,5977,12547,4622,12549,10805,8987,11269,10552,12550,20276, +9487,12551,4873,11026,7424,12552,10566,12556,7945,12553,5423,12554,4874,5645, +12557,12558,12559,12560,6970,5978,11069,11079,9558,10576,12561,12562,12564, +12566,12565,12567,4380,10795,6491,12568,8248,7425,5384,12569,10042,12570, +12571,12572,12573,10243,5447,3908,9502,12574,7196,8008,12576,12575,7426,5952, +12578,10013,12579,10043,8467,8525,5383,9549,8720,9805,10797,12581,8009,5652, +12582,12583,4107,3924,4940,8455,5168,11344,12586,4374,12585,5385,12587,11088, +12588,11569,5979,5909,12589,12591,12590,7742,4120,4157,12592,12593,5910,12594, +5197,6673,12595,10835,6420,5177,11270,8239,10014,7004,7206,6983, +6996,7253,10015,12598,4130,8240,5980,5924,5446,12602,8704,8541,5386,7427, +12603,12601,4387,8517,6935,6698,4101,4687,6213,6697,12604,12605,5160,4645, +6214,5159,9022,4100,9488,11037,6144,11352,9254,5981,5646,12614,5442,10793, +10044,12613,4925,12608,12609,12611,12612,5178,7744,10508,12610,12606,5954, +12607,11779,10577,9031,5953,6223,12615,9532,12619,7005,6997,12622,12620,11010, +12617,12626,12621,12624,5925,11038,12625,12627,12629,6479,11809,12618,12616, +12628,12623,12631,12802,12633,12637,12800,12634,12829,6472,4624,12632,12804, +3925,12803,3844,10281,12801,12635,12630,12636,6439,12805,3926,12814,12806, +12807,7428,10824,12812,12811,9230,12813,12810,4115,6421,7695,12808,9281,12809, +3841,12819,11266,7430,12825,12824,12815,8482,12816,8526,12821,7429,12818, +11075,5659,12822,12823,12820,12826,12817,12832,12837,12833,12828,12838,8208, +12840,6145,12830,8796,12834,12827,4876,4941,4676,12835,12831,5717,12841,12839, +8242,5161,5387,12836,5459,4131,12845,12843,13062,12848,12842,12846,12844,6699, +12847,12850,12855,12853,12852,8721,4388,12849,12851,7431,4114,12854,4413, +12865,7515,12861,12859,12860,12862,4124,8216,12856,12857,4697,12864,4942, +12867,12863,12866,10509,9524,10007,12869,12868,4644,12870,12873,12872,12871, +9752,12874,12875,12877,12876,12879,12882,12880,12878,12881,12883,12884,12885, +12886,12887,12324,7003,6700,4434,3927,8739,12888,6403,3886,7741,12889,5926, +6224,12891,12890,10559,12892,13056,12893,13057,13058,5718,4159,13059,13061, +13060, +13063,9273,13064,3860,6462,5660,8750,13065,13066,13068,13069,6467,5424,10774, +13067,13070,6432,6146,13074,6404,8722,13071,9017,13075,7745,13073,13076,5662, +13077,13078,6147,4639,13080,13081,13082,13079,13072,13083,13084,10819,7498, +13086,13087,13085,13089,9751,3911,10293,13090,7516,6936,9788,4943,6474,10808, +9489,5719,8494,13088,13091,8483,13092,13093,13095,9032,4877,21248,4160,10578, +7499,9255,6469,13101,10524,11580,4435,13097,8217,13100,9282,9256,9283,10008, +9004,6440,13096,4181,9237,13098,13094,7727,13102,7213,5388,13103,10567,8284, +8997,13105,10798,13106,13111,10510,13110,13104,13107,13109,6405,10536,13112, +8740,4436,7500,13114,13113,6215,13115,13117,13116,13119,13108,13121,13120, +13118,6701,7728,8243,13122,7963,3916,9795,9018,13124,13123,13125,13126,13127, +13128,10544,13129,4389,13130,11291,4623,12584,7207,8478,13131,11082,11027, +13133,8518,9238,8479,10294,13134,13135,4186,6937,13136,3887,13137,13138,4161, +4944,9535,10579,13142,8244,13141,5663,10810,13140,9284,13144,13143,13146, +13145,4187,13147,7432,13149,8708,13148,10514,7254,9274,13312,6148,13313,9728, +10045,11056,9732,13322,5143,11300,11022,13579,13314,13317,8484,10775,9257, +13318,10820,6441,7433,13319,6703,6702,3864,5927,7946,3888,13323,13324,13321, +4119,4878,13320,11044,10256,3847,3928,6704,3889,3842,13329,13327,11035,13330, +13328,13326,7696,13325,10553,5955,13334,13335,7434,13331,11787,9771,13333, +6406,13336,10295,13337,13332,11034,9789,13338,10257,13339,13343, +13340,4390,13342,6938,13341,5720,13355,13348,13345,8771,13344,13346,13347, +13349,13350,4945,13352,13351,13353,7501,13356,9019,4132,13354,13357,13358, +13361,13359,13360,6705,13362,6149,13363,6745,8471,13364,13365,6713,6150,11057, +5127,5928,13366,4663,13367,8472,13368,13570,13369,13370,13371,13373,13374, +13375,8527,4102,6984,3873,8246,4879,6932,6151,9285,7168,4880,8775,9033,3863, +5144,10580,6945,5169,8010,6939,11271,13376,5179,6442,4625,4162,7435,4391, +13377,11301,7208,6979,13378,4946,9521,11016,13379,13380,10296,13382,4871,5462, +13381,4881,7697,13386,6656,4392,13385,13383,13387,13384,9738,15148,7698,13388, +11551,13389,13391,8797,13390,7938,6746,8495,6998,10324,8011,6956,13392,7436, +13393,13394,3890,8473,7729,13395,9490,7437,7438,13396,8012,7439,13397,13398, +11071,13399,5413,7169,13400,13401,6971,7691,9555,7731,10071,9729,5416,13402, +5198,13403,5469,9518,4367,6706,13404,13569,13568,5468,13405,9239,8463,9258, +6951,8247,11353,13571,13572,9525,6674,13574,13575,13576,4947,13577,13578,4363, +8218,4931,13580,11015,8497,4664,13582,13584,4926,13581,13583,13586,13585, +13587,13588,9500,5389,4420,13589,13594,13592,10582,10581,9286,13591,7219, +13590,7761,13595,6473,13601,13602,13596,4626,13597,13606,13605,13604,13600, +13599,13603,10583,13610,13607,13609,11345,13608,13598,7762,13611,6422,13612, +13613,13616,13615,13614,9287,13593,13622,13618,13617,13619,13620,13623,11589, +13624,13621,13625,4927,13626,13628,13627,13629,13630,8013,7170, +7235,8258,6152,6423,6153,5199,13631,6424,5929,13632,11013,9762,13633,6154, +4875,8710,5425,6707,10298,10016,13634,4948,13637,8960,13636,13635,13638,9034, +7746,6708,7977,8498,5121,8961,13639,13640,7502,10776,13643,13642,13641,10332, +13650,10809,13644,13646,10826,13645,13647,9991,13648,10525,13649,4882,10526, +9742,13651,13652,6155,4883,13653,5911,11299,11272,4949,13655,8962,6156,7440, +10046,7441,7255,9035,10584,9240,6157,10299,13656,9272,6433,5930,9036,3874, +7245,6158,11302,13657,13658,9776,13659,11606,11788,13661,13660,4646,13824, +13827,13828,13826,10271,7442,13830,13829,13825,13831,13832,13833,13836,13834, +13835,13837,4163,9037,13838,5721,4437,9749,13839,9562,10554,13840,11789,13841, +10527,13844,12032,12048,6927,9556,13845,5180,8963,3929,13846,10501,6159,8751, +9038,11086,5912,5931,13847,13848,13854,6980,8964,5390,13849,10250,8741,13850, +13851,5391,13852,13853,13855,9301,13856,13857,13858,13843,13842,13859,5664, +10246,6443,10262,8965,10282,13860,7443,4133,13861,13862,11089,10047,13865, +4188,7947,13864,13863,5665,8499,13869,13867,13866,11526,5956,7256,13868,9259, +7197,9503,13872,13871,13870,13873,5957,13874,10331,7226,13875,10072,9504,8966, +9231,13876,5130,7699,10251,4950,9733,13877,6709,10777,10778,4189,13882,8776, +13879,4438,14092,13881,9743,13880,13878,6233,13884,13890,13896,13888,9275, +13893,10300,13887,13892,11590,6710,8500,13885,5181,13895,7948,4164,13889,4439, +13894,5392,13891,13897,13899,13909,13907,13904,13903,11607, +13905,5393,6160,7257,13912,13898,13902,13886,4441,13906,13908,8752,6407,4375, +13900,13911,13910,5394,8456,4677,5666,13901,13913,13916,14080,6940,14086,9039, +13914,14084,4440,14082,14083,13917,14081,5958,11273,4884,4152,14085,9753,3852, +10048,13883,14091,14095,11076,14088,9288,14093,7503,14094,9526,11814,14090, +14096,6234,7978,3891,14089,14087,8249,13915,6675,8485,14108,8250,14103,14100, +14101,6981,14104,14107,14102,7172,14105,14099,11099,11098,14109,14110,3892, +14098,5457,3845,4885,14106,14114,14113,14118,14119,14117,14120,14112,14116, +14121,14122,14111,6747,14115,8501,6161,14097,7700,14135,10568,14125,14126, +14127,14134,14133,10844,4886,14131,5668,4627,14128,11543,14130,3893,14132, +14123,14129,14136,5667,14124,11324,11274,14139,14143,8285,11608,14144,14141, +14138,14137,14142,10511,9491,5669,14145,14140,14146,5722,4368,14154,4887, +14152,14153,6408,14151,14149,14148,14155,14147,14157,4442,14159,14158,8967, +14162,14160,14150,5723,14161,14165,14164,14166,14163,14167,14168,14169,10569, +14171,14170,7198,7949,4421,4443,14172,3870,7979,14173,19234,14336,5696,14337, +8014,14338,14339,5145,14340,14341,14342,8502,5932,11072,10779,7241,14343,8015, +19740,10049,6985,6444,14344,8486,10502,8528,14347,14345,14348,14346,14349, +10512,3862,10301,10050,14350,14353,7444,5146,14351,14358,7445,14352,9763, +11325,14354,14355,14359,9289,14356,6162,7997,14373,10003,8529,10051,14604, +10585,9040,10836,14362,4352,8777,14371,8723,14365,14372,14367,14374,14370, +14369,9806,14363, +4444,14361,5200,8530,14357,14360,6163,7994,7446,14368,9777,5201,4647,4678, +7680,14376,14381,14377,5724,14382,6657,6216,7173,14364,6748,14379,6711,14380, +3875,14375,8968,5202,5395,14378,3846,6434,7701,9041,10035,14384,8253,8457, +6666,14385,14387,14383,10560,8988,8251,10586,6957,14399,14398,7767,5725,14392, +7448,9543,9744,14390,8252,6999,14395,7447,14389,14394,9778,14388,5632,4668, +14396,11530,6445,8724,14393,7995,6164,7747,4165,8219,14391,5156,5670,9006, +14397,8254,14400,14402,8470,14408,14403,14405,10272,9042,14406,11275,11303, +4888,3853,14404,14401,4951,4166,14407,11304,14411,8474,14418,14412,14409, +14416,14386,14413,14417,10017,9290,14410,14414,5671,6480,7996,14422,9221, +14419,10815,14420,14421,11053,7937,5697,14428,6676,14425,14424,9745,9492,9232, +14426,14427,10318,9764,6658,8016,10799,4648,14596,14429,11305,14598,14594, +14595,8255,14593,14366,14597,14592,14602,14603,9222,14605,6659,14600,5147, +14606,14599,14610,14609,14608,14611,14613,7504,14612,14616,14614,14615,14415, +14618,14617,14423,14619,14607,6712,14620,14621,14623,14622,14624,4445,6165, +10587,7950,5933,14626,14629,10289,5182,14628,14627,9779,14630,5396,14632, +14631,4889,6677,9527,5672,7763,14633,7951,9223,10302,14634,14635,14636,10519, +13372,7973,10283,6455,10052,10018,9260,11552,14638,6959,14639,3861,5427,7980, +10303,14640,6689,8742,6714,7702,14641,10588,4182,6715,14644,14642,14645,11544, +14643,8026,14646,8465,14647,4953,14649,14648,14650,14651,4954,9563, +8725,5195,6716,8256,7227,3855,14652,4353,14656,6166,14655,6410,7449,14654, +7450,11039,6409,3894,7981,14661,7952,4134,7220,10821,6481,7451,7942,14660, +14658,14659,8778,14853,14665,6749,6167,14663,14664,7703,14662,6670,14667, +14666,14671,14672,14668,4609,14669,14670,10036,10304,5673,14673,7953,7452, +8753,5414,14674,14678,4394,14675,14677,14676,7242,8743,3876,14679,14680,8969, +11600,6690,10570,10780,14849,14682,14685,14684,14681,14848,9533,14683,14850, +7243,14851,11306,9815,14852,14854,14855,14856,5417,4135,6168,14857,14858,7248, +8257,12599,8221,8220,8503,6438,12113,5709,11276,10589,10333,14859,6482,8990, +14860,11790,10781,8970,14861,4955,14862,14863,11065,11011,10837,10811,6660, +14865,6986,10800,14867,14870,14869,4952,5183,14866,14868,14871,7768,11354, +3880,6463,8475,6972,7506,14874,9261,14872,8458,14873,7505,11068,14875,14876, +11335,14881,6169,9780,14878,9291,14653,14657,5166,9766,14880,7453,10019,14886, +10073,14877,14883,14882,7982,10828,11570,10822,4395,6717,11815,14885,7764, +14884,14879,5934,14891,14889,4396,14887,14893,14899,8487,10528,14901,10241, +14900,9807,10782,4890,8022,7199,9010,11277,14896,14895,14897,14894,14902, +14892,14890,14898,14888,8779,11095,6949,6483,6425,10830,4640,9005,9513,4136, +8017,7955,5641,14904,6170,4699,14906,4691,14912,14909,8018,4650,6411,4649, +6446,14907,5700,5674,9292,14905,3877,14908,14910,5420,5643,4891,5162,14913, +6488,10832,6678,14914,10255,14926,4370,14915,14932,14916,11553,14923, +9790,14931,14918,3859,14920,6171,14922,14921,14917,14928,7454,13132,5959, +11355,14919,9043,4610,6412,14911,14927,4672,14925,14929,9293,4957,15121,11048, +14934,4956,14941,10783,15104,15106,15110,14936,8713,9294,15114,14939,15111, +15105,7704,15115,7954,15113,4892,11823,14933,15109,3895,14935,11033,14940, +7681,8998,14930,15108,7769,15118,4688,5888,15120,14937,15119,15112,14938, +15116,15117,15134,9517,15107,15130,15132,9015,11307,10325,15127,8489,15133, +8222,15124,15137,15136,9550,15135,9545,15139,15126,5415,15129,7228,9791,15131, +5418,15123,15125,15122,11791,4665,15128,15138,4628,6470,4156,15155,11792, +15158,7705,15157,15156,15153,15141,15170,15140,15159,15151,15146,15143,15144, +15152,21249,15149,6172,8999,8259,15147,15142,15145,11308,10825,15150,15160, +15168,15161,15174,15172,15167,15166,9007,8260,15164,15162,15169,15175,10068, +15181,15176,15179,15173,8787,10263,15163,15171,7455,11054,15191,15178,5889, +4354,4670,15154,7456,15183,15190,7000,4689,8717,15180,15185,15189,5397,5163, +15187,5120,9514,15186,15188,15182,15184,4671,8744,15195,15193,5960,15192, +15360,14903,15194,15196,15197,15371,15367,14924,15366,15365,15362,15177,15364, +15363,15369,11781,15372,5466,15368,15370,9990,15373,15377,15374,11346,15375, +15165,15378,15379,4116,15381,5702,6912,5428,4355,11326,15383,15382,15385,5148, +5429,4893,15388,15387,15389,4397,8726,15390,4894,15392,15391,15393,15394, +15395,6718,7956,6400,10319,10561,11811,6740,6447,11601,15396,15397,6719,15398, +15399,15401,15400,10807, +7229,6987,6691,15402,15404,7682,15403,15405,15406,15407,15408,15409,15411, +15410,15412,4356,8745,15413,6661,4651,15414,9249,13099,5122,15415,15416,10571, +10823,9510,15417,10053,10074,11058,15418,15420,15419,15422,15421,15424,6720, +11024,15425,15426,5123,15427,15429,15428,7748,10264,4137,10020,9044,7200,5184, +10021,6925,15431,4895,4183,9553,15430,6173,8754,15432,15440,15433,8480,5185, +15441,5703,5124,15439,15437,15434,11327,8991,9528,15435,15443,15442,5634,4364, +6426,15436,15438,10806,8531,10838,15451,15452,4398,10503,11100,15616,6914, +7457,15447,15453,4167,5398,15444,15449,8019,9808,10054,15446,10752,15448, +15619,15617,15450,10753,9767,5186,9220,8780,15620,15618,8504,15445,4138,11309, +15631,15630,8021,15627,11339,9493,15621,8996,4139,6174,15624,7174,15629,15628, +15623,15626,4679,15625,9768,11533,7507,8020,15637,15635,10284,15632,15634, +4121,6175,11793,4636,10305,11328,4611,7706,15636,15641,7458,11279,15638,15633, +15639,11581,9298,9505,4629,4148,15645,15648,11554,11331,15655,15649,15646, +11571,15652,7209,15654,15659,9296,15657,15651,8727,15658,15647,15653,15660, +3931,15650,15661,7707,7230,10500,6413,15642,15656,9241,7957,4680,6448,7459, +15644,7201,5675,15643,15665,7244,5913,15680,15674,5203,9262,15669,15678,3854, +4113,4376,15671,8459,15662,15664,6176,15681,15676,15668,15675,11018,15673, +15677,5935,7460,8728,15667,11278,15670,15663,9297,15666,15672,11824,6941, +10845,15682,9997,15694,5914,7231,15684,11534,6177,15697,3917,15695,15683, +15689,15691,11310,15686,9229,15688,15696,15690,11046,15685,6913,15709,4681, +15687,15692,15693,8523,8505,15701,15707,15705,9224,15874,15702,15703,15679, +5208,10265,6942,6230,11794,15699,15873,4168,8261,9816,4896,11609,11008,9009, +15706,15708,8209,15872,15704,15698,4898,5704,15886,15881,8023,4674,7232,15890, +15883,8971,15880,9016,15915,15877,15876,15885,15879,15878,15884,7936,15875, +15887,15888,4897,15893,15892,15894,15897,9250,15891,15895,5698,8536,15889, +9754,15896,15901,15899,15902,15905,15898,6217,9735,15640,11347,15900,15904, +8532,15903,15882,20040,15908,15912,15910,15906,15907,15911,15909,10285,15917, +15914,15913,15916,9523,15918,8788,8524,7940,15919,15921,15920,15700,15922, +9542,15923,4399,9299,4612,5187,6973,6449,11782,7749,4169,15925,15924,15928, +8729,15931,15926,15930,15929,9247,3896,11604,15933,4103,15935,15934,15932, +15927,10754,15937,15936,4170,15939,10513,15938,11028,7462,8210,7461,11610, +15945,8024,15941,15946,4171,15944,9792,15940,15943,7463,10032,15947,6960,8025, +15950,15942,5638,15948,11311,15951,21253,7214,15952,15953,9741,15955,15956, +9746,9300,15958,15960,11572,15957,15959,4172,15954,12858,15961,8262,6679, +15963,15962,7683,12600,15964,16128,15949,15965,16129,9817,16130,16131,16132, +16133,9021,16135,16134,16136,16137,6974,10306,11083,16138,16139,8245,6915, +16140,16141,16142,10545,10022,16143,9782,8972,16144,4422,5196,11045,11029, +4371,11795,10801,10505,7958,16145,9506,5890,16146,6451,16148,16147,16149, +16150,16151,5149,16152,16153, +5891,10023,16155,7508,16154,5399,16156,16158,16157,16159,5936,16160,5448,8223, +6236,16162,16163,16161,6988,9511,5400,16165,8715,16164,11796,9793,16168,16170, +16167,11059,16169,16171,11555,16175,16174,8789,9740,5892,16173,16172,11280, +11281,16176,4173,6229,6721,16177,16178,16180,7202,16182,16181,16183,4652, +16185,16184,16187,16186,5915,11527,5419,4357,5449,4928,11591,16189,16191, +16192,4400,16188,6680,8992,16190,16195,6989,16193,5661,10024,16194,16221, +16200,5916,5188,16197,11356,11535,8533,16199,16201,11573,5430,10075,9769, +16202,16204,16207,16203,16206,5961,4140,16208,7759,16205,11579,16211,21251, +16209,16212,16198,16210,6427,16213,16214,11357,16215,16216,16196,16217,4899, +6916,16218,16219,16220,4122,16384,10266,16385,4867,16386,16387,16388,16390, +16391,16389,10290,16393,16392,16395,16394,16396,16397,16399,16398,6232,16401, +16400,4900,7730,9243,16402,7959,6681,4184,16403,11312,10562,16404,9251,11282, +6178,7708,8746,12563,8973,4423,16405,16406,16411,16409,16408,14625,4613,16407, +3897,9993,10025,11536,16412,16410,8763,7941,9994,10252,16414,11531,5676,16415, +16413,10037,16416,16417,3898,7509,16422,16419,9548,16418,5125,16425,16420, +16421,16424,16423,10244,8225,8224,5150,16426,16427,16428,16430,16429,4149, +16438,10055,16432,16434,16436,7709,16437,16435,6943,16431,16433,10273,7464, +16440,16439,16441,6917,6414,9302,16442,9002,16444,11520,16443,8264,16449, +16451,16452,8755,16450,16447,16445,16446,16448,16455,16453,16454,16456,16458, +16459,16460,16461,16457, +16463,16462,16464,11556,16467,16465,16466,4929,11101,10537,16469,16468,16470, +16471,16475,16472,16473,16474,16476,16477,16640,16641,16642,9998,9263,16643, +9809,10259,16644,16645,9225,4614,6179,16646,16647,16648,6664,16650,16649, +16651,16652,10056,16653,16654,21064,16655,16656,16657,6669,16658,9781,10814, +4141,4150,16659,16661,16660,9295,7960,15384,16662,11040,16663,4901,10038, +16664,16665,16666,11067,11060,8989,8265,16668,7233,7465,16671,16670,16669, +10076,4902,5896,16677,16674,7710,11025,16673,16675,16676,16672,16678,16679, +8974,4930,8772,16680,16681,16684,7750,9507,16685,10802,16682,16683,16688, +16687,16686,16690,16689,16691,16693,16692,10540,7221,11557,16694,9494,16695, +16696,16700,16698,16699,16697,16701,16702,16703,16704,11030,16705,11087,16706, +8749,9801,5450,8730,16707,5401,7983,16708,6428,16709,16710,5893,6452,16712, +9269,6453,5165,10755,9770,9270,6203,16714,7466,11537,6180,5894,9986,16716, +16718,5962,16717,9045,16720,4630,16715,10057,4111,6475,11825,16719,16721, +10538,7992,16723,16724,16722,4653,16730,16729,6918,16731,16726,16732,16727, +10039,16725,16728,16897,16896,10816,16733,3914,16899,16898,7467,16900,8226, +16902,16901,16903,16711,16713,16905,16904,6919,11592,6961,16906,5654,5151, +5126,6722,11283,16912,16911,8227,16908,16910,7210,7711,16909,16907,9737,7468, +10267,6454,9303,16913,16914,16936,5431,11804,8212,16915,4401,9046,10496,16916, +5209,16917,16919,16920,9736,16921,16922,16923,5432,4402,9508,7175,6723,16924, +7176,4393,10274,16925, +10058,8228,16928,16929,9800,7712,16926,8768,16927,7469,3899,5128,16930,9047, +16931,7974,11020,10242,16932,16933,8756,11558,16935,16934,6990,16937,3919, +16940,16938,4403,5677,16939,6181,6225,10565,16941,10803,16943,7984,4142,4377, +3851,16942,16944,16945,7510,16946,4654,16948,5705,5189,16949,5460,16950,8027, +9516,7999,6484,16951,8769,8266,16953,16955,16952,16954,5633,16956,5637,5190, +11313,16958,16959,4109,16962,4693,16961,16960,16964,16957,16965,11528,16966, +16967,13139,16969,16968,16970,16971,11540,16972,20302,7470,16973,16974,7222, +9495,16975,8711,16976,8731,16977,5380,12318,8764,6930,4903,16978,17153,16981, +5191,16980,17155,16979,7471,16983,16984,9226,16985,4669,7737,10307,16987,8519, +16982,16986,16988,6490,17157,10253,9989,9304,5433,17156,17154,10004,16989, +8765,9306,9305,6485,17175,17159,17161,17164,17165,17162,17163,17160,17158, +17152,10542,4404,17172,17169,17174,17173,9810,11014,6682,17167,17176,17171, +17170,17166,17168,4904,8732,8028,9985,17181,9987,8000,17178,10030,17182,10546, +8762,17177,17179,17180,17183,6947,9509,17188,17187,17184,11797,17193,17197, +17194,17190,17191,17196,17185,12596,17192,17186,17195,17201,4905,17198,17199, +17200,17203,17202,10069,17204,11611,10572,17209,17206,17205,7985,17208,17210, +17207,17214,17211,17212,17189,17213,17215,17216,10533,17217,11073,5421,5640, +17218,10515,7751,11023,17219,11538,9811,8229,9747,7212,3871,17224,17222,17220, +4864,7472,17225,17223,17221,17229,17228,17227,17226,17230,17231,7961,17232, +17234, +17233,5937,8215,17236,9307,17235,17237,10516,8267,6182,17238,11559,17240, +17241,17242,17243,6724,17244,5678,5193,5129,17408,11090,6183,17245,17411, +11077,9755,10258,7234,17410,6962,6184,6725,5192,10517,17409,8230,10785,6486, +6726,9020,17414,11582,6456,17415,7713,17417,7473,6415,17416,7177,5917,8231, +17412,17418,17413,5679,17421,17425,5706,17420,17429,6185,11340,3867,17426, +5194,17423,17424,9308,17422,17419,4615,8003,5895,17431,17428,17430,17427,5680, +8466,17432,8269,17445,17441,17435,17439,7001,3900,17434,17442,17446,6186, +11061,9013,17436,17444,17433,8733,17438,3868,11049,17437,5434,10059,8268, +11567,7246,17485,17447,8029,17443,17448,17450,9048,17453,17449,10547,4906, +11050,3901,17452,11612,17451,4174,9547,17454,17461,17455,17462,17458,9818, +6953,17460,17457,17463,17456,7203,10756,7211,17459,17471,17467,17470,17468, +17472,17466,17440,7986,10026,17469,17464,8192,5681,7178,7684,8213,17475,17477, +17478,17474,17476,17465,17473,17481,17480,10841,5642,17479,17483,17482,17486, +17488,6683,17484,17489,17490,17491,17497,9242,17493,17492,17494,17495,17496, +17498,17499,4907,17500,17501,17664,17665,17666,17667,17668,17669,17671,17670, +17672,17673,17674,17677,17675,17676,6464,5682,8757,10002,7247,9772,10060, +17678,14156,17679,17681,11332,17680,17683,17682,11314,17684,10077,17685,17688, +17687,17686,17689,5649,8193,5152,17693,17690,17691,17694,17695,17692,4104, +4358,17697,17698,17699,11329,7179,17701,17700,7752,17702,17703,17704,4932, +4908,17705,17706,10812,11330, +11315,11798,6188,17709,6963,17708,17710,6920,8496,17711,6187,11062,17712, +17713,17714,17715,17716,6921,11084,17718,8734,17717,17720,17719,17721,7962, +17722,17723,10520,17724,8270,17725,17726,11613,17729,17728,17727,8975,17730, +7685,17731,17732,11799,17733,17734,17736,17735,9988,9560,11805,9992,17738, +7474,10249,17739,17737,4909,5939,6727,10061,5897,10786,17742,17740,6189,6190, +3912,6471,9784,3902,17747,8735,9783,8506,17749,17745,17748,17743,17746,10757, +5940,3932,17744,17751,17752,9496,5402,17925,9756,6728,5403,7975,11813,11021, +17750,7987,5170,17753,17755,17754,17756,8709,9757,8976,17922,17921,17757,7732, +10308,17924,17923,6191,11826,17940,17928,17929,6991,17927,6231,17926,17930, +8977,10497,8194,8507,17934,17935,17931,17932,17933,6192,17941,17937,10309, +10827,10247,17936,17939,17938,10787,17942,17943,8214,17944,17946,17950,17947, +17945,9758,17948,17949,4369,17956,17951,17952,17953,8448,17955,17954,17957, +17958,17959,7714,4424,17960,11574,6922,7180,6729,8758,17961,17962,4112,17963, +17964,17965,17966,17967,5404,14601,17968,8004,17969,6954,17970,12047,17971, +10557,4923,8195,7223,10320,7181,17972,6193,17973,10027,17987,17975,8488,9812, +5918,17974,8196,17976,9049,17978,17977,17980,17979,17981,17983,17982,4910, +17984,17985,17986,6416,11560,17988,7686,4175,17989,17990,17991,3921,17992, +17993,10310,6950,17995,4616,3857,17994,17997,9773,7715,4405,10758,5692,5435, +17996,4425,4866,4176,18001,11593,8508,10275,18013,4406,18011,18009,18000, +17998,17999, +6978,5451,8790,9520,4144,18003,18002,18008,18004,18007,11055,18006,4407,4700, +18010,18012,5683,18178,18187,18188,3850,18195,3920,18186,18185,18180,18179, +18177,18176,8770,8538,18182,18181,18184,8271,5684,4128,18183,6194,8272,18201, +18202,4408,4365,18199,18189,18197,18204,18198,18196,18005,18194,18190,4911, +18192,18203,18193,18205,18191,9819,11336,18200,18222,18214,7770,5157,5436, +18209,4410,7475,18212,6457,9264,18217,10573,18208,4409,5941,10248,18218,18206, +18215,18225,18210,18211,9497,18216,18213,10759,18219,3903,18207,18221,18220, +9802,18227,18238,4701,18241,18223,18228,11341,18237,11316,11529,8791,4682, +10321,18243,9472,3856,18236,18232,8273,18226,18234,18239,9739,3849,18231, +18240,10327,18235,18230,7476,7182,6923,11063,10278,18246,18255,18233,4694, +7511,18244,18249,8274,18245,18252,8766,18253,11317,18242,4631,18248,18251, +11019,18254,18247,18250,10760,11776,18258,18265,18257,6946,18224,10541,11009, +18264,18263,18259,18260,4117,18262,18256,9012,18261,3933,8449,10530,18266, +18432,10040,18269,7477,6952,18434,5405,18435,10328,18268,18229,18267,11822, +9473,10322,18442,18448,18449,18436,9813,18446,18438,18440,18450,18439,18443, +4177,9540,18444,18447,18437,8197,18441,6662,7716,5647,11091,11096,7249,18454, +18452,11821,18451,11348,18453,18455,18456,18459,18457,9474,18458,10028,18445, +7250,18460,18465,8275,18464,18433,18466,8232,18461,18463,18462,15376,15361, +18468,18467,11349,16667,18469,18470,18471,5942,5171,18473,12348,5204,11545, +5458,18474,18475,8781,18476, +9561,3865,4418,18481,18482,18477,6684,18478,9761,18479,18480,18490,18484, +18487,18483,18485,18486,6967,18488,8736,5685,4641,18491,4638,18496,18492, +18495,10009,18493,18494,10279,10041,18497,8540,18507,18503,4426,18501,10761, +18502,18499,18500,18505,18508,18506,18504,18498,8759,18515,11017,18513,18514, +18509,18511,18512,18510,8005,11800,18519,18520,18688,7689,18522,18525,18517, +18516,18689,4411,18523,18690,18524,18521,8978,18518,9799,18694,11290,18693, +18692,18701,18695,18703,11333,18706,18697,18698,18702,18705,18704,18696,18699, +18716,18709,18707,18708,18713,18714,4617,5153,18712,18691,18711,18715,18710, +18717,18719,18718,18721,18720,18489,18725,18722,18723,18724,18726,5707,18728, +18727,7183,6195,15622,18729,7216,4632,18730,4145,7478,18731,6196,18732,3904, +10268,18733,7753,18740,18737,8782,18738,18735,5437,18734,18741,5653,8509, +18747,18743,8468,18742,18745,18736,18746,18748,10062,18744,18749,18751,5938, +18739,3872,18750,6458,11605,18752,18753,8276,11521,18754,11284,18755,18756, +10563,18757,6431,11522,18762,18763,7479,18761,11334,18758,18760,7964,7773, +18759,18764,10498,18766,18765,4683,10762,18767,18779,18769,18770,18771,18772, +18776,18777,18775,18773,18768,18774,18778,20246,4359,18781,5438,18780,18945, +18944,18947,18946,18948,7184,18949,18950,18951,7965,11318,18952,10499,9765, +18953,18954,5898,5131,18955,6730,9760,18956,4655,18957,18959,11350,18958,7717, +18960,18961,18962,4912,18963,18964,18965,18966,4656,18967,18968,18969,4433, +7687,18970,18971,18972,5919,9050,18973, +5686,7733,18976,9475,18975,5648,18974,8534,5132,18977,18978,7480,5708,18979, +10763,7998,5205,11092,8233,18980,7718,8783,7481,18981,18984,18985,6429,8481, +18983,7482,10269,18982,6731,4146,18989,5687,6733,6732,11820,18988,18987,8198, +5164,11810,4633,7483,18986,18991,18992,18990,5943,11295,6734,9734,18995,7967, +8737,11285,18998,5963,7966,18994,18999,5964,18996,18997,18993,8001,9512,8718, +4412,10063,5154,8979,19002,19000,8747,7968,4913,19001,7738,11561,11807,19003, +19014,8980,19013,19010,19018,19011,19007,9051,19006,19004,11264,6735,19008, +19005,19012,7251,5920,8537,10788,4153,3905,9476,19016,19015,9541,19020,19009, +19019,19021,5899,19017,6197,6964,19022,11319,19025,19028,19026,10260,19023, +5439,19027,19029,19033,19030,19032,19031,19034,6928,19036,19035,10311,19200, +5688,19037,19201,19202,5155,17696,7512,19203,5965,19204,19205,6685,14637, +19206,19207,7185,19208,19209,19210,19211,19212,8714,19213,19215,19214,9477, +19216,10764,19217,19218,19219,19220,9529,7484,19221,6218,12045,19222,19223, +10270,19224,19232,19225,19227,19226,19228,10789,19229,19230,19231,19233,4620, +9030,10312,6465,6198,10286,4414,10029,19236,4914,7988,19235,19240,8792,11074, +19238,19239,5133,19241,9794,8510,10064,9244,19237,10790,4427,19243,11783,8993, +11812,6736,19242,8464,19259,8199,9559,10287,19246,6686,6737,7485,9796,5900, +19245,19244,10313,6944,9265,19248,19249,6199,19247,19250,19251,19253,8450, +19252,4933,19255,19254,19256,19258,19260,19261,7989,6958,19262,4657, +19263,8277,19264,19265,10314,5134,19266,8981,4154,19267,6992,7765,8460,19270, +19269,19268,19276,19274,19271,19273,19272,19275,5206,19279,7990,19280,5944, +19277,19278,11784,8982,8200,19281,19284,19282,19283,11320,9478,19287,19285, +19286,19288,19464,19291,19292,19290,19289,9052,19456,19460,19457,19293,19458, +19459,19466,19461,7991,19463,19465,19462,19468,7186,19467,19469,19470,19473, +19472,19471,19475,19474,11093,19477,19476,19478,19479,19481,19480,7719,19482, +5452,19483,19485,19486,19487,19484,19488,6965,19489,5135,5650,5901,19490,9551, +9245,19491,19494,6931,19493,19492,5689,19495,4658,19497,6459,19496,19505, +19499,19501,10564,19498,19500,19504,19502,5136,19503,19506,9785,11575,7187, +19507,11265,19509,19508,19512,11296,19511,4684,19510,19515,19514,19513,9233, +19516,19517,19518,6219,5636,19519,19520,19521,7720,19522,6924,19523,19524, +12544,12381,19525,17487,19526,8707,7690,9759,19527,10548,9011,6237,8712,4105, +10839,7734,5693,5440,10549,19528,19530,19529,4415,9557,19531,9814,9234,19532, +7217,19534,11041,19549,19536,19537,9000,8511,8278,9479,19535,5172,19544,19541, +19716,9480,8767,19538,9053,9266,19539,19543,7743,9798,9003,7969,19542,8461, +8451,19540,3848,11777,19545,8512,7188,7721,19547,19546,3918,19548,10254,19718, +9530,7754,8760,5463,19717,11286,4126,10550,4416,19712,19713,19714,19715,9498, +8706,3906,19719,19720,21250,8476,19721,4178,8235,5902,11321,19722,9227,8279, +6966,19723,19726,7236,19724,8202,8201,3907,11562,19728,10065,19730,19729, +19727,16963,4915,19533,19732,19731,19733,11287,9536,10765,19734,6968,19735, +19736,19737,9216,3913,6200,11801,19741,5651,19738,19739,10323,4659,11288,5406, +9267,19742,19743,19744,9217,19746,19745,9522,19747,7189,6975,9786,8784,6993, +7755,19748,19749,7740,19750,19751,19752,11342,7190,19754,19753,6201,6226,6687, +19757,7237,19756,19755,8520,5966,7970,9999,7192,19758,7486,19761,19759,19760, +19763,19762,7513,19764,19765,19766,10031,6450,6976,19767,19768,11523,7204, +11085,11563,19769,5441,19770,9218,19773,4695,7722,19771,19772,9023,10804,5467, +19775,19776,19774,19778,9534,4642,19782,19779,19781,19777,20014,19780,11594, +5945,19790,9235,19785,19788,19786,19791,19792,19784,19797,4179,19783,9996, +19787,7487,6202,10791,5443,7205,9499,8204,19795,19789,19794,11042,8983,19796, +19793,8203,19800,19799,19798,10766,7258,19801,10558,4147,10277,8785,5207, +19803,6204,6667,19802,7756,7757,19968,19970,7514,19969,19971,5426,10276,6977, +11778,19805,6487,11806,19973,19972,19974,19804,9544,9268,9014,19979,8738, +19975,19976,5644,19978,5903,19977,7488,4696,19983,6430,8280,9001,4634,19981, +19982,8994,19980,19984,19990,19993,19992,9228,19985,19986,19989,19991,5407, +19994,19988,19987,19998,19999,20000,19997,19996,7489,9481,19995,20004,20002, +20003,20001,8535,20005,20006,20008,4916,20007,11097,20019,20009,20012,20010, +20011,20013,20015,20016,20017,20020,20018,20021,20023,20022,8984,11078,20024, +8205,20025,10531,20026,4618,4123,4918,4917,20027,20028,20029,20030,20031,4919, +4660,6205,10005,20033,20032,20034,4155,20037,20036,20035,20038,20041,3878, +20039,20043,20042,20045,20044,20046,9485,20047,20048,20050,20049,10315,20051, +20052,6468,20053,20054,10792,8234,3843,8490,20055,10316,20058,20056,6206, +20057,5921,10532,20060,20224,20061,20225,4096,7735,7259,4920,20226,9797,20228, +4097,20227,8995,11564,9482,20059,11525,5904,11322,5464,11539,5639,8513,17920, +20229,4619,7758,4661,20231,20232,20230,5699,6460,7490,4098,11576,20234,19725, +20233,20237,20235,20236,20238,20239,11595,20240,20241,7976,10010,7772,4934, +11289,4428,7191,5946,20244,20243,6738,20245,20242,6663,20249,18700,12597,7766, +20247,11524,9552,4106,8002,6933,10518,4127,11596,11338,20250,9252,7002,20251, +20252,7723,20253,11597,20248,20255,20257,20256,20254,20258,20259,8281,4417, +20260,11031,20261,20262,11785,14864,20263,20264,20265,20269,20266,20267,20268, +20270,7971,11094,7972,20271,10066,20272,21042,11051,20273,20274,20275,4662, +20277,7736,20278,5635,20279,20283,20281,20282,4690,20280,20284,20285,3879, +20286,20287,7491,20288,5158,20291,20290,20289,19024,10555,20292,20293,20294, +20295,20296,20297,4921,20298,20299,9730,20301,4378,20304,20303,4099,5408, +10534,8985,6401,6207,7238,7739,20306,20305,11297,4935,10033,9531,7771,11565, +5690,20309,20308,10794,9483,4143,20310,20307,10288,11337,20311,20312,20314, +8521,4666,4667,20313,4936,5905,4937,9246,11583,5947,20315,20316,20317,20480, +20482,20481,10326,20483,20484,20485,20486,20488,20487,20489,10067,17707,7688, +5137,20490, +20491,12555,15386,10034,3930,3866,6739,10767,7517,20492,11070,20493,11323, +4129,6688,20494,4429,20495,20496,20498,20499,20501,20497,20500,4922,20502, +20503,20504,20505,20506,20508,20507,20510,20513,20509,20511,20512,20514,5409, +6994,20515,20516,6208,20517,4637,9774,20518,20519,8761,9546,20520,9820,8491, +4151,5453,5454,8786,20525,5455,4430,20524,20522,20523,20521,20535,20526,20527, +20528,20529,20531,20530,7224,20532,20534,5138,20533,8282,5906,20536,8492, +20537,9484,20538,20543,20541,20540,20542,20539,20545,20544,20547,5410,20546, +20548,20549,20551,20550,20552,20554,20553,6235,20555,20556,4635,20557,20558, +7760,20559,20560,20561,20562,6209,20563,20564,20565,20566,20567,10000,20569, +10245,20570,20568,20572,20571,20573,20736,20737,20738,20739,20740,20741,20742, +20743,20744,20745,20746,20747,20748,20749,15380,20750,17239,5139,4608,6417, +20752,20751,11012,20754,20755,20753,20756,10817,20757,5210,11780,20758,20760, +3869,20761,10506,20759,20762,20763,20764,20765,20766,10829,6668,6489,8206, +20767,20770,20768,20771,5968,20769,20772,20773,20774,20778,6665,8515,20779, +20776,20775,20777,5694,20783,20782,20781,3858,20793,20789,20790,20786,20792, +20788,4673,11819,20791,20787,20785,20784,20795,20798,20797,20796,10280,20794, +3922,20799,20801,4686,20780,4118,20803,20802,20800,8716,10831,11577,20804, +20805,20806,20807,20808,8986,20809,10006,20814,20810,20811,10768,11043,9519, +20815,20816,9501,20813,20812,4361,20824,20823,4180,20821,20820,20818,4698, +20817,6929,4360,6210,20827,20826,20825, +20822,20828,20829,20996,20995,20997,4108,20992,20993,6227,11032,20994,10769, +21002,20998,21003,21000,20999,5691,21004,21005,21006,21001,20819,21007,9024, +21011,21012,21010,21009,21015,21008,21013,21014,21017,21016,21019,21020,21021, +11816,21018,8522,6476,21022,21023,21024,21025,21026,5907,21027,21028,6926, +21029,21030,21031,21032,21035,21033,11803,21034,11598,21036,11578,21037,9821, +21038,21040,21041,21039,6220,11052,10818,13654,15423,10842,4362,21043,5167, +21044,21045,21046,6228,21047,16179,11066,8514,21048,21050,21049,21051,21052, +21053,21054,21055,21056,21057,21058,21059,21060,21061,21062,21063,9219,5948, +21065,8236,21066,21067,10240,21068,21069,16918,19257,20300,21070,21071,21073, +21074,21075,11599,21072,21076,21077,21079,21078,21081,21082,21080,11541,21083, +21084,16947,21085,9,83,79,82,84,41,42,85,59,3,4,30,527,528,529,530,531,532, +533,534,535,536,6,7,66,64,67,8,86,544,545,546,547,548,549,550,551,552,553,554, +555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,45,46,15,17,13, +576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594, +595,596,597,598,599,600,601,47,34,48,16,78, From 72656157f54c47277b01ec85a6ba7c4084fea6c8 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 18 Nov 2017 17:51:48 +0100 Subject: [PATCH 412/412] fix fgetwc when decoding a character that crosses buffer boundary Update the buffer position according to the bytes consumed into st when decoding an incomplete character at the end of the buffer. --- src/stdio/fgetwc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stdio/fgetwc.c b/src/stdio/fgetwc.c index e455cfec..a00c1a86 100644 --- a/src/stdio/fgetwc.c +++ b/src/stdio/fgetwc.c @@ -22,6 +22,7 @@ static wint_t __fgetwc_unlocked_internal(FILE *f) f->rpos++; return WEOF; } + f->rpos = f->rend; } else l = -2; /* Convert character byte-by-byte */