summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/bits
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/bits')
-rw-r--r--libc/sysdeps/linux/common/bits/hwcap.h22
-rw-r--r--libc/sysdeps/linux/common/bits/jmp_buf_tag.h37
-rw-r--r--libc/sysdeps/linux/common/bits/kernel-features.h5
-rw-r--r--libc/sysdeps/linux/common/bits/mman-linux.h1
-rw-r--r--libc/sysdeps/linux/common/bits/resource.h17
-rw-r--r--libc/sysdeps/linux/common/bits/sched.h1
-rw-r--r--libc/sysdeps/linux/common/bits/sem.h20
-rw-r--r--libc/sysdeps/linux/common/bits/stab.def4
-rwxr-xr-x[-rw-r--r--]libc/sysdeps/linux/common/bits/syscalls-common.h54
-rw-r--r--libc/sysdeps/linux/common/bits/typesizes.h12
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_uwchar.h1
-rw-r--r--libc/sysdeps/linux/common/bits/wchar.h32
12 files changed, 197 insertions, 9 deletions
diff --git a/libc/sysdeps/linux/common/bits/hwcap.h b/libc/sysdeps/linux/common/bits/hwcap.h
new file mode 100644
index 000000000..e7b899df0
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/hwcap.h
@@ -0,0 +1,22 @@
+/* Defines for bits in AT_HWCAP.
+ Copyright (C) 2012-2023 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 _SYS_AUXV_H
+# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
+#endif
+
+/* No bits defined for this architecture. */
diff --git a/libc/sysdeps/linux/common/bits/jmp_buf_tag.h b/libc/sysdeps/linux/common/bits/jmp_buf_tag.h
new file mode 100644
index 000000000..367b7bc66
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/jmp_buf_tag.h
@@ -0,0 +1,37 @@
+/* Define struct __jmp_buf_tag.
+ Copyright (C) 1991-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 __jmp_buf_tag_defined
+#define __jmp_buf_tag_defined 1
+
+#include <bits/setjmp.h>
+#include <bits/sigset.h>
+
+/* Calling environment, plus possibly a saved signal mask. */
+struct __jmp_buf_tag
+ {
+ /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+ assume that a `jmp_buf' begins with a `__jmp_buf' and that
+ `__mask_was_saved' follows it. Do not move these members
+ or add others before it. */
+ __jmp_buf __jmpbuf; /* Calling environment. */
+ int __mask_was_saved; /* Saved the signal mask? */
+ __sigset_t __saved_mask; /* Saved signal mask. */
+ };
+
+#endif
diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
index f1ebe0204..2f4f407bd 100644
--- a/libc/sysdeps/linux/common/bits/kernel-features.h
+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
@@ -490,6 +490,11 @@
# define __ASSUME_FALLOCATE 1
#endif
+/* prlimit64 is available in 2.6.36. */
+#if __LINUX_KERNEL_VERSION >= 0x020624
+# define __ASSUME_PRLIMIT64 1
+#endif
+
/* getcpu is a syscall for x86-64 since 3.1. */
#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
# define __ASSUME_GETCPU_SYSCALL 1
diff --git a/libc/sysdeps/linux/common/bits/mman-linux.h b/libc/sysdeps/linux/common/bits/mman-linux.h
index 6ca08415a..4947ddd89 100644
--- a/libc/sysdeps/linux/common/bits/mman-linux.h
+++ b/libc/sysdeps/linux/common/bits/mman-linux.h
@@ -46,6 +46,7 @@
/* Other flags. */
#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* Used to solve problem with MAP_FIXED */
#ifdef __USE_MISC
# define MAP_FILE 0
# ifdef __MAP_ANONYMOUS
diff --git a/libc/sysdeps/linux/common/bits/resource.h b/libc/sysdeps/linux/common/bits/resource.h
index df0ba56d9..89c3d4e41 100644
--- a/libc/sysdeps/linux/common/bits/resource.h
+++ b/libc/sysdeps/linux/common/bits/resource.h
@@ -99,7 +99,13 @@ enum __rlimit_resource
__RLIMIT_RTPRIO = 14,
#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
- __RLIMIT_NLIMITS = 15,
+ /* Maximum CPU time in µs that a process scheduled under a real-time
+ scheduling policy may consume without making a blocking system
+ call before being forcibly descheduled. */
+ __RLIMIT_RTTIME = 15,
+#define RLIMIT_RTTIME __RLIMIT_RTTIME
+
+ __RLIMIT_NLIMITS = 16,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
#define RLIM_NLIMITS __RLIM_NLIMITS
@@ -159,6 +165,15 @@ enum __rusage_who
/* All of its terminated child processes. */
RUSAGE_CHILDREN = -1
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+ ,
+ /* The calling thread. */
+ RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+ /* Name for the same functionality on Solaris. */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
};
#define __need_timeval
diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h
index 9d05314f5..18a9fb98d 100644
--- a/libc/sysdeps/linux/common/bits/sched.h
+++ b/libc/sysdeps/linux/common/bits/sched.h
@@ -31,6 +31,7 @@
#ifdef __USE_GNU
# define SCHED_BATCH 3
# define SCHED_IDLE 5
+# define SCHED_DEADLINE 6
# define SCHED_RESET_ON_FORK 0x40000000
#endif
diff --git a/libc/sysdeps/linux/common/bits/sem.h b/libc/sysdeps/linux/common/bits/sem.h
index 910c4b714..24a130981 100644
--- a/libc/sysdeps/linux/common/bits/sem.h
+++ b/libc/sysdeps/linux/common/bits/sem.h
@@ -39,15 +39,31 @@
struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
+#if defined(__UCLIBC_USE_TIME64__)
+ unsigned long int __sem_otime_internal_1;
+ unsigned long int __sem_otime_internal_2;
+#else
__time_t sem_otime; /* last semop() time */
-#if __WORDSIZE == 32
+#endif
+#if (__WORDSIZE == 32 && !defined(__ARC64_ARCH32__) && !defined(__arc__) && !defined(__arm__) && !defined(__or1k__) && !defined(__xtensa__)) || \
+ ((defined(__ARC64_ARCH32__) || defined(__arc__) || defined(__arm__) || defined(__or1k__) || defined(__xtensa__)) && !defined(__UCLIBC_USE_TIME64__))
unsigned long int __uclibc_unused1;
#endif
+#if defined(__UCLIBC_USE_TIME64__)
+ unsigned long int __sem_ctime_internal_1;
+ unsigned long int __sem_ctime_internal_2;
+#else
__time_t sem_ctime; /* last time changed by semctl() */
-#if __WORDSIZE == 32
+#endif
+#if (__WORDSIZE == 32 && !defined(__ARC64_ARCH32__) && !defined(__arc__) && !defined(__arm__) && !defined(__or1k__) && !defined(__xtensa__)) || \
+ ((defined(__ARC64_ARCH32__) || defined(__arc__) || defined(__arm__) || defined(__or1k__) || defined(__xtensa__)) && !defined(__UCLIBC_USE_TIME64__))
unsigned long int __uclibc_unused2;
#endif
unsigned long int sem_nsems; /* number of semaphores in set */
+#if defined(__UCLIBC_USE_TIME64__)
+ __time_t sem_otime; /* last semop() time */
+ __time_t sem_ctime; /* last time changed by semctl() */
+#endif
unsigned long int __uclibc_unused3;
unsigned long int __uclibc_unused4;
};
diff --git a/libc/sysdeps/linux/common/bits/stab.def b/libc/sysdeps/linux/common/bits/stab.def
index 8a2b8f39d..8d16c5c2c 100644
--- a/libc/sysdeps/linux/common/bits/stab.def
+++ b/libc/sysdeps/linux/common/bits/stab.def
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
/* This contains contribution from Cygnus Support. */
-
+
/* Global variable. Only the name is significant.
To find the address, look in the corresponding external symbol. */
__define_stab (N_GSYM, 0x20, "GSYM")
@@ -177,7 +177,7 @@ __define_stab (N_NBLCS, 0xF8, "NBLCS")
/* Second symbol entry containing a length-value for the preceding entry.
The value is the length. */
__define_stab (N_LENG, 0xfe, "LENG")
-
+
/* The above information, in matrix format.
STAB MATRIX
diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h
index 3665345a6..c3b193e6f 100644..100755
--- a/libc/sysdeps/linux/common/bits/syscalls-common.h
+++ b/libc/sysdeps/linux/common/bits/syscalls-common.h
@@ -99,21 +99,75 @@ type name(C_DECL_ARGS_##nargs(args)) { \
return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args)); \
}
+#define SYSCALL_FUNC_TIME64(nargs, type, name, args...) \
+type name(C_DECL_ARGS_##nargs(args)) { \
+ return (type)INLINE_SYSCALL(name##_time64, nargs, C_ARGS_##nargs(args)); \
+}
+
+#define SYSCALL_FUNC_64(nargs, type, name, args...) \
+type name(C_DECL_ARGS_##nargs(args)) { \
+ return (type)INLINE_SYSCALL(name##64, nargs, C_ARGS_##nargs(args)); \
+}
+
+
#define SYSCALL_NOERR_FUNC(nargs, type, name, args...) \
type name(C_DECL_ARGS_##nargs(args)) { \
return (type)INLINE_SYSCALL_NOERR(name, nargs, C_ARGS_##nargs(args)); \
}
+#define SYSCALL_NOERR_FUNC_TIME64(nargs, type, name, args...) \
+type name(C_DECL_ARGS_##nargs(args)) { \
+ return (type)INLINE_SYSCALL_NOERR(name##_time64, nargs, C_ARGS_##nargs(args)); \
+}
+
+#define SYSCALL_NOERR_FUNC_64(nargs, type, name, args...) \
+type name(C_DECL_ARGS_##nargs(args)) { \
+ return (type)INLINE_SYSCALL_NOERR(name##64, nargs, C_ARGS_##nargs(args)); \
+}
+
+#define SYSCALL_FUNC_BODY(nargs, type, name, args...) \
+ return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args));
+
+#define SYSCALL_FUNC_BODY_TIME64(nargs, type, name, args...) \
+ return (type)INLINE_SYSCALL(name##_time64, nargs, C_ARGS_##nargs(args));
+
+#define SYSCALL_FUNC_BODY_64(nargs, type, name, args...) \
+ return (type)INLINE_SYSCALL(name##64, nargs, C_ARGS_##nargs(args));
+
#define _syscall0(args...) SYSCALL_FUNC(0, args)
#define _syscall_noerr0(args...) SYSCALL_NOERR_FUNC(0, args)
#define _syscall1(args...) SYSCALL_FUNC(1, args)
#define _syscall_noerr1(args...) SYSCALL_NOERR_FUNC(1, args)
#define _syscall2(args...) SYSCALL_FUNC(2, args)
+#define _syscall2_body(args...) SYSCALL_FUNC_BODY(2, args)
#define _syscall3(args...) SYSCALL_FUNC(3, args)
#define _syscall4(args...) SYSCALL_FUNC(4, args)
#define _syscall5(args...) SYSCALL_FUNC(5, args)
#define _syscall6(args...) SYSCALL_FUNC(6, args)
+#define _syscall0_time64(args...) SYSCALL_FUNC_TIME64(0, args)
+#define _syscall_noerr0_time64(args...) SYSCALL_NOERR_FUNC_TIME64(0, args)
+#define _syscall1_time64(args...) SYSCALL_FUNC_TIME64(1, args)
+#define _syscall_noerr1_time64(args...) SYSCALL_NOERR_FUNC_TIME64(1, args)
+#define _syscall2_time64(args...) SYSCALL_FUNC_TIME64(2, args)
+#define _syscall2_body_time64(args...) SYSCALL_FUNC_BODY_TIME64(2, args)
+#define _syscall3_time64(args...) SYSCALL_FUNC_TIME64(3, args)
+#define _syscall4_time64(args...) SYSCALL_FUNC_TIME64(4, args)
+#define _syscall5_time64(args...) SYSCALL_FUNC_TIME64(5, args)
+#define _syscall6_time64(args...) SYSCALL_FUNC_TIME64(6, args)
+
+#define _syscall0_64(args...) SYSCALL_FUNC_64(0, args)
+#define _syscall_noerr0_64(args...) SYSCALL_NOERR_FUNC_64(0, args)
+#define _syscall1_64(args...) SYSCALL_FUNC_64(1, args)
+#define _syscall_noerr1_64(args...) SYSCALL_NOERR_FUNC_64(1, args)
+#define _syscall2_64(args...) SYSCALL_FUNC_64(2, args)
+#define _syscall2_body_64(args...) SYSCALL_FUNC_BODY_64(2, args)
+#define _syscall3_64(args...) SYSCALL_FUNC_64(3, args)
+#define _syscall4_64(args...) SYSCALL_FUNC_64(4, args)
+#define _syscall5_64(args...) SYSCALL_FUNC_64(5, args)
+#define _syscall6_64(args...) SYSCALL_FUNC_64(6, args)
+
+
#endif /* _syscall0 */
#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/linux/common/bits/typesizes.h b/libc/sysdeps/linux/common/bits/typesizes.h
index e1c5a27bb..dcb2c3b0a 100644
--- a/libc/sysdeps/linux/common/bits/typesizes.h
+++ b/libc/sysdeps/linux/common/bits/typesizes.h
@@ -46,9 +46,21 @@
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
#define __ID_T_TYPE __U32_TYPE
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+
+#ifdef __UCLIBC_USE_TIME64__
+#define __TIME_T_TYPE __S64_TYPE
+#else
#define __TIME_T_TYPE __SLONGWORD_TYPE
+#endif /* __UCLIBC_USE_TIME64__ */
+
#define __USECONDS_T_TYPE __U32_TYPE
+
+#ifdef __UCLIBC_USE_TIME64__
+#define __SUSECONDS_T_TYPE __S64_TYPE
+#else
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#endif
+
#define __DADDR_T_TYPE __S32_TYPE
#define __SWBLK_T_TYPE __SLONGWORD_TYPE
#define __KEY_T_TYPE __S32_TYPE
diff --git a/libc/sysdeps/linux/common/bits/uClibc_uwchar.h b/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
index 47ea3cda1..91b789c80 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
@@ -36,6 +36,7 @@
#include <limits.h>
#include <stdint.h>
+#include <wchar.h>
#if WCHAR_MIN == 0
typedef wchar_t __uwchar_t;
diff --git a/libc/sysdeps/linux/common/bits/wchar.h b/libc/sysdeps/linux/common/bits/wchar.h
index a3ff5319e..ce951d9b6 100644
--- a/libc/sysdeps/linux/common/bits/wchar.h
+++ b/libc/sysdeps/linux/common/bits/wchar.h
@@ -1,5 +1,5 @@
/* wchar_t type related definitions.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,12 +14,36 @@
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/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _BITS_WCHAR_H
#define _BITS_WCHAR_H 1
-#define __WCHAR_MIN (-2147483647 - 1)
-#define __WCHAR_MAX (2147483647)
+/* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__
+ are not defined, give the right value and type as long as both int
+ and wchar_t are 32-bit types. Adding L'\0' to a constant value
+ ensures that the type is correct; it is necessary to use (L'\0' +
+ 0) rather than just L'\0' so that the type in C++ is the promoted
+ version of wchar_t rather than the distinct wchar_t type itself.
+ Because wchar_t in preprocessor #if expressions is treated as
+ intmax_t or uintmax_t, the expression (L'\0' - 1) would have the
+ wrong value for WCHAR_MAX in such expressions and so cannot be used
+ to define __WCHAR_MAX in the unsigned case. */
+
+#ifdef __WCHAR_MAX__
+# define __WCHAR_MAX __WCHAR_MAX__
+#elif L'\0' - 1 > 0
+# define __WCHAR_MAX (0xffffffffu + L'\0')
+#else
+# define __WCHAR_MAX (0x7fffffff + L'\0')
+#endif
+
+#ifdef __WCHAR_MIN__
+# define __WCHAR_MIN __WCHAR_MIN__
+#elif L'\0' - 1 > 0
+# define __WCHAR_MIN (L'\0' + 0)
+#else
+# define __WCHAR_MIN (-__WCHAR_MAX - 1)
+#endif
#endif /* bits/wchar.h */