summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Rules.mak2
-rw-r--r--include/stdio.h5
-rw-r--r--include/sys/uio.h19
-rw-r--r--include/unistd.h4
-rw-r--r--ldso/include/dl-syscall.h4
-rwxr-xr-xldso/ldso/ldso.c2
-rw-r--r--ldso/libdl/libdl.c4
-rw-r--r--libc/sysdeps/linux/aarch64/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/alpha/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/alpha/bits/stat.h2
-rwxr-xr-xlibc/sysdeps/linux/arc/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/arm/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/avr32/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/bfin/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/c6x/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/common/Makefile.in3
-rw-r--r--libc/sysdeps/linux/common/bits/fcntl-linux.h34
-rw-r--r--libc/sysdeps/linux/common/bits/mman-shared.h2
-rw-r--r--libc/sysdeps/linux/common/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/common/lseek.c2
-rw-r--r--libc/sysdeps/linux/common/memfd_create.c13
-rw-r--r--libc/sysdeps/linux/common/process_vm_readv.c32
-rw-r--r--libc/sysdeps/linux/common/process_vm_writev.c32
-rw-r--r--libc/sysdeps/linux/common/sys/random.h4
-rw-r--r--libc/sysdeps/linux/cris/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/csky/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/frv/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/frv/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/h8300/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/hppa/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/i386/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/ia64/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/ia64/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/kvx/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/lm32/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/m68k/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/m68k/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/metag/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/microblaze/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/mips/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/mips/bits/stat.h8
-rw-r--r--libc/sysdeps/linux/nds32/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/nds32/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/nios2/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/or1k/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/powerpc/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/powerpc/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/riscv32/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/riscv32/getcontext.S74
-rw-r--r--libc/sysdeps/linux/riscv32/setcontext.S112
-rw-r--r--libc/sysdeps/linux/riscv32/swapcontext.S122
-rw-r--r--libc/sysdeps/linux/riscv64/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/riscv64/getcontext.S74
-rw-r--r--libc/sysdeps/linux/riscv64/setcontext.S112
-rw-r--r--libc/sysdeps/linux/riscv64/swapcontext.S122
-rw-r--r--libc/sysdeps/linux/sh/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/sparc/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/sparc/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/sparc64/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/sparc64/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/tile/bits/fcntl.h3
-rw-r--r--libc/sysdeps/linux/x86_64/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/x86_64/bits/stat.h4
-rw-r--r--libc/sysdeps/linux/xtensa/bits/fcntl.h2
-rw-r--r--libc/sysdeps/linux/xtensa/bits/stat.h4
-rw-r--r--libiconv/iconv.c12
-rw-r--r--libiconv/include/jis0208.h170
-rw-r--r--libpthread/nptl/allocatestack.c5
-rw-r--r--libpthread/nptl/sysdeps/arc/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/arm/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/csky/dl-tls.h2
-rw-r--r--libpthread/nptl/sysdeps/generic/dl-tls.c2
-rw-r--r--libpthread/nptl/sysdeps/i386/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/metag/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/microblaze/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/mips/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/or1k/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/powerpc/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/riscv32/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/riscv64/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/sh/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/sparc/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/x86_64/dl-tls.h3
-rw-r--r--libpthread/nptl/sysdeps/xtensa/dl-tls.h3
84 files changed, 390 insertions, 744 deletions
diff --git a/Rules.mak b/Rules.mak
index e56878d80..0138a1c67 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -128,7 +128,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
# Now config hard core
MAJOR_VERSION := 1
MINOR_VERSION := 0
-SUBLEVEL := 49
+SUBLEVEL := 50
EXTRAVERSION :=
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)
diff --git a/include/stdio.h b/include/stdio.h
index 0915da909..a48fa9b78 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -110,7 +110,10 @@ typedef __STDIO_fpos64_t fpos64_t;
#define SEEK_SET 0 /* Seek from beginning of file. */
#define SEEK_CUR 1 /* Seek from current position. */
#define SEEK_END 2 /* Seek from end of file. */
-
+#ifdef __USE_GNU
+# define SEEK_DATA 3 /* Seek to next data. */
+# define SEEK_HOLE 4 /* Seek to next hole. */
+#endif
#if defined __USE_SVID || defined __USE_XOPEN
/* Default path prefix for `mkstemp'. */
diff --git a/include/sys/uio.h b/include/sys/uio.h
index 330426fec..9e9708c0c 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -74,6 +74,25 @@ extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count,
__off64_t __offset) __wur;
#endif /* Use misc. */
+#ifdef __USE_GNU
+/* Read from another process' address space. */
+extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
+ unsigned long int __liovcnt,
+ const struct iovec *__rvec,
+ unsigned long int __riovcnt,
+ unsigned long int __flags)
+ __THROW;
+
+/* Write to another process' address space. */
+extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
+ unsigned long int __liovcnt,
+ const struct iovec *__rvec,
+ unsigned long int __riovcnt,
+ unsigned long int __flags)
+ __THROW;
+
+#endif
+
__END_DECLS
#endif /* sys/uio.h */
diff --git a/include/unistd.h b/include/unistd.h
index 36cd5fcb5..d50e1e4d3 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -316,6 +316,10 @@ libc_hidden_proto(faccessat)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Seek from end of file. */
+# ifdef __USE_GNU
+# define SEEK_DATA 3 /* Seek to next data. */
+# define SEEK_HOLE 4 /* Seek to next hole. */
+# endif
#endif
#if defined __USE_BSD && !defined L_SET
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 9ec0eac60..c143b8d45 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -141,7 +141,7 @@ static __always_inline int _dl_stat(const char *file_name,
{
return _dl_newfstatat(AT_FDCWD, file_name, buf, 0);
}
-#elif defined __NR_stat && (!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__)) || (LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))
+#elif defined __NR_stat && (!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__) || (LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0)))
# define __NR__dl_stat __NR_stat
static __always_inline _syscall2(int, _dl_stat, const char *, file_name,
struct stat *, buf)
@@ -168,7 +168,7 @@ static __always_inline int _dl_stat(const char *file_name,
#if defined __NR_fstat64 && !defined __NR_fstat && (!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__))
# define __NR__dl_fstat __NR_fstat64
static __always_inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf)
-#elif defined __NR_fstat
+#elif defined __NR_fstat && !defined __UCLIBC_USE_TIME64__ || defined(__sparc__)
# define __NR__dl_fstat __NR_fstat
static __always_inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf)
#elif defined __NR_statx && defined __UCLIBC_HAVE_STATX__
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 435bd43bc..e866d6418 100755
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -682,7 +682,7 @@ of this helper program; chances are you did not intend to run this program.\n\
*/
/* Now cover the application program. */
if (app_tpnt->dynamic_info[DT_TEXTREL]) {
- int j;
+ unsigned int j;
ElfW(Phdr) *ppnt_outer = ppnt;
_dl_debug_early("calling mprotect on the application program\n");
ppnt = (ElfW(Phdr) *) _dl_auxvt[AT_PHDR].a_un.a_val;
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 37c4a876e..6e50cb087 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -972,11 +972,11 @@ static int do_dlclose(void *vhandle, int need_fini)
end = (end + ADDR_ALIGN) & PAGE_ALIGN;
start = start & ~ADDR_ALIGN;
if (end > start) {
- _dl_if_debug_print("unmapping: %s at %p with length: '%p' until %p\n", tpnt->libname, tpnt->mapaddr, end - start, tpnt->mapaddr + (end - start));
+ _dl_if_debug_print("unmapping: %s at %p with length: '%p' until %p\n", tpnt->libname, (void *)tpnt->mapaddr, (void *)(end - start), (void *)(tpnt->mapaddr + (end - start)));
DL_LIB_UNMAP (tpnt, end - start);
}
else {
- _dl_if_debug_print("NOT unmapping: %s at %p. start<end ('%p'<'%p')", tpnt->libname, tpnt->mapaddr, start, end);
+ _dl_if_debug_print("NOT unmapping: %s at %p. start<end ('%p'<'%p')", tpnt->libname, (void *)tpnt->mapaddr, (void *)start, (void *)end);
}
/* Free elements in RTLD_LOCAL scope list */
for (runp = tpnt->rtld_local; runp; runp = tmp) {
diff --git a/libc/sysdeps/linux/aarch64/bits/fcntl.h b/libc/sysdeps/linux/aarch64/bits/fcntl.h
index dbe929351..024344eec 100644
--- a/libc/sysdeps/linux/aarch64/bits/fcntl.h
+++ b/libc/sysdeps/linux/aarch64/bits/fcntl.h
@@ -289,3 +289,6 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
#endif /* use GNU */
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h
index 11e68214e..7d06c76b7 100644
--- a/libc/sysdeps/linux/alpha/bits/fcntl.h
+++ b/libc/sysdeps/linux/alpha/bits/fcntl.h
@@ -236,3 +236,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/alpha/bits/stat.h b/libc/sysdeps/linux/alpha/bits/stat.h
index 88bc6617d..f2dca250d 100644
--- a/libc/sysdeps/linux/alpha/bits/stat.h
+++ b/libc/sysdeps/linux/alpha/bits/stat.h
@@ -40,7 +40,7 @@
Use neat tidy anonymous unions and structures when possible. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
# if __GNUC_PREREQ(3,3)
# define __ST_TIME(X) \
__extension__ union { \
diff --git a/libc/sysdeps/linux/arc/bits/fcntl.h b/libc/sysdeps/linux/arc/bits/fcntl.h
index beb32e41e..b02849691 100755
--- a/libc/sysdeps/linux/arc/bits/fcntl.h
+++ b/libc/sysdeps/linux/arc/bits/fcntl.h
@@ -230,3 +230,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h
index 823660648..52dee4287 100644
--- a/libc/sysdeps/linux/arm/bits/fcntl.h
+++ b/libc/sysdeps/linux/arm/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/avr32/bits/fcntl.h b/libc/sysdeps/linux/avr32/bits/fcntl.h
index ec0a3b55d..9e41550be 100644
--- a/libc/sysdeps/linux/avr32/bits/fcntl.h
+++ b/libc/sysdeps/linux/avr32/bits/fcntl.h
@@ -218,3 +218,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
__END_DECLS
#endif
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/bfin/bits/fcntl.h b/libc/sysdeps/linux/bfin/bits/fcntl.h
index 0909ae6c4..67d2c5245 100644
--- a/libc/sysdeps/linux/bfin/bits/fcntl.h
+++ b/libc/sysdeps/linux/bfin/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/c6x/bits/fcntl.h b/libc/sysdeps/linux/c6x/bits/fcntl.h
index 14aea565e..00f3b34e0 100644
--- a/libc/sysdeps/linux/c6x/bits/fcntl.h
+++ b/libc/sysdeps/linux/c6x/bits/fcntl.h
@@ -237,3 +237,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index 848bc1e4a..e0b280c33 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -30,6 +30,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
inotify.c \
ioperm.c \
iopl.c \
+ memfd_create.c \
modify_ldt.c \
module.c \
name_to_handle_at.c \
@@ -39,6 +40,8 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
ppoll.c \
prctl.c \
prlimit.c \
+ process_vm_readv.c \
+ process_vm_writev.c \
readahead.c \
reboot.c \
remap_file_pages.c \
diff --git a/libc/sysdeps/linux/common/bits/fcntl-linux.h b/libc/sysdeps/linux/common/bits/fcntl-linux.h
new file mode 100644
index 000000000..d0236fd8b
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/fcntl-linux.h
@@ -0,0 +1,34 @@
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl-linux.h> directly; include <fcntl.h> instead."
+#endif
+
+#ifdef __USE_GNU
+/* Types of seals. */
+# define F_SEAL_SEAL 0x0001 /* Prevent further seals from being set. */
+# define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */
+# define F_SEAL_GROW 0x0004 /* Prevent file from growing. */
+# define F_SEAL_WRITE 0x0008 /* Prevent writes. */
+# define F_SEAL_FUTURE_WRITE 0x0010 /* Prevent future writes while
+ mapped. */
+# define F_SEAL_EXEC 0x0020 /* Prevent chmod modifying exec bits. */
+
+# define F_ADD_SEALS 1033 /* Add seals to file. */
+# define F_GET_SEALS 1034 /* Get seals for file. */
+#endif
diff --git a/libc/sysdeps/linux/common/bits/mman-shared.h b/libc/sysdeps/linux/common/bits/mman-shared.h
index 98c9e1d3c..c40ae2d1e 100644
--- a/libc/sysdeps/linux/common/bits/mman-shared.h
+++ b/libc/sysdeps/linux/common/bits/mman-shared.h
@@ -40,11 +40,9 @@
__BEGIN_DECLS
-#if 0
/* Create a new memory file descriptor. NAME is a name for debugging.
FLAGS is a combination of the MFD_* constants. */
int memfd_create (const char *__name, unsigned int __flags) __THROW;
-#endif
/* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into
memory. FLAGS is a combination of the MLOCK_* flags above. */
diff --git a/libc/sysdeps/linux/common/bits/stat.h b/libc/sysdeps/linux/common/bits/stat.h
index 07c09f50a..fc76cc3e7 100644
--- a/libc/sysdeps/linux/common/bits/stat.h
+++ b/libc/sysdeps/linux/common/bits/stat.h
@@ -61,7 +61,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -107,7 +107,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c
index 80d69318a..0fc99efae 100644
--- a/libc/sysdeps/linux/common/lseek.c
+++ b/libc/sysdeps/linux/common/lseek.c
@@ -40,6 +40,8 @@ off_t __NC(lseek)(int fd, off_t offset attribute_unused, int whence)
case SEEK_SET:
case SEEK_CUR:
case SEEK_END:
+ case SEEK_DATA:
+ case SEEK_HOLE:
break;
default:
__set_errno(EINVAL);
diff --git a/libc/sysdeps/linux/common/memfd_create.c b/libc/sysdeps/linux/common/memfd_create.c
new file mode 100644
index 000000000..7165f3278
--- /dev/null
+++ b/libc/sysdeps/linux/common/memfd_create.c
@@ -0,0 +1,13 @@
+/*
+ * memfd_create() for uClibc-ng
+ *
+ * Copyright (C) 2024 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mman.h>
+#if defined(__NR_memfd_create)
+_syscall2(int, memfd_create, const char *, name, unsigned int, flags)
+#endif
diff --git a/libc/sysdeps/linux/common/process_vm_readv.c b/libc/sysdeps/linux/common/process_vm_readv.c
new file mode 100644
index 000000000..b69c1c97a
--- /dev/null
+++ b/libc/sysdeps/linux/common/process_vm_readv.c
@@ -0,0 +1,32 @@
+/* process_vm_readv - Linux specific syscall.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sys/uio.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_process_vm_readv
+ssize_t
+process_vm_readv (pid_t pid, const struct iovec *local_iov,
+ unsigned long int liovcnt,
+ const struct iovec *remote_iov,
+ unsigned long int riovcnt, unsigned long int flags)
+{
+ return INLINE_SYSCALL (process_vm_readv, 6, pid, local_iov,
+ liovcnt, remote_iov, riovcnt, flags);
+}
+#endif
diff --git a/libc/sysdeps/linux/common/process_vm_writev.c b/libc/sysdeps/linux/common/process_vm_writev.c
new file mode 100644
index 000000000..e22817a8d
--- /dev/null
+++ b/libc/sysdeps/linux/common/process_vm_writev.c
@@ -0,0 +1,32 @@
+/* process_vm_writev - Linux specific syscall.
+ Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sys/uio.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_process_vm_writev
+ssize_t
+process_vm_writev (pid_t pid, const struct iovec *local_iov,
+ unsigned long int liovcnt,
+ const struct iovec *remote_iov,
+ unsigned long int riovcnt, unsigned long int flags)
+{
+ return INLINE_SYSCALL (process_vm_writev, 6, pid, local_iov,
+ liovcnt, remote_iov, riovcnt, flags);
+}
+#endif
diff --git a/libc/sysdeps/linux/common/sys/random.h b/libc/sysdeps/linux/common/sys/random.h
index 3d12744ad..3d24e439b 100644
--- a/libc/sysdeps/linux/common/sys/random.h
+++ b/libc/sysdeps/linux/common/sys/random.h
@@ -9,7 +9,7 @@
__BEGIN_DECLS
-#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+#if defined __UCLIBC_LINUX_SPECIFIC__
# if 0 /*def __ASSUME_GETRANDOM_SYSCALL */
# include <linux/random.h>
# else
@@ -20,9 +20,11 @@ __BEGIN_DECLS
*
* GRND_NONBLOCK Don't block and return EAGAIN instead
* GRND_RANDOM Use the /dev/random pool instead of /dev/urandom
+ * GRND_INSECURE Write random data that may not be cryptographically secure.
*/
# define GRND_NONBLOCK 0x0001
# define GRND_RANDOM 0x0002
+# define GRND_INSECURE 0x0004
# endif
/* FIXME: aren't there a couple of __restrict and const missing ? */
extern int getrandom(void *__buf, size_t count, unsigned int flags)
diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h
index e9bc90ea9..e1d4ee1a6 100644
--- a/libc/sysdeps/linux/cris/bits/fcntl.h
+++ b/libc/sysdeps/linux/cris/bits/fcntl.h
@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/csky/bits/fcntl.h b/libc/sysdeps/linux/csky/bits/fcntl.h
index b36f41569..25f4491ba 100644
--- a/libc/sysdeps/linux/csky/bits/fcntl.h
+++ b/libc/sysdeps/linux/csky/bits/fcntl.h
@@ -232,3 +232,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h
index 02c8ac310..81a1bcd99 100644
--- a/libc/sysdeps/linux/frv/bits/fcntl.h
+++ b/libc/sysdeps/linux/frv/bits/fcntl.h
@@ -226,3 +226,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/frv/bits/stat.h b/libc/sysdeps/linux/frv/bits/stat.h
index 381d207f2..18321c080 100644
--- a/libc/sysdeps/linux/frv/bits/stat.h
+++ b/libc/sysdeps/linux/frv/bits/stat.h
@@ -70,7 +70,7 @@ struct stat
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -117,7 +117,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h
index 2062f7cda..7cbe04e15 100644
--- a/libc/sysdeps/linux/h8300/bits/fcntl.h
+++ b/libc/sysdeps/linux/h8300/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h
index 4ce76ce5f..bcd6618b2 100644
--- a/libc/sysdeps/linux/hppa/bits/fcntl.h
+++ b/libc/sysdeps/linux/hppa/bits/fcntl.h
@@ -234,3 +234,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h
index f3c08bbe5..5caf66114 100644
--- a/libc/sysdeps/linux/i386/bits/fcntl.h
+++ b/libc/sysdeps/linux/i386/bits/fcntl.h
@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h
index a20f44ff7..53263c3d3 100644
--- a/libc/sysdeps/linux/ia64/bits/fcntl.h
+++ b/libc/sysdeps/linux/ia64/bits/fcntl.h
@@ -238,3 +238,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/ia64/bits/stat.h b/libc/sysdeps/linux/ia64/bits/stat.h
index 6723166e7..2b70b8cf8 100644
--- a/libc/sysdeps/linux/ia64/bits/stat.h
+++ b/libc/sysdeps/linux/ia64/bits/stat.h
@@ -38,7 +38,7 @@ struct stat
int pad0;
__dev_t st_rdev; /* Device number, if device. */
__off_t st_size; /* Size of file, in bytes. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -77,7 +77,7 @@ struct stat64
int pad0;
__dev_t st_rdev; /* Device number, if device. */
__off_t st_size; /* Size of file, in bytes. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/kvx/bits/fcntl.h b/libc/sysdeps/linux/kvx/bits/fcntl.h
index ea0c59d09..79cd3f14e 100644
--- a/libc/sysdeps/linux/kvx/bits/fcntl.h
+++ b/libc/sysdeps/linux/kvx/bits/fcntl.h
@@ -227,3 +227,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/lm32/bits/fcntl.h b/libc/sysdeps/linux/lm32/bits/fcntl.h
index 0bfea6e7a..049c7fd83 100644
--- a/libc/sysdeps/linux/lm32/bits/fcntl.h
+++ b/libc/sysdeps/linux/lm32/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h
index 5a56c8781..92c0964d9 100644
--- a/libc/sysdeps/linux/m68k/bits/fcntl.h
+++ b/libc/sysdeps/linux/m68k/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/m68k/bits/stat.h b/libc/sysdeps/linux/m68k/bits/stat.h
index 7b9c3d144..70da1b384 100644
--- a/libc/sysdeps/linux/m68k/bits/stat.h
+++ b/libc/sysdeps/linux/m68k/bits/stat.h
@@ -60,7 +60,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -106,7 +106,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/metag/bits/fcntl.h b/libc/sysdeps/linux/metag/bits/fcntl.h
index bdd697348..471938b7d 100644
--- a/libc/sysdeps/linux/metag/bits/fcntl.h
+++ b/libc/sysdeps/linux/metag/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h b/libc/sysdeps/linux/microblaze/bits/fcntl.h
index 110927d95..8c9c2ceef 100644
--- a/libc/sysdeps/linux/microblaze/bits/fcntl.h
+++ b/libc/sysdeps/linux/microblaze/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h
index 33251c74d..a98b8c2e5 100644
--- a/libc/sysdeps/linux/mips/bits/fcntl.h
+++ b/libc/sysdeps/linux/mips/bits/fcntl.h
@@ -268,3 +268,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/mips/bits/stat.h b/libc/sysdeps/linux/mips/bits/stat.h
index 539fa33d2..81d2e4687 100644
--- a/libc/sysdeps/linux/mips/bits/stat.h
+++ b/libc/sysdeps/linux/mips/bits/stat.h
@@ -60,7 +60,7 @@ struct stat
long int st_pad2[2];
__off64_t st_size; /* Size of file, in bytes. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -103,7 +103,7 @@ struct stat {
unsigned int st_rdev; /* Device number, if device. */
int st_pad2[3];
__off_t st_size; /* Size of file, in bytes. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -145,7 +145,7 @@ struct stat64
__dev_t st_rdev; /* Device number, if device. */
long int st_pad2[2];
__off64_t st_size; /* Size of file, in bytes. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -184,7 +184,7 @@ struct stat64 {
unsigned int st_rdev; /* Device number, if device. */
int st_pad2[3];
__off_t st_size; /* Size of file, in bytes. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/nds32/bits/fcntl.h b/libc/sysdeps/linux/nds32/bits/fcntl.h
index 2e6a95ec8..cfce8ab27 100644
--- a/libc/sysdeps/linux/nds32/bits/fcntl.h
+++ b/libc/sysdeps/linux/nds32/bits/fcntl.h
@@ -249,3 +249,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/nds32/bits/stat.h b/libc/sysdeps/linux/nds32/bits/stat.h
index c4e09e0f2..5272751f4 100644
--- a/libc/sysdeps/linux/nds32/bits/stat.h
+++ b/libc/sysdeps/linux/nds32/bits/stat.h
@@ -64,7 +64,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -110,7 +110,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/nios2/bits/fcntl.h b/libc/sysdeps/linux/nios2/bits/fcntl.h
index 200a35443..0c11c3aba 100644
--- a/libc/sysdeps/linux/nios2/bits/fcntl.h
+++ b/libc/sysdeps/linux/nios2/bits/fcntl.h
@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/or1k/bits/fcntl.h b/libc/sysdeps/linux/or1k/bits/fcntl.h
index c9599ef3a..78eed9d5f 100644
--- a/libc/sysdeps/linux/or1k/bits/fcntl.h
+++ b/libc/sysdeps/linux/or1k/bits/fcntl.h
@@ -244,3 +244,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h
index ef1beeca0..54e4894ec 100644
--- a/libc/sysdeps/linux/powerpc/bits/fcntl.h
+++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h
@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/powerpc/bits/stat.h b/libc/sysdeps/linux/powerpc/bits/stat.h
index 7494586b5..ce2ebf896 100644
--- a/libc/sysdeps/linux/powerpc/bits/stat.h
+++ b/libc/sysdeps/linux/powerpc/bits/stat.h
@@ -59,7 +59,7 @@ struct stat
# else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
# endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -99,7 +99,7 @@ struct stat64
__off64_t st_size; /* Size of file, in bytes. */
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/riscv32/bits/fcntl.h b/libc/sysdeps/linux/riscv32/bits/fcntl.h
index a9d7c84e0..fdfb1805d 100644
--- a/libc/sysdeps/linux/riscv32/bits/fcntl.h
+++ b/libc/sysdeps/linux/riscv32/bits/fcntl.h
@@ -229,3 +229,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/riscv32/getcontext.S b/libc/sysdeps/linux/riscv32/getcontext.S
deleted file mode 100644
index 0b9e7c2d3..000000000
--- a/libc/sysdeps/linux/riscv32/getcontext.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Save current context.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "ucontext-macros.h"
-
-/* int getcontext (ucontext_t *ucp) */
-
- .text
-LEAF (getcontext)
- SAVE_INT_REG (ra, 0, a0)
- SAVE_INT_REG (ra, 1, a0)
- SAVE_INT_REG (sp, 2, a0)
- SAVE_INT_REG (s0, 8, a0)
- SAVE_INT_REG (s1, 9, a0)
- SAVE_INT_REG (x0, 10, a0) /* return 0 by overwriting a0. */
- SAVE_INT_REG (s2, 18, a0)
- SAVE_INT_REG (s3, 19, a0)
- SAVE_INT_REG (s4, 20, a0)
- SAVE_INT_REG (s5, 21, a0)
- SAVE_INT_REG (s6, 22, a0)
- SAVE_INT_REG (s7, 23, a0)
- SAVE_INT_REG (s8, 24, a0)
- SAVE_INT_REG (s9, 25, a0)
- SAVE_INT_REG (s10, 26, a0)
- SAVE_INT_REG (s11, 27, a0)
-
-#ifndef __riscv_float_abi_soft
- frsr a1
-
- SAVE_FP_REG (fs0, 8, a0)
- SAVE_FP_REG (fs1, 9, a0)
- SAVE_FP_REG (fs2, 18, a0)
- SAVE_FP_REG (fs3, 19, a0)
- SAVE_FP_REG (fs4, 20, a0)
- SAVE_FP_REG (fs5, 21, a0)
- SAVE_FP_REG (fs6, 22, a0)
- SAVE_FP_REG (fs7, 23, a0)
- SAVE_FP_REG (fs8, 24, a0)
- SAVE_FP_REG (fs9, 25, a0)
- SAVE_FP_REG (fs10, 26, a0)
- SAVE_FP_REG (fs11, 27, a0)
-
- sw a1, MCONTEXT_FSR(a0)
-#endif /* __riscv_float_abi_soft */
-
-/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
- li a3, _NSIG8
- add a2, a0, UCONTEXT_SIGMASK
- mv a1, zero
- li a0, SIG_BLOCK
-
- li a7, SYS_ify (rt_sigprocmask)
- scall
- bltz a0, 99f
-
- ret
-
-99: j __syscall_error
-
-PSEUDO_END (getcontext)
diff --git a/libc/sysdeps/linux/riscv32/setcontext.S b/libc/sysdeps/linux/riscv32/setcontext.S
deleted file mode 100644
index 15cc17bd8..000000000
--- a/libc/sysdeps/linux/riscv32/setcontext.S
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Set current context.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "ucontext-macros.h"
-
-/* int __setcontext (const ucontext_t *ucp)
-
- Restores the machine context in UCP and thereby resumes execution
- in that context.
-
- This implementation is intended to be used for *synchronous* context
- switches only. Therefore, it does not have to restore anything
- other than the PRESERVED state. */
-
- .text
-LEAF (setcontext)
-
- mv t0, a0 /* Save ucp into t0. */
-
-/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
- li a3, _NSIG8
- mv a2, zero
- add a1, a0, UCONTEXT_SIGMASK
- li a0, SIG_SETMASK
-
- li a7, SYS_ify (rt_sigprocmask)
- scall
-
- bltz a0, 99f
-
- cfi_def_cfa (t0, 0)
-
-#ifndef __riscv_float_abi_soft
- lw t1, MCONTEXT_FSR(t0)
-
- RESTORE_FP_REG_CFI (fs0, 8, t0)
- RESTORE_FP_REG_CFI (fs1, 9, t0)
- RESTORE_FP_REG_CFI (fs2, 18, t0)
- RESTORE_FP_REG_CFI (fs3, 19, t0)
- RESTORE_FP_REG_CFI (fs4, 20, t0)
- RESTORE_FP_REG_CFI (fs5, 21, t0)
- RESTORE_FP_REG_CFI (fs6, 22, t0)
- RESTORE_FP_REG_CFI (fs7, 23, t0)
- RESTORE_FP_REG_CFI (fs8, 24, t0)
- RESTORE_FP_REG_CFI (fs9, 25, t0)
- RESTORE_FP_REG_CFI (fs10, 26, t0)
- RESTORE_FP_REG_CFI (fs11, 27, t0)
-
- fssr t1
-#endif /* __riscv_float_abi_soft */
-
- /* Note the contents of argument registers will be random
- unless makecontext() has been called. */
- RESTORE_INT_REG (t1, 0, t0)
- RESTORE_INT_REG_CFI (ra, 1, t0)
- RESTORE_INT_REG (sp, 2, t0)
- RESTORE_INT_REG_CFI (s0, 8, t0)
- RESTORE_INT_REG_CFI (s1, 9, t0)
- RESTORE_INT_REG (a0, 10, t0)
- RESTORE_INT_REG (a1, 11, t0)
- RESTORE_INT_REG (a2, 12, t0)
- RESTORE_INT_REG (a3, 13, t0)
- RESTORE_INT_REG (a4, 14, t0)
- RESTORE_INT_REG (a5, 15, t0)
- RESTORE_INT_REG (a6, 16, t0)
- RESTORE_INT_REG (a7, 17, t0)
- RESTORE_INT_REG_CFI (s2, 18, t0)
- RESTORE_INT_REG_CFI (s3, 19, t0)
- RESTORE_INT_REG_CFI (s4, 20, t0)
- RESTORE_INT_REG_CFI (s5, 21, t0)
- RESTORE_INT_REG_CFI (s6, 22, t0)
- RESTORE_INT_REG_CFI (s7, 23, t0)
- RESTORE_INT_REG_CFI (s8, 24, t0)
- RESTORE_INT_REG_CFI (s9, 25, t0)
- RESTORE_INT_REG_CFI (s10, 26, t0)
- RESTORE_INT_REG_CFI (s11, 27, t0)
-
- jr t1
-
-99: j __syscall_error
-
-PSEUDO_END (setcontext)
-
-LEAF (start_context)
-
- /* Terminate call stack by noting ra == 0. Happily, s0 == 0 here. */
- cfi_register (ra, s0)
-
- /* Call the function passed to makecontext. */
- jalr s1
-
- /* Invoke subsequent context if present, else exit(0). */
- mv a0, s2
- beqz s2, 1f
- jal setcontext
-1: j exit
-
-PSEUDO_END (start_context)
diff --git a/libc/sysdeps/linux/riscv32/swapcontext.S b/libc/sysdeps/linux/riscv32/swapcontext.S
deleted file mode 100644
index f5e12b2db..000000000
--- a/libc/sysdeps/linux/riscv32/swapcontext.S
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Save and set current context.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "ucontext-macros.h"
-
-/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
-
-LEAF (swapcontext)
- mv t0, a1 /* Save ucp into t0. */
-
- SAVE_INT_REG (ra, 0, a0)
- SAVE_INT_REG (ra, 1, a0)
- SAVE_INT_REG (sp, 2, a0)
- SAVE_INT_REG (s0, 8, a0)
- SAVE_INT_REG (s1, 9, a0)
- SAVE_INT_REG (x0, 10, a0) /* return 0 by overwriting a0. */
- SAVE_INT_REG (s2, 18, a0)
- SAVE_INT_REG (s3, 19, a0)
- SAVE_INT_REG (s4, 20, a0)
- SAVE_INT_REG (s5, 21, a0)
- SAVE_INT_REG (s6, 22, a0)
- SAVE_INT_REG (s7, 23, a0)
- SAVE_INT_REG (s8, 24, a0)
- SAVE_INT_REG (s9, 25, a0)
- SAVE_INT_REG (s10, 26, a0)
- SAVE_INT_REG (s11, 27, a0)
-
-#ifndef __riscv_float_abi_soft
- frsr a1
-
- SAVE_FP_REG (fs0, 8, a0)
- SAVE_FP_REG (fs1, 9, a0)
- SAVE_FP_REG (fs2, 18, a0)
- SAVE_FP_REG (fs3, 19, a0)
- SAVE_FP_REG (fs4, 20, a0)
- SAVE_FP_REG (fs5, 21, a0)
- SAVE_FP_REG (fs6, 22, a0)
- SAVE_FP_REG (fs7, 23, a0)
- SAVE_FP_REG (fs8, 24, a0)
- SAVE_FP_REG (fs9, 25, a0)
- SAVE_FP_REG (fs10, 26, a0)
- SAVE_FP_REG (fs11, 27, a0)
-
- sw a1, MCONTEXT_FSR(a0)
-#endif /* __riscv_float_abi_soft */
-
-/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */
- li a3, _NSIG8
- add a2, a0, UCONTEXT_SIGMASK
- add a1, t0, UCONTEXT_SIGMASK
- li a0, SIG_SETMASK
-
- li a7, SYS_ify (rt_sigprocmask)
- scall
-
- bltz a0, 99f
-
-#ifndef __riscv_float_abi_soft
- lw t1, MCONTEXT_FSR(t0)
-
- RESTORE_FP_REG (fs0, 8, t0)
- RESTORE_FP_REG (fs1, 9, t0)
- RESTORE_FP_REG (fs2, 18, t0)
- RESTORE_FP_REG (fs3, 19, t0)
- RESTORE_FP_REG (fs4, 20, t0)
- RESTORE_FP_REG (fs5, 21, t0)
- RESTORE_FP_REG (fs6, 22, t0)
- RESTORE_FP_REG (fs7, 23, t0)
- RESTORE_FP_REG (fs8, 24, t0)
- RESTORE_FP_REG (fs9, 25, t0)
- RESTORE_FP_REG (fs10, 26, t0)
- RESTORE_FP_REG (fs11, 27, t0)
-
- fssr t1
-#endif /* __riscv_float_abi_soft */
-
- /* Note the contents of argument registers will be random
- unless makecontext() has been called. */
- RESTORE_INT_REG (t1, 0, t0)
- RESTORE_INT_REG (ra, 1, t0)
- RESTORE_INT_REG (sp, 2, t0)
- RESTORE_INT_REG (s0, 8, t0)
- RESTORE_INT_REG (s1, 9, t0)
- RESTORE_INT_REG (a0, 10, t0)
- RESTORE_INT_REG (a1, 11, t0)
- RESTORE_INT_REG (a2, 12, t0)
- RESTORE_INT_REG (a3, 13, t0)
- RESTORE_INT_REG (a4, 14, t0)
- RESTORE_INT_REG (a5, 15, t0)
- RESTORE_INT_REG (a6, 16, t0)
- RESTORE_INT_REG (a7, 17, t0)
- RESTORE_INT_REG (s2, 18, t0)
- RESTORE_INT_REG (s3, 19, t0)
- RESTORE_INT_REG (s4, 20, t0)
- RESTORE_INT_REG (s5, 21, t0)
- RESTORE_INT_REG (s6, 22, t0)
- RESTORE_INT_REG (s7, 23, t0)
- RESTORE_INT_REG (s8, 24, t0)
- RESTORE_INT_REG (s9, 25, t0)
- RESTORE_INT_REG (s10, 26, t0)
- RESTORE_INT_REG (s11, 27, t0)
-
- jr t1
-
-
-99: j __syscall_error
-
-PSEUDO_END (swapcontext)
diff --git a/libc/sysdeps/linux/riscv64/bits/fcntl.h b/libc/sysdeps/linux/riscv64/bits/fcntl.h
index a9d7c84e0..fdfb1805d 100644
--- a/libc/sysdeps/linux/riscv64/bits/fcntl.h
+++ b/libc/sysdeps/linux/riscv64/bits/fcntl.h
@@ -229,3 +229,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/riscv64/getcontext.S b/libc/sysdeps/linux/riscv64/getcontext.S
deleted file mode 100644
index 0b9e7c2d3..000000000
--- a/libc/sysdeps/linux/riscv64/getcontext.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Save current context.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "ucontext-macros.h"
-
-/* int getcontext (ucontext_t *ucp) */
-
- .text
-LEAF (getcontext)
- SAVE_INT_REG (ra, 0, a0)
- SAVE_INT_REG (ra, 1, a0)
- SAVE_INT_REG (sp, 2, a0)
- SAVE_INT_REG (s0, 8, a0)
- SAVE_INT_REG (s1, 9, a0)
- SAVE_INT_REG (x0, 10, a0) /* return 0 by overwriting a0. */
- SAVE_INT_REG (s2, 18, a0)
- SAVE_INT_REG (s3, 19, a0)
- SAVE_INT_REG (s4, 20, a0)
- SAVE_INT_REG (s5, 21, a0)
- SAVE_INT_REG (s6, 22, a0)
- SAVE_INT_REG (s7, 23, a0)
- SAVE_INT_REG (s8, 24, a0)
- SAVE_INT_REG (s9, 25, a0)
- SAVE_INT_REG (s10, 26, a0)
- SAVE_INT_REG (s11, 27, a0)
-
-#ifndef __riscv_float_abi_soft
- frsr a1
-
- SAVE_FP_REG (fs0, 8, a0)
- SAVE_FP_REG (fs1, 9, a0)
- SAVE_FP_REG (fs2, 18, a0)
- SAVE_FP_REG (fs3, 19, a0)
- SAVE_FP_REG (fs4, 20, a0)
- SAVE_FP_REG (fs5, 21, a0)
- SAVE_FP_REG (fs6, 22, a0)
- SAVE_FP_REG (fs7, 23, a0)
- SAVE_FP_REG (fs8, 24, a0)
- SAVE_FP_REG (fs9, 25, a0)
- SAVE_FP_REG (fs10, 26, a0)
- SAVE_FP_REG (fs11, 27, a0)
-
- sw a1, MCONTEXT_FSR(a0)
-#endif /* __riscv_float_abi_soft */
-
-/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
- li a3, _NSIG8
- add a2, a0, UCONTEXT_SIGMASK
- mv a1, zero
- li a0, SIG_BLOCK
-
- li a7, SYS_ify (rt_sigprocmask)
- scall
- bltz a0, 99f
-
- ret
-
-99: j __syscall_error
-
-PSEUDO_END (getcontext)
diff --git a/libc/sysdeps/linux/riscv64/setcontext.S b/libc/sysdeps/linux/riscv64/setcontext.S
deleted file mode 100644
index 15cc17bd8..000000000
--- a/libc/sysdeps/linux/riscv64/setcontext.S
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Set current context.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "ucontext-macros.h"
-
-/* int __setcontext (const ucontext_t *ucp)
-
- Restores the machine context in UCP and thereby resumes execution
- in that context.
-
- This implementation is intended to be used for *synchronous* context
- switches only. Therefore, it does not have to restore anything
- other than the PRESERVED state. */
-
- .text
-LEAF (setcontext)
-
- mv t0, a0 /* Save ucp into t0. */
-
-/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
- li a3, _NSIG8
- mv a2, zero
- add a1, a0, UCONTEXT_SIGMASK
- li a0, SIG_SETMASK
-
- li a7, SYS_ify (rt_sigprocmask)
- scall
-
- bltz a0, 99f
-
- cfi_def_cfa (t0, 0)
-
-#ifndef __riscv_float_abi_soft
- lw t1, MCONTEXT_FSR(t0)
-
- RESTORE_FP_REG_CFI (fs0, 8, t0)
- RESTORE_FP_REG_CFI (fs1, 9, t0)
- RESTORE_FP_REG_CFI (fs2, 18, t0)
- RESTORE_FP_REG_CFI (fs3, 19, t0)
- RESTORE_FP_REG_CFI (fs4, 20, t0)
- RESTORE_FP_REG_CFI (fs5, 21, t0)
- RESTORE_FP_REG_CFI (fs6, 22, t0)
- RESTORE_FP_REG_CFI (fs7, 23, t0)
- RESTORE_FP_REG_CFI (fs8, 24, t0)
- RESTORE_FP_REG_CFI (fs9, 25, t0)
- RESTORE_FP_REG_CFI (fs10, 26, t0)
- RESTORE_FP_REG_CFI (fs11, 27, t0)
-
- fssr t1
-#endif /* __riscv_float_abi_soft */
-
- /* Note the contents of argument registers will be random
- unless makecontext() has been called. */
- RESTORE_INT_REG (t1, 0, t0)
- RESTORE_INT_REG_CFI (ra, 1, t0)
- RESTORE_INT_REG (sp, 2, t0)
- RESTORE_INT_REG_CFI (s0, 8, t0)
- RESTORE_INT_REG_CFI (s1, 9, t0)
- RESTORE_INT_REG (a0, 10, t0)
- RESTORE_INT_REG (a1, 11, t0)
- RESTORE_INT_REG (a2, 12, t0)
- RESTORE_INT_REG (a3, 13, t0)
- RESTORE_INT_REG (a4, 14, t0)
- RESTORE_INT_REG (a5, 15, t0)
- RESTORE_INT_REG (a6, 16, t0)
- RESTORE_INT_REG (a7, 17, t0)
- RESTORE_INT_REG_CFI (s2, 18, t0)
- RESTORE_INT_REG_CFI (s3, 19, t0)
- RESTORE_INT_REG_CFI (s4, 20, t0)
- RESTORE_INT_REG_CFI (s5, 21, t0)
- RESTORE_INT_REG_CFI (s6, 22, t0)
- RESTORE_INT_REG_CFI (s7, 23, t0)
- RESTORE_INT_REG_CFI (s8, 24, t0)
- RESTORE_INT_REG_CFI (s9, 25, t0)
- RESTORE_INT_REG_CFI (s10, 26, t0)
- RESTORE_INT_REG_CFI (s11, 27, t0)
-
- jr t1
-
-99: j __syscall_error
-
-PSEUDO_END (setcontext)
-
-LEAF (start_context)
-
- /* Terminate call stack by noting ra == 0. Happily, s0 == 0 here. */
- cfi_register (ra, s0)
-
- /* Call the function passed to makecontext. */
- jalr s1
-
- /* Invoke subsequent context if present, else exit(0). */
- mv a0, s2
- beqz s2, 1f
- jal setcontext
-1: j exit
-
-PSEUDO_END (start_context)
diff --git a/libc/sysdeps/linux/riscv64/swapcontext.S b/libc/sysdeps/linux/riscv64/swapcontext.S
deleted file mode 100644
index f5e12b2db..000000000
--- a/libc/sysdeps/linux/riscv64/swapcontext.S
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Save and set current context.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "ucontext-macros.h"
-
-/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
-
-LEAF (swapcontext)
- mv t0, a1 /* Save ucp into t0. */
-
- SAVE_INT_REG (ra, 0, a0)
- SAVE_INT_REG (ra, 1, a0)
- SAVE_INT_REG (sp, 2, a0)
- SAVE_INT_REG (s0, 8, a0)
- SAVE_INT_REG (s1, 9, a0)
- SAVE_INT_REG (x0, 10, a0) /* return 0 by overwriting a0. */
- SAVE_INT_REG (s2, 18, a0)
- SAVE_INT_REG (s3, 19, a0)
- SAVE_INT_REG (s4, 20, a0)
- SAVE_INT_REG (s5, 21, a0)
- SAVE_INT_REG (s6, 22, a0)
- SAVE_INT_REG (s7, 23, a0)
- SAVE_INT_REG (s8, 24, a0)
- SAVE_INT_REG (s9, 25, a0)
- SAVE_INT_REG (s10, 26, a0)
- SAVE_INT_REG (s11, 27, a0)
-
-#ifndef __riscv_float_abi_soft
- frsr a1
-
- SAVE_FP_REG (fs0, 8, a0)
- SAVE_FP_REG (fs1, 9, a0)
- SAVE_FP_REG (fs2, 18, a0)
- SAVE_FP_REG (fs3, 19, a0)
- SAVE_FP_REG (fs4, 20, a0)
- SAVE_FP_REG (fs5, 21, a0)
- SAVE_FP_REG (fs6, 22, a0)
- SAVE_FP_REG (fs7, 23, a0)
- SAVE_FP_REG (fs8, 24, a0)
- SAVE_FP_REG (fs9, 25, a0)
- SAVE_FP_REG (fs10, 26, a0)
- SAVE_FP_REG (fs11, 27, a0)
-
- sw a1, MCONTEXT_FSR(a0)
-#endif /* __riscv_float_abi_soft */
-
-/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */
- li a3, _NSIG8
- add a2, a0, UCONTEXT_SIGMASK
- add a1, t0, UCONTEXT_SIGMASK
- li a0, SIG_SETMASK
-
- li a7, SYS_ify (rt_sigprocmask)
- scall
-
- bltz a0, 99f
-
-#ifndef __riscv_float_abi_soft
- lw t1, MCONTEXT_FSR(t0)
-
- RESTORE_FP_REG (fs0, 8, t0)
- RESTORE_FP_REG (fs1, 9, t0)
- RESTORE_FP_REG (fs2, 18, t0)
- RESTORE_FP_REG (fs3, 19, t0)
- RESTORE_FP_REG (fs4, 20, t0)
- RESTORE_FP_REG (fs5, 21, t0)
- RESTORE_FP_REG (fs6, 22, t0)
- RESTORE_FP_REG (fs7, 23, t0)
- RESTORE_FP_REG (fs8, 24, t0)
- RESTORE_FP_REG (fs9, 25, t0)
- RESTORE_FP_REG (fs10, 26, t0)
- RESTORE_FP_REG (fs11, 27, t0)
-
- fssr t1
-#endif /* __riscv_float_abi_soft */
-
- /* Note the contents of argument registers will be random
- unless makecontext() has been called. */
- RESTORE_INT_REG (t1, 0, t0)
- RESTORE_INT_REG (ra, 1, t0)
- RESTORE_INT_REG (sp, 2, t0)
- RESTORE_INT_REG (s0, 8, t0)
- RESTORE_INT_REG (s1, 9, t0)
- RESTORE_INT_REG (a0, 10, t0)
- RESTORE_INT_REG (a1, 11, t0)
- RESTORE_INT_REG (a2, 12, t0)
- RESTORE_INT_REG (a3, 13, t0)
- RESTORE_INT_REG (a4, 14, t0)
- RESTORE_INT_REG (a5, 15, t0)
- RESTORE_INT_REG (a6, 16, t0)
- RESTORE_INT_REG (a7, 17, t0)
- RESTORE_INT_REG (s2, 18, t0)
- RESTORE_INT_REG (s3, 19, t0)
- RESTORE_INT_REG (s4, 20, t0)
- RESTORE_INT_REG (s5, 21, t0)
- RESTORE_INT_REG (s6, 22, t0)
- RESTORE_INT_REG (s7, 23, t0)
- RESTORE_INT_REG (s8, 24, t0)
- RESTORE_INT_REG (s9, 25, t0)
- RESTORE_INT_REG (s10, 26, t0)
- RESTORE_INT_REG (s11, 27, t0)
-
- jr t1
-
-
-99: j __syscall_error
-
-PSEUDO_END (swapcontext)
diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h
index 0d687f04f..4ae682425 100644
--- a/libc/sysdeps/linux/sh/bits/fcntl.h
+++ b/libc/sysdeps/linux/sh/bits/fcntl.h
@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h
index 935495937..35224cdb3 100644
--- a/libc/sysdeps/linux/sparc/bits/fcntl.h
+++ b/libc/sysdeps/linux/sparc/bits/fcntl.h
@@ -252,3 +252,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/sparc/bits/stat.h b/libc/sysdeps/linux/sparc/bits/stat.h
index b88885fe2..0fbef8b3f 100644
--- a/libc/sysdeps/linux/sparc/bits/stat.h
+++ b/libc/sysdeps/linux/sparc/bits/stat.h
@@ -53,7 +53,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -93,7 +93,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/sparc64/bits/fcntl.h b/libc/sysdeps/linux/sparc64/bits/fcntl.h
index 395c95baf..00e91a671 100644
--- a/libc/sysdeps/linux/sparc64/bits/fcntl.h
+++ b/libc/sysdeps/linux/sparc64/bits/fcntl.h
@@ -248,3 +248,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/sparc64/bits/stat.h b/libc/sysdeps/linux/sparc64/bits/stat.h
index 8516b159c..62b48b745 100644
--- a/libc/sysdeps/linux/sparc64/bits/stat.h
+++ b/libc/sysdeps/linux/sparc64/bits/stat.h
@@ -58,7 +58,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -101,7 +101,7 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/tile/bits/fcntl.h b/libc/sysdeps/linux/tile/bits/fcntl.h
index 818da5c4a..28fda899d 100644
--- a/libc/sysdeps/linux/tile/bits/fcntl.h
+++ b/libc/sysdeps/linux/tile/bits/fcntl.h
@@ -229,3 +229,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h
index 3547a2046..821b2e3cc 100644
--- a/libc/sysdeps/linux/x86_64/bits/fcntl.h
+++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h
@@ -259,3 +259,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/x86_64/bits/stat.h b/libc/sysdeps/linux/x86_64/bits/stat.h
index a7412c8f9..a8c75feaa 100644
--- a/libc/sysdeps/linux/x86_64/bits/stat.h
+++ b/libc/sysdeps/linux/x86_64/bits/stat.h
@@ -77,7 +77,7 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -138,7 +138,7 @@ struct stat64
#endif
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h
index 5af9d2124..9bc5fa893 100644
--- a/libc/sysdeps/linux/xtensa/bits/fcntl.h
+++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h
@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len,
#endif
__END_DECLS
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/libc/sysdeps/linux/xtensa/bits/stat.h b/libc/sysdeps/linux/xtensa/bits/stat.h
index 045a017fd..43af825ec 100644
--- a/libc/sysdeps/linux/xtensa/bits/stat.h
+++ b/libc/sysdeps/linux/xtensa/bits/stat.h
@@ -54,7 +54,7 @@ struct stat
unsigned long __pad2;
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -94,7 +94,7 @@ struct stat64
unsigned long __pad2;
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
diff --git a/libiconv/iconv.c b/libiconv/iconv.c
index 0462f6e10..095932fd6 100644
--- a/libiconv/iconv.c
+++ b/libiconv/iconv.c
@@ -199,7 +199,7 @@ static void put_16(unsigned char *s, unsigned c, int e)
static unsigned get_32(const unsigned char *s, int e)
{
e &= 3;
- return s[e]+0U<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
+ return (s[e]+0U)<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
}
static void put_32(unsigned char *s, unsigned c, int e)
@@ -242,7 +242,7 @@ static inline int utf8enc_wchar(char *outb, wchar_t c)
}
}
-static inline int utf8seq_is_overlong(char *s, int n)
+static inline int utf8seq_is_overlong(unsigned char *s, int n)
{
switch (n)
{
@@ -268,12 +268,12 @@ static inline int utf8seq_is_overlong(char *s, int n)
return 0;
}
-static inline int utf8seq_is_surrogate(char *s, int n)
+static inline int utf8seq_is_surrogate(unsigned char *s, int n)
{
return ((n == 3) && (*s == 0xED) && (*(s+1) >= 0xA0) && (*(s+1) <= 0xBF));
}
-static inline int utf8seq_is_illegal(char *s, int n)
+static inline int utf8seq_is_illegal(unsigned char *s, int n)
{
return ((n == 3) && (*s == 0xEF) && (*(s+1) == 0xBF) &&
(*(s+2) >= 0xBE) && (*(s+2) <= 0xBF));
@@ -331,7 +331,7 @@ static unsigned legacy_map(const unsigned char *map, unsigned 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;
+ 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];
}
@@ -384,7 +384,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
if (c < 128) break;
else {
wchar_t wc;
- l = utf8dec_wchar(&wc, *in, *inb);
+ l = utf8dec_wchar(&wc, (unsigned char*)(*in), *inb);
c = wc;
}
if (!l) l++;
diff --git a/libiconv/include/jis0208.h b/libiconv/include/jis0208.h
index de9c5f26a..12183ed3e 100644
--- a/libiconv/include/jis0208.h
+++ b/libiconv/include/jis0208.h
@@ -1,80 +1,80 @@
-12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,
+{12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,
65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,
12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,8216,8217,8220,8221,
65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,
12301,12302,12303,12304,12305,65291,8722,177,215,247,65309,8800,65308,65310,
8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,162,163,65285,
-65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,
+65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671},{9670,9633,9632,9651,
9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,0,0,0,0,0,0,0,0,0,0,0,
8712,8715,8838,8839,8834,8835,8746,8745,0,0,0,0,0,0,0,0,8743,8744,172,8658,
8660,8704,8707,0,0,0,0,0,0,0,0,0,0,0,8736,8869,8978,8706,8711,8801,8786,8810,
8811,8730,8765,8733,8757,8747,8748,0,0,0,0,0,0,0,8491,8240,9839,9837,9834,
-8224,8225,182,0,0,0,0,9711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65296,65297,65298,
+8224,8225,182,0,0,0,0,9711},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65296,65297,65298,
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,
+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,
+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,
+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,
+0,0,0,0,0,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,
+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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
+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,
+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,
+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,
@@ -82,21 +82,21 @@
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,
+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,
+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,
+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,
@@ -104,21 +104,21 @@
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,
+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,
+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,
+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,
@@ -126,21 +126,21 @@
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,
+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,
+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,
+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,
@@ -148,21 +148,21 @@
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,
+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,
+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,
+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,
@@ -170,21 +170,21 @@
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,
+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,
33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,
22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,
37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,
34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,
-38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,
+38619,25454,26441,26905,33733,38935,38592,35070},{28548,25722,23544,19990,28716,
30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,
26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,
35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,
26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,
20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,
20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,
-27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,
+27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218},{32330,32680,
33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,
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,
@@ -192,21 +192,21 @@
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,
+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,
+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,
+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,
@@ -214,21 +214,21 @@
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,
+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,
+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,
+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,
@@ -236,14 +236,14 @@
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,
+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,
+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,
@@ -251,21 +251,21 @@
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,
+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,
+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,
+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,
@@ -273,26 +273,26 @@
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,
+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,
+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,
+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,
+0,0,0,0,0,0,0,0,0,0,0,0,0,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,
@@ -300,14 +300,14 @@
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,
+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,
+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,
@@ -315,21 +315,21 @@
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,
+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,
+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,
+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,
@@ -337,21 +337,21 @@
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,
+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,
+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,
+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,
@@ -359,21 +359,21 @@
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,
+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,
+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,
+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,
@@ -381,21 +381,21 @@
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,
+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,
+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,
+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,
@@ -403,21 +403,21 @@
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,
+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,
+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,
+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,
@@ -425,21 +425,21 @@
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,
+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,
+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,
+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,
@@ -447,21 +447,21 @@
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,
+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,
+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,
+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,
@@ -469,21 +469,21 @@
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,
+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,
+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,
+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,
@@ -491,21 +491,21 @@
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,
+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,
+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,
+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,
@@ -513,14 +513,14 @@
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,
+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,
+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,
@@ -528,21 +528,21 @@
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,
+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,
+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,
+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,
@@ -550,14 +550,14 @@
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,
+40254,40262,40264},{40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,
40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,
40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,
40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,
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,0,0,0,
+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,
+0,0,0,0,0,0,0}
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c
index 7ef884543..941ef22f0 100644
--- a/libpthread/nptl/allocatestack.c
+++ b/libpthread/nptl/allocatestack.c
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <sys/param.h>
+#include <dl-tls.h>
#include <tls.h>
#include <lowlevellock.h>
#include <link.h>
@@ -241,6 +242,10 @@ get_cached_stack (size_t *sizep, void **memp)
/* Clear the DTV. */
dtv_t *dtv = GET_DTV (TLS_TPADJ (result));
+ for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
+ if (! dtv[1 + cnt].pointer.is_static
+ && dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
+ free (dtv[1 + cnt].pointer.val);
memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
/* Re-initialize the TLS. */
diff --git a/libpthread/nptl/sysdeps/arc/dl-tls.h b/libpthread/nptl/sysdeps/arc/dl-tls.h
index 34e54e4d3..e81c0c187 100644
--- a/libpthread/nptl/sysdeps/arc/dl-tls.h
+++ b/libpthread/nptl/sysdeps/arc/dl-tls.h
@@ -26,3 +26,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/arm/dl-tls.h b/libpthread/nptl/sysdeps/arm/dl-tls.h
index a728455e4..a79ea7160 100644
--- a/libpthread/nptl/sysdeps/arm/dl-tls.h
+++ b/libpthread/nptl/sysdeps/arm/dl-tls.h
@@ -26,3 +26,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/csky/dl-tls.h b/libpthread/nptl/sysdeps/csky/dl-tls.h
index ebf1a7dc3..7171d47ea 100644
--- a/libpthread/nptl/sysdeps/csky/dl-tls.h
+++ b/libpthread/nptl/sysdeps/csky/dl-tls.h
@@ -14,3 +14,5 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/generic/dl-tls.c b/libpthread/nptl/sysdeps/generic/dl-tls.c
index 7d25e4706..7b7991be8 100644
--- a/libpthread/nptl/sysdeps/generic/dl-tls.c
+++ b/libpthread/nptl/sysdeps/generic/dl-tls.c
@@ -45,8 +45,6 @@
to allow dynamic loading of modules defining IE-model TLS data. */
# define TLS_STATIC_SURPLUS 64 + DL_NNS * 100
-/* Value used for dtv entries for which the allocation is delayed. */
-# define TLS_DTV_UNALLOCATED ((void *) -1l)
#ifndef SHARED
extern dtv_t static_dtv;
diff --git a/libpthread/nptl/sysdeps/i386/dl-tls.h b/libpthread/nptl/sysdeps/i386/dl-tls.h
index 32495c1e0..004082407 100644
--- a/libpthread/nptl/sysdeps/i386/dl-tls.h
+++ b/libpthread/nptl/sysdeps/i386/dl-tls.h
@@ -59,3 +59,6 @@ strong_alias (___tls_get_addr, ___tls_get_addr_internal)
# endif
#endif
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/metag/dl-tls.h b/libpthread/nptl/sysdeps/metag/dl-tls.h
index 81632e057..811d6254f 100644
--- a/libpthread/nptl/sysdeps/metag/dl-tls.h
+++ b/libpthread/nptl/sysdeps/metag/dl-tls.h
@@ -26,3 +26,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/microblaze/dl-tls.h b/libpthread/nptl/sysdeps/microblaze/dl-tls.h
index 5613e21e2..ded8714bd 100644
--- a/libpthread/nptl/sysdeps/microblaze/dl-tls.h
+++ b/libpthread/nptl/sysdeps/microblaze/dl-tls.h
@@ -24,3 +24,6 @@ typedef struct
} tls_index;
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/mips/dl-tls.h b/libpthread/nptl/sysdeps/mips/dl-tls.h
index e26aa388b..63ec2bc00 100644
--- a/libpthread/nptl/sysdeps/mips/dl-tls.h
+++ b/libpthread/nptl/sysdeps/mips/dl-tls.h
@@ -43,3 +43,6 @@ extern void *__tls_get_addr (tls_index *ti);
# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/or1k/dl-tls.h b/libpthread/nptl/sysdeps/or1k/dl-tls.h
index 5613e21e2..ded8714bd 100644
--- a/libpthread/nptl/sysdeps/or1k/dl-tls.h
+++ b/libpthread/nptl/sysdeps/or1k/dl-tls.h
@@ -24,3 +24,6 @@ typedef struct
} tls_index;
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/powerpc/dl-tls.h b/libpthread/nptl/sysdeps/powerpc/dl-tls.h
index c322ade60..ae50098c7 100644
--- a/libpthread/nptl/sysdeps/powerpc/dl-tls.h
+++ b/libpthread/nptl/sysdeps/powerpc/dl-tls.h
@@ -46,3 +46,6 @@ extern void *__tls_get_addr (tls_index *ti);
# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
#endif
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/riscv32/dl-tls.h b/libpthread/nptl/sysdeps/riscv32/dl-tls.h
index 31991be0d..4124b7c78 100644
--- a/libpthread/nptl/sysdeps/riscv32/dl-tls.h
+++ b/libpthread/nptl/sysdeps/riscv32/dl-tls.h
@@ -32,3 +32,6 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/riscv64/dl-tls.h b/libpthread/nptl/sysdeps/riscv64/dl-tls.h
index 31991be0d..4124b7c78 100644
--- a/libpthread/nptl/sysdeps/riscv64/dl-tls.h
+++ b/libpthread/nptl/sysdeps/riscv64/dl-tls.h
@@ -32,3 +32,6 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/sh/dl-tls.h b/libpthread/nptl/sysdeps/sh/dl-tls.h
index f5f90beaf..e0d13eec4 100644
--- a/libpthread/nptl/sysdeps/sh/dl-tls.h
+++ b/libpthread/nptl/sysdeps/sh/dl-tls.h
@@ -26,3 +26,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/sparc/dl-tls.h b/libpthread/nptl/sysdeps/sparc/dl-tls.h
index 7d9e8f0f7..aac9d5b30 100644
--- a/libpthread/nptl/sysdeps/sparc/dl-tls.h
+++ b/libpthread/nptl/sysdeps/sparc/dl-tls.h
@@ -26,3 +26,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/x86_64/dl-tls.h b/libpthread/nptl/sysdeps/x86_64/dl-tls.h
index d6c338cda..5cac55f33 100644
--- a/libpthread/nptl/sysdeps/x86_64/dl-tls.h
+++ b/libpthread/nptl/sysdeps/x86_64/dl-tls.h
@@ -26,3 +26,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/libpthread/nptl/sysdeps/xtensa/dl-tls.h b/libpthread/nptl/sysdeps/xtensa/dl-tls.h
index 5fc4ea2d0..dfc91753e 100644
--- a/libpthread/nptl/sysdeps/xtensa/dl-tls.h
+++ b/libpthread/nptl/sysdeps/xtensa/dl-tls.h
@@ -70,3 +70,6 @@ extern ptrdiff_t attribute_hidden
_dl_tlsdesc_dynamic(struct tlsdesc_dynamic_arg *);
#endif
#endif
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)