Merge "Add signal to re-enable MTE for a thread" into main
diff --git a/README.md b/README.md
index 0f2c30f..953e983 100644
--- a/README.md
+++ b/README.md
@@ -177,7 +177,7 @@
library that would make more sense as the place to add the wrapper.
In all other cases, you should use
-[syscall(3)](http://man7.org/linux/man-pages/man2/syscall.2.html) instead.
+[syscall(3)](https://man7.org/linux/man-pages/man2/syscall.2.html) instead.
Adding a system call usually involves:
diff --git a/benchmarks/property_benchmark.cpp b/benchmarks/property_benchmark.cpp
index 1b4ba23..b356ab7 100644
--- a/benchmarks/property_benchmark.cpp
+++ b/benchmarks/property_benchmark.cpp
@@ -28,8 +28,7 @@
#if defined(__BIONIC__)
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
+#include <sys/system_properties.h>
#include <benchmark/benchmark.h>
#include <system_properties/system_properties.h>
diff --git a/docs/status.md b/docs/status.md
index 0436c40..174c005 100644
--- a/docs/status.md
+++ b/docs/status.md
@@ -56,7 +56,8 @@
Current libc symbols: https://android.googlesource.com/platform/bionic/+/main/libc/libc.map.txt
New libc functions in API level 36:
- * `qsort_r` (new POSIX addition).
+ * `qsort_r`, `sig2str`/`str2sig` (POSIX Issue 8 additions).
+ * New system call wrapper: `mseal` (`<sys/mman.h>`).
New libc functions in V (API level 35):
* New `android_crash_detail_register`, `android_crash_detail_unregister`,
diff --git a/libc/Android.bp b/libc/Android.bp
index 42ffd37..64785a5 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -571,7 +571,6 @@
"upstream-openbsd/lib/libc/stdio/fgetwc.c",
"upstream-openbsd/lib/libc/stdio/fgetws.c",
"upstream-openbsd/lib/libc/stdio/flags.c",
- "upstream-openbsd/lib/libc/stdio/fpurge.c",
"upstream-openbsd/lib/libc/stdio/fputwc.c",
"upstream-openbsd/lib/libc/stdio/fputws.c",
"upstream-openbsd/lib/libc/stdio/fvwrite.c",
@@ -1032,7 +1031,6 @@
"bionic/thread_private.cpp",
"bionic/threads.cpp",
"bionic/time.cpp",
- "bionic/time_l.cpp",
"bionic/tmpfile.cpp",
"bionic/umount.cpp",
"bionic/unlink.cpp",
@@ -2259,6 +2257,11 @@
"kernel/uapi/xen/**/*.h",
],
license: "NOTICE",
+ // These don't pass the bad verification we do because many of them are
+ // arch-specific, and they aren't necessarily independently includable.
+ // That's not much of a problem though, since C-incompaitibilities in the
+ // UAPI headers should run into problems long before they reach us.
+ skip_verification: true,
}
ndk_headers {
@@ -2275,6 +2278,7 @@
to: "scsi",
srcs: ["kernel/android/scsi/**/*.h"],
license: "NOTICE",
+ skip_verification: true,
}
ndk_headers {
@@ -2283,6 +2287,7 @@
to: "arm-linux-androideabi",
srcs: ["kernel/uapi/asm-arm/**/*.h"],
license: "NOTICE",
+ skip_verification: true,
}
ndk_headers {
@@ -2291,6 +2296,7 @@
to: "aarch64-linux-android",
srcs: ["kernel/uapi/asm-arm64/**/*.h"],
license: "NOTICE",
+ skip_verification: true,
}
ndk_headers {
@@ -2299,6 +2305,7 @@
to: "riscv64-linux-android",
srcs: ["kernel/uapi/asm-riscv/**/*.h"],
license: "NOTICE",
+ skip_verification: true,
}
ndk_headers {
@@ -2307,6 +2314,7 @@
to: "i686-linux-android",
srcs: ["kernel/uapi/asm-x86/**/*.h"],
license: "NOTICE",
+ skip_verification: true,
}
ndk_headers {
@@ -2315,6 +2323,7 @@
to: "x86_64-linux-android",
srcs: ["kernel/uapi/asm-x86/**/*.h"],
license: "NOTICE",
+ skip_verification: true,
}
ndk_library {
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 182de17..7d4fdd7 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -126,6 +126,7 @@
int mlock2(const void* addr, size_t len, int flags) all
int munlock(const void* addr, size_t len) all
int mlockall(int flags) all
+int mseal(void*, size_t, unsigned long) lp64
int munlockall() all
int mincore(void* start, size_t length, unsigned char* vec) all
int __ioctl:ioctl(int, int, void*) all
@@ -350,7 +351,7 @@
int setdomainname(const char*, size_t) all
int sethostname(const char*, size_t) all
-int __sync_file_range:sync_file_range(int, off64_t, off64_t, unsigned int) x86,lp64
+int sync_file_range(int, off64_t, off64_t, unsigned int) x86,lp64
int __sync_file_range2:sync_file_range2(int, unsigned int, off64_t, off64_t) arm
pid_t wait4(pid_t, int*, int, struct rusage*) all
diff --git a/libc/bionic/clock.cpp b/libc/bionic/clock.cpp
index 31e6c3c..45d29b7 100644
--- a/libc/bionic/clock.cpp
+++ b/libc/bionic/clock.cpp
@@ -32,7 +32,7 @@
#include "private/bionic_constants.h"
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html
+// https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/clock.html
clock_t clock() {
timespec ts;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
diff --git a/libc/bionic/langinfo.cpp b/libc/bionic/langinfo.cpp
index 6f5057c..9645475 100644
--- a/libc/bionic/langinfo.cpp
+++ b/libc/bionic/langinfo.cpp
@@ -98,6 +98,4 @@
return const_cast<char*>(result);
}
-char* nl_langinfo_l(nl_item item, locale_t) {
- return nl_langinfo(item);
-}
+__strong_alias(nl_langinfo_l, nl_langinfo)
diff --git a/libc/bionic/legacy_32_bit_support.cpp b/libc/bionic/legacy_32_bit_support.cpp
index 4e19ebf..e66126b 100644
--- a/libc/bionic/legacy_32_bit_support.cpp
+++ b/libc/bionic/legacy_32_bit_support.cpp
@@ -161,3 +161,9 @@
}
return __mremap(old_address, old_size, new_size, flags, new_address);
}
+
+// mseal(2) is LP64-only.
+int mseal(void*, size_t, unsigned long) {
+ errno = ENOSYS;
+ return -1;
+}
diff --git a/libc/bionic/lockf.cpp b/libc/bionic/lockf.cpp
index 804ad68..54e13f5 100644
--- a/libc/bionic/lockf.cpp
+++ b/libc/bionic/lockf.cpp
@@ -68,6 +68,12 @@
return -1;
}
+#if defined(__LP64__)
+// For LP64, off_t == off64_t.
+__strong_alias(lockf, lockf64);
+#else
+// For ILP32 we need a shim that truncates the off64_t to off_t.
int lockf(int fd, int cmd, off_t length) {
return lockf64(fd, cmd, length);
}
+#endif
diff --git a/libc/bionic/poll.cpp b/libc/bionic/poll.cpp
index 7d80b4c..5b58425 100644
--- a/libc/bionic/poll.cpp
+++ b/libc/bionic/poll.cpp
@@ -48,11 +48,17 @@
return __ppoll(fds, fd_count, ts_ptr, nullptr, 0);
}
+// The underlying ppoll(2) system call only takes `sigset64_t`.
+#if defined(__LP64__)
+// That's fine for LP64 where `sigset_t` and `sigset64_t` are the same.
+__strong_alias(ppoll, ppoll64);
+#else
+// ILP32 needs a shim.
int ppoll(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset_t* ss) {
- // The underlying `__ppoll` system call only takes `sigset64_t`.
SigSetConverter set{ss};
return ppoll64(fds, fd_count, ts, set.ptr);
}
+#endif
int ppoll64(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset64_t* ss) {
// The underlying __ppoll system call modifies its `struct timespec` argument.
@@ -90,12 +96,19 @@
return result;
}
+// The underlying pselect6(2) system call only takes `sigset64_t`.
+#if defined(__LP64__)
+// That's fine for LP64 where `sigset_t` and `sigset64_t` are the same.
+__strong_alias(pselect, pselect64);
+#else
+// ILP32 needs a shim.
int pselect(int fd_count, fd_set* read_fds, fd_set* write_fds, fd_set* error_fds,
const timespec* ts, const sigset_t* ss) {
// The underlying `__pselect6` system call only takes `sigset64_t`.
SigSetConverter set{ss};
return pselect64(fd_count, read_fds, write_fds, error_fds, ts, set.ptr);
}
+#endif
int pselect64(int fd_count, fd_set* read_fds, fd_set* write_fds, fd_set* error_fds,
const timespec* ts, const sigset64_t* ss) {
diff --git a/libc/bionic/posix_timers.cpp b/libc/bionic/posix_timers.cpp
index ccbbfcf..65749a4 100644
--- a/libc/bionic/posix_timers.cpp
+++ b/libc/bionic/posix_timers.cpp
@@ -117,7 +117,7 @@
pthread_kill(timer->callback_thread, TIMER_SIGNAL);
}
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_create.html
+// https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/timer_create.html
int timer_create(clockid_t clock_id, sigevent* evp, timer_t* timer_id) {
PosixTimer* timer = reinterpret_cast<PosixTimer*>(malloc(sizeof(PosixTimer)));
if (timer == nullptr) {
@@ -201,7 +201,7 @@
return 0;
}
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_delete.html
+// https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/timer_delete.html
int timer_delete(timer_t id) {
int rc = __timer_delete(to_kernel_timer_id(id));
if (rc == -1) {
@@ -220,12 +220,12 @@
return 0;
}
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_gettime.html
+// https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/timer_gettime.html
int timer_gettime(timer_t id, itimerspec* ts) {
return __timer_gettime(to_kernel_timer_id(id), ts);
}
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_settime.html
+// https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/timer_settime.html
// When using timer_settime to disarm a repeatable SIGEV_THREAD timer with a very small
// period (like below 1ms), the kernel may continue to send events to the callback thread
// for a few extra times. This behavior is fine because in POSIX standard: The effect of
@@ -235,7 +235,7 @@
return __timer_settime(timer->kernel_timer_id, flags, ts, ots);
}
-// http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_getoverrun.html
+// https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/timer_getoverrun.html
int timer_getoverrun(timer_t id) {
return __timer_getoverrun(to_kernel_timer_id(id));
}
diff --git a/libc/bionic/sigprocmask.cpp b/libc/bionic/sigprocmask.cpp
index 6d436a6..10e2fa3 100644
--- a/libc/bionic/sigprocmask.cpp
+++ b/libc/bionic/sigprocmask.cpp
@@ -41,18 +41,6 @@
// can't allow clang to decide to inline sigprocmask.
//
-int sigprocmask(int how,
- const sigset_t* bionic_new_set,
- sigset_t* bionic_old_set) __attribute__((__noinline__)) {
- SigSetConverter new_set{bionic_new_set};
- SigSetConverter old_set{bionic_old_set};
- int rc = sigprocmask64(how, new_set.ptr, old_set.ptr);
- if (rc == 0 && bionic_old_set != nullptr) {
- old_set.copy_out();
- }
- return rc;
-}
-
int sigprocmask64(int how,
const sigset64_t* new_set,
sigset64_t* old_set) __attribute__((__noinline__)) {
@@ -70,3 +58,21 @@
}
return __rt_sigprocmask(how, mutable_new_set_ptr, old_set, sizeof(*new_set));
}
+
+#if defined(__LP64__)
+// For LP64, `sigset64_t` and `sigset_t` are the same.
+__strong_alias(sigprocmask, sigprocmask64);
+#else
+// ILP32 needs a shim.
+int sigprocmask(int how,
+ const sigset_t* bionic_new_set,
+ sigset_t* bionic_old_set) __attribute__((__noinline__)) {
+ SigSetConverter new_set{bionic_new_set};
+ SigSetConverter old_set{bionic_old_set};
+ int rc = sigprocmask64(how, new_set.ptr, old_set.ptr);
+ if (rc == 0 && bionic_old_set != nullptr) {
+ old_set.copy_out();
+ }
+ return rc;
+}
+#endif
diff --git a/libc/bionic/spawn.cpp b/libc/bionic/spawn.cpp
index 38f99ad..d97057f 100644
--- a/libc/bionic/spawn.cpp
+++ b/libc/bionic/spawn.cpp
@@ -186,8 +186,8 @@
char* const argv[],
char* const env[],
int exec_fn(const char* path, char* const argv[], char* const env[])) {
- // See http://man7.org/linux/man-pages/man3/posix_spawn.3.html
- // and http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html
+ // See https://man7.org/linux/man-pages/man3/posix_spawn.3.html
+ // and https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/posix_spawn.html
ScopedSignalBlocker ssb;
diff --git a/libc/bionic/stdlib_l.cpp b/libc/bionic/stdlib_l.cpp
index 18e9f86..a636d08 100644
--- a/libc/bionic/stdlib_l.cpp
+++ b/libc/bionic/stdlib_l.cpp
@@ -37,23 +37,6 @@
return strtof(s, end_ptr);
}
-long strtol_l(const char* s, char** end_ptr, int base, locale_t) {
- return strtol(s, end_ptr, base);
-}
-
long double strtold_l(const char* s, char** end_ptr, locale_t) {
return strtold(s, end_ptr);
}
-
-long long strtoll_l(const char* s, char** end_ptr, int base, locale_t) {
- return strtoll(s, end_ptr, base);
-}
-
-unsigned long strtoul_l(const char* s, char** end_ptr, int base, locale_t) {
- return strtoul(s, end_ptr, base);
-}
-
-unsigned long long strtoull_l(const char* s, char** end_ptr, int base, locale_t) {
- return strtoull(s, end_ptr, base);
-}
-
diff --git a/libc/bionic/strerror.cpp b/libc/bionic/strerror.cpp
index 743130d..c41b547 100644
--- a/libc/bionic/strerror.cpp
+++ b/libc/bionic/strerror.cpp
@@ -102,3 +102,4 @@
strerror_r(error_number, result, sizeof(tls.strerror_buf));
return result;
}
+__strong_alias(strerror_l, strerror);
diff --git a/libc/bionic/string_l.cpp b/libc/bionic/string_l.cpp
index 66bfb0e..84396bf 100644
--- a/libc/bionic/string_l.cpp
+++ b/libc/bionic/string_l.cpp
@@ -33,10 +33,6 @@
return strcoll(s1, s2);
}
-char* strerror_l(int error, locale_t) {
- return strerror(error);
-}
-
size_t strxfrm_l(char* dst, const char* src, size_t n, locale_t) {
return strxfrm(dst, src, n);
}
diff --git a/libc/bionic/strsignal.cpp b/libc/bionic/strsignal.cpp
index f18b6d0..29c22e2 100644
--- a/libc/bionic/strsignal.cpp
+++ b/libc/bionic/strsignal.cpp
@@ -27,29 +27,29 @@
*/
#include <signal.h>
+#include <stdlib.h>
#include <string.h>
#include "bionic/pthread_internal.h"
+// Maps regular signals like SIGSEGV to strings like "Segmentation fault".
+// Signal 0 and all the real-time signals are just nullptr, but that's the ABI.
const char* const sys_siglist[NSIG] = {
#define __BIONIC_SIGDEF(signal_number, signal_description) [signal_number] = signal_description,
#include "private/bionic_sigdefs.h"
};
+// Maps regular signals like SIGSEGV to strings like "SEGV".
+// Signal 0 and all the real-time signals are just nullptr, but that's the ABI.
const char* const sys_signame[NSIG] = {
#define __BIONIC_SIGDEF(signal_number, unused) [signal_number] = &(#signal_number)[3],
#include "private/bionic_sigdefs.h"
};
extern "C" __LIBC_HIDDEN__ const char* __strsignal(int signal_number, char* buf, size_t buf_len) {
- const char* signal_name = nullptr;
- if (signal_number >= 0 && signal_number < NSIG) {
- signal_name = sys_siglist[signal_number];
+ if (signal_number >= SIGHUP && signal_number < SIGSYS) {
+ return sys_siglist[signal_number];
}
- if (signal_name != nullptr) {
- return signal_name;
- }
-
const char* prefix = "Unknown";
if (signal_number >= SIGRTMIN && signal_number <= SIGRTMAX) {
prefix = "Real-time";
@@ -66,3 +66,72 @@
bionic_tls& tls = __get_bionic_tls();
return const_cast<char*>(__strsignal(signal_number, tls.strsignal_buf, sizeof(tls.strsignal_buf)));
}
+
+int sig2str(int sig, char* str) {
+ if (sig >= SIGHUP && sig <= SIGSYS) {
+ strcpy(str, sys_signame[sig]);
+ return 0;
+ }
+ if (sig == SIGRTMIN) {
+ strcpy(str, "RTMIN");
+ return 0;
+ }
+ if (sig == SIGRTMAX) {
+ strcpy(str, "RTMAX");
+ return 0;
+ }
+ if (sig > SIGRTMIN && sig < SIGRTMAX) {
+ if (sig - SIGRTMIN <= SIGRTMAX - sig) {
+ sprintf(str, "RTMIN+%d", sig - SIGRTMIN);
+ } else {
+ sprintf(str, "RTMAX-%d", SIGRTMAX - sig);
+ }
+ return 0;
+ }
+ return -1;
+}
+
+int str2sig(const char* str, int* sig) {
+ // A name in our list, like "SEGV"?
+ for (size_t i = SIGHUP; i <= SIGSYS; ++i) {
+ if (!strcmp(str, sys_signame[i])) {
+ *sig = i;
+ return 0;
+ }
+ }
+
+ // The two named special cases?
+ if (!strcmp(str, "RTMIN")) {
+ *sig = SIGRTMIN;
+ return 0;
+ }
+ if (!strcmp(str, "RTMAX")) {
+ *sig = SIGRTMAX;
+ return 0;
+ }
+
+ // Must be either an integer corresponding to a regular signal such as "9",
+ // or a string of the form "RTMIN+%d" or "RTMAX-%d".
+ int base = 0;
+ if (!strncmp(str, "RTMIN+", 6)) {
+ base = SIGRTMIN;
+ str += 5;
+ } else if (!strncmp(str, "RTMAX-", 6)) {
+ base = SIGRTMAX;
+ str += 5;
+ }
+ char* end = nullptr;
+ errno = 0;
+ int offset = strtol(str, &end, 10);
+ if (errno || *end) return -1;
+
+ // Reject out of range integers (like "666"),
+ // and out of range real-time signals (like "RTMIN+666" or "RTMAX-666").
+ int result = base + offset;
+ bool regular = (base == 0 && result >= SIGHUP && result <= SIGSYS);
+ bool realtime = (result >= SIGRTMIN && result <= SIGRTMAX);
+ if (!regular && !realtime) return -1;
+
+ *sig = result;
+ return 0;
+}
diff --git a/libc/bionic/strtol.cpp b/libc/bionic/strtol.cpp
index def7921..607145d 100644
--- a/libc/bionic/strtol.cpp
+++ b/libc/bionic/strtol.cpp
@@ -142,34 +142,42 @@
long strtol(const char* s, char** end, int base) {
return StrToI<long, LONG_MIN, LONG_MAX, char>(s, end, base);
}
+__strong_alias(strtol_l, strtol);
long wcstol(const wchar_t* s, wchar_t** end, int base) {
return StrToI<long, LONG_MIN, LONG_MAX, wchar_t>(s, end, base);
}
+__strong_alias(wcstol_l, wcstol);
long long strtoll(const char* s, char** end, int base) {
return StrToI<long long, LLONG_MIN, LLONG_MAX, char>(s, end, base);
}
+__strong_alias(strtoll_l, strtoll);
long long wcstoll(const wchar_t* s, wchar_t** end, int base) {
return StrToI<long long, LLONG_MIN, LLONG_MAX, wchar_t>(s, end, base);
}
+__strong_alias(wcstoll_l, wcstoll);
unsigned long strtoul(const char* s, char** end, int base) {
return StrToI<unsigned long, 0, ULONG_MAX, char>(s, end, base);
}
+__strong_alias(strtoul_l, strtoul);
unsigned long wcstoul(const wchar_t* s, wchar_t** end, int base) {
return StrToI<unsigned long, 0, ULONG_MAX, wchar_t>(s, end, base);
}
+__strong_alias(wcstoul_l, wcstoul);
unsigned long long strtoull(const char* s, char** end, int base) {
return StrToI<unsigned long long, 0, ULLONG_MAX, char>(s, end, base);
}
+__strong_alias(strtoull_l, strtoull);
unsigned long long wcstoull(const wchar_t* s, wchar_t** end, int base) {
return StrToI<unsigned long long, 0, ULLONG_MAX, wchar_t>(s, end, base);
}
+__strong_alias(wcstoull_l, wcstoull);
uintmax_t strtoumax(const char* s, char** end, int base) {
return StrToI<uintmax_t, 0, UINTMAX_MAX, char>(s, end, base);
diff --git a/libc/bionic/sync_file_range.cpp b/libc/bionic/sync_file_range.cpp
index 7f60882..e7b904d 100644
--- a/libc/bionic/sync_file_range.cpp
+++ b/libc/bionic/sync_file_range.cpp
@@ -28,13 +28,12 @@
#include <fcntl.h>
-extern "C" int __sync_file_range(int, off64_t, off64_t, unsigned int);
-extern "C" int __sync_file_range2(int, unsigned int, off64_t, off64_t);
-
-int sync_file_range(int fd, off64_t offset, off64_t length, unsigned int flags) {
#if __arm__
+// Only arm32 is missing the sync_file_range() syscall,
+// and needs us to manually re-order arguments for it.
+// (Because arm32 needs register pairs for 64-bit values to start on an even register.)
+extern "C" int __sync_file_range2(int, unsigned int, off64_t, off64_t);
+int sync_file_range(int fd, off64_t offset, off64_t length, unsigned int flags) {
return __sync_file_range2(fd, flags, offset, length);
-#else
- return __sync_file_range(fd, offset, length, flags);
-#endif
}
+#endif
diff --git a/libc/bionic/system.cpp b/libc/bionic/system.cpp
index 93d7497..8349498 100644
--- a/libc/bionic/system.cpp
+++ b/libc/bionic/system.cpp
@@ -38,7 +38,7 @@
int system(const char* command) {
// "The system() function shall always return non-zero when command is NULL."
- // http://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html
+ // https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/system.html
if (command == nullptr) return 1;
ScopedSignalBlocker sigchld_blocker(SIGCHLD);
diff --git a/libc/bionic/system_property_api.cpp b/libc/bionic/system_property_api.cpp
index 8fdea59..ed30fc2 100644
--- a/libc/bionic/system_property_api.cpp
+++ b/libc/bionic/system_property_api.cpp
@@ -26,8 +26,7 @@
* SUCH DAMAGE.
*/
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
+#include <sys/system_properties.h>
#include <async_safe/CHECK.h>
#include <system_properties/prop_area.h>
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index 73cf151..9d73445 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -34,11 +34,10 @@
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
+#include <sys/system_properties.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
#include <unistd.h>
#include <async_safe/log.h>
diff --git a/libc/bionic/time_l.cpp b/libc/bionic/time_l.cpp
deleted file mode 100644
index e5fa9a5..0000000
--- a/libc/bionic/time_l.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <time.h>
-//#include <xlocale.h>
-
-char* strptime_l(const char* buf, const char* fmt, struct tm* tm, locale_t) {
- return strptime(buf, fmt, tm);
-}
diff --git a/libc/bionic/wchar_l.cpp b/libc/bionic/wchar_l.cpp
index 1e7a231..b2c4a00 100644
--- a/libc/bionic/wchar_l.cpp
+++ b/libc/bionic/wchar_l.cpp
@@ -41,34 +41,6 @@
return wcscoll(ws1, ws2);
}
-double wcstod_l(const wchar_t* s, wchar_t** end_ptr, locale_t) {
- return wcstod(s, end_ptr);
-}
-
-float wcstof_l(const wchar_t* s, wchar_t** end_ptr, locale_t) {
- return wcstof(s, end_ptr);
-}
-
-long wcstol_l(const wchar_t* s, wchar_t** end_ptr, int base, locale_t) {
- return wcstol(s, end_ptr, base);
-}
-
-long long wcstoll_l(const wchar_t* s, wchar_t** end_ptr, int base, locale_t) {
- return wcstoll(s, end_ptr, base);
-}
-
-unsigned long wcstoul_l(const wchar_t* s, wchar_t** end_ptr, int base, locale_t) {
- return wcstoul(s, end_ptr, base);
-}
-
-unsigned long long wcstoull_l(const wchar_t* s, wchar_t** end_ptr, int base, locale_t) {
- return wcstoull(s, end_ptr, base);
-}
-
-long double wcstold_l(const wchar_t* s, wchar_t** end_ptr, locale_t) {
- return wcstold(s, end_ptr);
-}
-
size_t wcsxfrm_l(wchar_t* dst, const wchar_t* src, size_t n, locale_t) {
return wcsxfrm(dst, src, n);
}
diff --git a/libc/bionic/wcstod.cpp b/libc/bionic/wcstod.cpp
index c82d788..00c8a08 100644
--- a/libc/bionic/wcstod.cpp
+++ b/libc/bionic/wcstod.cpp
@@ -94,11 +94,14 @@
float wcstof(const wchar_t* s, wchar_t** end) {
return wcstod<float>(s, end, strtof);
}
+__strong_alias(wcstof_l, wcstof);
double wcstod(const wchar_t* s, wchar_t** end) {
return wcstod<double>(s, end, strtod);
}
+__strong_alias(wcstod_l, wcstod);
long double wcstold(const wchar_t* s, wchar_t** end) {
return wcstod<long double>(s, end, strtold);
}
+__strong_alias(wcstold_l, wcstold);
diff --git a/libc/bionic/wctype.cpp b/libc/bionic/wctype.cpp
index b37f17b..481197a 100644
--- a/libc/bionic/wctype.cpp
+++ b/libc/bionic/wctype.cpp
@@ -55,45 +55,44 @@
};
int iswalnum(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_POSIX_ALNUM, isalnum); }
+__strong_alias(iswalnum_l, iswalnum);
int iswalpha(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_ALPHABETIC, isalpha); }
+__strong_alias(iswalpha_l, iswalpha);
int iswblank(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_POSIX_BLANK, isblank); }
+__strong_alias(iswblank_l, iswblank);
int iswgraph(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_POSIX_GRAPH, isgraph); }
+__strong_alias(iswgraph_l, iswgraph);
int iswlower(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_LOWERCASE, islower); }
+__strong_alias(iswlower_l, iswlower);
int iswprint(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_POSIX_PRINT, isprint); }
+__strong_alias(iswprint_l, iswprint);
int iswspace(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_WHITE_SPACE, isspace); }
+__strong_alias(iswspace_l, iswspace);
int iswupper(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_UPPERCASE, isupper); }
+__strong_alias(iswupper_l, iswupper);
int iswxdigit(wint_t wc) { return __icu_hasBinaryProperty(wc, UCHAR_POSIX_XDIGIT, isxdigit); }
+__strong_alias(iswxdigit_l, iswxdigit);
int iswcntrl(wint_t wc) {
typedef int8_t (*FnT)(UChar32);
static auto u_charType = reinterpret_cast<FnT>(__find_icu_symbol("u_charType"));
return u_charType ? (u_charType(wc) == U_CONTROL_CHAR) : iscntrl(wc);
}
+__strong_alias(iswcntrl_l, iswcntrl);
int iswdigit(wint_t wc) {
typedef UBool (*FnT)(UChar32);
static auto u_isdigit = reinterpret_cast<FnT>(__find_icu_symbol("u_isdigit"));
return u_isdigit ? u_isdigit(wc) : isdigit(wc);
}
+__strong_alias(iswdigit_l, iswdigit);
int iswpunct(wint_t wc) {
typedef UBool (*FnT)(UChar32);
static auto u_ispunct = reinterpret_cast<FnT>(__find_icu_symbol("u_ispunct"));
return u_ispunct ? u_ispunct(wc) : ispunct(wc);
}
-
-int iswalnum_l(wint_t c, locale_t) { return iswalnum(c); }
-int iswalpha_l(wint_t c, locale_t) { return iswalpha(c); }
-int iswblank_l(wint_t c, locale_t) { return iswblank(c); }
-int iswcntrl_l(wint_t c, locale_t) { return iswcntrl(c); }
-int iswdigit_l(wint_t c, locale_t) { return iswdigit(c); }
-int iswgraph_l(wint_t c, locale_t) { return iswgraph(c); }
-int iswlower_l(wint_t c, locale_t) { return iswlower(c); }
-int iswprint_l(wint_t c, locale_t) { return iswprint(c); }
-int iswpunct_l(wint_t c, locale_t) { return iswpunct(c); }
-int iswspace_l(wint_t c, locale_t) { return iswspace(c); }
-int iswupper_l(wint_t c, locale_t) { return iswupper(c); }
-int iswxdigit_l(wint_t c, locale_t) { return iswxdigit(c); }
+__strong_alias(iswpunct_l, iswpunct);
int iswctype(wint_t wc, wctype_t char_class) {
if (char_class < WC_TYPE_ALNUM || char_class > WC_TYPE_XDIGIT) return 0;
@@ -103,10 +102,7 @@
};
return fns[char_class - WC_TYPE_ALNUM](wc);
}
-
-int iswctype_l(wint_t wc, wctype_t char_class, locale_t) {
- return iswctype(wc, char_class);
-}
+__strong_alias(iswctype_l, iswctype);
wint_t towlower(wint_t wc) {
if (wc < 0x80) return tolower(wc);
@@ -115,6 +111,7 @@
static auto u_tolower = reinterpret_cast<FnT>(__find_icu_symbol("u_tolower"));
return u_tolower ? u_tolower(wc) : tolower(wc);
}
+__strong_alias(towlower_l, towlower);
wint_t towupper(wint_t wc) {
if (wc < 0x80) return toupper(wc);
@@ -123,9 +120,7 @@
static auto u_toupper = reinterpret_cast<FnT>(__find_icu_symbol("u_toupper"));
return u_toupper ? u_toupper(wc) : toupper(wc);
}
-
-wint_t towupper_l(wint_t c, locale_t) { return towupper(c); }
-wint_t towlower_l(wint_t c, locale_t) { return towlower(c); }
+__strong_alias(towupper_l, towupper);
wctype_t wctype(const char* property) {
static const char* const properties[WC_TYPE_MAX - 1] = {
@@ -139,10 +134,7 @@
}
return static_cast<wctype_t>(0);
}
-
-wctype_t wctype_l(const char* property, locale_t) {
- return wctype(property);
-}
+__strong_alias(wctype_l, wctype);
static wctrans_t wctrans_tolower = wctrans_t(1);
static wctrans_t wctrans_toupper = wctrans_t(2);
@@ -153,10 +145,7 @@
errno = EINVAL;
return nullptr;
}
-
-wctrans_t wctrans_l(const char* name, locale_t) {
- return wctrans(name);
-}
+__strong_alias(wctrans_l, wctrans);
wint_t towctrans(wint_t c, wctrans_t t) {
if (t == wctrans_tolower) return towlower(c);
@@ -164,7 +153,4 @@
errno = EINVAL;
return c;
}
-
-wint_t towctrans_l(wint_t c, wctrans_t t, locale_t) {
- return towctrans(c, t);
-}
+__strong_alias(towctrans_l, towctrans);
diff --git a/libc/include/alloca.h b/libc/include/alloca.h
index e05dea6..2786e2f 100644
--- a/libc/include/alloca.h
+++ b/libc/include/alloca.h
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
/**
- * [alloca(3)](http://man7.org/linux/man-pages/man3/alloca.3.html) allocates space on the stack.
+ * [alloca(3)](https://man7.org/linux/man-pages/man3/alloca.3.html) allocates space on the stack.
*
* New code should not use alloca because it cannot report failure.
* Use regular heap allocation instead.
diff --git a/libc/include/android/dlext.h b/libc/include/android/dlext.h
index b42e5b2..842ceea 100644
--- a/libc/include/android/dlext.h
+++ b/libc/include/android/dlext.h
@@ -30,7 +30,7 @@
/**
* \file
* Advanced dynamic library opening support. Most users will want to use
- * the standard [dlopen(3)](http://man7.org/linux/man-pages/man3/dlopen.3.html)
+ * the standard [dlopen(3)](https://man7.org/linux/man-pages/man3/dlopen.3.html)
* functionality in `<dlfcn.h>` instead.
*/
@@ -174,7 +174,7 @@
/**
* Opens the given library. The `__filename` and `__flags` arguments are
- * the same as for [dlopen(3)](http://man7.org/linux/man-pages/man3/dlopen.3.html),
+ * the same as for [dlopen(3)](https://man7.org/linux/man-pages/man3/dlopen.3.html),
* with the Android-specific flags supplied via the `flags` member of `__info`.
*/
void* _Nullable android_dlopen_ext(const char* _Nullable __filename, int __flags, const android_dlextinfo* _Nullable __info);
diff --git a/libc/include/android/versioning.h b/libc/include/android/versioning.h
index 6bab291..ecbc33f 100644
--- a/libc/include/android/versioning.h
+++ b/libc/include/android/versioning.h
@@ -21,7 +21,6 @@
#if defined(__BIONIC_VERSIONER)
#define __INTRODUCED_IN(api_level) __attribute__((__annotate__("introduced_in=" #api_level)))
-#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level) __attribute__((__annotate__("introduced_in=" #api_level))) __VERSIONER_NO_GUARD
#define __DEPRECATED_IN(api_level, msg) __attribute__((__annotate__("deprecated_in=" #api_level)))
#define __REMOVED_IN(api_level, msg) __attribute__((__annotate__("obsoleted_in=" #api_level)))
#define __INTRODUCED_IN_32(api_level) __attribute__((__annotate__("introduced_in_32=" #api_level)))
@@ -41,17 +40,10 @@
// be enforced. In the case, the absence of 'strict' makes it possible to call an unavailable API
// without the __builtin_available check, which will cause a link error at runtime.
// Android platform build system defines this macro along with -Wunguarded-availability
-//
-// The _NO_GUARD_FOR_NDK variants keep the __VERSIONER_NO_GUARD behavior working for the NDK. This
-// allows libc++ to refer to these functions in inlines without needing to guard them, needed since
-// libc++ doesn't currently guard these calls. There's no risk to the apps though because using
-// those APIs will still cause a link error.
#if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
#define __BIONIC_AVAILABILITY(__what, ...) __attribute__((__availability__(android,__what __VA_OPT__(,) __VA_ARGS__)))
-#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level) __INTRODUCED_IN(api_level)
#else
#define __BIONIC_AVAILABILITY(__what, ...) __attribute__((__availability__(android,strict,__what __VA_OPT__(,) __VA_ARGS__)))
-#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level)
#endif
#define __INTRODUCED_IN(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
diff --git a/libc/include/bits/fcntl.h b/libc/include/bits/fcntl.h
index ee5a6e1..e3f3548 100644
--- a/libc/include/bits/fcntl.h
+++ b/libc/include/bits/fcntl.h
@@ -38,7 +38,7 @@
__BEGIN_DECLS
/**
- * [fcntl(3)](http://man7.org/linux/man-pages/man2/fcntl.2.html) performs various operations
+ * [fcntl(3)](https://man7.org/linux/man-pages/man2/fcntl.2.html) performs various operations
* on file descriptors.
*
* The return value depends on the operation.
diff --git a/libc/include/bits/getentropy.h b/libc/include/bits/getentropy.h
index a5a14f7..4cd44f7 100644
--- a/libc/include/bits/getentropy.h
+++ b/libc/include/bits/getentropy.h
@@ -39,7 +39,7 @@
__BEGIN_DECLS
/**
- * [getentropy(3)](http://man7.org/linux/man-pages/man3/getentropy.3.html) fills the given buffer
+ * [getentropy(3)](https://man7.org/linux/man-pages/man3/getentropy.3.html) fills the given buffer
* with random bytes.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/bits/getopt.h b/libc/include/bits/getopt.h
index 60a89ed..8fc0463 100644
--- a/libc/include/bits/getopt.h
+++ b/libc/include/bits/getopt.h
@@ -33,7 +33,7 @@
__BEGIN_DECLS
/**
- * [getopt(3)](http://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
+ * [getopt(3)](https://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
*
* Returns the next option character on success, returns -1 if all options have been parsed, and
* returns `'?'` on error.
diff --git a/libc/include/bits/glibc-syscalls.h b/libc/include/bits/glibc-syscalls.h
index eceb334..7b171e8 100644
--- a/libc/include/bits/glibc-syscalls.h
+++ b/libc/include/bits/glibc-syscalls.h
@@ -693,6 +693,9 @@
#if defined(__NR_mremap)
#define SYS_mremap __NR_mremap
#endif
+#if defined(__NR_mseal)
+ #define SYS_mseal __NR_mseal
+#endif
#if defined(__NR_msgctl)
#define SYS_msgctl __NR_msgctl
#endif
diff --git a/libc/include/bits/ioctl.h b/libc/include/bits/ioctl.h
index 260eb7d..ae75880 100644
--- a/libc/include/bits/ioctl.h
+++ b/libc/include/bits/ioctl.h
@@ -38,7 +38,7 @@
__BEGIN_DECLS
/**
- * [ioctl(2)](http://man7.org/linux/man-pages/man2/ioctl.2.html) operates on device files.
+ * [ioctl(2)](https://man7.org/linux/man-pages/man2/ioctl.2.html) operates on device files.
*/
int ioctl(int __fd, int __op, ...);
diff --git a/libc/include/bits/lockf.h b/libc/include/bits/lockf.h
index d9f5987..195b34a 100644
--- a/libc/include/bits/lockf.h
+++ b/libc/include/bits/lockf.h
@@ -48,7 +48,7 @@
__BEGIN_DECLS
/**
- * [lockf(3)](http://man7.org/linux/man-pages/man3/lockf.3.html) manipulates POSIX file locks.
+ * [lockf(3)](https://man7.org/linux/man-pages/man3/lockf.3.html) manipulates POSIX file locks.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*
diff --git a/libc/include/bits/posix_limits.h b/libc/include/bits/posix_limits.h
index 452f5f6..d98be27 100644
--- a/libc/include/bits/posix_limits.h
+++ b/libc/include/bits/posix_limits.h
@@ -40,7 +40,7 @@
(((__ANDROID_API__) >= (level)) ? _POSIX_VERSION : __BIONIC_POSIX_FEATURE_MISSING)
/* Availability macros. */
-/* See http://man7.org/linux/man-pages/man7/posixoptions.7.html for documentation. */
+/* See https://man7.org/linux/man-pages/man7/posixoptions.7.html for documentation. */
/* Keep this list sorted by name. */
#define _POSIX_ADVISORY_INFO __BIONIC_POSIX_FEATURE_SINCE(23) /* posix_memadvise arrived late. */
#define _POSIX_ASYNCHRONOUS_IO __BIONIC_POSIX_FEATURE_MISSING
diff --git a/libc/include/bits/seek_constants.h b/libc/include/bits/seek_constants.h
index 6f3f22d..bfc02a8 100644
--- a/libc/include/bits/seek_constants.h
+++ b/libc/include/bits/seek_constants.h
@@ -46,7 +46,7 @@
* Seek to the first data (non-hole) location in the file
* greater than or equal to the given offset.
*
- * See [lseek(2)](http://man7.org/linux/man-pages/man2/lseek.2.html).
+ * See [lseek(2)](https://man7.org/linux/man-pages/man2/lseek.2.html).
*/
#define SEEK_DATA 3
@@ -54,7 +54,7 @@
* Seek to the first hole (non-data) location in the file
* greater than or equal to the given offset.
*
- * See [lseek(2)](http://man7.org/linux/man-pages/man2/lseek.2.html).
+ * See [lseek(2)](https://man7.org/linux/man-pages/man2/lseek.2.html).
*/
#define SEEK_HOLE 4
diff --git a/libc/include/bits/strcasecmp.h b/libc/include/bits/strcasecmp.h
index 23acbe5..be910ad 100644
--- a/libc/include/bits/strcasecmp.h
+++ b/libc/include/bits/strcasecmp.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [strcasecmp(3)](http://man7.org/linux/man-pages/man3/strcasecmp.3.html) compares two strings
+ * [strcasecmp(3)](https://man7.org/linux/man-pages/man3/strcasecmp.3.html) compares two strings
* ignoring case.
*
* Returns an integer less than, equal to, or greater than zero if the first string is less than,
@@ -54,7 +54,7 @@
int strcasecmp_l(const char* _Nonnull __s1, const char* _Nonnull __s2, locale_t _Nonnull __l) __attribute_pure__ __INTRODUCED_IN(23);
/**
- * [strncasecmp(3)](http://man7.org/linux/man-pages/man3/strncasecmp.3.html) compares the first
+ * [strncasecmp(3)](https://man7.org/linux/man-pages/man3/strncasecmp.3.html) compares the first
* `n` bytes of two strings ignoring case.
*
* Returns an integer less than, equal to, or greater than zero if the first `n` bytes of the
diff --git a/libc/include/bits/wctype.h b/libc/include/bits/wctype.h
index 11d5fde..13a4254 100644
--- a/libc/include/bits/wctype.h
+++ b/libc/include/bits/wctype.h
@@ -58,8 +58,8 @@
int iswctype(wint_t __wc, wctype_t __type);
typedef const void* wctrans_t;
-wint_t towctrans(wint_t __wc, wctrans_t _Nonnull __transform) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
-wctrans_t _Nullable wctrans(const char* _Nonnull __name) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
+wint_t towctrans(wint_t __wc, wctrans_t _Nonnull __transform) __INTRODUCED_IN(26);
+wctrans_t _Nullable wctrans(const char* _Nonnull __name) __INTRODUCED_IN(26);
__END_DECLS
diff --git a/libc/include/byteswap.h b/libc/include/byteswap.h
index 0773426..a679ea0 100644
--- a/libc/include/byteswap.h
+++ b/libc/include/byteswap.h
@@ -37,19 +37,19 @@
#include <sys/endian.h>
/**
- * [bswap_16(3)](http://man7.org/linux/man-pages/man3/bswap_16.3.html) swaps the bytes in a
+ * [bswap_16(3)](https://man7.org/linux/man-pages/man3/bswap_16.3.html) swaps the bytes in a
* 16-bit value.
*/
#define bswap_16(x) __swap16(x)
/**
- * [bswap_32(3)](http://man7.org/linux/man-pages/man3/bswap_32.3.html) swaps the bytes in a
+ * [bswap_32(3)](https://man7.org/linux/man-pages/man3/bswap_32.3.html) swaps the bytes in a
* 32-bit value.
*/
#define bswap_32(x) __swap32(x)
/**
- * [bswap_64(3)](http://man7.org/linux/man-pages/man3/bswap_64.3.html) swaps the bytes in a
+ * [bswap_64(3)](https://man7.org/linux/man-pages/man3/bswap_64.3.html) swaps the bytes in a
* 64-bit value.
*/
#define bswap_64(x) __swap64(x)
diff --git a/libc/include/dirent.h b/libc/include/dirent.h
index 4f5d0fb..5333d78 100644
--- a/libc/include/dirent.h
+++ b/libc/include/dirent.h
@@ -90,7 +90,7 @@
typedef struct DIR DIR;
/**
- * [opendir(3)](http://man7.org/linux/man-pages/man3/opendir.3.html)
+ * [opendir(3)](https://man7.org/linux/man-pages/man3/opendir.3.html)
* opens a directory stream for the directory at `__path`.
*
* Returns null and sets `errno` on failure.
@@ -98,7 +98,7 @@
DIR* _Nullable opendir(const char* _Nonnull __path);
/**
- * [fopendir(3)](http://man7.org/linux/man-pages/man3/opendir.3.html)
+ * [fopendir(3)](https://man7.org/linux/man-pages/man3/opendir.3.html)
* opens a directory stream for the directory at `__dir_fd`.
*
* Returns null and sets `errno` on failure.
@@ -106,7 +106,7 @@
DIR* _Nullable fdopendir(int __dir_fd);
/**
- * [readdir(3)](http://man7.org/linux/man-pages/man3/readdir.3.html)
+ * [readdir(3)](https://man7.org/linux/man-pages/man3/readdir.3.html)
* returns the next directory entry in the given directory.
*
* Returns a pointer to a directory entry on success,
@@ -116,7 +116,7 @@
struct dirent* _Nullable readdir(DIR* _Nonnull __dir);
/**
- * [readdir64(3)](http://man7.org/linux/man-pages/man3/readdir.3.html)
+ * [readdir64(3)](https://man7.org/linux/man-pages/man3/readdir.3.html)
* returns the next directory entry in the given directory.
*
* Returns a pointer to a directory entry on success,
@@ -129,7 +129,7 @@
int readdir64_r(DIR* _Nonnull __dir, struct dirent64* _Nonnull __entry, struct dirent64* _Nullable * _Nonnull __buffer) __attribute__((__deprecated__("readdir64_r is deprecated; use readdir64 instead")));
/**
- * [closedir(3)](http://man7.org/linux/man-pages/man3/closedir.3.html)
+ * [closedir(3)](https://man7.org/linux/man-pages/man3/closedir.3.html)
* closes a directory stream.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -137,13 +137,13 @@
int closedir(DIR* _Nonnull __dir);
/**
- * [rewinddir(3)](http://man7.org/linux/man-pages/man3/rewinddir.3.html)
+ * [rewinddir(3)](https://man7.org/linux/man-pages/man3/rewinddir.3.html)
* rewinds a directory stream to the first entry.
*/
void rewinddir(DIR* _Nonnull __dir);
/**
- * [seekdir(3)](http://man7.org/linux/man-pages/man3/seekdir.3.html)
+ * [seekdir(3)](https://man7.org/linux/man-pages/man3/seekdir.3.html)
* seeks a directory stream to the given entry, which must be a value returned
* by telldir().
*
@@ -152,7 +152,7 @@
void seekdir(DIR* _Nonnull __dir, long __location) __INTRODUCED_IN(23);
/**
- * [telldir(3)](http://man7.org/linux/man-pages/man3/telldir.3.html)
+ * [telldir(3)](https://man7.org/linux/man-pages/man3/telldir.3.html)
* returns a value representing the current position in the directory
* for use with seekdir().
*
@@ -163,7 +163,7 @@
long telldir(DIR* _Nonnull __dir) __INTRODUCED_IN(23);
/**
- * [dirfd(3)](http://man7.org/linux/man-pages/man3/dirfd.3.html)
+ * [dirfd(3)](https://man7.org/linux/man-pages/man3/dirfd.3.html)
* returns the file descriptor backing the given directory stream.
*
* Returns a file descriptor on success and returns -1 and sets `errno` on failure.
@@ -171,19 +171,19 @@
int dirfd(DIR* _Nonnull __dir);
/**
- * [alphasort](http://man7.org/linux/man-pages/man3/alphasort.3.html) is a
+ * [alphasort](https://man7.org/linux/man-pages/man3/alphasort.3.html) is a
* comparator for use with scandir() that uses strcoll().
*/
int alphasort(const struct dirent* _Nonnull * _Nonnull __lhs, const struct dirent* _Nonnull * _Nonnull __rhs);
/**
- * [alphasort64](http://man7.org/linux/man-pages/man3/alphasort.3.html) is a
+ * [alphasort64](https://man7.org/linux/man-pages/man3/alphasort.3.html) is a
* comparator for use with scandir64() that uses strcmp().
*/
int alphasort64(const struct dirent64* _Nonnull * _Nonnull __lhs, const struct dirent64* _Nonnull * _Nonnull __rhs);
/**
- * [scandir(3)](http://man7.org/linux/man-pages/man3/scandir.3.html)
+ * [scandir(3)](https://man7.org/linux/man-pages/man3/scandir.3.html)
* scans all the directory `__path`, filtering entries with `__filter` and
* sorting them with qsort() using the given `__comparator`, and storing them
* into `__name_list`. Passing NULL as the filter accepts all entries.
@@ -195,7 +195,7 @@
int scandir(const char* _Nonnull __path, struct dirent* _Nonnull * _Nonnull * _Nonnull __name_list, int (* _Nullable __filter)(const struct dirent* _Nonnull), int (* _Nullable __comparator)(const struct dirent* _Nonnull * _Nonnull, const struct dirent* _Nonnull * _Nonnull));
/**
- * [scandir64(3)](http://man7.org/linux/man-pages/man3/scandir.3.html)
+ * [scandir64(3)](https://man7.org/linux/man-pages/man3/scandir.3.html)
* scans all the directory `__path`, filtering entries with `__filter` and
* sorting them with qsort() using the given `__comparator`, and storing them
* into `__name_list`. Passing NULL as the filter accepts all entries.
@@ -209,7 +209,7 @@
#if defined(__USE_GNU)
/**
- * [scandirat64(3)](http://man7.org/linux/man-pages/man3/scandirat.3.html)
+ * [scandirat64(3)](https://man7.org/linux/man-pages/man3/scandirat.3.html)
* scans all the directory referenced by the pair of `__dir_fd` and `__path`,
* filtering entries with `__filter` and sorting them with qsort() using the
* given `__comparator`, and storing them into `__name_list`. Passing NULL as
@@ -224,7 +224,7 @@
int scandirat64(int __dir_fd, const char* _Nonnull __path, struct dirent64* _Nonnull * _Nonnull * _Nonnull __name_list, int (* _Nullable __filter)(const struct dirent64* _Nonnull), int (* _Nullable __comparator)(const struct dirent64* _Nonnull * _Nonnull, const struct dirent64* _Nonnull * _Nonnull)) __INTRODUCED_IN(24);
/**
- * [scandirat(3)](http://man7.org/linux/man-pages/man3/scandirat.3.html)
+ * [scandirat(3)](https://man7.org/linux/man-pages/man3/scandirat.3.html)
* scans all the directory referenced by the pair of `__dir_fd` and `__path`,
* filtering entries with `__filter` and sorting them with qsort() using the
* given `__comparator`, and storing them into `__name_list`. Passing NULL as
diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h
index d65a409..071d50a 100644
--- a/libc/include/dlfcn.h
+++ b/libc/include/dlfcn.h
@@ -48,7 +48,7 @@
} Dl_info;
/**
- * [dlopen(3)](http://man7.org/linux/man-pages/man3/dlopen.3.html)
+ * [dlopen(3)](https://man7.org/linux/man-pages/man3/dlopen.3.html)
* loads the given shared library.
*
* Returns a pointer to an opaque handle for use with other <dlfcn.h> functions
@@ -58,7 +58,7 @@
void* _Nullable dlopen(const char* _Nullable __filename, int __flag);
/**
- * [dlclose(3)](http://man7.org/linux/man-pages/man3/dlclose.3.html)
+ * [dlclose(3)](https://man7.org/linux/man-pages/man3/dlclose.3.html)
* decrements the reference count for the given shared library (and
* any libraries brought in by that library's DT_NEEDED entries).
*
@@ -84,7 +84,7 @@
int dlclose(void* _Nonnull __handle);
/**
- * [dlerror(3)](http://man7.org/linux/man-pages/man3/dlerror.3.html)
+ * [dlerror(3)](https://man7.org/linux/man-pages/man3/dlerror.3.html)
* returns a human-readable error message describing the most recent
* failure from one of the <dlfcn.h> functions on the calling thread.
*
@@ -97,7 +97,7 @@
char* _Nullable dlerror(void);
/**
- * [dlsym(3)](http://man7.org/linux/man-pages/man3/dlsym.3.html)
+ * [dlsym(3)](https://man7.org/linux/man-pages/man3/dlsym.3.html)
* returns a pointer to the symbol with the given name in the shared
* library represented by the given handle. The handle may have been
* returned from dlopen(), or can be RTLD_DEFAULT or RTLD_NEXT.
@@ -108,7 +108,7 @@
void* _Nullable dlsym(void* __BIONIC_COMPLICATED_NULLNESS __handle, const char* _Nullable __symbol);
/**
- * [dlvsym(3)](http://man7.org/linux/man-pages/man3/dlvsym.3.html)
+ * [dlvsym(3)](https://man7.org/linux/man-pages/man3/dlvsym.3.html)
* returns a pointer to the symbol with the given name and version in the shared
* library represented by the given handle. The handle may have been
* returned from dlopen(), or can be RTLD_DEFAULT or RTLD_NEXT.
@@ -119,7 +119,7 @@
void* _Nullable dlvsym(void* __BIONIC_COMPLICATED_NULLNESS __handle, const char* _Nullable __symbol, const char* _Nullable __version) __INTRODUCED_IN(24);
/**
- * [dladdr(3)](http://man7.org/linux/man-pages/man3/dladdr.3.html)
+ * [dladdr(3)](https://man7.org/linux/man-pages/man3/dladdr.3.html)
* returns information about the symbol at the given address.
*
* Returns non-zero on success, and returns 0 on failure. Note that unlike
diff --git a/libc/include/elf.h b/libc/include/elf.h
index 374d5bb..24454d7 100644
--- a/libc/include/elf.h
+++ b/libc/include/elf.h
@@ -272,14 +272,12 @@
/* riscv64 psabi. */
-/* FreeBSD is missing these, found in
+/*
* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocations
- * so I've sent https://github.com/freebsd/freebsd-src/pull/1141 upstream.
+ * Missing from FreeBSD and the Linux uapi headers.
+ * TODO: upstreamed to FreeBSD as https://github.com/freebsd/freebsd-src/pull/1141.
*/
#define R_RISCV_TLSDESC 12
-#define R_RISCV_PLT32 59
-#define R_RISCV_SET_ULEB128 60
-#define R_RISCV_SUB_ULEB128 61
#define R_RISCV_TLSDESC_HI20 62
#define R_RISCV_TLSDESC_LOAD_LO12 63
#define R_RISCV_TLSDESC_ADD_LO12 64
diff --git a/libc/include/err.h b/libc/include/err.h
index af44514..d8122d7 100644
--- a/libc/include/err.h
+++ b/libc/include/err.h
@@ -43,7 +43,7 @@
__BEGIN_DECLS
/**
- * [err(3)](http://man7.org/linux/man-pages/man3/err.3.html) outputs the program name,
+ * [err(3)](https://man7.org/linux/man-pages/man3/err.3.html) outputs the program name,
* the printf()-like formatted message, and the result of strerror() if `errno` is non-zero.
*
* Calls exit() with `__status`.
@@ -53,7 +53,7 @@
__noreturn void err(int __status, const char* _Nullable __fmt, ...) __printflike(2, 3);
/**
- * [verr(3)](http://man7.org/linux/man-pages/man3/verr.3.html) outputs the program name,
+ * [verr(3)](https://man7.org/linux/man-pages/man3/verr.3.html) outputs the program name,
* the vprintf()-like formatted message, and the result of strerror() if `errno` is non-zero.
*
* Calls exit() with `__status`.
@@ -63,7 +63,7 @@
__noreturn void verr(int __status, const char* _Nullable __fmt, va_list __args) __printflike(2, 0);
/**
- * [errx(3)](http://man7.org/linux/man-pages/man3/errx.3.html) outputs the program name, and
+ * [errx(3)](https://man7.org/linux/man-pages/man3/errx.3.html) outputs the program name, and
* the printf()-like formatted message.
*
* Calls exit() with `__status`.
@@ -73,7 +73,7 @@
__noreturn void errx(int __status, const char* _Nullable __fmt, ...) __printflike(2, 3);
/**
- * [verrx(3)](http://man7.org/linux/man-pages/man3/err.3.html) outputs the program name, and
+ * [verrx(3)](https://man7.org/linux/man-pages/man3/err.3.html) outputs the program name, and
* the vprintf()-like formatted message.
*
* Calls exit() with `__status`.
@@ -83,7 +83,7 @@
__noreturn void verrx(int __status, const char* _Nullable __fmt, va_list __args) __printflike(2, 0);
/**
- * [warn(3)](http://man7.org/linux/man-pages/man3/warn.3.html) outputs the program name,
+ * [warn(3)](https://man7.org/linux/man-pages/man3/warn.3.html) outputs the program name,
* the printf()-like formatted message, and the result of strerror() if `errno` is non-zero.
*
* New code should consider error() in `<error.h>`.
@@ -91,7 +91,7 @@
void warn(const char* _Nullable __fmt, ...) __printflike(1, 2);
/**
- * [vwarn(3)](http://man7.org/linux/man-pages/man3/vwarn.3.html) outputs the program name,
+ * [vwarn(3)](https://man7.org/linux/man-pages/man3/vwarn.3.html) outputs the program name,
* the vprintf()-like formatted message, and the result of strerror() if `errno` is non-zero.
*
* New code should consider error() in `<error.h>`.
@@ -99,7 +99,7 @@
void vwarn(const char* _Nullable __fmt, va_list __args) __printflike(1, 0);
/**
- * [warnx(3)](http://man7.org/linux/man-pages/man3/warnx.3.html) outputs the program name, and
+ * [warnx(3)](https://man7.org/linux/man-pages/man3/warnx.3.html) outputs the program name, and
* the printf()-like formatted message.
*
* New code should consider error() in `<error.h>`.
@@ -107,7 +107,7 @@
void warnx(const char* _Nullable __fmt, ...) __printflike(1, 2);
/**
- * [vwarnx(3)](http://man7.org/linux/man-pages/man3/warn.3.html) outputs the program name, and
+ * [vwarnx(3)](https://man7.org/linux/man-pages/man3/warn.3.html) outputs the program name, and
* the vprintf()-like formatted message.
*
* New code should consider error() in `<error.h>`.
diff --git a/libc/include/errno.h b/libc/include/errno.h
index 12ebdf7..0b79592 100644
--- a/libc/include/errno.h
+++ b/libc/include/errno.h
@@ -52,7 +52,7 @@
int* _Nonnull __errno(void) __attribute_const__;
/**
- * [errno(3)](http://man7.org/linux/man-pages/man3/errno.3.html) is the last error on the calling
+ * [errno(3)](https://man7.org/linux/man-pages/man3/errno.3.html) is the last error on the calling
* thread.
*/
#define errno (*__errno())
diff --git a/libc/include/error.h b/libc/include/error.h
index 187ee17..cb867cd 100644
--- a/libc/include/error.h
+++ b/libc/include/error.h
@@ -38,7 +38,7 @@
__BEGIN_DECLS
/**
- * [error_print_progname(3)](http://man7.org/linux/man-pages/man3/error_print_progname.3.html) is
+ * [error_print_progname(3)](https://man7.org/linux/man-pages/man3/error_print_progname.3.html) is
* a function pointer that, if non-null, is called by error() instead of prefixing errors with the
* program name.
*
@@ -47,7 +47,7 @@
extern void (* _Nullable error_print_progname)(void) __INTRODUCED_IN(23);
/**
- * [error_message_count(3)](http://man7.org/linux/man-pages/man3/error_message_count.3.html) is
+ * [error_message_count(3)](https://man7.org/linux/man-pages/man3/error_message_count.3.html) is
* a global count of the number of calls to error() and error_at_line().
*
* Available since API level 23.
@@ -55,7 +55,7 @@
extern unsigned int error_message_count __INTRODUCED_IN(23);
/**
- * [error_one_per_line(3)](http://man7.org/linux/man-pages/man3/error_one_per_line.3.html) is
+ * [error_one_per_line(3)](https://man7.org/linux/man-pages/man3/error_one_per_line.3.html) is
* a global flag that if non-zero disables printing multiple errors with the same filename and
* line number.
*
@@ -64,7 +64,7 @@
extern int error_one_per_line __INTRODUCED_IN(23);
/**
- * [error(3)](http://man7.org/linux/man-pages/man3/error.3.html) formats the given printf()-like
+ * [error(3)](https://man7.org/linux/man-pages/man3/error.3.html) formats the given printf()-like
* error message, preceded by the program name. Calls exit if `__status` is non-zero, and appends
* the result of strerror() if `__errno` is non-zero.
*
@@ -73,7 +73,7 @@
void error(int __status, int __errno, const char* _Nonnull __fmt, ...) __printflike(3, 4) __INTRODUCED_IN(23);
/**
- * [error_at_line(3)](http://man7.org/linux/man-pages/man3/error_at_line.3.html) formats the given
+ * [error_at_line(3)](https://man7.org/linux/man-pages/man3/error_at_line.3.html) formats the given
* printf()-like error message, preceded by the program name and the given filename and line number.
* Calls exit if `__status` is non-zero, and appends the result of strerror() if `__errno` is
* non-zero.
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 16ce6fa..c81028e 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -103,7 +103,7 @@
#endif
/**
- * [creat(2)](http://man7.org/linux/man-pages/man2/creat.2.html)
+ * [creat(2)](https://man7.org/linux/man-pages/man2/creat.2.html)
* creates a file.
*
* Returns a new file descriptor on success and returns -1 and sets `errno` on
@@ -114,7 +114,7 @@
int creat64(const char* _Nonnull __path, mode_t __mode);
/**
- * [openat(2)](http://man7.org/linux/man-pages/man2/openat.2.html)
+ * [openat(2)](https://man7.org/linux/man-pages/man2/openat.2.html)
* opens (and possibly creates) a file.
*
* Returns a new file descriptor on success and returns -1 and sets `errno` on
@@ -125,7 +125,7 @@
int openat64(int __dir_fd, const char* _Nonnull __path, int __flags, ...);
/**
- * [open(2)](http://man7.org/linux/man-pages/man2/open.2.html)
+ * [open(2)](https://man7.org/linux/man-pages/man2/open.2.html)
* opens (and possibly creates) a file.
*
* Returns a new file descriptor on success and returns -1 and sets `errno` on
@@ -136,7 +136,7 @@
int open64(const char* _Nonnull __path, int __flags, ...);
/**
- * [splice(2)](http://man7.org/linux/man-pages/man2/splice.2.html)
+ * [splice(2)](https://man7.org/linux/man-pages/man2/splice.2.html)
* splices data to/from a pipe.
*
* Valid flags are `SPLICE_F_MOVE`, `SPLICE_F_NONBLOCK`, `SPLICE_F_MORE`, and
@@ -148,7 +148,7 @@
ssize_t splice(int __in_fd, off64_t* __BIONIC_COMPLICATED_NULLNESS __in_offset, int __out_fd, off64_t* __BIONIC_COMPLICATED_NULLNESS __out_offset, size_t __length, unsigned int __flags);
/**
- * [tee(2)](http://man7.org/linux/man-pages/man2/tee.2.html)
+ * [tee(2)](https://man7.org/linux/man-pages/man2/tee.2.html)
* duplicates data from one pipe to another.
*
* Valid flags are `SPLICE_F_MOVE`, `SPLICE_F_NONBLOCK`, `SPLICE_F_MORE`, and
@@ -160,7 +160,7 @@
ssize_t tee(int __in_fd, int __out_fd, size_t __length, unsigned int __flags);
/**
- * [vmsplice(2)](http://man7.org/linux/man-pages/man2/vmsplice.2.html)
+ * [vmsplice(2)](https://man7.org/linux/man-pages/man2/vmsplice.2.html)
* splices data to/from a pipe.
*
* Valid flags are `SPLICE_F_MOVE`, `SPLICE_F_NONBLOCK`, `SPLICE_F_MORE`, and
@@ -172,7 +172,7 @@
ssize_t vmsplice(int __fd, const struct iovec* _Nonnull __iov, size_t __count, unsigned int __flags);
/**
- * [fallocate(2)](http://man7.org/linux/man-pages/man2/fallocate.2.html)
+ * [fallocate(2)](https://man7.org/linux/man-pages/man2/fallocate.2.html)
* is a Linux-specific extension of posix_fallocate().
*
* Valid flags are `FALLOC_FL_KEEP_SIZE`, `FALLOC_FL_PUNCH_HOLE`,
@@ -187,7 +187,7 @@
int fallocate64(int __fd, int __mode, off64_t __offset, off64_t __length);
/**
- * [posix_fadvise(2)](http://man7.org/linux/man-pages/man2/posix_fadvise.2.html)
+ * [posix_fadvise(2)](https://man7.org/linux/man-pages/man2/posix_fadvise.2.html)
* declares an expected access pattern for file data.
*
* Valid flags are `POSIX_FADV_NORMAL`, `POSIX_FADV_RANDOM`,
@@ -201,7 +201,7 @@
int posix_fadvise64(int __fd, off64_t __offset, off64_t __length, int __advice);
/**
- * [posix_fallocate(2)](http://man7.org/linux/man-pages/man2/posix_fallocate.2.html)
+ * [posix_fallocate(2)](https://man7.org/linux/man-pages/man2/posix_fallocate.2.html)
* allocates file space.
*
* Returns 0 on success and returns an error number on failure.
@@ -213,7 +213,7 @@
#if defined(__USE_GNU)
/**
- * [readahead(2)](http://man7.org/linux/man-pages/man2/readahead.2.html)
+ * [readahead(2)](https://man7.org/linux/man-pages/man2/readahead.2.html)
* initiates readahead for the given file.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -221,7 +221,7 @@
ssize_t readahead(int __fd, off64_t __offset, size_t __length);
/**
- * [sync_file_range(2)](http://man7.org/linux/man-pages/man2/sync_file_range.2.html)
+ * [sync_file_range(2)](https://man7.org/linux/man-pages/man2/sync_file_range.2.html)
* syncs part of a file with disk.
*
* Valid flags are `SYNC_FILE_RANGE_WAIT_BEFORE`, `SYNC_FILE_RANGE_WRITE`, and
diff --git a/libc/include/fenv.h b/libc/include/fenv.h
index f7dcc8e..4c1d490 100644
--- a/libc/include/fenv.h
+++ b/libc/include/fenv.h
@@ -49,7 +49,7 @@
__BEGIN_DECLS
/**
- * [feclearexcept(3)](http://man7.org/linux/man-pages/man3/feclearexcept.3.html)
+ * [feclearexcept(3)](https://man7.org/linux/man-pages/man3/feclearexcept.3.html)
* clears the given `exceptions` in hardware.
*
* Returns 0 on success, and returns non-zero on failure.
@@ -57,7 +57,7 @@
int feclearexcept(int __exceptions);
/**
- * [fegetexceptflag(3)](http://man7.org/linux/man-pages/man3/fegetexceptflag.3.html)
+ * [fegetexceptflag(3)](https://man7.org/linux/man-pages/man3/fegetexceptflag.3.html)
* copies the state of the given `exceptions` from hardware into `*flag_ptr`.
* See fesetexceptflag().
*
@@ -66,7 +66,7 @@
int fegetexceptflag(fexcept_t* _Nonnull __flag_ptr, int __exceptions);
/**
- * [feraiseexcept(3)](http://man7.org/linux/man-pages/man3/feraiseexcept.3.html)
+ * [feraiseexcept(3)](https://man7.org/linux/man-pages/man3/feraiseexcept.3.html)
* raises the given `exceptions` in hardware.
*
* Returns 0 on success, and returns non-zero on failure.
@@ -74,7 +74,7 @@
int feraiseexcept(int __exceptions);
/**
- * [fesetexceptflag(3)](http://man7.org/linux/man-pages/man3/fesetexceptflag.3.html)
+ * [fesetexceptflag(3)](https://man7.org/linux/man-pages/man3/fesetexceptflag.3.html)
* copies the state of the given `exceptions` from `*flag_ptr` into hardware.
* See fesetexceptflag().
*
@@ -83,7 +83,7 @@
int fesetexceptflag(const fexcept_t* _Nonnull __flag_ptr, int __exceptions);
/**
- * [fetestexcept(3)](http://man7.org/linux/man-pages/man3/fetestexcept.3.html)
+ * [fetestexcept(3)](https://man7.org/linux/man-pages/man3/fetestexcept.3.html)
* tests whether the given `exceptions` are set in hardware.
*
* Returns the currently-set subset of `exceptions`.
@@ -91,7 +91,7 @@
int fetestexcept(int __exceptions);
/**
- * [fegetround(3)](http://man7.org/linux/man-pages/man3/fegetround.3.html)
+ * [fegetround(3)](https://man7.org/linux/man-pages/man3/fegetround.3.html)
* returns the current rounding mode.
*
* Returns the rounding mode on success, and returns a negative value on failure.
@@ -99,7 +99,7 @@
int fegetround(void);
/**
- * [fesetround(3)](http://man7.org/linux/man-pages/man3/fesetround.3.html)
+ * [fesetround(3)](https://man7.org/linux/man-pages/man3/fesetround.3.html)
* sets the current rounding mode.
*
* Returns 0 on success, and returns non-zero on failure.
@@ -107,7 +107,7 @@
int fesetround(int __rounding_mode);
/**
- * [fegetenv(3)](http://man7.org/linux/man-pages/man3/fegetenv.3.html)
+ * [fegetenv(3)](https://man7.org/linux/man-pages/man3/fegetenv.3.html)
* gets the current floating-point environment. See fesetenv().
*
* Returns 0 on success, and returns non-zero on failure.
@@ -115,7 +115,7 @@
int fegetenv(fenv_t* _Nonnull __env);
/**
- * [feholdexcept(3)](http://man7.org/linux/man-pages/man3/feholdexcept.3.html)
+ * [feholdexcept(3)](https://man7.org/linux/man-pages/man3/feholdexcept.3.html)
* gets the current floating-point environment, clears the status flags, and
* ignores floating point exceptions. See fesetenv()/feupdateenv().
*
@@ -124,7 +124,7 @@
int feholdexcept(fenv_t* _Nonnull __env);
/**
- * [fesetenv(3)](http://man7.org/linux/man-pages/man3/fesetenv.3.html)
+ * [fesetenv(3)](https://man7.org/linux/man-pages/man3/fesetenv.3.html)
* sets the current floating-point environment. See fegetenv().
*
* Returns 0 on success, and returns non-zero on failure.
@@ -132,7 +132,7 @@
int fesetenv(const fenv_t* _Nonnull __env);
/**
- * [feupdateenv(3)](http://man7.org/linux/man-pages/man3/feupdateenv.3.html)
+ * [feupdateenv(3)](https://man7.org/linux/man-pages/man3/feupdateenv.3.html)
* sets the current floating-point environment to `*env` but with currently-raised
* exceptions still raised. See fesetenv().
*
@@ -141,7 +141,7 @@
int feupdateenv(const fenv_t* _Nonnull __env);
/**
- * [feenableexcept(3)](http://man7.org/linux/man-pages/man3/feenableexcept.3.html)
+ * [feenableexcept(3)](https://man7.org/linux/man-pages/man3/feenableexcept.3.html)
* sets the given `exceptions` to trap, if the hardware supports it. This is not
* generally useful on Android, because only x86/x86-64 can trap.
*
@@ -150,7 +150,7 @@
int feenableexcept(int __exceptions);
/**
- * [fedisableexcept(3)](http://man7.org/linux/man-pages/man3/fedisableexcept.3.html)
+ * [fedisableexcept(3)](https://man7.org/linux/man-pages/man3/fedisableexcept.3.html)
* sets the given `exceptions` to not trap, if the hardware supports it. This is not
* generally useful on Android, because only x86/x86-64 can trap.
*
@@ -159,7 +159,7 @@
int fedisableexcept(int __exceptions);
/**
- * [fegetexcept(3)](http://man7.org/linux/man-pages/man3/fegetexcept.3.html)
+ * [fegetexcept(3)](https://man7.org/linux/man-pages/man3/fegetexcept.3.html)
* returns the exceptions that currently trap. This is not generally useful on
* Android, because only x86/x86-64 can trap.
*
diff --git a/libc/include/fnmatch.h b/libc/include/fnmatch.h
index 1788a27..e3b17fd 100644
--- a/libc/include/fnmatch.h
+++ b/libc/include/fnmatch.h
@@ -60,7 +60,7 @@
#define FNM_FILE_NAME FNM_PATHNAME
/**
- * [fnmatch(3)](http://man7.org/linux/man-pages/man3/fnmatch.3.html) matches `__string` against
+ * [fnmatch(3)](https://man7.org/linux/man-pages/man3/fnmatch.3.html) matches `__string` against
* the shell wildcard `__pattern`.
*
* Returns 0 on success, and returns `FNM_NOMATCH` on failure.
diff --git a/libc/include/getopt.h b/libc/include/getopt.h
index c1c0442..1a30eb7 100644
--- a/libc/include/getopt.h
+++ b/libc/include/getopt.h
@@ -70,12 +70,12 @@
__BEGIN_DECLS
/**
- * [getopt_long(3)](http://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
+ * [getopt_long(3)](https://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
*/
int getopt_long(int __argc, char* _Nonnull const* _Nonnull __argv, const char* _Nonnull __options, const struct option* _Nonnull __long_options, int* _Nullable __long_index);
/**
- * [getopt_long_only(3)](http://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
+ * [getopt_long_only(3)](https://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
*/
int getopt_long_only(int __argc, char* _Nonnull const* _Nonnull __argv, const char* _Nonnull __options, const struct option* _Nonnull __long_options, int* _Nullable __long_index);
diff --git a/libc/include/iconv.h b/libc/include/iconv.h
index 27e04bb..9da46b4 100644
--- a/libc/include/iconv.h
+++ b/libc/include/iconv.h
@@ -47,7 +47,7 @@
typedef struct __iconv_t* iconv_t;
/**
- * [iconv_open(3)](http://man7.org/linux/man-pages/man3/iconv_open.3.html) allocates a new converter
+ * [iconv_open(3)](https://man7.org/linux/man-pages/man3/iconv_open.3.html) allocates a new converter
* from `__src_encoding` to `__dst_encoding`.
*
* Android supports the `utf8`, `ascii`, `usascii`, `utf16be`, `utf16le`, `utf32be`, `utf32le`,
@@ -63,7 +63,7 @@
iconv_t _Nonnull iconv_open(const char* _Nonnull __dst_encoding, const char* _Nonnull __src_encoding) __INTRODUCED_IN(28);
/**
- * [iconv(3)](http://man7.org/linux/man-pages/man3/iconv.3.html) converts characters from one
+ * [iconv(3)](https://man7.org/linux/man-pages/man3/iconv.3.html) converts characters from one
* encoding to another.
*
* Returns the number of characters converted on success and returns `((size_t) -1)` and
@@ -74,7 +74,7 @@
size_t iconv(iconv_t _Nonnull __converter, char* _Nullable * _Nullable __src_buf, size_t* __BIONIC_COMPLICATED_NULLNESS __src_bytes_left, char* _Nullable * _Nullable __dst_buf, size_t* __BIONIC_COMPLICATED_NULLNESS __dst_bytes_left) __INTRODUCED_IN(28);
/**
- * [iconv_close(3)](http://man7.org/linux/man-pages/man3/iconv_close.3.html) deallocates a converter
+ * [iconv_close(3)](https://man7.org/linux/man-pages/man3/iconv_close.3.html) deallocates a converter
* returned by iconv_open().
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
diff --git a/libc/include/ifaddrs.h b/libc/include/ifaddrs.h
index 7c0dcbf..c4d0e10 100644
--- a/libc/include/ifaddrs.h
+++ b/libc/include/ifaddrs.h
@@ -72,7 +72,7 @@
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
/**
- * [getifaddrs(3)](http://man7.org/linux/man-pages/man3/getifaddrs.3.html) creates a linked list
+ * [getifaddrs(3)](https://man7.org/linux/man-pages/man3/getifaddrs.3.html) creates a linked list
* of `struct ifaddrs`. The list must be freed by freeifaddrs().
*
* Returns 0 and stores the list in `*__list_ptr` on success,
@@ -83,7 +83,7 @@
int getifaddrs(struct ifaddrs* _Nullable * _Nonnull __list_ptr) __INTRODUCED_IN(24);
/**
- * [freeifaddrs(3)](http://man7.org/linux/man-pages/man3/freeifaddrs.3.html) frees a linked list
+ * [freeifaddrs(3)](https://man7.org/linux/man-pages/man3/freeifaddrs.3.html) frees a linked list
* of `struct ifaddrs` returned by getifaddrs().
*
* Available since API level 24.
diff --git a/libc/include/libgen.h b/libc/include/libgen.h
index 474f066..8f2ea2b 100644
--- a/libc/include/libgen.h
+++ b/libc/include/libgen.h
@@ -41,7 +41,7 @@
__BEGIN_DECLS
/**
- * [basename(3)](http://man7.org/linux/man-pages/man3/basename.3.html)
+ * [basename(3)](https://man7.org/linux/man-pages/man3/basename.3.html)
* returns the final component of the given path.
*
* See `<string.h>` for the GNU basename(). Including `<libgen.h>`,
@@ -59,7 +59,7 @@
#define basename __posix_basename
/**
- * [dirname(3)](http://man7.org/linux/man-pages/man3/dirname.3.html)
+ * [dirname(3)](https://man7.org/linux/man-pages/man3/dirname.3.html)
* returns all but the final component of the given path.
*
* Note that Android's cv-qualifiers differ from POSIX; Android's implementation doesn't
diff --git a/libc/include/link.h b/libc/include/link.h
index ee1fc42..216502e 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -99,7 +99,7 @@
};
/**
- * [dl_iterate_phdr(3)](http://man7.org/linux/man-pages/man3/dl_iterate_phdr.3.html)
+ * [dl_iterate_phdr(3)](https://man7.org/linux/man-pages/man3/dl_iterate_phdr.3.html)
* calls the given callback once for every loaded shared object. The size
* argument to the callback lets you determine whether you have a smaller
* `dl_phdr_info` from before API level 30, or the newer full one.
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index 3ebc1be..21c3b36 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -34,7 +34,7 @@
#define __BIONIC_ALLOC_SIZE(...) __attribute__((__alloc_size__(__VA_ARGS__)))
/**
- * [malloc(3)](http://man7.org/linux/man-pages/man3/malloc.3.html) allocates
+ * [malloc(3)](https://man7.org/linux/man-pages/man3/malloc.3.html) allocates
* memory on the heap.
*
* Returns a pointer to the allocated memory on success and returns a null
@@ -58,7 +58,7 @@
void* _Nullable malloc(size_t __byte_count) __mallocfunc __BIONIC_ALLOC_SIZE(1) __wur;
/**
- * [calloc(3)](http://man7.org/linux/man-pages/man3/calloc.3.html) allocates
+ * [calloc(3)](https://man7.org/linux/man-pages/man3/calloc.3.html) allocates
* and clears memory on the heap.
*
* Returns a pointer to the allocated memory on success and returns a null
@@ -67,7 +67,7 @@
void* _Nullable calloc(size_t __item_count, size_t __item_size) __mallocfunc __BIONIC_ALLOC_SIZE(1,2) __wur;
/**
- * [realloc(3)](http://man7.org/linux/man-pages/man3/realloc.3.html) resizes
+ * [realloc(3)](https://man7.org/linux/man-pages/man3/realloc.3.html) resizes
* allocated memory on the heap.
*
* Returns a pointer (which may be different from `__ptr`) to the resized
@@ -77,7 +77,7 @@
void* _Nullable realloc(void* _Nullable __ptr, size_t __byte_count) __BIONIC_ALLOC_SIZE(2) __wur;
/**
- * [reallocarray(3)](http://man7.org/linux/man-pages/man3/realloc.3.html) resizes
+ * [reallocarray(3)](https://man7.org/linux/man-pages/man3/realloc.3.html) resizes
* allocated memory on the heap.
*
* Equivalent to `realloc(__ptr, __item_count * __item_size)` but fails if the
@@ -90,13 +90,13 @@
void* _Nullable reallocarray(void* _Nullable __ptr, size_t __item_count, size_t __item_size) __BIONIC_ALLOC_SIZE(2, 3) __wur __INTRODUCED_IN(29);
/**
- * [free(3)](http://man7.org/linux/man-pages/man3/free.3.html) deallocates
+ * [free(3)](https://man7.org/linux/man-pages/man3/free.3.html) deallocates
* memory on the heap.
*/
void free(void* _Nullable __ptr);
/**
- * [memalign(3)](http://man7.org/linux/man-pages/man3/memalign.3.html) allocates
+ * [memalign(3)](https://man7.org/linux/man-pages/man3/memalign.3.html) allocates
* memory on the heap with the required alignment.
*
* Returns a pointer to the allocated memory on success and returns a null
@@ -107,7 +107,7 @@
void* _Nullable memalign(size_t __alignment, size_t __byte_count) __mallocfunc __BIONIC_ALLOC_SIZE(2) __wur;
/**
- * [malloc_usable_size(3)](http://man7.org/linux/man-pages/man3/malloc_usable_size.3.html)
+ * [malloc_usable_size(3)](https://man7.org/linux/man-pages/man3/malloc_usable_size.3.html)
* returns the actual size of the given heap block.
*/
size_t malloc_usable_size(const void* _Nullable __ptr) __wur;
@@ -140,7 +140,7 @@
#endif
/**
- * [mallinfo(3)](http://man7.org/linux/man-pages/man3/mallinfo.3.html) returns
+ * [mallinfo(3)](https://man7.org/linux/man-pages/man3/mallinfo.3.html) returns
* information about the current state of the heap. Note that mallinfo() is
* inherently unreliable and consider using malloc_info() instead.
*/
@@ -152,14 +152,14 @@
struct mallinfo2 { __MALLINFO_BODY };
/**
- * [mallinfo2(3)](http://man7.org/linux/man-pages/man3/mallinfo2.3.html) returns
+ * [mallinfo2(3)](https://man7.org/linux/man-pages/man3/mallinfo2.3.html) returns
* information about the current state of the heap. Note that mallinfo2() is
* inherently unreliable and consider using malloc_info() instead.
*/
struct mallinfo2 mallinfo2(void) __RENAME(mallinfo);
/**
- * [malloc_info(3)](http://man7.org/linux/man-pages/man3/malloc_info.3.html)
+ * [malloc_info(3)](https://man7.org/linux/man-pages/man3/malloc_info.3.html)
* writes information about the current state of the heap to the given stream.
*
* The XML structure for malloc_info() is as follows:
@@ -349,7 +349,7 @@
#define M_LOG_STATS (-205)
/**
- * [mallopt(3)](http://man7.org/linux/man-pages/man3/mallopt.3.html) modifies
+ * [mallopt(3)](https://man7.org/linux/man-pages/man3/mallopt.3.html) modifies
* heap behavior. Values of `__option` are the `M_` constants from this header.
*
* Returns 1 on success, 0 on error.
@@ -359,7 +359,7 @@
int mallopt(int __option, int __value) __INTRODUCED_IN(26);
/**
- * [__malloc_hook(3)](http://man7.org/linux/man-pages/man3/__malloc_hook.3.html)
+ * [__malloc_hook(3)](https://man7.org/linux/man-pages/man3/__malloc_hook.3.html)
* is called to implement malloc(). By default this points to the system's
* implementation.
*
@@ -370,7 +370,7 @@
extern void* _Nonnull (*volatile _Nonnull __malloc_hook)(size_t __byte_count, const void* _Nonnull __caller) __INTRODUCED_IN(28);
/**
- * [__realloc_hook(3)](http://man7.org/linux/man-pages/man3/__realloc_hook.3.html)
+ * [__realloc_hook(3)](https://man7.org/linux/man-pages/man3/__realloc_hook.3.html)
* is called to implement realloc(). By default this points to the system's
* implementation.
*
@@ -381,7 +381,7 @@
extern void* _Nonnull (*volatile _Nonnull __realloc_hook)(void* _Nullable __ptr, size_t __byte_count, const void* _Nonnull __caller) __INTRODUCED_IN(28);
/**
- * [__free_hook(3)](http://man7.org/linux/man-pages/man3/__free_hook.3.html)
+ * [__free_hook(3)](https://man7.org/linux/man-pages/man3/__free_hook.3.html)
* is called to implement free(). By default this points to the system's
* implementation.
*
@@ -392,7 +392,7 @@
extern void (*volatile _Nonnull __free_hook)(void* _Nullable __ptr, const void* _Nonnull __caller) __INTRODUCED_IN(28);
/**
- * [__memalign_hook(3)](http://man7.org/linux/man-pages/man3/__memalign_hook.3.html)
+ * [__memalign_hook(3)](https://man7.org/linux/man-pages/man3/__memalign_hook.3.html)
* is called to implement memalign(). By default this points to the system's
* implementation.
*
diff --git a/libc/include/netinet/ether.h b/libc/include/netinet/ether.h
index 4af7eda..a847385 100644
--- a/libc/include/netinet/ether.h
+++ b/libc/include/netinet/ether.h
@@ -39,7 +39,7 @@
__BEGIN_DECLS
/**
- * [ether_ntoa(3)](http://man7.org/linux/man-pages/man3/ether_ntoa.3.html) returns a string
+ * [ether_ntoa(3)](https://man7.org/linux/man-pages/man3/ether_ntoa.3.html) returns a string
* representation of the given Ethernet (MAC) address.
*
* Returns a pointer to a static buffer.
@@ -47,7 +47,7 @@
char* _Nonnull ether_ntoa(const struct ether_addr* _Nonnull __addr);
/**
- * [ether_ntoa_r(3)](http://man7.org/linux/man-pages/man3/ether_ntoa_r.3.html) returns a string
+ * [ether_ntoa_r(3)](https://man7.org/linux/man-pages/man3/ether_ntoa_r.3.html) returns a string
* representation of the given Ethernet (MAC) address.
*
* Returns a pointer to the given buffer.
@@ -55,7 +55,7 @@
char* _Nonnull ether_ntoa_r(const struct ether_addr* _Nonnull __addr, char* _Nonnull __buf);
/**
- * [ether_aton(3)](http://man7.org/linux/man-pages/man3/ether_aton.3.html) returns an `ether_addr`
+ * [ether_aton(3)](https://man7.org/linux/man-pages/man3/ether_aton.3.html) returns an `ether_addr`
* corresponding to the given Ethernet (MAC) address string.
*
* Returns a pointer to a static buffer, or NULL if the given string isn't a valid MAC address.
@@ -63,7 +63,7 @@
struct ether_addr* _Nullable ether_aton(const char* _Nonnull __ascii);
/**
- * [ether_aton_r(3)](http://man7.org/linux/man-pages/man3/ether_aton_r.3.html) returns an
+ * [ether_aton_r(3)](https://man7.org/linux/man-pages/man3/ether_aton_r.3.html) returns an
* `ether_addr` corresponding to the given Ethernet (MAC) address string.
*
* Returns a pointer to the given buffer, or NULL if the given string isn't a valid MAC address.
diff --git a/libc/include/nl_types.h b/libc/include/nl_types.h
index f4d7f43..6c9935d 100644
--- a/libc/include/nl_types.h
+++ b/libc/include/nl_types.h
@@ -56,7 +56,7 @@
typedef int nl_item;
/**
- * [catopen(3)](http://man7.org/linux/man-pages/man3/catopen.3.html) opens a message catalog.
+ * [catopen(3)](https://man7.org/linux/man-pages/man3/catopen.3.html) opens a message catalog.
*
* On Android, this always returns failure: `((nl_catd) -1)`.
*
@@ -65,7 +65,7 @@
nl_catd _Nonnull catopen(const char* _Nonnull __name, int __flag) __INTRODUCED_IN(26);
/**
- * [catgets(3)](http://man7.org/linux/man-pages/man3/catgets.3.html) translates the given message
+ * [catgets(3)](https://man7.org/linux/man-pages/man3/catgets.3.html) translates the given message
* using the given message catalog.
*
* On Android, this always returns `__msg`.
@@ -75,7 +75,7 @@
char* _Nonnull catgets(nl_catd _Nonnull __catalog, int __set_number, int __msg_number, const char* _Nonnull __msg) __INTRODUCED_IN(26);
/**
- * [catclose(3)](http://man7.org/linux/man-pages/man3/catclose.3.html) closes a message catalog.
+ * [catclose(3)](https://man7.org/linux/man-pages/man3/catclose.3.html) closes a message catalog.
*
* On Android, this always returns -1 with `errno` set to `EBADF`.
*/
diff --git a/libc/include/poll.h b/libc/include/poll.h
index 6bdc886..0dda3da 100644
--- a/libc/include/poll.h
+++ b/libc/include/poll.h
@@ -44,7 +44,7 @@
typedef unsigned int nfds_t;
/**
- * [poll(3)](http://man7.org/linux/man-pages/man3/poll.3.html) waits on a set of file descriptors.
+ * [poll(3)](https://man7.org/linux/man-pages/man3/poll.3.html) waits on a set of file descriptors.
*
* Returns the number of ready file descriptors on success, 0 for timeout,
* and returns -1 and sets `errno` on failure.
@@ -52,7 +52,7 @@
int poll(struct pollfd* _Nullable __fds, nfds_t __count, int __timeout_ms);
/**
- * [ppoll(3)](http://man7.org/linux/man-pages/man3/ppoll.3.html) waits on a set of file descriptors
+ * [ppoll(3)](https://man7.org/linux/man-pages/man3/ppoll.3.html) waits on a set of file descriptors
* or a signal. Set `__timeout` to null for no timeout. Set `__mask` to null to not set the signal
* mask.
*
diff --git a/libc/include/pty.h b/libc/include/pty.h
index be447d6..1cfb772 100644
--- a/libc/include/pty.h
+++ b/libc/include/pty.h
@@ -41,7 +41,7 @@
__BEGIN_DECLS
/**
- * [openpty(3)](http://man7.org/linux/man-pages/man3/openpty.3.html) finds
+ * [openpty(3)](https://man7.org/linux/man-pages/man3/openpty.3.html) finds
* a free pseudoterminal and configures it with the given terminal and window
* size settings.
*
@@ -52,7 +52,7 @@
int openpty(int* _Nonnull __pty_fd, int* _Nonnull __tty_fd, char* _Nullable __tty_name, const struct termios* _Nullable __termios_ptr, const struct winsize* _Nullable __winsize_ptr) __INTRODUCED_IN(23);
/**
- * [forkpty(3)](http://man7.org/linux/man-pages/man3/forkpty.3.html) creates
+ * [forkpty(3)](https://man7.org/linux/man-pages/man3/forkpty.3.html) creates
* a new process connected to a pseudoterminal from openpty().
*
* Returns 0 in the child/the pid of the child in the parent on success,
diff --git a/libc/include/sched.h b/libc/include/sched.h
index 9f043b6..e8f7736 100644
--- a/libc/include/sched.h
+++ b/libc/include/sched.h
@@ -45,42 +45,42 @@
*
* (Linux's name for POSIX's SCHED_OTHER.)
*
- * See [sched(7)](http://man7.org/linux/man-pages/man7/sched.7.html)
+ * See [sched(7)](https://man7.org/linux/man-pages/man7/sched.7.html)
*/
/*
* @def SCHED_FIFO
* The real-time first-in/first-out scheduling policy.
*
- * See [sched(7)](http://man7.org/linux/man-pages/man7/sched.7.html)
+ * See [sched(7)](https://man7.org/linux/man-pages/man7/sched.7.html)
*/
/*
* @def SCHED_RR
* The real-time round-robin policy. (See also SCHED_NORMAL/SCHED_OTHER.)
*
- * See [sched(7)](http://man7.org/linux/man-pages/man7/sched.7.html)
+ * See [sched(7)](https://man7.org/linux/man-pages/man7/sched.7.html)
*/
/*
* @def SCHED_BATCH
* The batch scheduling policy.
*
- * See [sched(7)](http://man7.org/linux/man-pages/man7/sched.7.html)
+ * See [sched(7)](https://man7.org/linux/man-pages/man7/sched.7.html)
*/
/*
* @def SCHED_IDLE
* The low priority "only when otherwise idle" scheduling priority.
*
- * See [sched(7)](http://man7.org/linux/man-pages/man7/sched.7.html)
+ * See [sched(7)](https://man7.org/linux/man-pages/man7/sched.7.html)
*/
/*
* @def SCHED_DEADLINE
* The deadline scheduling policy.
*
- * See [sched(7)](http://man7.org/linux/man-pages/man7/sched.7.html)
+ * See [sched(7)](https://man7.org/linux/man-pages/man7/sched.7.html)
*/
/*
@@ -116,7 +116,7 @@
int sched_getscheduler(pid_t __pid);
/**
- * [sched_yield(2)](http://man7.org/linux/man-pages/man2/sched_yield.2.html)
+ * [sched_yield(2)](https://man7.org/linux/man-pages/man2/sched_yield.2.html)
* voluntarily gives up using the CPU so that another thread can run.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -124,7 +124,7 @@
int sched_yield(void);
/**
- * [sched_get_priority_max(2)](http://man7.org/linux/man-pages/man2/sched_get_priority_max.2.html)
+ * [sched_get_priority_max(2)](https://man7.org/linux/man-pages/man2/sched_get_priority_max.2.html)
* gets the maximum priority value allowed for the given scheduling policy.
*
* Returns a priority on success and returns -1 and sets `errno` on failure.
@@ -132,7 +132,7 @@
int sched_get_priority_max(int __policy);
/**
- * [sched_get_priority_min(2)](http://man7.org/linux/man-pages/man2/sched_get_priority_min.2.html)
+ * [sched_get_priority_min(2)](https://man7.org/linux/man-pages/man2/sched_get_priority_min.2.html)
* gets the minimum priority value allowed for the given scheduling policy.
*
* Returns a priority on success and returns -1 and sets `errno` on failure.
@@ -140,7 +140,7 @@
int sched_get_priority_min(int __policy);
/**
- * [sched_setparam(2)](http://man7.org/linux/man-pages/man2/sched_setparam.2.html)
+ * [sched_setparam(2)](https://man7.org/linux/man-pages/man2/sched_setparam.2.html)
* sets the scheduling parameters for the given thread.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -148,7 +148,7 @@
int sched_setparam(pid_t __pid, const struct sched_param* _Nonnull __param);
/**
- * [sched_getparam(2)](http://man7.org/linux/man-pages/man2/sched_getparam.2.html)
+ * [sched_getparam(2)](https://man7.org/linux/man-pages/man2/sched_getparam.2.html)
* gets the scheduling parameters for the given thread.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -156,7 +156,7 @@
int sched_getparam(pid_t __pid, struct sched_param* _Nonnull __param);
/**
- * [sched_rr_get_interval(2)](http://man7.org/linux/man-pages/man2/sched_rr_get_interval.2.html)
+ * [sched_rr_get_interval(2)](https://man7.org/linux/man-pages/man2/sched_rr_get_interval.2.html)
* queries the round-robin time quantum for the given thread.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -166,7 +166,7 @@
#if defined(__USE_GNU)
/**
- * [clone(2)](http://man7.org/linux/man-pages/man2/clone.2.html)
+ * [clone(2)](https://man7.org/linux/man-pages/man2/clone.2.html)
* creates a new child process.
*
* Returns the pid of the child to the caller on success and
@@ -175,7 +175,7 @@
int clone(int (* __BIONIC_COMPLICATED_NULLNESS __fn)(void* __BIONIC_COMPLICATED_NULLNESS ), void* __BIONIC_COMPLICATED_NULLNESS __child_stack, int __flags, void* _Nullable __arg, ...);
/**
- * [unshare(2)](http://man7.org/linux/man-pages/man2/unshare.2.html)
+ * [unshare(2)](https://man7.org/linux/man-pages/man2/unshare.2.html)
* disassociates part of the caller's execution context.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -183,7 +183,7 @@
int unshare(int __flags);
/**
- * [setns(2)](http://man7.org/linux/man-pages/man2/setns.2.html)
+ * [setns(2)](https://man7.org/linux/man-pages/man2/setns.2.html)
* reassociates a thread with a different namespace.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -191,7 +191,7 @@
int setns(int __fd, int __ns_type);
/**
- * [sched_getcpu(3)](http://man7.org/linux/man-pages/man3/sched_getcpu.3.html)
+ * [sched_getcpu(3)](https://man7.org/linux/man-pages/man3/sched_getcpu.3.html)
* reports which CPU the caller is running on.
*
* Returns a non-negative CPU number on success and returns -1 and sets
@@ -219,7 +219,7 @@
} cpu_set_t;
/**
- * [sched_setaffinity(2)](http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html)
+ * [sched_setaffinity(2)](https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html)
* sets the CPU affinity mask for the given thread.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -227,7 +227,7 @@
int sched_setaffinity(pid_t __pid, size_t __set_size, const cpu_set_t* _Nonnull __set);
/**
- * [sched_getaffinity(2)](http://man7.org/linux/man-pages/man2/sched_getaffinity.2.html)
+ * [sched_getaffinity(2)](https://man7.org/linux/man-pages/man2/sched_getaffinity.2.html)
* gets the CPU affinity mask for the given thread.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
diff --git a/libc/include/search.h b/libc/include/search.h
index fe897d1..85e31ee 100644
--- a/libc/include/search.h
+++ b/libc/include/search.h
@@ -64,19 +64,19 @@
__BEGIN_DECLS
/**
- * [insque(3)](http://man7.org/linux/man-pages/man3/insque.3.html) inserts
+ * [insque(3)](https://man7.org/linux/man-pages/man3/insque.3.html) inserts
* an item in a queue (an intrusive doubly-linked list).
*/
void insque(void* _Nonnull __element, void* _Nullable __previous);
/**
- * [remque(3)](http://man7.org/linux/man-pages/man3/remque.3.html) removes
+ * [remque(3)](https://man7.org/linux/man-pages/man3/remque.3.html) removes
* an item from a queue (an intrusive doubly-linked list).
*/
void remque(void* _Nonnull __element);
/**
- * [hcreate(3)](http://man7.org/linux/man-pages/man3/hcreate.3.html)
+ * [hcreate(3)](https://man7.org/linux/man-pages/man3/hcreate.3.html)
* initializes the global hash table, with space for at least `__n` elements.
*
* See hcreate_r() if you need more than one hash table.
@@ -88,7 +88,7 @@
int hcreate(size_t __n) __INTRODUCED_IN(28);
/**
- * [hdestroy(3)](http://man7.org/linux/man-pages/man3/hdestroy.3.html) destroys
+ * [hdestroy(3)](https://man7.org/linux/man-pages/man3/hdestroy.3.html) destroys
* the global hash table.
*
* See hdestroy_r() if you need more than one hash table.
@@ -98,7 +98,7 @@
void hdestroy(void) __INTRODUCED_IN(28);
/**
- * [hsearch(3)](http://man7.org/linux/man-pages/man3/hsearch.3.html) finds or
+ * [hsearch(3)](https://man7.org/linux/man-pages/man3/hsearch.3.html) finds or
* inserts `__entry` in the global hash table, based on `__action`.
*
* See hsearch_r() if you need more than one hash table.
@@ -113,7 +113,7 @@
#if defined(__USE_BSD) || defined(__USE_GNU)
/**
- * [hcreate_r(3)](http://man7.org/linux/man-pages/man3/hcreate_r.3.html)
+ * [hcreate_r(3)](https://man7.org/linux/man-pages/man3/hcreate_r.3.html)
* initializes a hash table `__table` with space for at least `__n` elements.
*
* Returns *non-zero* on success and returns 0 and sets `errno` on failure.
@@ -123,7 +123,7 @@
int hcreate_r(size_t __n, struct hsearch_data* _Nonnull __table) __INTRODUCED_IN(28);
/**
- * [hdestroy_r(3)](http://man7.org/linux/man-pages/man3/hdestroy_r.3.html) destroys
+ * [hdestroy_r(3)](https://man7.org/linux/man-pages/man3/hdestroy_r.3.html) destroys
* the hash table `__table`.
*
* Available since API level 28.
@@ -131,7 +131,7 @@
void hdestroy_r(struct hsearch_data* _Nonnull __table) __INTRODUCED_IN(28);
/**
- * [hsearch_r(3)](http://man7.org/linux/man-pages/man3/hsearch_r.3.html) finds or
+ * [hsearch_r(3)](https://man7.org/linux/man-pages/man3/hsearch_r.3.html) finds or
* inserts `__entry` in the hash table `__table`, based on `__action`.
*
* Returns *non-zero* on success and returns 0 and sets `errno` on failure.
@@ -144,7 +144,7 @@
#endif
/**
- * [lfind(3)](http://man7.org/linux/man-pages/man3/lfind.3.html) brute-force
+ * [lfind(3)](https://man7.org/linux/man-pages/man3/lfind.3.html) brute-force
* searches the unsorted array `__array` (of `__count` items each of size `__size`)
* for `__key`, using `__comparator`.
*
@@ -155,7 +155,7 @@
void* _Nullable lfind(const void* _Nonnull __key, const void* _Nonnull __array, size_t* _Nonnull __count, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
- * [lsearch(3)](http://man7.org/linux/man-pages/man3/lsearch.3.html) brute-force
+ * [lsearch(3)](https://man7.org/linux/man-pages/man3/lsearch.3.html) brute-force
* searches the unsorted array `__array` (of `__count` items each of size `__size`)
* for `__key`, using `__comparator`.
*
@@ -168,7 +168,7 @@
void* _Nonnull lsearch(const void* _Nonnull __key, void* _Nonnull __array, size_t* _Nonnull __count, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
- * [tdelete(3)](http://man7.org/linux/man-pages/man3/tdelete.3.html) searches
+ * [tdelete(3)](https://man7.org/linux/man-pages/man3/tdelete.3.html) searches
* for and removes an element in the tree `*__root_ptr`. The search is performed
* using `__comparator`.
*
@@ -177,13 +177,13 @@
void* _Nullable tdelete(const void* _Nonnull __key, void* _Nullable * _Nullable __root_ptr, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
- * [tdestroy(3)](http://man7.org/linux/man-pages/man3/tdestroy.3.html) destroys
+ * [tdestroy(3)](https://man7.org/linux/man-pages/man3/tdestroy.3.html) destroys
* the hash table `__root` using `__free_fn` on each node.
*/
void tdestroy(void* _Nullable __root, void (* _Nullable __free_fn)(void* _Nullable));
/**
- * [tfind(3)](http://man7.org/linux/man-pages/man3/tfind.3.html) searches
+ * [tfind(3)](https://man7.org/linux/man-pages/man3/tfind.3.html) searches
* for an element in the tree `*__root_ptr`. The search is performed using
* `__comparator`.
*
@@ -192,7 +192,7 @@
void* _Nullable tfind(const void* _Nonnull __key, void* _Nullable const* _Nullable __root_ptr, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
- * [tsearch(3)](http://man7.org/linux/man-pages/man3/tsearch.3.html) searches
+ * [tsearch(3)](https://man7.org/linux/man-pages/man3/tsearch.3.html) searches
* for an element in the tree `*__root_ptr`. The search is performed using
* `__comparator`.
*
@@ -203,7 +203,7 @@
void* _Nullable tsearch(const void* _Nonnull __key, void* _Nullable * _Nullable __root_ptr, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
- * [twalk(3)](http://man7.org/linux/man-pages/man3/twalk.3.html) calls
+ * [twalk(3)](https://man7.org/linux/man-pages/man3/twalk.3.html) calls
* `__visitor` on every node in the tree.
*/
void twalk(const void* _Nullable __root, void (* _Nullable __visitor)(const void* _Nullable, VISIT, int));
diff --git a/libc/include/setjmp.h b/libc/include/setjmp.h
index 0aaaac5..6c141cb 100644
--- a/libc/include/setjmp.h
+++ b/libc/include/setjmp.h
@@ -111,7 +111,7 @@
__noreturn void longjmp(jmp_buf __env, int __value);
/**
- * [sigsetjmp(3)](http://man7.org/linux/man-pages/man3/sigsetjmp.3.html)
+ * [sigsetjmp(3)](https://man7.org/linux/man-pages/man3/sigsetjmp.3.html)
* sets the target of a future siglongjmp() call, saving or not saving the
* current signal mask based on the second argument.
*
@@ -121,7 +121,7 @@
int sigsetjmp(sigjmp_buf __env, int __save_signal_mask) __returns_twice;
/**
- * [siglongjmp(3)](http://man7.org/linux/man-pages/man3/siglongjmp.3.html)
+ * [siglongjmp(3)](https://man7.org/linux/man-pages/man3/siglongjmp.3.html)
* transfers control back to the site of the sigsetjmp() call that initialized
* the given jump buffer, returning the given value.
*
diff --git a/libc/include/signal.h b/libc/include/signal.h
index 9d47bcc..893fa9d 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -122,6 +122,34 @@
int sigwaitinfo(const sigset_t* _Nonnull __set, siginfo_t* _Nullable __info) __INTRODUCED_IN(23);
int sigwaitinfo64(const sigset64_t* _Nonnull __set, siginfo_t* _Nullable __info) __INTRODUCED_IN(28);
+/**
+ * Buffer size suitable for any call to sig2str().
+ */
+#define SIG2STR_MAX 32
+
+/**
+ * [sig2str(3)](https://man7.org/linux/man-pages/man3/sig2str.3.html)
+ * converts the integer corresponding to SIGSEGV (say) into a string
+ * like "SEGV" (not including the "SIG" used in the constants).
+ * SIG2STR_MAX is a safe size to use for the buffer.
+ *
+ * Returns 0 on success, and returns -1 _without_ setting errno otherwise.
+ *
+ * Available since API level 36.
+ */
+int sig2str(int __signal, char* _Nonnull __buf) __INTRODUCED_IN(36);
+
+/**
+ * [str2sig(3)](https://man7.org/linux/man-pages/man3/str2sig.3.html)
+ * converts a string like "SEGV" (not including the "SIG" used in the constants)
+ * into the integer corresponding to SIGSEGV.
+ *
+ * Returns 0 on success, and returns -1 _without_ setting errno otherwise.
+ *
+ * Available since API level 36.
+ */
+int str2sig(const char* _Nonnull __name, int* _Nonnull __signal) __INTRODUCED_IN(36);
+
__END_DECLS
#endif
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 279c658..d99d032 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -154,7 +154,7 @@
__warnattr("tempnam is unsafe, use mkstemp or tmpfile instead");
/**
- * [rename(2)](http://man7.org/linux/man-pages/man2/rename.2.html) changes
+ * [rename(2)](https://man7.org/linux/man-pages/man2/rename.2.html) changes
* the name or location of a file.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -162,7 +162,7 @@
int rename(const char* _Nonnull __old_path, const char* _Nonnull __new_path);
/**
- * [renameat(2)](http://man7.org/linux/man-pages/man2/renameat.2.html) changes
+ * [renameat(2)](https://man7.org/linux/man-pages/man2/renameat.2.html) changes
* the name or location of a file, interpreting relative paths using an fd.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -172,25 +172,25 @@
#if defined(__USE_GNU)
/**
- * Flag for [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html)
+ * Flag for [renameat2(2)](https://man7.org/linux/man-pages/man2/renameat2.2.html)
* to fail if the new path already exists.
*/
#define RENAME_NOREPLACE (1<<0)
/**
- * Flag for [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html)
+ * Flag for [renameat2(2)](https://man7.org/linux/man-pages/man2/renameat2.2.html)
* to atomically exchange the two paths.
*/
#define RENAME_EXCHANGE (1<<1)
/**
- * Flag for [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html)
+ * Flag for [renameat2(2)](https://man7.org/linux/man-pages/man2/renameat2.2.html)
* to create a union/overlay filesystem object.
*/
#define RENAME_WHITEOUT (1<<2)
/**
- * [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html) changes
+ * [renameat2(2)](https://man7.org/linux/man-pages/man2/renameat2.2.html) changes
* the name or location of a file, interpreting relative paths using an fd,
* with optional `RENAME_` flags.
*
diff --git a/libc/include/stdio_ext.h b/libc/include/stdio_ext.h
index 8b106a6..d426a4a 100644
--- a/libc/include/stdio_ext.h
+++ b/libc/include/stdio_ext.h
@@ -39,7 +39,7 @@
__BEGIN_DECLS
/**
- * [__fbufsize(3)](http://man7.org/linux/man-pages/man3/__fbufsize.3.html) returns the size of
+ * [__fbufsize(3)](https://man7.org/linux/man-pages/man3/__fbufsize.3.html) returns the size of
* the stream's buffer.
*
* Available since API level 23.
@@ -47,7 +47,7 @@
size_t __fbufsize(FILE* _Nonnull __fp) __INTRODUCED_IN(23);
/**
- * [__freadable(3)](http://man7.org/linux/man-pages/man3/__freadable.3.html) returns non-zero if
+ * [__freadable(3)](https://man7.org/linux/man-pages/man3/__freadable.3.html) returns non-zero if
* the stream allows reading, 0 otherwise.
*
* Available since API level 23.
@@ -55,7 +55,7 @@
int __freadable(FILE* _Nonnull __fp) __INTRODUCED_IN(23);
/**
- * [__freading(3)](http://man7.org/linux/man-pages/man3/__freading.3.html) returns non-zero if
+ * [__freading(3)](https://man7.org/linux/man-pages/man3/__freading.3.html) returns non-zero if
* the stream's last operation was a read, 0 otherwise.
*
* Available since API level 28.
@@ -63,7 +63,7 @@
int __freading(FILE* _Nonnull __fp) __INTRODUCED_IN(28);
/**
- * [__fwritable(3)](http://man7.org/linux/man-pages/man3/__fwritable.3.html) returns non-zero if
+ * [__fwritable(3)](https://man7.org/linux/man-pages/man3/__fwritable.3.html) returns non-zero if
* the stream allows writing, 0 otherwise.
*
* Available since API level 23.
@@ -71,7 +71,7 @@
int __fwritable(FILE* _Nonnull __fp) __INTRODUCED_IN(23);
/**
- * [__fwriting(3)](http://man7.org/linux/man-pages/man3/__fwriting.3.html) returns non-zero if
+ * [__fwriting(3)](https://man7.org/linux/man-pages/man3/__fwriting.3.html) returns non-zero if
* the stream's last operation was a write, 0 otherwise.
*
* Available since API level 28.
@@ -79,7 +79,7 @@
int __fwriting(FILE* _Nonnull __fp) __INTRODUCED_IN(28);
/**
- * [__flbf(3)](http://man7.org/linux/man-pages/man3/__flbf.3.html) returns non-zero if
+ * [__flbf(3)](https://man7.org/linux/man-pages/man3/__flbf.3.html) returns non-zero if
* the stream is line-buffered, 0 otherwise.
*
* Available since API level 23.
@@ -87,15 +87,13 @@
int __flbf(FILE* _Nonnull __fp) __INTRODUCED_IN(23);
/**
- * [__fpurge(3)](http://man7.org/linux/man-pages/man3/__fpurge.3.html) discards the contents of
+ * [__fpurge(3)](https://man7.org/linux/man-pages/man3/__fpurge.3.html) discards the contents of
* the stream's buffer.
- *
- * Available since API level 23.
*/
-void __fpurge(FILE* _Nonnull __fp) __INTRODUCED_IN(23);
+void __fpurge(FILE* _Nonnull __fp) __RENAME(fpurge);
/**
- * [__fpending(3)](http://man7.org/linux/man-pages/man3/__fpending.3.html) returns the number of
+ * [__fpending(3)](https://man7.org/linux/man-pages/man3/__fpending.3.html) returns the number of
* bytes in the output buffer. See __freadahead() for the input buffer.
*
* Available since API level 23.
@@ -111,7 +109,7 @@
size_t __freadahead(FILE* _Nonnull __fp) __INTRODUCED_IN(34);
/**
- * [_flushlbf(3)](http://man7.org/linux/man-pages/man3/_flushlbf.3.html) flushes all
+ * [_flushlbf(3)](https://man7.org/linux/man-pages/man3/_flushlbf.3.html) flushes all
* line-buffered streams.
*
* Available since API level 23.
@@ -134,7 +132,7 @@
#define FSETLOCKING_BYCALLER 2
/**
- * [__fsetlocking(3)](http://man7.org/linux/man-pages/man3/__fsetlocking.3.html) sets the
+ * [__fsetlocking(3)](https://man7.org/linux/man-pages/man3/__fsetlocking.3.html) sets the
* stream's locking mode to one of the `FSETLOCKING_` types.
*
* Returns the current locking style, `FSETLOCKING_INTERNAL` or `FSETLOCKING_BYCALLER`.
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index b160e6b..7c376d0 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -89,7 +89,7 @@
__wur char* _Nullable realpath(const char* _Nonnull __path, char* _Nullable __resolved);
/**
- * [system(3)](http://man7.org/linux/man-pages/man3/system.3.html) executes
+ * [system(3)](https://man7.org/linux/man-pages/man3/system.3.html) executes
* the given command in a new shell process.
*
* On Android, the special case of `system(NULL)` always returns 1,
@@ -100,13 +100,13 @@
* or permanently (for lack of permission, say).
*
* Returns -1 and sets errno if process creation fails; returns a
- * [waitpid(2)](http://man7.org/linux/man-pages/man2/waitpid.2.html)
+ * [waitpid(2)](https://man7.org/linux/man-pages/man2/waitpid.2.html)
* status otherwise.
*/
int system(const char* _Nonnull __command);
/**
- * [bsearch(3)](http://man7.org/linux/man-pages/man3/bsearch.3.html) searches
+ * [bsearch(3)](https://man7.org/linux/man-pages/man3/bsearch.3.html) searches
* a sorted array.
*
* Returns a pointer to a matching item on success,
@@ -115,13 +115,13 @@
__wur void* _Nullable bsearch(const void* _Nonnull __key, const void* _Nullable __base, size_t __nmemb, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull __lhs, const void* _Nonnull __rhs));
/**
- * [qsort(3)](http://man7.org/linux/man-pages/man3/qsort.3.html) sorts an array
+ * [qsort(3)](https://man7.org/linux/man-pages/man3/qsort.3.html) sorts an array
* of n elements each of the given size, using the given comparator.
*/
void qsort(void* _Nullable __array, size_t __n, size_t __size, int (* _Nonnull __comparator)(const void* _Nullable __lhs, const void* _Nullable __rhs));
/**
- * [qsort_r(3)](http://man7.org/linux/man-pages/man3/qsort_r.3.html) sorts an
+ * [qsort_r(3)](https://man7.org/linux/man-pages/man3/qsort_r.3.html) sorts an
* array of n elements each of the given size, using the given comparator,
* and passing the given context argument to the comparator.
*
@@ -180,7 +180,7 @@
lldiv_t lldiv(long long __numerator, long long __denominator) __attribute_const__;
/**
- * [getloadavg(3)](http://man7.org/linux/man-pages/man3/getloadavg.3.html) queries the
+ * [getloadavg(3)](https://man7.org/linux/man-pages/man3/getloadavg.3.html) queries the
* number of runnable processes averaged over time. The Linux kernel supports averages
* over the last 1, 5, and 15 minutes.
*
@@ -192,7 +192,7 @@
const char* _Nullable getprogname(void);
void setprogname(const char* _Nonnull __name);
-int mblen(const char* _Nullable __s, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
+int mblen(const char* _Nullable __s, size_t __n) __INTRODUCED_IN(26);
size_t mbstowcs(wchar_t* _Nullable __dst, const char* _Nullable __src, size_t __n);
int mbtowc(wchar_t* _Nullable __wc_ptr, const char* _Nullable __s, size_t __n);
int wctomb(char* _Nullable __dst, wchar_t __wc);
diff --git a/libc/include/string.h b/libc/include/string.h
index a67df4c..0df534c 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -57,7 +57,7 @@
void* _Nonnull memmove(void* _Nonnull __dst, const void* _Nonnull __src, size_t __n);
/**
- * [memset(3)](http://man7.org/linux/man-pages/man3/memset.3.html) writes the
+ * [memset(3)](https://man7.org/linux/man-pages/man3/memset.3.html) writes the
* bottom 8 bits of the given int to the next `n` bytes of `dst`.
*
* Returns `dst`.
@@ -65,7 +65,7 @@
void* _Nonnull memset(void* _Nonnull __dst, int __ch, size_t __n);
/**
- * [memset_explicit(3)](http://man7.org/linux/man-pages/man3/memset_explicit.3.html)
+ * [memset_explicit(3)](https://man7.org/linux/man-pages/man3/memset_explicit.3.html)
* writes the bottom 8 bits of the given int to the next `n` bytes of `dst`,
* but won't be optimized out by the compiler.
*
@@ -117,7 +117,7 @@
#endif
/**
- * [strerrorname_np(3)](http://man7.org/linux/man-pages/man3/strerrordesc_np.3.html)
+ * [strerrorname_np(3)](https://man7.org/linux/man-pages/man3/strerrordesc_np.3.html)
* returns the name of the errno constant corresponding to its argument.
* `strerrorname_np(38)` would return "ENOSYS", because `ENOSYS` is errno 38. This
* is mostly useful for error reporting in cases where a string like "ENOSYS" is
@@ -133,7 +133,7 @@
#endif
/**
- * [strerrordesc_np(3)](http://man7.org/linux/man-pages/man3/strerrordesc_np.3.html)
+ * [strerrordesc_np(3)](https://man7.org/linux/man-pages/man3/strerrordesc_np.3.html)
* is like strerror() but without localization. Since Android's strerror()
* does not localize, this is the same as strerror() on Android.
*
diff --git a/libc/include/strings.h b/libc/include/strings.h
index 4b8cc08..d203bd2 100644
--- a/libc/include/strings.h
+++ b/libc/include/strings.h
@@ -72,7 +72,7 @@
}
/**
- * [ffs(3)](http://man7.org/linux/man-pages/man3/ffs.3.html) finds the
+ * [ffs(3)](https://man7.org/linux/man-pages/man3/ffs.3.html) finds the
* first set bit in `__n`.
*
* Returns 0 if no bit is set, or the index of the lowest set bit (counting
@@ -83,7 +83,7 @@
}
/**
- * [ffsl(3)](http://man7.org/linux/man-pages/man3/ffsl.3.html) finds the
+ * [ffsl(3)](https://man7.org/linux/man-pages/man3/ffsl.3.html) finds the
* first set bit in `__n`.
*
* Returns 0 if no bit is set, or the index of the lowest set bit (counting
@@ -94,7 +94,7 @@
}
/**
- * [ffsll(3)](http://man7.org/linux/man-pages/man3/ffsll.3.html) finds the
+ * [ffsll(3)](https://man7.org/linux/man-pages/man3/ffsll.3.html) finds the
* first set bit in `__n`.
*
* Returns 0 if no bit is set, or the index of the lowest set bit (counting
diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h
index 05612b3..12cafec 100644
--- a/libc/include/sys/_system_properties.h
+++ b/libc/include/sys/_system_properties.h
@@ -1,172 +1 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <sys/cdefs.h>
-#include <stdint.h>
-
-#ifndef _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#error you should #include <sys/system_properties.h> instead
-#endif
-
#include <sys/system_properties.h>
-
-__BEGIN_DECLS
-
-/**
- * Reads the global serial number of the system properties _area_.
- *
- * Called to predict if a series of cached __system_property_find()
- * objects will have seen __system_property_serial() values change.
- * Also aids the converse, as changes in the global serial can
- * also be used to predict if a failed __system_property_find()
- * could in turn now find a new object; thus preventing the
- * cycles of effort to poll __system_property_find().
- *
- * Typically called at beginning of a cache cycle to signal if _any_ possible
- * changes have occurred since last. If there is, one may check each individual
- * __system_property_serial() to confirm dirty, or __system_property_find()
- * to check if the property now exists. If a call to __system_property_add()
- * or __system_property_update() has completed between two calls to
- * __system_property_area_serial() then the second call will return a larger
- * value than the first call. Beware of race conditions as changes to the
- * properties are not atomic, the main value of this call is to determine
- * whether the expensive __system_property_find() is worth retrying to see if
- * a property now exists.
- *
- * Returns the serial number on success, -1 on error.
- */
-uint32_t __system_property_area_serial(void);
-
-/**
- * Reads the serial number of a specific system property previously returned by
- * __system_property_find(). This is a cheap way to check whether a system
- * property has changed or not.
- *
- * Returns the serial number on success, -1 on error.
- */
-uint32_t __system_property_serial(const prop_info* _Nonnull __pi);
-
-//
-// libc implementation detail.
-//
-
-/**
- * Initializes the system properties area in read-only mode.
- *
- * This is called automatically during libc initialization,
- * so user code should never need to call this.
- *
- * Returns 0 on success, -1 otherwise.
- */
-int __system_properties_init(void);
-
-//
-// init implementation details.
-//
-
-#define PROP_SERVICE_NAME "property_service"
-#define PROP_SERVICE_FOR_SYSTEM_NAME "property_service_for_system"
-#define PROP_DIRNAME "/dev/__properties__"
-
-// Messages sent to init.
-#define PROP_MSG_SETPROP 1
-#define PROP_MSG_SETPROP2 0x00020001
-
-// Status codes returned by init (but not passed from libc to the caller).
-#define PROP_SUCCESS 0
-#define PROP_ERROR_READ_CMD 0x0004
-#define PROP_ERROR_READ_DATA 0x0008
-#define PROP_ERROR_READ_ONLY_PROPERTY 0x000B
-#define PROP_ERROR_INVALID_NAME 0x0010
-#define PROP_ERROR_INVALID_VALUE 0x0014
-#define PROP_ERROR_PERMISSION_DENIED 0x0018
-#define PROP_ERROR_INVALID_CMD 0x001B
-#define PROP_ERROR_HANDLE_CONTROL_MESSAGE 0x0020
-#define PROP_ERROR_SET_FAILED 0x0024
-
-/**
- * Initializes the area to be used to store properties.
- *
- * Can only be done by the process that has write access to the property area,
- * typically init.
- *
- * See __system_properties_init() for the equivalent for all other processes.
- */
-int __system_property_area_init(void);
-
-/**
- * Adds a new system property.
- * Can only be done by the process that has write access to the property area --
- * typically init -- which must handle sequencing to ensure that only one property is
- * updated at a time.
- *
- * Returns 0 on success, -1 if the property area is full.
- */
-int __system_property_add(const char* _Nonnull __name, unsigned int __name_length, const char* _Nonnull __value, unsigned int __value_length);
-
-/**
- * Updates the value of a system property returned by __system_property_find().
- * Can only be done by the process that has write access to the property area --
- * typically init -- which must handle sequencing to ensure that only one property is
- * updated at a time.
- *
- * Returns 0 on success, -1 if the parameters are incorrect.
- */
-int __system_property_update(prop_info* _Nonnull __pi, const char* _Nonnull __value, unsigned int __value_length);
-
-/**
- * Reloads the system properties from disk.
- * Not intended for use by any apps except the Zygote.
- * Should only be called from the main thread.
- *
- * Pointers received from functions such as __system_property_find()
- * may be invalidated by calls to this function.
- *
- * Returns 0 on success, -1 otherwise.
- *
- * Available since API level 35.
- */
-int __system_properties_zygote_reload(void) __INTRODUCED_IN(35);
-
-//
-// Deprecated functions.
-//
-
-/** Deprecated: use __system_property_wait instead. */
-uint32_t __system_property_wait_any(uint32_t __old_serial);
-
-/**
- * Deprecated: previously for testing, but now that SystemProperties is its own
- * testable class, there is never a reason to call this function and its
- * implementation simply returns -1.
- */
-int __system_property_set_filename(const char* __unused __filename);
-
-__END_DECLS
diff --git a/libc/include/sys/auxv.h b/libc/include/sys/auxv.h
index b664e2a..732f944 100644
--- a/libc/include/sys/auxv.h
+++ b/libc/include/sys/auxv.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [getauxval(3)](http://man7.org/linux/man-pages/man3/getauxval.3.html) returns values from
+ * [getauxval(3)](https://man7.org/linux/man-pages/man3/getauxval.3.html) returns values from
* the ELF auxiliary vector passed by the kernel.
*
* Returns the corresponding value on success,
diff --git a/libc/include/sys/capability.h b/libc/include/sys/capability.h
index b43bbf0..3d1d896 100644
--- a/libc/include/sys/capability.h
+++ b/libc/include/sys/capability.h
@@ -39,7 +39,7 @@
__BEGIN_DECLS
/**
- * [capget(2)](http://man7.org/linux/man-pages/man2/capget.2.html) gets the calling
+ * [capget(2)](https://man7.org/linux/man-pages/man2/capget.2.html) gets the calling
* thread's capabilities.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -47,7 +47,7 @@
int capget(cap_user_header_t _Nonnull __hdr_ptr, cap_user_data_t _Nullable __data_ptr);
/**
- * [capset(2)](http://man7.org/linux/man-pages/man2/capset.2.html) sets the calling
+ * [capset(2)](https://man7.org/linux/man-pages/man2/capset.2.html) sets the calling
* thread's capabilities.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/epoll.h b/libc/include/sys/epoll.h
index 2bad655..a5e3c14 100644
--- a/libc/include/sys/epoll.h
+++ b/libc/include/sys/epoll.h
@@ -42,8 +42,8 @@
__BEGIN_DECLS
/**
- * [epoll_create(2)](http://man7.org/linux/man-pages/man2/epoll_create.2.html)
- * creates a new [epoll](http://man7.org/linux/man-pages/man7/epoll.7.html)
+ * [epoll_create(2)](https://man7.org/linux/man-pages/man2/epoll_create.2.html)
+ * creates a new [epoll](https://man7.org/linux/man-pages/man7/epoll.7.html)
* file descriptor.
*
* Returns a new file descriptor on success and returns -1 and sets `errno` on
@@ -52,8 +52,8 @@
int epoll_create(int __size);
/**
- * [epoll_create1(2)](http://man7.org/linux/man-pages/man2/epoll_create1.2.html)
- * creates a new [epoll](http://man7.org/linux/man-pages/man7/epoll.7.html)
+ * [epoll_create1(2)](https://man7.org/linux/man-pages/man2/epoll_create1.2.html)
+ * creates a new [epoll](https://man7.org/linux/man-pages/man7/epoll.7.html)
* file descriptor with the given flags.
*
* Returns a new file descriptor on success and returns -1 and sets `errno` on
@@ -62,7 +62,7 @@
int epoll_create1(int __flags);
/**
- * [epoll_ctl(2)](http://man7.org/linux/man-pages/man2/epoll_ctl.2.html)
+ * [epoll_ctl(2)](https://man7.org/linux/man-pages/man2/epoll_ctl.2.html)
* adds/modifies/removes file descriptors from the given epoll file descriptor.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -70,7 +70,7 @@
int epoll_ctl(int __epoll_fd, int __op, int __fd, struct epoll_event* __BIONIC_COMPLICATED_NULLNESS __event);
/**
- * [epoll_wait(2)](http://man7.org/linux/man-pages/man2/epoll_wait.2.html)
+ * [epoll_wait(2)](https://man7.org/linux/man-pages/man2/epoll_wait.2.html)
* waits for an event on the given epoll file descriptor.
*
* Returns the number of ready file descriptors on success, 0 on timeout,
diff --git a/libc/include/sys/eventfd.h b/libc/include/sys/eventfd.h
index 1ad11e3..b9d3fe9 100644
--- a/libc/include/sys/eventfd.h
+++ b/libc/include/sys/eventfd.h
@@ -46,7 +46,7 @@
#define EFD_NONBLOCK O_NONBLOCK
/**
- * [eventfd(2)](http://man7.org/linux/man-pages/man2/eventfd.2.html) creates a file descriptor
+ * [eventfd(2)](https://man7.org/linux/man-pages/man2/eventfd.2.html) creates a file descriptor
* for event notification.
*
* Returns a new file descriptor on success, and returns -1 and sets `errno` on failure.
@@ -57,7 +57,7 @@
typedef uint64_t eventfd_t;
/**
- * [eventfd_read(3)](http://man7.org/linux/man-pages/man2/eventfd.2.html) is a convenience
+ * [eventfd_read(3)](https://man7.org/linux/man-pages/man2/eventfd.2.html) is a convenience
* wrapper to read an `eventfd_t` from an eventfd file descriptor.
*
* Returns 0 on success, or returns -1 otherwise.
@@ -65,7 +65,7 @@
int eventfd_read(int __fd, eventfd_t* _Nonnull __value);
/**
- * [eventfd_write(3)](http://man7.org/linux/man-pages/man2/eventfd.2.html) is a convenience
+ * [eventfd_write(3)](https://man7.org/linux/man-pages/man2/eventfd.2.html) is a convenience
* wrapper to write an `eventfd_t` to an eventfd file descriptor.
*
* Returns 0 on success, or returns -1 otherwise.
diff --git a/libc/include/sys/file.h b/libc/include/sys/file.h
index ccdfeea..45117fa 100644
--- a/libc/include/sys/file.h
+++ b/libc/include/sys/file.h
@@ -41,7 +41,7 @@
__BEGIN_DECLS
/**
- * [flock(2)](http://man7.org/linux/man-pages/man2/flock.2.html) performs
+ * [flock(2)](https://man7.org/linux/man-pages/man2/flock.2.html) performs
* advisory file lock operations.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/fsuid.h b/libc/include/sys/fsuid.h
index 273749f..eeb5783 100644
--- a/libc/include/sys/fsuid.h
+++ b/libc/include/sys/fsuid.h
@@ -39,7 +39,7 @@
__BEGIN_DECLS
/**
- * [setfsuid(2)](http://man7.org/linux/man-pages/man2/setfsuid.2.html) sets the UID used for
+ * [setfsuid(2)](https://man7.org/linux/man-pages/man2/setfsuid.2.html) sets the UID used for
* filesystem checks.
*
* Returns the previous UID.
@@ -47,7 +47,7 @@
int setfsuid(uid_t __uid);
/**
- * [setfsgid(2)](http://man7.org/linux/man-pages/man2/setfsgid.2.html) sets the GID used for
+ * [setfsgid(2)](https://man7.org/linux/man-pages/man2/setfsgid.2.html) sets the GID used for
* filesystem checks.
*
* Returns the previous GID.
diff --git a/libc/include/sys/io.h b/libc/include/sys/io.h
index d187b78..11f3f3a 100644
--- a/libc/include/sys/io.h
+++ b/libc/include/sys/io.h
@@ -42,7 +42,7 @@
__BEGIN_DECLS
/**
- * [iopl(2)](http://man7.org/linux/man-pages/man2/iopl.2.html) changes the I/O
+ * [iopl(2)](https://man7.org/linux/man-pages/man2/iopl.2.html) changes the I/O
* privilege level for all x86/x8-64 I/O ports, for the calling thread.
*
* New callers should use ioperm() instead.
@@ -58,7 +58,7 @@
#endif
/**
- * [ioperm(2)](http://man7.org/linux/man-pages/man2/ioperm.2.html) sets the I/O
+ * [ioperm(2)](https://man7.org/linux/man-pages/man2/ioperm.2.html) sets the I/O
* permissions for the given number of x86/x86-64 I/O ports, starting at the
* given port.
*
diff --git a/libc/include/sys/ipc.h b/libc/include/sys/ipc.h
index 2e2b8cf..f557ce5 100644
--- a/libc/include/sys/ipc.h
+++ b/libc/include/sys/ipc.h
@@ -47,7 +47,7 @@
__BEGIN_DECLS
/**
- * [ftok(3)](http://man7.org/linux/man-pages/man3/ftok.3.html) converts a path and id to a
+ * [ftok(3)](https://man7.org/linux/man-pages/man3/ftok.3.html) converts a path and id to a
* System V IPC key.
*
* Returns a key on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/klog.h b/libc/include/sys/klog.h
index b60c2c4..237d2e2 100644
--- a/libc/include/sys/klog.h
+++ b/libc/include/sys/klog.h
@@ -61,7 +61,7 @@
#define KLOG_SIZE_BUFFER 10
/**
- * [klogctl(2)](http://man7.org/linux/man-pages/man2/syslog.2.html) operates on the kernel log.
+ * [klogctl(2)](https://man7.org/linux/man-pages/man2/syslog.2.html) operates on the kernel log.
*
* This system call is not available to applications.
* Use syslog() or `<android/log.h>` instead.
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index 823c9ba..1a0e7f6 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -43,7 +43,7 @@
#define MAP_FAILED __BIONIC_CAST(reinterpret_cast, void*, -1)
/**
- * [mmap(2)](http://man7.org/linux/man-pages/man2/mmap.2.html)
+ * [mmap(2)](https://man7.org/linux/man-pages/man2/mmap.2.html)
* creates a memory mapping for the given range.
*
* Returns the address of the mapping on success,
@@ -63,7 +63,7 @@
void* _Nonnull mmap64(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off64_t __offset);
/**
- * [munmap(2)](http://man7.org/linux/man-pages/man2/munmap.2.html)
+ * [munmap(2)](https://man7.org/linux/man-pages/man2/munmap.2.html)
* deletes a memory mapping for the given range.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -71,7 +71,7 @@
int munmap(void* _Nonnull __addr, size_t __size);
/**
- * [msync(2)](http://man7.org/linux/man-pages/man2/msync.2.html)
+ * [msync(2)](https://man7.org/linux/man-pages/man2/msync.2.html)
* flushes changes to a memory-mapped file to disk.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -79,7 +79,7 @@
int msync(void* _Nonnull __addr, size_t __size, int __flags);
/**
- * [mprotect(2)](http://man7.org/linux/man-pages/man2/mprotect.2.html)
+ * [mprotect(2)](https://man7.org/linux/man-pages/man2/mprotect.2.html)
* sets the protection on a memory region.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -93,7 +93,7 @@
#define MREMAP_FIXED 2
/**
- * [mremap(2)](http://man7.org/linux/man-pages/man2/mremap.2.html)
+ * [mremap(2)](https://man7.org/linux/man-pages/man2/mremap.2.html)
* expands or shrinks an existing memory mapping.
*
* Returns the address of the mapping on success,
@@ -102,7 +102,7 @@
void* _Nonnull mremap(void* _Nonnull __old_addr, size_t __old_size, size_t __new_size, int __flags, ...);
/**
- * [mlockall(2)](http://man7.org/linux/man-pages/man2/mlockall.2.html)
+ * [mlockall(2)](https://man7.org/linux/man-pages/man2/mlockall.2.html)
* locks pages (preventing swapping).
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -110,7 +110,7 @@
int mlockall(int __flags);
/**
- * [munlockall(2)](http://man7.org/linux/man-pages/man2/munlockall.2.html)
+ * [munlockall(2)](https://man7.org/linux/man-pages/man2/munlockall.2.html)
* unlocks pages (allowing swapping).
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -118,7 +118,7 @@
int munlockall(void);
/**
- * [mlock(2)](http://man7.org/linux/man-pages/man2/mlock.2.html)
+ * [mlock(2)](https://man7.org/linux/man-pages/man2/mlock.2.html)
* locks pages (preventing swapping).
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -126,7 +126,7 @@
int mlock(const void* _Nonnull __addr, size_t __size);
/**
- * [mlock2(2)](http://man7.org/linux/man-pages/man2/mlock.2.html)
+ * [mlock2(2)](https://man7.org/linux/man-pages/man2/mlock.2.html)
* locks pages (preventing swapping), with optional flags.
*
* Available since API level 30.
@@ -136,7 +136,7 @@
int mlock2(const void* _Nonnull __addr, size_t __size, int __flags) __INTRODUCED_IN(30);
/**
- * [munlock(2)](http://man7.org/linux/man-pages/man2/munlock.2.html)
+ * [munlock(2)](https://man7.org/linux/man-pages/man2/munlock.2.html)
* unlocks pages (allowing swapping).
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -144,7 +144,7 @@
int munlock(const void* _Nonnull __addr, size_t __size);
/**
- * [mincore(2)](http://man7.org/linux/man-pages/man2/mincore.2.html)
+ * [mincore(2)](https://man7.org/linux/man-pages/man2/mincore.2.html)
* tests whether pages are resident in memory.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -152,7 +152,7 @@
int mincore(void* _Nonnull __addr, size_t __size, unsigned char* _Nonnull __vector);
/**
- * [madvise(2)](http://man7.org/linux/man-pages/man2/madvise.2.html)
+ * [madvise(2)](https://man7.org/linux/man-pages/man2/madvise.2.html)
* gives the kernel advice about future usage patterns.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -160,7 +160,7 @@
int madvise(void* _Nonnull __addr, size_t __size, int __advice);
/**
- * [process_madvise(2)](http://man7.org/linux/man-pages/man2/process_madvise.2.html)
+ * [process_madvise(2)](https://man7.org/linux/man-pages/man2/process_madvise.2.html)
* works just like madvise(2) but applies to the process specified by the given
* PID file descriptor.
*
@@ -176,7 +176,7 @@
#if defined(__USE_GNU)
/**
- * [memfd_create(2)](http://man7.org/linux/man-pages/man2/memfd_create.2.html)
+ * [memfd_create(2)](https://man7.org/linux/man-pages/man2/memfd_create.2.html)
* creates an anonymous file.
*
* Available since API level 30.
@@ -212,7 +212,7 @@
#endif
/**
- * [posix_madvise(3)](http://man7.org/linux/man-pages/man3/posix_madvise.3.html)
+ * [posix_madvise(3)](https://man7.org/linux/man-pages/man3/posix_madvise.3.html)
* gives the kernel advice about future usage patterns.
*
* Available since API level 23.
@@ -222,4 +222,16 @@
*/
int posix_madvise(void* _Nonnull __addr, size_t __size, int __advice) __INTRODUCED_IN(23);
+/**
+ * [mseal(2)](https://man7.org/linux/man-pages/man2/mseal.2.html)
+ * seals the given range to prevent modifications such as mprotect() calls.
+ *
+ * Available since API level 36.
+ * Requires a Linux 6.10 or newer kernel.
+ * Always fails for 32-bit processes.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
+int mseal(void* _Nonnull __addr, size_t __size, unsigned long __flags) __INTRODUCED_IN(36);
+
__END_DECLS
diff --git a/libc/include/sys/mount.h b/libc/include/sys/mount.h
index aace205..0880c98 100644
--- a/libc/include/sys/mount.h
+++ b/libc/include/sys/mount.h
@@ -50,7 +50,7 @@
#define UMOUNT_NOFOLLOW 8
/**
- * [mount(2)](http://man7.org/linux/man-pages/man2/mount.2.html) mounts the filesystem `source` at
+ * [mount(2)](https://man7.org/linux/man-pages/man2/mount.2.html) mounts the filesystem `source` at
* the mount point `target`.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -58,7 +58,7 @@
int mount(const char* __BIONIC_COMPLICATED_NULLNESS __source, const char* _Nonnull __target, const char* __BIONIC_COMPLICATED_NULLNESS __fs_type, unsigned long __flags, const void* _Nullable __data);
/**
- * [umount(2)](http://man7.org/linux/man-pages/man2/umount.2.html) unmounts the filesystem at
+ * [umount(2)](https://man7.org/linux/man-pages/man2/umount.2.html) unmounts the filesystem at
* the given mount point.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -66,7 +66,7 @@
int umount(const char* _Nonnull __target);
/**
- * [umount2(2)](http://man7.org/linux/man-pages/man2/umount2.2.html) unmounts the filesystem at
+ * [umount2(2)](https://man7.org/linux/man-pages/man2/umount2.2.html) unmounts the filesystem at
* the given mount point, according to the supplied flags.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/personality.h b/libc/include/sys/personality.h
index 9eb992f..34d1a1a 100644
--- a/libc/include/sys/personality.h
+++ b/libc/include/sys/personality.h
@@ -39,7 +39,7 @@
__BEGIN_DECLS
/**
- * [personality(2)](http://man7.org/linux/man-pages/man2/personality.2.html) sets the calling
+ * [personality(2)](https://man7.org/linux/man-pages/man2/personality.2.html) sets the calling
* process' personality.
*
* Returns the previous persona on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/prctl.h b/libc/include/sys/prctl.h
index 1c80415..4e0b4b5 100644
--- a/libc/include/sys/prctl.h
+++ b/libc/include/sys/prctl.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [prctl(2)](http://man7.org/linux/man-pages/man2/prctl.2.html) performs a variety of
+ * [prctl(2)](https://man7.org/linux/man-pages/man2/prctl.2.html) performs a variety of
* operations based on the `PR_` constant passed as the first argument.
*
* Returns -1 and sets `errno` on failure; success values vary by option.
diff --git a/libc/include/sys/quota.h b/libc/include/sys/quota.h
index 37f8925..6e32705 100644
--- a/libc/include/sys/quota.h
+++ b/libc/include/sys/quota.h
@@ -45,7 +45,7 @@
__BEGIN_DECLS
/**
- * [quotactl(2)](http://man7.org/linux/man-pages/man2/quotactl.2.html) manipulates disk quotas.
+ * [quotactl(2)](https://man7.org/linux/man-pages/man2/quotactl.2.html) manipulates disk quotas.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*
diff --git a/libc/include/sys/random.h b/libc/include/sys/random.h
index 2ff5349..fcea419 100644
--- a/libc/include/sys/random.h
+++ b/libc/include/sys/random.h
@@ -43,7 +43,7 @@
__BEGIN_DECLS
/**
- * [getrandom(2)](http://man7.org/linux/man-pages/man2/getrandom.2.html) fills the given buffer
+ * [getrandom(2)](https://man7.org/linux/man-pages/man2/getrandom.2.html) fills the given buffer
* with random bytes.
*
* Returns the number of bytes copied on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/reboot.h b/libc/include/sys/reboot.h
index 5d9e1a7..f4bc861 100644
--- a/libc/include/sys/reboot.h
+++ b/libc/include/sys/reboot.h
@@ -50,7 +50,7 @@
#define RB_POWER_OFF LINUX_REBOOT_CMD_POWER_OFF
/**
- * [reboot(2)](http://man7.org/linux/man-pages/man2/reboot.2.html) reboots the device.
+ * [reboot(2)](https://man7.org/linux/man-pages/man2/reboot.2.html) reboots the device.
*
* Does not return on successful reboot, returns 0 if CAD was successfully enabled/disabled,
* and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h
index 437a234..d5b3495 100644
--- a/libc/include/sys/select.h
+++ b/libc/include/sys/select.h
@@ -87,7 +87,7 @@
#define FD_ISSET(fd, set) __FD_ISSET_chk(fd, set, __bos(set))
/**
- * [select(2)](http://man7.org/linux/man-pages/man2/select.2.html) waits on a
+ * [select(2)](https://man7.org/linux/man-pages/man2/select.2.html) waits on a
* set of file descriptors.
*
* Use poll() instead.
@@ -98,7 +98,7 @@
int select(int __max_fd_plus_one, fd_set* _Nullable __read_fds, fd_set* _Nullable __write_fds, fd_set* _Nullable __exception_fds, struct timeval* _Nullable __timeout);
/**
- * [pselect(2)](http://man7.org/linux/man-pages/man2/select.2.html) waits on a
+ * [pselect(2)](https://man7.org/linux/man-pages/man2/select.2.html) waits on a
* set of file descriptors.
*
* Use ppoll() instead.
@@ -109,7 +109,7 @@
int pselect(int __max_fd_plus_one, fd_set* _Nullable __read_fds, fd_set* _Nullable __write_fds, fd_set* _Nullable __exception_fds, const struct timespec* _Nullable __timeout, const sigset_t* _Nullable __mask);
/**
- * [pselect64(2)](http://man7.org/linux/man-pages/man2/select.2.html) waits on a
+ * [pselect64(2)](https://man7.org/linux/man-pages/man2/select.2.html) waits on a
* set of file descriptors.
*
* Use ppoll64() instead.
diff --git a/libc/include/sys/sendfile.h b/libc/include/sys/sendfile.h
index 26522a6..ac623e7 100644
--- a/libc/include/sys/sendfile.h
+++ b/libc/include/sys/sendfile.h
@@ -43,7 +43,7 @@
ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64);
#else
/**
- * [sendfile(2)](http://man7.org/linux/man-pages/man2/sendfile.2.html) copies data directly
+ * [sendfile(2)](https://man7.org/linux/man-pages/man2/sendfile.2.html) copies data directly
* between two file descriptors.
*
* Returns the number of bytes copied on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/signalfd.h b/libc/include/sys/signalfd.h
index 2be9bdc..5568b7d 100644
--- a/libc/include/sys/signalfd.h
+++ b/libc/include/sys/signalfd.h
@@ -41,7 +41,7 @@
__BEGIN_DECLS
/**
- * [signalfd(2)](http://man7.org/linux/man-pages/man2/signalfd.2.html) creates/manipulates a
+ * [signalfd(2)](https://man7.org/linux/man-pages/man2/signalfd.2.html) creates/manipulates a
* file descriptor for reading signal events.
*
* Returns the file descriptor on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index f916573..0ea596b 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -205,7 +205,7 @@
#if defined(__USE_GNU)
/**
- * [statx(2)](http://man7.org/linux/man-pages/man2/statx.2.html) returns
+ * [statx(2)](https://man7.org/linux/man-pages/man2/statx.2.html) returns
* extended file status information.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/statvfs.h b/libc/include/sys/statvfs.h
index 7bc5e63..2feca81 100644
--- a/libc/include/sys/statvfs.h
+++ b/libc/include/sys/statvfs.h
@@ -92,7 +92,7 @@
#define ST_NOSYMFOLLOW 0x2000
/**
- * [statvfs(3)](http://man7.org/linux/man-pages/man3/statvfs.3.html)
+ * [statvfs(3)](https://man7.org/linux/man-pages/man3/statvfs.3.html)
* queries filesystem statistics for the given path.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -100,7 +100,7 @@
int statvfs(const char* _Nonnull __path, struct statvfs* _Nonnull __buf);
/**
- * [fstatvfs(3)](http://man7.org/linux/man-pages/man3/fstatvfs.3.html)
+ * [fstatvfs(3)](https://man7.org/linux/man-pages/man3/fstatvfs.3.html)
* queries filesystem statistics for the given file descriptor.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/swap.h b/libc/include/sys/swap.h
index 474aed7..2aaf86e 100644
--- a/libc/include/sys/swap.h
+++ b/libc/include/sys/swap.h
@@ -52,14 +52,14 @@
#define SWAP_FLAG_PRIO_SHIFT 0
/**
- * [swapon(2)](http://man7.org/linux/man-pages/man2/swapon.2.html) enables swapping.
+ * [swapon(2)](https://man7.org/linux/man-pages/man2/swapon.2.html) enables swapping.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
int swapon(const char* _Nonnull __path, int __flags);
/**
- * [swapoff(2)](http://man7.org/linux/man-pages/man2/swapoff.2.html) disables swapping.
+ * [swapoff(2)](https://man7.org/linux/man-pages/man2/swapoff.2.html) disables swapping.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
diff --git a/libc/include/sys/sysinfo.h b/libc/include/sys/sysinfo.h
index cae5c49..5956feb 100644
--- a/libc/include/sys/sysinfo.h
+++ b/libc/include/sys/sysinfo.h
@@ -39,14 +39,14 @@
__BEGIN_DECLS
/**
- * [sysinfo(2)](http://man7.org/linux/man-pages/man2/sysinfo.2.html) queries system information.
+ * [sysinfo(2)](https://man7.org/linux/man-pages/man2/sysinfo.2.html) queries system information.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
int sysinfo(struct sysinfo* _Nonnull __info);
/**
- * [get_nprocs_conf(3)](http://man7.org/linux/man-pages/man3/get_nprocs_conf.3.html) returns
+ * [get_nprocs_conf(3)](https://man7.org/linux/man-pages/man3/get_nprocs_conf.3.html) returns
* the total number of processors in the system.
*
* Available since API level 23.
@@ -56,7 +56,7 @@
int get_nprocs_conf(void) __INTRODUCED_IN(23);
/**
- * [get_nprocs(3)](http://man7.org/linux/man-pages/man3/get_nprocs.3.html) returns
+ * [get_nprocs(3)](https://man7.org/linux/man-pages/man3/get_nprocs.3.html) returns
* the number of processors in the system that are currently on-line.
*
* Available since API level 23.
@@ -66,7 +66,7 @@
int get_nprocs(void) __INTRODUCED_IN(23);
/**
- * [get_phys_pages(3)](http://man7.org/linux/man-pages/man3/get_phys_pages.3.html) returns
+ * [get_phys_pages(3)](https://man7.org/linux/man-pages/man3/get_phys_pages.3.html) returns
* the total number of physical pages in the system.
*
* Available since API level 23.
@@ -76,7 +76,7 @@
long get_phys_pages(void) __INTRODUCED_IN(23);
/**
- * [get_avphys_pages(3)](http://man7.org/linux/man-pages/man3/get_avphys_pages.3.html) returns
+ * [get_avphys_pages(3)](https://man7.org/linux/man-pages/man3/get_avphys_pages.3.html) returns
* the number of physical pages in the system that are currently available.
*
* Available since API level 23.
diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index ae94db5..e8b6e34 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -110,11 +110,136 @@
*/
#define PROP_NAME_MAX 32
+/** Deprecated. Use __system_property_foreach() instead. */
+const prop_info* _Nullable __system_property_find_nth(unsigned __n);
/** Deprecated. Use __system_property_read_callback() instead. */
int __system_property_read(const prop_info* _Nonnull __pi, char* _Nullable __name, char* _Nonnull __value);
/** Deprecated. Use __system_property_read_callback() instead. */
int __system_property_get(const char* _Nonnull __name, char* _Nonnull __value);
-/** Deprecated. Use __system_property_foreach() instead. */
-const prop_info* _Nullable __system_property_find_nth(unsigned __n);
+/** Deprecated: use __system_property_wait() instead. */
+uint32_t __system_property_wait_any(uint32_t __old_serial);
+
+/**
+ * Reads the global serial number of the system properties _area_.
+ *
+ * Called to predict if a series of cached __system_property_find()
+ * objects will have seen __system_property_serial() values change.
+ * Also aids the converse, as changes in the global serial can
+ * also be used to predict if a failed __system_property_find()
+ * could in turn now find a new object; thus preventing the
+ * cycles of effort to poll __system_property_find().
+ *
+ * Typically called at beginning of a cache cycle to signal if _any_ possible
+ * changes have occurred since last. If there is, one may check each individual
+ * __system_property_serial() to confirm dirty, or __system_property_find()
+ * to check if the property now exists. If a call to __system_property_add()
+ * or __system_property_update() has completed between two calls to
+ * __system_property_area_serial() then the second call will return a larger
+ * value than the first call. Beware of race conditions as changes to the
+ * properties are not atomic, the main value of this call is to determine
+ * whether the expensive __system_property_find() is worth retrying to see if
+ * a property now exists.
+ *
+ * Returns the serial number on success, -1 on error.
+ */
+uint32_t __system_property_area_serial(void);
+
+/**
+ * Reads the serial number of a specific system property previously returned by
+ * __system_property_find(). This is a cheap way to check whether a system
+ * property has changed or not.
+ *
+ * Returns the serial number on success, -1 on error.
+ */
+uint32_t __system_property_serial(const prop_info* _Nonnull __pi);
+
+//
+// libc implementation detail.
+//
+
+/**
+ * Initializes the system properties area in read-only mode.
+ *
+ * This is called automatically during libc initialization,
+ * so user code should never need to call this.
+ *
+ * Returns 0 on success, -1 otherwise.
+ */
+int __system_properties_init(void);
+
+//
+// init implementation details.
+//
+
+#define PROP_SERVICE_NAME "property_service"
+#define PROP_SERVICE_FOR_SYSTEM_NAME "property_service_for_system"
+#define PROP_DIRNAME "/dev/__properties__"
+
+// Messages sent to init.
+#define PROP_MSG_SETPROP 1
+#define PROP_MSG_SETPROP2 0x00020001
+
+// Status codes returned by init (but not passed from libc to the caller).
+#define PROP_SUCCESS 0
+#define PROP_ERROR_READ_CMD 0x0004
+#define PROP_ERROR_READ_DATA 0x0008
+#define PROP_ERROR_READ_ONLY_PROPERTY 0x000B
+#define PROP_ERROR_INVALID_NAME 0x0010
+#define PROP_ERROR_INVALID_VALUE 0x0014
+#define PROP_ERROR_PERMISSION_DENIED 0x0018
+#define PROP_ERROR_INVALID_CMD 0x001B
+#define PROP_ERROR_HANDLE_CONTROL_MESSAGE 0x0020
+#define PROP_ERROR_SET_FAILED 0x0024
+
+/**
+ * Initializes the area to be used to store properties.
+ *
+ * Can only be done by the process that has write access to the property area,
+ * typically init.
+ *
+ * See __system_properties_init() for the equivalent for all other processes.
+ */
+int __system_property_area_init(void);
+
+/**
+ * Adds a new system property.
+ * Can only be done by the process that has write access to the property area --
+ * typically init -- which must handle sequencing to ensure that only one property is
+ * updated at a time.
+ *
+ * Returns 0 on success, -1 if the property area is full.
+ */
+int __system_property_add(const char* _Nonnull __name, unsigned int __name_length, const char* _Nonnull __value, unsigned int __value_length);
+
+/**
+ * Updates the value of a system property returned by __system_property_find().
+ * Can only be done by the process that has write access to the property area --
+ * typically init -- which must handle sequencing to ensure that only one property is
+ * updated at a time.
+ *
+ * Returns 0 on success, -1 if the parameters are incorrect.
+ */
+int __system_property_update(prop_info* _Nonnull __pi, const char* _Nonnull __value, unsigned int __value_length);
+
+/**
+ * Reloads the system properties from disk.
+ * Not intended for use by any apps except the Zygote.
+ * Should only be called from the main thread.
+ *
+ * Pointers received from functions such as __system_property_find()
+ * may be invalidated by calls to this function.
+ *
+ * Returns 0 on success, -1 otherwise.
+ *
+ * Available since API level 35.
+ */
+int __system_properties_zygote_reload(void) __INTRODUCED_IN(35);
+
+/**
+ * Deprecated: previously for testing, but now that SystemProperties is its own
+ * testable class, there is never a reason to call this function and its
+ * implementation simply returns -1.
+ */
+int __system_property_set_filename(const char* _Nullable __unused __filename);
__END_DECLS
diff --git a/libc/include/sys/timerfd.h b/libc/include/sys/timerfd.h
index de1f55b..96d3bef 100644
--- a/libc/include/sys/timerfd.h
+++ b/libc/include/sys/timerfd.h
@@ -46,7 +46,7 @@
#define TFD_NONBLOCK O_NONBLOCK
/**
- * [timerfd_create(2)](http://man7.org/linux/man-pages/man2/timerfd_create.2.html) creates a
+ * [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html) creates a
* timer file descriptor.
*
* Returns the new file descriptor on success, and returns -1 and sets `errno` on failure.
@@ -59,7 +59,7 @@
#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
/**
- * [timerfd_settime(2)](http://man7.org/linux/man-pages/man2/timerfd_settime.2.html) starts or
+ * [timerfd_settime(2)](https://man7.org/linux/man-pages/man2/timerfd_settime.2.html) starts or
* stops a timer.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -67,7 +67,7 @@
int timerfd_settime(int __fd, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value);
/**
- * [timerfd_gettime(2)](http://man7.org/linux/man-pages/man2/timerfd_gettime.2.html) queries the
+ * [timerfd_gettime(2)](https://man7.org/linux/man-pages/man2/timerfd_gettime.2.html) queries the
* current timer settings.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/times.h b/libc/include/sys/times.h
index 8b6e91d..ac6ec18 100644
--- a/libc/include/sys/times.h
+++ b/libc/include/sys/times.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [times(2)](http://man7.org/linux/man-pages/man2/times.2.html) fills a buffer with the
+ * [times(2)](https://man7.org/linux/man-pages/man2/times.2.html) fills a buffer with the
* calling process' CPU usage.
*
* Returns a (possibly overflowed) absolute time on success,
diff --git a/libc/include/sys/timex.h b/libc/include/sys/timex.h
index 4823edf..828eb47 100644
--- a/libc/include/sys/timex.h
+++ b/libc/include/sys/timex.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [adjtimex(2)](http://man7.org/linux/man-pages/man2/adjtimex.2.html) adjusts the kernel clock.
+ * [adjtimex(2)](https://man7.org/linux/man-pages/man2/adjtimex.2.html) adjusts the kernel clock.
*
* Returns the clock state on success, and returns -1 and sets `errno` on failure.
*
diff --git a/libc/include/sys/uio.h b/libc/include/sys/uio.h
index c8c64ae..d3e6561 100644
--- a/libc/include/sys/uio.h
+++ b/libc/include/sys/uio.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [readv(2)](http://man7.org/linux/man-pages/man2/readv.2.html) reads
+ * [readv(2)](https://man7.org/linux/man-pages/man2/readv.2.html) reads
* from an fd into the `__count` buffers described by `__iov`.
*
* Returns the number of bytes read on success,
@@ -49,7 +49,7 @@
ssize_t readv(int __fd, const struct iovec* _Nonnull __iov, int __count);
/**
- * [writev(2)](http://man7.org/linux/man-pages/man2/writev.2.html) writes
+ * [writev(2)](https://man7.org/linux/man-pages/man2/writev.2.html) writes
* to an fd from the `__count` buffers described by `__iov`.
*
* Returns the number of bytes written on success,
@@ -60,7 +60,7 @@
#if defined(__USE_GNU)
/**
- * [preadv(2)](http://man7.org/linux/man-pages/man2/preadv.2.html) reads
+ * [preadv(2)](https://man7.org/linux/man-pages/man2/preadv.2.html) reads
* from an fd into the `__count` buffers described by `__iov`, starting at
* offset `__offset` into the file.
*
@@ -72,7 +72,7 @@
ssize_t preadv(int __fd, const struct iovec* _Nonnull __iov, int __count, off_t __offset) __RENAME_IF_FILE_OFFSET64(preadv64) __INTRODUCED_IN(24);
/**
- * [pwritev(2)](http://man7.org/linux/man-pages/man2/pwritev.2.html) writes
+ * [pwritev(2)](https://man7.org/linux/man-pages/man2/pwritev.2.html) writes
* to an fd from the `__count` buffers described by `__iov`, starting at offset
* `__offset` into the file.
*
@@ -98,7 +98,7 @@
ssize_t pwritev64(int __fd, const struct iovec* _Nonnull __iov, int __count, off64_t __offset) __INTRODUCED_IN(24);
/**
- * [preadv2(2)](http://man7.org/linux/man-pages/man2/preadv2.2.html) reads
+ * [preadv2(2)](https://man7.org/linux/man-pages/man2/preadv2.2.html) reads
* from an fd into the `__count` buffers described by `__iov`, starting at
* offset `__offset` into the file, with the given flags.
*
@@ -110,7 +110,7 @@
ssize_t preadv2(int __fd, const struct iovec* _Nonnull __iov, int __count, off_t __offset, int __flags) __RENAME_IF_FILE_OFFSET64(preadv64v2) __INTRODUCED_IN(33);
/**
- * [pwritev2(2)](http://man7.org/linux/man-pages/man2/pwritev2.2.html) writes
+ * [pwritev2(2)](https://man7.org/linux/man-pages/man2/pwritev2.2.html) writes
* to an fd from the `__count` buffers described by `__iov`, starting at offset
* `__offset` into the file, with the given flags.
*
@@ -136,7 +136,7 @@
ssize_t pwritev64v2(int __fd, const struct iovec* _Nonnull __iov, int __count, off64_t __offset, int __flags) __INTRODUCED_IN(33);
/**
- * [process_vm_readv(2)](http://man7.org/linux/man-pages/man2/process_vm_readv.2.html)
+ * [process_vm_readv(2)](https://man7.org/linux/man-pages/man2/process_vm_readv.2.html)
* reads from the address space of another process.
*
* Returns the number of bytes read on success,
@@ -147,7 +147,7 @@
ssize_t process_vm_readv(pid_t __pid, const struct iovec* __BIONIC_COMPLICATED_NULLNESS __local_iov, unsigned long __local_iov_count, const struct iovec* __BIONIC_COMPLICATED_NULLNESS __remote_iov, unsigned long __remote_iov_count, unsigned long __flags) __INTRODUCED_IN(23);
/**
- * [process_vm_writev(2)](http://man7.org/linux/man-pages/man2/process_vm_writev.2.html)
+ * [process_vm_writev(2)](https://man7.org/linux/man-pages/man2/process_vm_writev.2.html)
* writes to the address space of another process.
*
* Returns the number of bytes read on success,
diff --git a/libc/include/sys/utsname.h b/libc/include/sys/utsname.h
index aa8c1a0..23d1282 100644
--- a/libc/include/sys/utsname.h
+++ b/libc/include/sys/utsname.h
@@ -57,7 +57,7 @@
};
/**
- * [uname(2)](http://man7.org/linux/man-pages/man2/uname.2.html) returns information
+ * [uname(2)](https://man7.org/linux/man-pages/man2/uname.2.html) returns information
* about the kernel.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
diff --git a/libc/include/sys/xattr.h b/libc/include/sys/xattr.h
index 745f50c..38c11e2 100644
--- a/libc/include/sys/xattr.h
+++ b/libc/include/sys/xattr.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [fsetxattr(2)](http://man7.org/linux/man-pages/man2/fsetxattr.2.html)
+ * [fsetxattr(2)](https://man7.org/linux/man-pages/man2/fsetxattr.2.html)
* sets an extended attribute on the file referred to by the given file
* descriptor.
*
@@ -55,7 +55,7 @@
int fsetxattr(int __fd, const char* _Nonnull __name, const void* _Nullable __value, size_t __size, int __flags);
/**
- * [setxattr(2)](http://man7.org/linux/man-pages/man2/setxattr.2.html)
+ * [setxattr(2)](https://man7.org/linux/man-pages/man2/setxattr.2.html)
* sets an extended attribute on the file referred to by the given path.
*
* A `size` of 0 can be used to set an empty value, in which case `value` is
@@ -69,7 +69,7 @@
int setxattr(const char* _Nonnull __path, const char* _Nonnull __name, const void* _Nullable __value, size_t __size, int __flags);
/**
- * [lsetxattr(2)](http://man7.org/linux/man-pages/man2/lsetxattr.2.html)
+ * [lsetxattr(2)](https://man7.org/linux/man-pages/man2/lsetxattr.2.html)
* sets an extended attribute on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
@@ -84,7 +84,7 @@
int lsetxattr(const char* _Nonnull __path, const char* _Nonnull __name, const void* _Nullable __value, size_t __size, int __flags);
/**
- * [fgetxattr(2)](http://man7.org/linux/man-pages/man2/fgetxattr.2.html)
+ * [fgetxattr(2)](https://man7.org/linux/man-pages/man2/fgetxattr.2.html)
* gets an extended attribute on the file referred to by the given file
* descriptor.
*
@@ -96,7 +96,7 @@
ssize_t fgetxattr(int __fd, const char* _Nonnull __name, void* _Nullable __value, size_t __size);
/**
- * [getxattr(2)](http://man7.org/linux/man-pages/man2/getxattr.2.html)
+ * [getxattr(2)](https://man7.org/linux/man-pages/man2/getxattr.2.html)
* gets an extended attribute on the file referred to by the given path.
*
* A `size` of 0 can be used to query the current length, in which case `value` is ignored and may be null.
@@ -107,7 +107,7 @@
ssize_t getxattr(const char* _Nonnull __path, const char* _Nonnull __name, void* _Nullable __value, size_t __size);
/**
- * [lgetxattr(2)](http://man7.org/linux/man-pages/man2/lgetxattr.2.html)
+ * [lgetxattr(2)](https://man7.org/linux/man-pages/man2/lgetxattr.2.html)
* gets an extended attribute on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
@@ -119,7 +119,7 @@
ssize_t lgetxattr(const char* _Nonnull __path, const char* _Nonnull __name, void* _Nullable __value, size_t __size);
/**
- * [flistxattr(2)](http://man7.org/linux/man-pages/man2/flistxattr.2.html)
+ * [flistxattr(2)](https://man7.org/linux/man-pages/man2/flistxattr.2.html)
* lists the extended attributes on the file referred to by the given file
* descriptor.
*
@@ -131,7 +131,7 @@
ssize_t flistxattr(int __fd, char* _Nullable __list, size_t __size);
/**
- * [listxattr(2)](http://man7.org/linux/man-pages/man2/listxattr.2.html)
+ * [listxattr(2)](https://man7.org/linux/man-pages/man2/listxattr.2.html)
* lists the extended attributes on the file referred to by the given path.
*
* A `size` of 0 can be used to query the current length, in which case `list` is ignored and may be null.
@@ -142,7 +142,7 @@
ssize_t listxattr(const char* _Nonnull __path, char* _Nullable __list, size_t __size);
/**
- * [llistxattr(2)](http://man7.org/linux/man-pages/man2/llistxattr.2.html)
+ * [llistxattr(2)](https://man7.org/linux/man-pages/man2/llistxattr.2.html)
* lists the extended attributes on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
@@ -154,7 +154,7 @@
ssize_t llistxattr(const char* _Nonnull __path, char* _Nullable __list, size_t __size);
/**
- * [fremovexattr(2)](http://man7.org/linux/man-pages/man2/fremovexattr.2.html)
+ * [fremovexattr(2)](https://man7.org/linux/man-pages/man2/fremovexattr.2.html)
* removes an extended attribute on the file referred to by the given file
* descriptor.
*
@@ -163,7 +163,7 @@
int fremovexattr(int __fd, const char* _Nonnull __name);
/**
- * [lremovexattr(2)](http://man7.org/linux/man-pages/man2/lremovexattr.2.html)
+ * [lremovexattr(2)](https://man7.org/linux/man-pages/man2/lremovexattr.2.html)
* removes an extended attribute on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
@@ -172,7 +172,7 @@
int lremovexattr(const char* _Nonnull __path, const char* _Nonnull __name);
/**
- * [removexattr(2)](http://man7.org/linux/man-pages/man2/removexattr.2.html)
+ * [removexattr(2)](https://man7.org/linux/man-pages/man2/removexattr.2.html)
* removes an extended attribute on the file referred to by the given path.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
diff --git a/libc/include/syslog.h b/libc/include/syslog.h
index 1e2fcc4..33979f0 100644
--- a/libc/include/syslog.h
+++ b/libc/include/syslog.h
@@ -212,34 +212,34 @@
#endif
/**
- * [closelog(3)](http://man7.org/linux/man-pages/man3/closelog.3.html) does
+ * [closelog(3)](https://man7.org/linux/man-pages/man3/closelog.3.html) does
* nothing on Android.
*/
void closelog(void);
/**
- * [openlog(3)](http://man7.org/linux/man-pages/man3/openlog.3.html) sets
+ * [openlog(3)](https://man7.org/linux/man-pages/man3/openlog.3.html) sets
* the log tag to `__prefix`, which can be NULL to return to the default of
* getprogname(). On Android, the other two arguments are ignored.
*/
void openlog(const char* _Nullable __prefix, int __option, int __facility);
/**
- * [setlogmask(3)](http://man7.org/linux/man-pages/man3/setlogmask.3.html)
+ * [setlogmask(3)](https://man7.org/linux/man-pages/man3/setlogmask.3.html)
* sets which log priorities will actually be logged. See `LOG_MASK` and
* `LOG_UPTO`.
*/
int setlogmask(int __mask);
/**
- * [syslog(3)](http://man7.org/linux/man-pages/man3/syslog.3.html) formats
+ * [syslog(3)](https://man7.org/linux/man-pages/man3/syslog.3.html) formats
* the printf()-like message and logs it with the given priority, unless
* suppressed by setlogmask(). On Android, the output goes to logcat.
*/
void syslog(int __priority, const char* _Nonnull __fmt, ...) __printflike(2, 3);
/**
- * [vsyslog(3)](http://man7.org/linux/man-pages/man3/vsyslog.3.html) formats
+ * [vsyslog(3)](https://man7.org/linux/man-pages/man3/vsyslog.3.html) formats
* the vprintf()-like message and logs it with the given priority, unless
* suppressed by setlogmask(). On Android, the output goes to logcat.
*/
diff --git a/libc/include/termios.h b/libc/include/termios.h
index 7abff5d..5eecfcd 100644
--- a/libc/include/termios.h
+++ b/libc/include/termios.h
@@ -46,25 +46,25 @@
// in cfmakeraw() and cfsetspeed() until 28.
/**
- * [cfgetispeed(3)](http://man7.org/linux/man-pages/man3/cfgetispeed.3.html)
+ * [cfgetispeed(3)](https://man7.org/linux/man-pages/man3/cfgetispeed.3.html)
* returns the terminal input baud rate.
*/
speed_t cfgetispeed(const struct termios* _Nonnull __t);
/**
- * [cfgetospeed(3)](http://man7.org/linux/man-pages/man3/cfgetospeed.3.html)
+ * [cfgetospeed(3)](https://man7.org/linux/man-pages/man3/cfgetospeed.3.html)
* returns the terminal output baud rate.
*/
speed_t cfgetospeed(const struct termios* _Nonnull __t);
/**
- * [cfmakeraw(3)](http://man7.org/linux/man-pages/man3/cfmakeraw.3.html)
+ * [cfmakeraw(3)](https://man7.org/linux/man-pages/man3/cfmakeraw.3.html)
* configures the terminal for "raw" mode.
*/
void cfmakeraw(struct termios* _Nonnull __t);
/**
- * [cfsetspeed(3)](http://man7.org/linux/man-pages/man3/cfsetspeed.3.html)
+ * [cfsetspeed(3)](https://man7.org/linux/man-pages/man3/cfsetspeed.3.html)
* sets the terminal input and output baud rate.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -72,7 +72,7 @@
int cfsetspeed(struct termios* _Nonnull __t, speed_t __speed);
/**
- * [cfsetispeed(3)](http://man7.org/linux/man-pages/man3/cfsetispeed.3.html)
+ * [cfsetispeed(3)](https://man7.org/linux/man-pages/man3/cfsetispeed.3.html)
* sets the terminal input baud rate.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -80,7 +80,7 @@
int cfsetispeed(struct termios* _Nonnull _t, speed_t __speed);
/**
- * [cfsetospeed(3)](http://man7.org/linux/man-pages/man3/cfsetospeed.3.html)
+ * [cfsetospeed(3)](https://man7.org/linux/man-pages/man3/cfsetospeed.3.html)
* sets the terminal output baud rate.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -88,7 +88,7 @@
int cfsetospeed(struct termios* _Nonnull __t, speed_t __speed);
/**
- * [tcdrain(3)](http://man7.org/linux/man-pages/man3/tcdrain.3.html)
+ * [tcdrain(3)](https://man7.org/linux/man-pages/man3/tcdrain.3.html)
* waits until all output has been written.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -96,7 +96,7 @@
int tcdrain(int __fd);
/**
- * [tcflow(3)](http://man7.org/linux/man-pages/man3/tcflow.3.html)
+ * [tcflow(3)](https://man7.org/linux/man-pages/man3/tcflow.3.html)
* suspends (`TCOOFF`) or resumes (`TCOON`) output, or transmits a
* stop (`TCIOFF`) or start (`TCION`) to suspend or resume input.
*
@@ -105,7 +105,7 @@
int tcflow(int __fd, int __action);
/**
- * [tcflush(3)](http://man7.org/linux/man-pages/man3/tcflush.3.html)
+ * [tcflush(3)](https://man7.org/linux/man-pages/man3/tcflush.3.html)
* discards pending input (`TCIFLUSH`), output (`TCOFLUSH`), or
* both (`TCIOFLUSH`). (In `<stdio.h>` terminology, this is a purge rather
* than a flush.)
@@ -115,7 +115,7 @@
int tcflush(int __fd, int __queue);
/**
- * [tcgetattr(3)](http://man7.org/linux/man-pages/man3/tcgetattr.3.html)
+ * [tcgetattr(3)](https://man7.org/linux/man-pages/man3/tcgetattr.3.html)
* reads the configuration of the given terminal.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -123,7 +123,7 @@
int tcgetattr(int __fd, struct termios* _Nonnull __t);
/**
- * [tcgetsid(3)](http://man7.org/linux/man-pages/man3/tcgetsid.3.html)
+ * [tcgetsid(3)](https://man7.org/linux/man-pages/man3/tcgetsid.3.html)
* returns the session id corresponding to the given fd.
*
* Returns a non-negative session id on success and
@@ -132,7 +132,7 @@
pid_t tcgetsid(int __fd);
/**
- * [tcsendbreak(3)](http://man7.org/linux/man-pages/man3/tcsendbreak.3.html)
+ * [tcsendbreak(3)](https://man7.org/linux/man-pages/man3/tcsendbreak.3.html)
* sends a break.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
@@ -140,7 +140,7 @@
int tcsendbreak(int __fd, int __duration);
/**
- * [tcsetattr(3)](http://man7.org/linux/man-pages/man3/tcsetattr.3.html)
+ * [tcsetattr(3)](https://man7.org/linux/man-pages/man3/tcsetattr.3.html)
* writes the configuration of the given terminal.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
diff --git a/libc/include/time.h b/libc/include/time.h
index f448851..fa72e16 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -100,7 +100,7 @@
#define TM_ZONE tm_zone
/**
- * [time(2)](http://man7.org/linux/man-pages/man2/time.2.html) returns
+ * [time(2)](https://man7.org/linux/man-pages/man2/time.2.html) returns
* the number of seconds since the Unix epoch (1970-01-01 00:00:00 +0000).
*
* Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
@@ -108,7 +108,7 @@
time_t time(time_t* _Nullable __t);
/**
- * [nanosleep(2)](http://man7.org/linux/man-pages/man2/nanosleep.2.html) sleeps
+ * [nanosleep(2)](https://man7.org/linux/man-pages/man2/nanosleep.2.html) sleeps
* for at least the given time (or until a signal arrives).
*
* Returns 0 on success, and returns -1 and sets `errno` on failure. If the sleep
@@ -118,7 +118,7 @@
int nanosleep(const struct timespec* _Nonnull __duration, struct timespec* _Nullable __remainder);
/**
- * [asctime(3)](http://man7.org/linux/man-pages/man3/asctime.3p.html) formats
+ * [asctime(3)](https://man7.org/linux/man-pages/man3/asctime.3p.html) formats
* the time `tm` as a string.
*
* Returns a pointer to a string on success, and returns NULL on failure.
@@ -130,7 +130,7 @@
char* _Nullable asctime(const struct tm* _Nonnull __tm);
/**
- * [asctime_r(3)](http://man7.org/linux/man-pages/man3/asctime_r.3p.html) formats
+ * [asctime_r(3)](https://man7.org/linux/man-pages/man3/asctime_r.3p.html) formats
* the time `tm` as a string in the given buffer `buf`.
*
* Returns a pointer to a string on success, and returns NULL on failure.
@@ -140,7 +140,7 @@
char* _Nullable asctime_r(const struct tm* _Nonnull __tm, char* _Nonnull __buf);
/**
- * [difftime(3)](http://man7.org/linux/man-pages/man3/difftime.3.html) returns
+ * [difftime(3)](https://man7.org/linux/man-pages/man3/difftime.3.html) returns
* the difference between two times.
*
* Returns the difference in seconds.
@@ -148,7 +148,7 @@
double difftime(time_t __lhs, time_t __rhs);
/**
- * [mktime(3)](http://man7.org/linux/man-pages/man3/mktime.3p.html) converts
+ * [mktime(3)](https://man7.org/linux/man-pages/man3/mktime.3p.html) converts
* broken-down time `tm` into the number of seconds since the Unix epoch.
*
* See tzset() for details of how the timezone is set, and mktime_rz()
@@ -169,7 +169,7 @@
time_t mktime_z(timezone_t _Nonnull __tz, struct tm* _Nonnull __tm) __INTRODUCED_IN(35);
/**
- * [localtime(3)](http://man7.org/linux/man-pages/man3/localtime.3p.html) converts
+ * [localtime(3)](https://man7.org/linux/man-pages/man3/localtime.3p.html) converts
* the number of seconds since the Unix epoch in `t` to a broken-down time, taking
* the device's timezone into account.
*
@@ -180,7 +180,7 @@
struct tm* _Nullable localtime(const time_t* _Nonnull __t);
/**
- * [localtime_r(3)](http://man7.org/linux/man-pages/man3/localtime_r.3p.html) converts
+ * [localtime_r(3)](https://man7.org/linux/man-pages/man3/localtime_r.3p.html) converts
* the number of seconds since the Unix epoch in `t` to a broken-down time.
* That broken-down time will be written to the given struct `tm`.
*
@@ -208,7 +208,7 @@
time_t timelocal(struct tm* _Nonnull __tm);
/**
- * [gmtime(3)](http://man7.org/linux/man-pages/man3/gmtime.3p.html) converts
+ * [gmtime(3)](https://man7.org/linux/man-pages/man3/gmtime.3p.html) converts
* the number of seconds since the Unix epoch in `t` to a broken-down time, using
* UTC (historically also known as GMT).
*
@@ -219,7 +219,7 @@
struct tm* _Nullable gmtime(const time_t* _Nonnull __t);
/**
- * [gmtime_r(3)](http://man7.org/linux/man-pages/man3/gmtime_r.3p.html) converts
+ * [gmtime_r(3)](https://man7.org/linux/man-pages/man3/gmtime_r.3p.html) converts
* the number of seconds since the Unix epoch in `t` to a broken-down time, using
* UTC (historically also known as GMT).
*
@@ -235,7 +235,7 @@
time_t timegm(struct tm* _Nonnull __tm);
/**
- * [strptime(3)](http://man7.org/linux/man-pages/man3/strptime.3.html) parses
+ * [strptime(3)](https://man7.org/linux/man-pages/man3/strptime.3.html) parses
* a string `s` assuming format `fmt` into broken-down time `tm`.
*
* Returns a pointer to the first character _not_ parsed, or null if no characters were parsed.
@@ -248,7 +248,7 @@
char* _Nullable strptime_l(const char* _Nonnull __s, const char* _Nonnull __fmt, struct tm* _Nonnull __tm, locale_t _Nonnull __l) __strftimelike(2) __INTRODUCED_IN(28);
/**
- * [strftime(3)](http://man7.org/linux/man-pages/man3/strftime.3.html) formats
+ * [strftime(3)](https://man7.org/linux/man-pages/man3/strftime.3.html) formats
* a broken-down time `tm` into the buffer `buf` using format `fmt`.
*
* Returns a pointer to the first character _not_ parsed, or null if no characters were parsed.
@@ -261,7 +261,7 @@
size_t strftime_l(char* _Nonnull __buf, size_t __n, const char* _Nonnull __fmt, const struct tm* _Nullable __tm, locale_t _Nonnull __l) __strftimelike(3);
/**
- * [ctime(3)](http://man7.org/linux/man-pages/man3/ctime.3p.html) formats
+ * [ctime(3)](https://man7.org/linux/man-pages/man3/ctime.3p.html) formats
* the time `tm` as a string.
*
* Returns a pointer to a string on success, and returns NULL on failure.
@@ -273,7 +273,7 @@
char* _Nullable ctime(const time_t* _Nonnull __t);
/**
- * [ctime_r(3)](http://man7.org/linux/man-pages/man3/ctime.3p.html) formats
+ * [ctime_r(3)](https://man7.org/linux/man-pages/man3/ctime.3p.html) formats
* the time `tm` as a string in the given buffer `buf`.
*
* Returns a pointer to a string on success, and returns NULL on failure.
@@ -283,7 +283,7 @@
char* _Nullable ctime_r(const time_t* _Nonnull __t, char* _Nonnull __buf);
/**
- * [tzset(3)](http://man7.org/linux/man-pages/man3/tzset.3.html) tells
+ * [tzset(3)](https://man7.org/linux/man-pages/man3/tzset.3.html) tells
* libc that the timezone has changed.
*
* tzset() on Android looks at both the system property
@@ -328,7 +328,7 @@
void tzfree(timezone_t _Nullable __tz) __INTRODUCED_IN(35);
/**
- * [clock(3)](http://man7.org/linux/man-pages/man3/clock.3.html)
+ * [clock(3)](https://man7.org/linux/man-pages/man3/clock.3.html)
* returns an approximation of CPU time used, equivalent to
* `clock_gettime(CLOCK_PROCESS_CPUTIME_ID)` but with more confusing
* units. Use `CLOCKS_PER_SEC` to convert the result to seconds.
@@ -340,7 +340,7 @@
clock_t clock(void);
/**
- * [clock_getcpuclockid(3)](http://man7.org/linux/man-pages/man3/clock_getcpuclockid.3.html)
+ * [clock_getcpuclockid(3)](https://man7.org/linux/man-pages/man3/clock_getcpuclockid.3.html)
* gets the clock ID of the cpu-time clock for the given `pid`.
*
* Returns 0 on success, and returns -1 and returns an error number on failure.
@@ -348,7 +348,7 @@
int clock_getcpuclockid(pid_t __pid, clockid_t* _Nonnull __clock) __INTRODUCED_IN(23);
/**
- * [clock_getres(2)](http://man7.org/linux/man-pages/man2/clock_getres.2.html)
+ * [clock_getres(2)](https://man7.org/linux/man-pages/man2/clock_getres.2.html)
* gets the resolution of the given clock.
*
* Returns 0 on success, and returns -1 and returns an error number on failure.
@@ -356,7 +356,7 @@
int clock_getres(clockid_t __clock, struct timespec* _Nullable __resolution);
/**
- * [clock_gettime(2)](http://man7.org/linux/man-pages/man2/clock_gettime.2.html)
+ * [clock_gettime(2)](https://man7.org/linux/man-pages/man2/clock_gettime.2.html)
* gets the time according to the given clock.
*
* Returns 0 on success, and returns -1 and returns an error number on failure.
@@ -364,7 +364,7 @@
int clock_gettime(clockid_t __clock, struct timespec* _Nonnull __ts);
/**
- * [clock_nanosleep(2)](http://man7.org/linux/man-pages/man2/clock_nanosleep.2.html)
+ * [clock_nanosleep(2)](https://man7.org/linux/man-pages/man2/clock_nanosleep.2.html)
* sleeps for the given time (or until the given time if the TIMER_ABSTIME flag
* is used), as measured by the given clock.
*
@@ -375,7 +375,7 @@
int clock_nanosleep(clockid_t __clock, int __flags, const struct timespec* _Nonnull __time, struct timespec* _Nullable __remainder);
/**
- * [clock_settime(2)](http://man7.org/linux/man-pages/man2/clock_settime.2.html)
+ * [clock_settime(2)](https://man7.org/linux/man-pages/man2/clock_settime.2.html)
* sets the time for the given clock.
*
* Returns 0 on success, and returns -1 and returns an error number on failure.
@@ -383,7 +383,7 @@
int clock_settime(clockid_t __clock, const struct timespec* _Nonnull __ts);
/**
- * [timer_create(2)](http://man7.org/linux/man-pages/man2/timer_create.2.html)
+ * [timer_create(2)](https://man7.org/linux/man-pages/man2/timer_create.2.html)
* creates a POSIX timer.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -391,7 +391,7 @@
int timer_create(clockid_t __clock, struct sigevent* _Nullable __event, timer_t _Nonnull * _Nonnull __timer_ptr);
/**
- * [timer_delete(2)](http://man7.org/linux/man-pages/man2/timer_delete.2.html)
+ * [timer_delete(2)](https://man7.org/linux/man-pages/man2/timer_delete.2.html)
* destroys a POSIX timer.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -399,7 +399,7 @@
int timer_delete(timer_t _Nonnull __timer);
/**
- * [timer_settime(2)](http://man7.org/linux/man-pages/man2/timer_settime.2.html)
+ * [timer_settime(2)](https://man7.org/linux/man-pages/man2/timer_settime.2.html)
* starts or stops a POSIX timer.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -407,7 +407,7 @@
int timer_settime(timer_t _Nonnull __timer, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value);
/**
- * [timer_gettime(2)](http://man7.org/linux/man-pages/man2/timer_gettime.2.html)
+ * [timer_gettime(2)](https://man7.org/linux/man-pages/man2/timer_gettime.2.html)
* gets the time until the given timer next fires.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
@@ -415,7 +415,7 @@
int timer_gettime(timer_t _Nonnull _timer, struct itimerspec* _Nonnull __ts);
/**
- * [timer_getoverrun(2)](http://man7.org/linux/man-pages/man2/timer_getoverrun.2.html)
+ * [timer_getoverrun(2)](https://man7.org/linux/man-pages/man2/timer_getoverrun.2.html)
* gets the overrun count (the number of times the timer should have fired, but
* didn't) for the last time the timer fired.
*
diff --git a/libc/include/uchar.h b/libc/include/uchar.h
index 626372a..55a36e7 100644
--- a/libc/include/uchar.h
+++ b/libc/include/uchar.h
@@ -55,7 +55,7 @@
#define __STD_UTF_32__ 1
/**
- * [c16rtomb(3)](http://man7.org/linux/man-pages/man3/c16rtomb.3.html) converts a single UTF-16
+ * [c16rtomb(3)](https://man7.org/linux/man-pages/man3/c16rtomb.3.html) converts a single UTF-16
* character to UTF-8.
*
* Returns the number of bytes written to `__buf` on success, and returns -1 and sets `errno`
@@ -64,7 +64,7 @@
size_t c16rtomb(char* _Nullable __buf, char16_t __ch16, mbstate_t* _Nullable __ps);
/**
- * [c32rtomb(3)](http://man7.org/linux/man-pages/man3/c32rtomb.3.html) converts a single UTF-32
+ * [c32rtomb(3)](https://man7.org/linux/man-pages/man3/c32rtomb.3.html) converts a single UTF-32
* character to UTF-8.
*
* Returns the number of bytes written to `__buf` on success, and returns -1 and sets `errno`
@@ -73,13 +73,13 @@
size_t c32rtomb(char* _Nullable __buf, char32_t __ch32, mbstate_t* _Nullable __ps);
/**
- * [mbrtoc16(3)](http://man7.org/linux/man-pages/man3/mbrtoc16.3.html) converts the next UTF-8
+ * [mbrtoc16(3)](https://man7.org/linux/man-pages/man3/mbrtoc16.3.html) converts the next UTF-8
* sequence to a UTF-16 code point.
*/
size_t mbrtoc16(char16_t* _Nullable __ch16, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps);
/**
- * [mbrtoc32(3)](http://man7.org/linux/man-pages/man3/mbrtoc32.3.html) converts the next UTF-8
+ * [mbrtoc32(3)](https://man7.org/linux/man-pages/man3/mbrtoc32.3.html) converts the next UTF-8
* sequence to a UTF-32 code point.
*/
size_t mbrtoc32(char32_t* _Nullable __ch32, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps);
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 2552ca8..e1c268f 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -79,7 +79,7 @@
__noreturn void _exit(int __status);
/**
- * [fork(2)](http://man7.org/linux/man-pages/man2/fork.2.html) creates a new
+ * [fork(2)](https://man7.org/linux/man-pages/man2/fork.2.html) creates a new
* process. fork() runs any handlers set by pthread_atfork().
*
* Returns 0 in the child, the pid of the child in the parent,
@@ -103,7 +103,7 @@
pid_t _Fork(void) __INTRODUCED_IN(35);
/**
- * [vfork(2)](http://man7.org/linux/man-pages/man2/vfork.2.html) creates a new
+ * [vfork(2)](https://man7.org/linux/man-pages/man2/vfork.2.html) creates a new
* process. vfork() differs from fork() in that it does not run any handlers
* set by pthread_atfork(), and the parent is suspended until the child calls
* exec() or exits.
@@ -114,7 +114,7 @@
pid_t vfork(void) __returns_twice;
/**
- * [getpid(2)](http://man7.org/linux/man-pages/man2/getpid.2.html) returns
+ * [getpid(2)](https://man7.org/linux/man-pages/man2/getpid.2.html) returns
* the caller's process ID.
*
* Returns the caller's process ID.
@@ -122,7 +122,7 @@
pid_t getpid(void);
/**
- * [gettid(2)](http://man7.org/linux/man-pages/man2/gettid.2.html) returns
+ * [gettid(2)](https://man7.org/linux/man-pages/man2/gettid.2.html) returns
* the caller's thread ID.
*
* Returns the caller's thread ID.
@@ -150,7 +150,7 @@
int nice(int __incr);
/**
- * [setegid(2)](http://man7.org/linux/man-pages/man2/setegid.2.html) sets
+ * [setegid(2)](https://man7.org/linux/man-pages/man2/setegid.2.html) sets
* the effective group ID.
*
* On Android, this function only affects the calling thread, not all threads
@@ -161,7 +161,7 @@
int setegid(gid_t __gid);
/**
- * [seteuid(2)](http://man7.org/linux/man-pages/man2/seteuid.2.html) sets
+ * [seteuid(2)](https://man7.org/linux/man-pages/man2/seteuid.2.html) sets
* the effective user ID.
*
* On Android, this function only affects the calling thread, not all threads
@@ -172,7 +172,7 @@
int seteuid(uid_t __uid);
/**
- * [setgid(2)](http://man7.org/linux/man-pages/man2/setgid.2.html) sets
+ * [setgid(2)](https://man7.org/linux/man-pages/man2/setgid.2.html) sets
* the group ID.
*
* On Android, this function only affects the calling thread, not all threads
@@ -183,7 +183,7 @@
int setgid(gid_t __gid);
/**
- * [setregid(2)](http://man7.org/linux/man-pages/man2/setregid.2.html) sets
+ * [setregid(2)](https://man7.org/linux/man-pages/man2/setregid.2.html) sets
* the real and effective group IDs (use -1 to leave an ID unchanged).
*
* On Android, this function only affects the calling thread, not all threads
@@ -194,7 +194,7 @@
int setregid(gid_t __rgid, gid_t __egid);
/**
- * [setresgid(2)](http://man7.org/linux/man-pages/man2/setresgid.2.html) sets
+ * [setresgid(2)](https://man7.org/linux/man-pages/man2/setresgid.2.html) sets
* the real, effective, and saved group IDs (use -1 to leave an ID unchanged).
*
* On Android, this function only affects the calling thread, not all threads
@@ -205,7 +205,7 @@
int setresgid(gid_t __rgid, gid_t __egid, gid_t __sgid);
/**
- * [setresuid(2)](http://man7.org/linux/man-pages/man2/setresuid.2.html) sets
+ * [setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html) sets
* the real, effective, and saved user IDs (use -1 to leave an ID unchanged).
*
* On Android, this function only affects the calling thread, not all threads
@@ -216,7 +216,7 @@
int setresuid(uid_t __ruid, uid_t __euid, uid_t __suid);
/**
- * [setreuid(2)](http://man7.org/linux/man-pages/man2/setreuid.2.html) sets
+ * [setreuid(2)](https://man7.org/linux/man-pages/man2/setreuid.2.html) sets
* the real and effective group IDs (use -1 to leave an ID unchanged).
*
* On Android, this function only affects the calling thread, not all threads
@@ -227,7 +227,7 @@
int setreuid(uid_t __ruid, uid_t __euid);
/**
- * [setuid(2)](http://man7.org/linux/man-pages/man2/setuid.2.html) sets
+ * [setuid(2)](https://man7.org/linux/man-pages/man2/setuid.2.html) sets
* the user ID.
*
* On Android, this function only affects the calling thread, not all threads
diff --git a/libc/include/utime.h b/libc/include/utime.h
index 4d181a8..f06a028 100644
--- a/libc/include/utime.h
+++ b/libc/include/utime.h
@@ -40,7 +40,7 @@
__BEGIN_DECLS
/**
- * [utime(2)](http://man7.org/linux/man-pages/man2/utime.2.html) changes the access and
+ * [utime(2)](https://man7.org/linux/man-pages/man2/utime.2.html) changes the access and
* modification time of `__filename`. If `__times` is null, the current time is used.
*
* New code should prefer utimensat().
diff --git a/libc/kernel/android/scsi/scsi/scsi.h b/libc/kernel/android/scsi/scsi/scsi.h
index 3559028..4efeada 100644
--- a/libc/kernel/android/scsi/scsi/scsi.h
+++ b/libc/kernel/android/scsi/scsi/scsi.h
@@ -7,6 +7,7 @@
#ifndef _SCSI_SCSI_H
#define _SCSI_SCSI_H
#include <linux/types.h>
+#include <asm/param.h>
#include <scsi/scsi_proto.h>
#include <scsi/scsi_status.h>
struct ccs_modesel_head {
diff --git a/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h b/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h
index 1032131..9c4e459 100644
--- a/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h
+++ b/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h
@@ -420,4 +420,5 @@
#define __NR_lsm_get_self_attr (__NR_SYSCALL_BASE + 459)
#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)
#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)
+#define __NR_mseal (__NR_SYSCALL_BASE + 462)
#endif
diff --git a/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h b/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h
index 1f57604..5060c2f 100644
--- a/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h
+++ b/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h
@@ -432,4 +432,5 @@
#define __NR_lsm_get_self_attr (__NR_SYSCALL_BASE + 459)
#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)
#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)
+#define __NR_mseal (__NR_SYSCALL_BASE + 462)
#endif
diff --git a/libc/kernel/uapi/asm-generic/unistd.h b/libc/kernel/uapi/asm-generic/unistd.h
index c882751..7eaa89a 100644
--- a/libc/kernel/uapi/asm-generic/unistd.h
+++ b/libc/kernel/uapi/asm-generic/unistd.h
@@ -412,8 +412,9 @@
#define __NR_lsm_get_self_attr 459
#define __NR_lsm_set_self_attr 460
#define __NR_lsm_list_modules 461
+#define __NR_mseal 462
#undef __NR_syscalls
-#define __NR_syscalls 462
+#define __NR_syscalls 463
#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
#define __NR_fcntl __NR3264_fcntl
#define __NR_statfs __NR3264_statfs
diff --git a/libc/kernel/uapi/asm-riscv/asm/hwprobe.h b/libc/kernel/uapi/asm-riscv/asm/hwprobe.h
index 5c82561..3f30c88 100644
--- a/libc/kernel/uapi/asm-riscv/asm/hwprobe.h
+++ b/libc/kernel/uapi/asm-riscv/asm/hwprobe.h
@@ -53,6 +53,7 @@
#define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33)
#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)
#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)
+#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
diff --git a/libc/kernel/uapi/asm-riscv/asm/kvm.h b/libc/kernel/uapi/asm-riscv/asm/kvm.h
index 4c759ed..12d8f61 100644
--- a/libc/kernel/uapi/asm-riscv/asm/kvm.h
+++ b/libc/kernel/uapi/asm-riscv/asm/kvm.h
@@ -127,6 +127,7 @@
KVM_RISCV_ISA_EXT_ZFA,
KVM_RISCV_ISA_EXT_ZTSO,
KVM_RISCV_ISA_EXT_ZACAS,
+ KVM_RISCV_ISA_EXT_SSCOFPMF,
KVM_RISCV_ISA_EXT_MAX,
};
enum KVM_RISCV_SBI_EXT_ID {
diff --git a/libc/kernel/uapi/asm-x86/asm/kvm.h b/libc/kernel/uapi/asm-x86/asm/kvm.h
index 440ffb8..17b1c5d 100644
--- a/libc/kernel/uapi/asm-x86/asm/kvm.h
+++ b/libc/kernel/uapi/asm-x86/asm/kvm.h
@@ -353,7 +353,10 @@
#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
#define KVM_STATE_NESTED_SVM_VMCB_SIZE 0x1000
#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
+#define KVM_X86_GRP_SYSTEM 0
#define KVM_X86_XCOMP_GUEST_SUPP 0
+#define KVM_X86_GRP_SEV 1
+#define KVM_X86_SEV_VMSA_FEATURES 0
struct kvm_vmx_nested_state_data {
__u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
__u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
@@ -528,6 +531,7 @@
KVM_SEV_CERT_EXPORT,
KVM_SEV_GET_ATTESTATION_REPORT,
KVM_SEV_SEND_CANCEL,
+ KVM_SEV_INIT2,
KVM_SEV_NR_MAX,
};
struct kvm_sev_cmd {
@@ -537,6 +541,13 @@
__u32 error;
__u32 sev_fd;
};
+struct kvm_sev_init {
+ __u64 vmsa_features;
+ __u32 flags;
+ __u16 ghcb_version;
+ __u16 pad1;
+ __u32 pad2[8];
+};
struct kvm_sev_launch_start {
__u32 handle;
__u32 policy;
@@ -654,4 +665,6 @@
#define KVM_EXIT_HYPERCALL_LONG_MODE _BITULL(0)
#define KVM_X86_DEFAULT_VM 0
#define KVM_X86_SW_PROTECTED_VM 1
+#define KVM_X86_SEV_VM 2
+#define KVM_X86_SEV_ES_VM 3
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_32.h b/libc/kernel/uapi/asm-x86/asm/unistd_32.h
index 72076fd..59c693d 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_32.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_32.h
@@ -457,4 +457,5 @@
#define __NR_lsm_get_self_attr 459
#define __NR_lsm_set_self_attr 460
#define __NR_lsm_list_modules 461
+#define __NR_mseal 462
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_64.h b/libc/kernel/uapi/asm-x86/asm/unistd_64.h
index 8c4f76e..5dd666c 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_64.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_64.h
@@ -379,4 +379,5 @@
#define __NR_lsm_get_self_attr 459
#define __NR_lsm_set_self_attr 460
#define __NR_lsm_list_modules 461
+#define __NR_mseal 462
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_x32.h b/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
index 984cfca..a2ff6f4 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
@@ -323,6 +323,7 @@
#define __NR_set_mempolicy_home_node (__X32_SYSCALL_BIT + 450)
#define __NR_cachestat (__X32_SYSCALL_BIT + 451)
#define __NR_fchmodat2 (__X32_SYSCALL_BIT + 452)
+#define __NR_map_shadow_stack (__X32_SYSCALL_BIT + 453)
#define __NR_futex_wake (__X32_SYSCALL_BIT + 454)
#define __NR_futex_wait (__X32_SYSCALL_BIT + 455)
#define __NR_futex_requeue (__X32_SYSCALL_BIT + 456)
@@ -331,6 +332,7 @@
#define __NR_lsm_get_self_attr (__X32_SYSCALL_BIT + 459)
#define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460)
#define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461)
+#define __NR_mseal (__X32_SYSCALL_BIT + 462)
#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
diff --git a/libc/kernel/uapi/drm/drm_mode.h b/libc/kernel/uapi/drm/drm_mode.h
index 9e6296c..8fccdaf 100644
--- a/libc/kernel/uapi/drm/drm_mode.h
+++ b/libc/kernel/uapi/drm/drm_mode.h
@@ -366,6 +366,10 @@
__u16 blue;
__u16 reserved;
};
+struct drm_plane_size_hint {
+ __u16 width;
+ __u16 height;
+};
struct hdr_metadata_infoframe {
__u8 eotf;
__u8 metadata_type;
diff --git a/libc/kernel/uapi/drm/i915_drm.h b/libc/kernel/uapi/drm/i915_drm.h
index 0738cee..13eda7c 100644
--- a/libc/kernel/uapi/drm/i915_drm.h
+++ b/libc/kernel/uapi/drm/i915_drm.h
@@ -365,6 +365,7 @@
#define I915_PARAM_HAS_USERPTR_PROBE 56
#define I915_PARAM_OA_TIMESTAMP_FREQUENCY 57
#define I915_PARAM_PXP_STATUS 58
+#define I915_PARAM_HAS_CONTEXT_FREQ_HINT 59
struct drm_i915_getparam {
__s32 param;
int * value;
@@ -743,6 +744,7 @@
#define I915_CONTEXT_PARAM_PERSISTENCE 0xb
#define I915_CONTEXT_PARAM_RINGSIZE 0xc
#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd
+#define I915_CONTEXT_PARAM_LOW_LATENCY 0xe
__u64 value;
};
struct drm_i915_gem_context_param_sseu {
diff --git a/libc/kernel/uapi/drm/nouveau_drm.h b/libc/kernel/uapi/drm/nouveau_drm.h
index f7d870e..01897af 100644
--- a/libc/kernel/uapi/drm/nouveau_drm.h
+++ b/libc/kernel/uapi/drm/nouveau_drm.h
@@ -25,10 +25,16 @@
#define NOUVEAU_GETPARAM_EXEC_PUSH_MAX 17
#define NOUVEAU_GETPARAM_VRAM_BAR_SIZE 18
#define NOUVEAU_GETPARAM_VRAM_USED 19
+#define NOUVEAU_GETPARAM_HAS_VMA_TILEMODE 20
struct drm_nouveau_getparam {
__u64 param;
__u64 value;
};
+#define NOUVEAU_FIFO_ENGINE_GR 0x01
+#define NOUVEAU_FIFO_ENGINE_VP 0x02
+#define NOUVEAU_FIFO_ENGINE_PPP 0x04
+#define NOUVEAU_FIFO_ENGINE_BSP 0x08
+#define NOUVEAU_FIFO_ENGINE_CE 0x30
struct drm_nouveau_channel_alloc {
__u32 fb_ctxdma_handle;
__u32 tt_ctxdma_handle;
@@ -44,6 +50,16 @@
struct drm_nouveau_channel_free {
__s32 channel;
};
+struct drm_nouveau_notifierobj_alloc {
+ __u32 channel;
+ __u32 handle;
+ __u32 size;
+ __u32 offset;
+};
+struct drm_nouveau_gpuobj_free {
+ __s32 channel;
+ __u32 handle;
+};
#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
diff --git a/libc/kernel/uapi/drm/panthor_drm.h b/libc/kernel/uapi/drm/panthor_drm.h
new file mode 100644
index 0000000..b45c1dc
--- /dev/null
+++ b/libc/kernel/uapi/drm/panthor_drm.h
@@ -0,0 +1,240 @@
+/*
+ * This file is auto-generated. Modifications will be lost.
+ *
+ * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
+ * for more information.
+ */
+#ifndef _PANTHOR_DRM_H_
+#define _PANTHOR_DRM_H_
+#include "drm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define DRM_PANTHOR_USER_MMIO_OFFSET_32BIT (1ull << 43)
+#define DRM_PANTHOR_USER_MMIO_OFFSET_64BIT (1ull << 56)
+#define DRM_PANTHOR_USER_MMIO_OFFSET (sizeof(unsigned long) < 8 ? DRM_PANTHOR_USER_MMIO_OFFSET_32BIT : DRM_PANTHOR_USER_MMIO_OFFSET_64BIT)
+#define DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET (DRM_PANTHOR_USER_MMIO_OFFSET | 0)
+enum drm_panthor_ioctl_id {
+ DRM_PANTHOR_DEV_QUERY = 0,
+ DRM_PANTHOR_VM_CREATE,
+ DRM_PANTHOR_VM_DESTROY,
+ DRM_PANTHOR_VM_BIND,
+ DRM_PANTHOR_VM_GET_STATE,
+ DRM_PANTHOR_BO_CREATE,
+ DRM_PANTHOR_BO_MMAP_OFFSET,
+ DRM_PANTHOR_GROUP_CREATE,
+ DRM_PANTHOR_GROUP_DESTROY,
+ DRM_PANTHOR_GROUP_SUBMIT,
+ DRM_PANTHOR_GROUP_GET_STATE,
+ DRM_PANTHOR_TILER_HEAP_CREATE,
+ DRM_PANTHOR_TILER_HEAP_DESTROY,
+};
+#define DRM_IOCTL_PANTHOR(__access,__id,__type) DRM_IO ##__access(DRM_COMMAND_BASE + DRM_PANTHOR_ ##__id, struct drm_panthor_ ##__type)
+#define DRM_IOCTL_PANTHOR_DEV_QUERY DRM_IOCTL_PANTHOR(WR, DEV_QUERY, dev_query)
+#define DRM_IOCTL_PANTHOR_VM_CREATE DRM_IOCTL_PANTHOR(WR, VM_CREATE, vm_create)
+#define DRM_IOCTL_PANTHOR_VM_DESTROY DRM_IOCTL_PANTHOR(WR, VM_DESTROY, vm_destroy)
+#define DRM_IOCTL_PANTHOR_VM_BIND DRM_IOCTL_PANTHOR(WR, VM_BIND, vm_bind)
+#define DRM_IOCTL_PANTHOR_VM_GET_STATE DRM_IOCTL_PANTHOR(WR, VM_GET_STATE, vm_get_state)
+#define DRM_IOCTL_PANTHOR_BO_CREATE DRM_IOCTL_PANTHOR(WR, BO_CREATE, bo_create)
+#define DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET DRM_IOCTL_PANTHOR(WR, BO_MMAP_OFFSET, bo_mmap_offset)
+#define DRM_IOCTL_PANTHOR_GROUP_CREATE DRM_IOCTL_PANTHOR(WR, GROUP_CREATE, group_create)
+#define DRM_IOCTL_PANTHOR_GROUP_DESTROY DRM_IOCTL_PANTHOR(WR, GROUP_DESTROY, group_destroy)
+#define DRM_IOCTL_PANTHOR_GROUP_SUBMIT DRM_IOCTL_PANTHOR(WR, GROUP_SUBMIT, group_submit)
+#define DRM_IOCTL_PANTHOR_GROUP_GET_STATE DRM_IOCTL_PANTHOR(WR, GROUP_GET_STATE, group_get_state)
+#define DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE DRM_IOCTL_PANTHOR(WR, TILER_HEAP_CREATE, tiler_heap_create)
+#define DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY DRM_IOCTL_PANTHOR(WR, TILER_HEAP_DESTROY, tiler_heap_destroy)
+struct drm_panthor_obj_array {
+ __u32 stride;
+ __u32 count;
+ __u64 array;
+};
+#define DRM_PANTHOR_OBJ_ARRAY(cnt,ptr) {.stride = sizeof((ptr)[0]),.count = (cnt),.array = (__u64) (uintptr_t) (ptr) }
+enum drm_panthor_sync_op_flags {
+ DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_MASK = 0xff,
+ DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_SYNCOBJ = 0,
+ DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_TIMELINE_SYNCOBJ = 1,
+ DRM_PANTHOR_SYNC_OP_WAIT = 0 << 31,
+ DRM_PANTHOR_SYNC_OP_SIGNAL = (int) (1u << 31),
+};
+struct drm_panthor_sync_op {
+ __u32 flags;
+ __u32 handle;
+ __u64 timeline_value;
+};
+enum drm_panthor_dev_query_type {
+ DRM_PANTHOR_DEV_QUERY_GPU_INFO = 0,
+ DRM_PANTHOR_DEV_QUERY_CSIF_INFO,
+};
+struct drm_panthor_gpu_info {
+ __u32 gpu_id;
+#define DRM_PANTHOR_ARCH_MAJOR(x) ((x) >> 28)
+#define DRM_PANTHOR_ARCH_MINOR(x) (((x) >> 24) & 0xf)
+#define DRM_PANTHOR_ARCH_REV(x) (((x) >> 20) & 0xf)
+#define DRM_PANTHOR_PRODUCT_MAJOR(x) (((x) >> 16) & 0xf)
+#define DRM_PANTHOR_VERSION_MAJOR(x) (((x) >> 12) & 0xf)
+#define DRM_PANTHOR_VERSION_MINOR(x) (((x) >> 4) & 0xff)
+#define DRM_PANTHOR_VERSION_STATUS(x) ((x) & 0xf)
+ __u32 gpu_rev;
+ __u32 csf_id;
+#define DRM_PANTHOR_CSHW_MAJOR(x) (((x) >> 26) & 0x3f)
+#define DRM_PANTHOR_CSHW_MINOR(x) (((x) >> 20) & 0x3f)
+#define DRM_PANTHOR_CSHW_REV(x) (((x) >> 16) & 0xf)
+#define DRM_PANTHOR_MCU_MAJOR(x) (((x) >> 10) & 0x3f)
+#define DRM_PANTHOR_MCU_MINOR(x) (((x) >> 4) & 0x3f)
+#define DRM_PANTHOR_MCU_REV(x) ((x) & 0xf)
+ __u32 l2_features;
+ __u32 tiler_features;
+ __u32 mem_features;
+ __u32 mmu_features;
+#define DRM_PANTHOR_MMU_VA_BITS(x) ((x) & 0xff)
+ __u32 thread_features;
+ __u32 max_threads;
+ __u32 thread_max_workgroup_size;
+ __u32 thread_max_barrier_size;
+ __u32 coherency_features;
+ __u32 texture_features[4];
+ __u32 as_present;
+ __u64 shader_present;
+ __u64 l2_present;
+ __u64 tiler_present;
+ __u32 core_features;
+ __u32 pad;
+};
+struct drm_panthor_csif_info {
+ __u32 csg_slot_count;
+ __u32 cs_slot_count;
+ __u32 cs_reg_count;
+ __u32 scoreboard_slot_count;
+ __u32 unpreserved_cs_reg_count;
+ __u32 pad;
+};
+struct drm_panthor_dev_query {
+ __u32 type;
+ __u32 size;
+ __u64 pointer;
+};
+struct drm_panthor_vm_create {
+ __u32 flags;
+ __u32 id;
+ __u64 user_va_range;
+};
+struct drm_panthor_vm_destroy {
+ __u32 id;
+ __u32 pad;
+};
+enum drm_panthor_vm_bind_op_flags {
+ DRM_PANTHOR_VM_BIND_OP_MAP_READONLY = 1 << 0,
+ DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC = 1 << 1,
+ DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED = 1 << 2,
+ DRM_PANTHOR_VM_BIND_OP_TYPE_MASK = (int) (0xfu << 28),
+ DRM_PANTHOR_VM_BIND_OP_TYPE_MAP = 0 << 28,
+ DRM_PANTHOR_VM_BIND_OP_TYPE_UNMAP = 1 << 28,
+ DRM_PANTHOR_VM_BIND_OP_TYPE_SYNC_ONLY = 2 << 28,
+};
+struct drm_panthor_vm_bind_op {
+ __u32 flags;
+ __u32 bo_handle;
+ __u64 bo_offset;
+ __u64 va;
+ __u64 size;
+ struct drm_panthor_obj_array syncs;
+};
+enum drm_panthor_vm_bind_flags {
+ DRM_PANTHOR_VM_BIND_ASYNC = 1 << 0,
+};
+struct drm_panthor_vm_bind {
+ __u32 vm_id;
+ __u32 flags;
+ struct drm_panthor_obj_array ops;
+};
+enum drm_panthor_vm_state {
+ DRM_PANTHOR_VM_STATE_USABLE,
+ DRM_PANTHOR_VM_STATE_UNUSABLE,
+};
+struct drm_panthor_vm_get_state {
+ __u32 vm_id;
+ __u32 state;
+};
+enum drm_panthor_bo_flags {
+ DRM_PANTHOR_BO_NO_MMAP = (1 << 0),
+};
+struct drm_panthor_bo_create {
+ __u64 size;
+ __u32 flags;
+ __u32 exclusive_vm_id;
+ __u32 handle;
+ __u32 pad;
+};
+struct drm_panthor_bo_mmap_offset {
+ __u32 handle;
+ __u32 pad;
+ __u64 offset;
+};
+struct drm_panthor_queue_create {
+ __u8 priority;
+ __u8 pad[3];
+ __u32 ringbuf_size;
+};
+enum drm_panthor_group_priority {
+ PANTHOR_GROUP_PRIORITY_LOW = 0,
+ PANTHOR_GROUP_PRIORITY_MEDIUM,
+ PANTHOR_GROUP_PRIORITY_HIGH,
+};
+struct drm_panthor_group_create {
+ struct drm_panthor_obj_array queues;
+ __u8 max_compute_cores;
+ __u8 max_fragment_cores;
+ __u8 max_tiler_cores;
+ __u8 priority;
+ __u32 pad;
+ __u64 compute_core_mask;
+ __u64 fragment_core_mask;
+ __u64 tiler_core_mask;
+ __u32 vm_id;
+ __u32 group_handle;
+};
+struct drm_panthor_group_destroy {
+ __u32 group_handle;
+ __u32 pad;
+};
+struct drm_panthor_queue_submit {
+ __u32 queue_index;
+ __u32 stream_size;
+ __u64 stream_addr;
+ __u32 latest_flush;
+ __u32 pad;
+ struct drm_panthor_obj_array syncs;
+};
+struct drm_panthor_group_submit {
+ __u32 group_handle;
+ __u32 pad;
+ struct drm_panthor_obj_array queue_submits;
+};
+enum drm_panthor_group_state_flags {
+ DRM_PANTHOR_GROUP_STATE_TIMEDOUT = 1 << 0,
+ DRM_PANTHOR_GROUP_STATE_FATAL_FAULT = 1 << 1,
+};
+struct drm_panthor_group_get_state {
+ __u32 group_handle;
+ __u32 state;
+ __u32 fatal_queues;
+ __u32 pad;
+};
+struct drm_panthor_tiler_heap_create {
+ __u32 vm_id;
+ __u32 initial_chunk_count;
+ __u32 chunk_size;
+ __u32 max_chunks;
+ __u32 target_in_flight;
+ __u32 handle;
+ __u64 tiler_heap_ctx_gpu_va;
+ __u64 first_heap_chunk_gpu_va;
+};
+struct drm_panthor_tiler_heap_destroy {
+ __u32 handle;
+ __u32 pad;
+};
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libc/kernel/uapi/drm/xe_drm.h b/libc/kernel/uapi/drm/xe_drm.h
index dd0da6f..d1b6dad 100644
--- a/libc/kernel/uapi/drm/xe_drm.h
+++ b/libc/kernel/uapi/drm/xe_drm.h
@@ -105,7 +105,11 @@
__u32 reference_clock;
__u64 near_mem_regions;
__u64 far_mem_regions;
- __u64 reserved[8];
+ __u16 ip_ver_major;
+ __u16 ip_ver_minor;
+ __u16 ip_ver_rev;
+ __u16 pad2;
+ __u64 reserved[7];
};
struct drm_xe_query_gt_list {
__u32 num_gt;
@@ -114,9 +118,9 @@
};
struct drm_xe_query_topology_mask {
__u16 gt_id;
-#define DRM_XE_TOPO_DSS_GEOMETRY (1 << 0)
-#define DRM_XE_TOPO_DSS_COMPUTE (1 << 1)
-#define DRM_XE_TOPO_EU_PER_DSS (1 << 2)
+#define DRM_XE_TOPO_DSS_GEOMETRY 1
+#define DRM_XE_TOPO_DSS_COMPUTE 2
+#define DRM_XE_TOPO_EU_PER_DSS 4
__u16 type;
__u32 num_bytes;
__u8 mask[];
@@ -131,6 +135,7 @@
};
struct drm_xe_query_uc_fw_version {
#define XE_QUERY_UC_TYPE_GUC_SUBMISSION 0
+#define XE_QUERY_UC_TYPE_HUC 1
__u16 uc_type;
__u16 pad;
__u32 branch_ver;
@@ -209,6 +214,8 @@
#define DRM_XE_VM_BIND_OP_UNMAP_ALL 0x3
#define DRM_XE_VM_BIND_OP_PREFETCH 0x4
__u32 op;
+#define DRM_XE_VM_BIND_FLAG_READONLY (1 << 0)
+#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (1 << 1)
#define DRM_XE_VM_BIND_FLAG_NULL (1 << 2)
#define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3)
__u32 flags;
diff --git a/libc/kernel/uapi/linux/bpf.h b/libc/kernel/uapi/linux/bpf.h
index 0e9e883..c732920 100644
--- a/libc/kernel/uapi/linux/bpf.h
+++ b/libc/kernel/uapi/linux/bpf.h
@@ -272,6 +272,7 @@
BPF_CGROUP_UNIX_GETSOCKNAME,
BPF_NETKIT_PRIMARY,
BPF_NETKIT_PEER,
+ BPF_TRACE_KPROBE_SESSION,
__MAX_BPF_ATTACH_TYPE
};
#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
@@ -290,6 +291,7 @@
BPF_LINK_TYPE_TCX = 11,
BPF_LINK_TYPE_UPROBE_MULTI = 12,
BPF_LINK_TYPE_NETKIT = 13,
+ BPF_LINK_TYPE_SOCKMAP = 14,
__MAX_BPF_LINK_TYPE,
};
#define MAX_BPF_LINK_TYPE __MAX_BPF_LINK_TYPE
@@ -529,6 +531,8 @@
struct {
__u64 name;
__u32 prog_fd;
+ __u32 : 32;
+ __aligned_u64 cookie;
} raw_tracepoint;
struct {
__aligned_u64 btf;
@@ -1150,6 +1154,10 @@
__u32 ifindex;
__u32 attach_type;
} netkit;
+ struct {
+ __u32 map_id;
+ __u32 attach_type;
+ } sockmap;
};
} __attribute__((aligned(8)));
struct bpf_sock_addr {
@@ -1299,6 +1307,7 @@
BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
BPF_FIB_LOOKUP_TBID = (1U << 3),
BPF_FIB_LOOKUP_SRC = (1U << 4),
+ BPF_FIB_LOOKUP_MARK = (1U << 5),
};
enum {
BPF_FIB_LKUP_RET_SUCCESS,
@@ -1320,7 +1329,7 @@
union {
__u16 tot_len;
__u16 mtu_result;
- };
+ } __attribute__((packed, aligned(2)));
__u32 ifindex;
union {
__u8 tos;
@@ -1342,8 +1351,15 @@
};
__u32 tbid;
};
- __u8 smac[6];
- __u8 dmac[6];
+ union {
+ struct {
+ __u32 mark;
+ };
+ struct {
+ __u8 smac[6];
+ __u8 dmac[6];
+ };
+ };
};
struct bpf_redir_neigh {
__u32 nh_family;
@@ -1415,6 +1431,9 @@
struct bpf_timer {
__u64 __opaque[2];
} __attribute__((aligned(8)));
+struct bpf_wq {
+ __u64 __opaque[2];
+} __attribute__((aligned(8)));
struct bpf_dynptr {
__u64 __opaque[2];
} __attribute__((aligned(8)));
diff --git a/libc/kernel/uapi/linux/cxl_mem.h b/libc/kernel/uapi/linux/cxl_mem.h
index 942e817..abe6573 100644
--- a/libc/kernel/uapi/linux/cxl_mem.h
+++ b/libc/kernel/uapi/linux/cxl_mem.h
@@ -9,7 +9,7 @@
#include <linux/types.h>
#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
#define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
-#define CXL_CMDS ___C(INVALID, "Invalid Command"), ___C(IDENTIFY, "Identify Command"), ___C(RAW, "Raw device command"), ___C(GET_SUPPORTED_LOGS, "Get Supported Logs"), ___C(GET_FW_INFO, "Get FW Info"), ___C(GET_PARTITION_INFO, "Get Partition Information"), ___C(GET_LSA, "Get Label Storage Area"), ___C(GET_HEALTH_INFO, "Get Health Info"), ___C(GET_LOG, "Get Log"), ___C(SET_PARTITION_INFO, "Set Partition Information"), ___C(SET_LSA, "Set Label Storage Area"), ___C(GET_ALERT_CONFIG, "Get Alert Configuration"), ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), ___DEPRECATED(GET_POISON, "Get Poison List"), ___DEPRECATED(INJECT_POISON, "Inject Poison"), ___DEPRECATED(CLEAR_POISON, "Clear Poison"), ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), ___DEPRECATED(SCAN_MEDIA, "Scan Media"), ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), ___C(GET_TIMESTAMP, "Get Timestamp"), ___C(MAX, "invalid / last command")
+#define CXL_CMDS ___C(INVALID, "Invalid Command"), ___C(IDENTIFY, "Identify Command"), ___C(RAW, "Raw device command"), ___C(GET_SUPPORTED_LOGS, "Get Supported Logs"), ___C(GET_FW_INFO, "Get FW Info"), ___C(GET_PARTITION_INFO, "Get Partition Information"), ___C(GET_LSA, "Get Label Storage Area"), ___C(GET_HEALTH_INFO, "Get Health Info"), ___C(GET_LOG, "Get Log"), ___C(SET_PARTITION_INFO, "Set Partition Information"), ___C(SET_LSA, "Set Label Storage Area"), ___C(GET_ALERT_CONFIG, "Get Alert Configuration"), ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), ___DEPRECATED(GET_POISON, "Get Poison List"), ___DEPRECATED(INJECT_POISON, "Inject Poison"), ___DEPRECATED(CLEAR_POISON, "Clear Poison"), ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), ___DEPRECATED(SCAN_MEDIA, "Scan Media"), ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), ___C(GET_TIMESTAMP, "Get Timestamp"), ___C(GET_LOG_CAPS, "Get Log Capabilities"), ___C(CLEAR_LOG, "Clear Log"), ___C(GET_SUP_LOG_SUBLIST, "Get Supported Logs Sub-List"), ___C(MAX, "invalid / last command")
#define ___C(a,b) CXL_MEM_COMMAND_ID_ ##a
#define ___DEPRECATED(a,b) CXL_MEM_DEPRECATED_ID_ ##a
enum {
diff --git a/libc/kernel/uapi/linux/devlink.h b/libc/kernel/uapi/linux/devlink.h
index 968d6be..d87c189 100644
--- a/libc/kernel/uapi/linux/devlink.h
+++ b/libc/kernel/uapi/linux/devlink.h
@@ -466,6 +466,7 @@
DEVLINK_PORT_FN_ATTR_OPSTATE,
DEVLINK_PORT_FN_ATTR_CAPS,
DEVLINK_PORT_FN_ATTR_DEVLINK,
+ DEVLINK_PORT_FN_ATTR_MAX_IO_EQS,
__DEVLINK_PORT_FUNCTION_ATTR_MAX,
DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1
};
diff --git a/libc/kernel/uapi/linux/dvb/frontend.h b/libc/kernel/uapi/linux/dvb/frontend.h
index 64e2cae..9428cc0 100644
--- a/libc/kernel/uapi/linux/dvb/frontend.h
+++ b/libc/kernel/uapi/linux/dvb/frontend.h
@@ -341,7 +341,7 @@
union {
__u64 uvalue;
__s64 svalue;
- };
+ } __attribute__((packed));
} __attribute__((packed));
#define MAX_DTV_STATS 4
struct dtv_fe_stats {
diff --git a/libc/kernel/uapi/linux/ethtool.h b/libc/kernel/uapi/linux/ethtool.h
index 48b4544..334c788 100644
--- a/libc/kernel/uapi/linux/ethtool.h
+++ b/libc/kernel/uapi/linux/ethtool.h
@@ -270,6 +270,25 @@
ETHTOOL_MODULE_POWER_MODE_LOW = 1,
ETHTOOL_MODULE_POWER_MODE_HIGH,
};
+enum ethtool_pse_types {
+ ETHTOOL_PSE_UNKNOWN = 1 << 0,
+ ETHTOOL_PSE_PODL = 1 << 1,
+ ETHTOOL_PSE_C33 = 1 << 2,
+};
+enum ethtool_c33_pse_admin_state {
+ ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN = 1,
+ ETHTOOL_C33_PSE_ADMIN_STATE_DISABLED,
+ ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED,
+};
+enum ethtool_c33_pse_pw_d_status {
+ ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN = 1,
+ ETHTOOL_C33_PSE_PW_D_STATUS_DISABLED,
+ ETHTOOL_C33_PSE_PW_D_STATUS_SEARCHING,
+ ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING,
+ ETHTOOL_C33_PSE_PW_D_STATUS_TEST,
+ ETHTOOL_C33_PSE_PW_D_STATUS_FAULT,
+ ETHTOOL_C33_PSE_PW_D_STATUS_OTHERFAULT,
+};
enum ethtool_podl_pse_admin_state {
ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN = 1,
ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED,
diff --git a/libc/kernel/uapi/linux/ethtool_netlink.h b/libc/kernel/uapi/linux/ethtool_netlink.h
index e4fc40e..6757ef5 100644
--- a/libc/kernel/uapi/linux/ethtool_netlink.h
+++ b/libc/kernel/uapi/linux/ethtool_netlink.h
@@ -103,9 +103,11 @@
__ETHTOOL_MSG_KERNEL_CNT,
ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1
};
-#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0)
-#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1)
-#define ETHTOOL_FLAG_STATS (1 << 2)
+enum ethtool_header_flags {
+ ETHTOOL_FLAG_COMPACT_BITSETS = 1 << 0,
+ ETHTOOL_FLAG_OMIT_REPLY = 1 << 1,
+ ETHTOOL_FLAG_STATS = 1 << 2,
+};
#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | ETHTOOL_FLAG_OMIT_REPLY | ETHTOOL_FLAG_STATS)
enum {
ETHTOOL_A_HEADER_UNSPEC,
@@ -355,10 +357,19 @@
ETHTOOL_A_TSINFO_TX_TYPES,
ETHTOOL_A_TSINFO_RX_FILTERS,
ETHTOOL_A_TSINFO_PHC_INDEX,
+ ETHTOOL_A_TSINFO_STATS,
__ETHTOOL_A_TSINFO_CNT,
ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1)
};
enum {
+ ETHTOOL_A_TS_STAT_UNSPEC,
+ ETHTOOL_A_TS_STAT_TX_PKTS,
+ ETHTOOL_A_TS_STAT_TX_LOST,
+ ETHTOOL_A_TS_STAT_TX_ERR,
+ __ETHTOOL_A_TS_STAT_CNT,
+ ETHTOOL_A_TS_STAT_MAX = (__ETHTOOL_A_TS_STAT_CNT - 1)
+};
+enum {
ETHTOOL_A_PHC_VCLOCKS_UNSPEC,
ETHTOOL_A_PHC_VCLOCKS_HEADER,
ETHTOOL_A_PHC_VCLOCKS_NUM,
@@ -378,6 +389,7 @@
ETHTOOL_A_CABLE_RESULT_CODE_OPEN,
ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT,
ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT,
+ ETHTOOL_A_CABLE_RESULT_CODE_IMPEDANCE_MISMATCH,
};
enum {
ETHTOOL_A_CABLE_PAIR_A,
@@ -628,6 +640,9 @@
ETHTOOL_A_PODL_PSE_ADMIN_STATE,
ETHTOOL_A_PODL_PSE_ADMIN_CONTROL,
ETHTOOL_A_PODL_PSE_PW_D_STATUS,
+ ETHTOOL_A_C33_PSE_ADMIN_STATE,
+ ETHTOOL_A_C33_PSE_ADMIN_CONTROL,
+ ETHTOOL_A_C33_PSE_PW_D_STATUS,
__ETHTOOL_A_PSE_CNT,
ETHTOOL_A_PSE_MAX = (__ETHTOOL_A_PSE_CNT - 1)
};
diff --git a/libc/kernel/uapi/linux/fcntl.h b/libc/kernel/uapi/linux/fcntl.h
index 0e5c84d..9f32f9f 100644
--- a/libc/kernel/uapi/linux/fcntl.h
+++ b/libc/kernel/uapi/linux/fcntl.h
@@ -10,9 +10,10 @@
#include <linux/openat2.h>
#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
+#define F_NOTIFY (F_LINUX_SPECIFIC_BASE + 2)
+#define F_DUPFD_QUERY (F_LINUX_SPECIFIC_BASE + 3)
#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
-#define F_NOTIFY (F_LINUX_SPECIFIC_BASE + 2)
#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
diff --git a/libc/kernel/uapi/linux/gtp.h b/libc/kernel/uapi/linux/gtp.h
index c828470..5a8cdde 100644
--- a/libc/kernel/uapi/linux/gtp.h
+++ b/libc/kernel/uapi/linux/gtp.h
@@ -31,6 +31,9 @@
GTPA_I_TEI,
GTPA_O_TEI,
GTPA_PAD,
+ GTPA_PEER_ADDR6,
+ GTPA_MS_ADDR6,
+ GTPA_FAMILY,
__GTPA_MAX,
};
#define GTPA_MAX (__GTPA_MAX - 1)
diff --git a/libc/kernel/uapi/linux/icmpv6.h b/libc/kernel/uapi/linux/icmpv6.h
index 9df18ad..a2ca922 100644
--- a/libc/kernel/uapi/linux/icmpv6.h
+++ b/libc/kernel/uapi/linux/icmpv6.h
@@ -81,6 +81,7 @@
#define ICMPV6_MOBILE_PREFIX_SOL 146
#define ICMPV6_MOBILE_PREFIX_ADV 147
#define ICMPV6_MRDISC_ADV 151
+#define ICMPV6_MRDISC_SOL 152
#define ICMPV6_MSG_MAX 255
#define ICMPV6_NOROUTE 0
#define ICMPV6_ADM_PROHIBITED 1
diff --git a/libc/kernel/uapi/linux/if_link.h b/libc/kernel/uapi/linux/if_link.h
index 397adfe..c2483a2 100644
--- a/libc/kernel/uapi/linux/if_link.h
+++ b/libc/kernel/uapi/linux/if_link.h
@@ -610,6 +610,8 @@
IFLA_GTP_ROLE,
IFLA_GTP_CREATE_SOCKETS,
IFLA_GTP_RESTART_COUNT,
+ IFLA_GTP_LOCAL,
+ IFLA_GTP_LOCAL6,
__IFLA_GTP_MAX,
};
#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
@@ -845,6 +847,7 @@
IFLA_HSR_SEQ_NR,
IFLA_HSR_VERSION,
IFLA_HSR_PROTOCOL,
+ IFLA_HSR_INTERLINK,
__IFLA_HSR_MAX,
};
#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
diff --git a/libc/kernel/uapi/linux/if_team.h b/libc/kernel/uapi/linux/if_team.h
index b22be7e..9985f63 100644
--- a/libc/kernel/uapi/linux/if_team.h
+++ b/libc/kernel/uapi/linux/if_team.h
@@ -4,30 +4,25 @@
* See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
* for more information.
*/
-#ifndef _UAPI_LINUX_IF_TEAM_H_
-#define _UAPI_LINUX_IF_TEAM_H_
+#ifndef _UAPI_LINUX_IF_TEAM_H
+#define _UAPI_LINUX_IF_TEAM_H
+#define TEAM_GENL_NAME "team"
+#define TEAM_GENL_VERSION 1
#define TEAM_STRING_MAX_LEN 32
-enum {
- TEAM_CMD_NOOP,
- TEAM_CMD_OPTIONS_SET,
- TEAM_CMD_OPTIONS_GET,
- TEAM_CMD_PORT_LIST_GET,
- __TEAM_CMD_MAX,
- TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
-};
+#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
enum {
TEAM_ATTR_UNSPEC,
TEAM_ATTR_TEAM_IFINDEX,
TEAM_ATTR_LIST_OPTION,
TEAM_ATTR_LIST_PORT,
__TEAM_ATTR_MAX,
- TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
+ TEAM_ATTR_MAX = (__TEAM_ATTR_MAX - 1)
};
enum {
TEAM_ATTR_ITEM_OPTION_UNSPEC,
TEAM_ATTR_ITEM_OPTION,
__TEAM_ATTR_ITEM_OPTION_MAX,
- TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
+ TEAM_ATTR_ITEM_OPTION_MAX = (__TEAM_ATTR_ITEM_OPTION_MAX - 1)
};
enum {
TEAM_ATTR_OPTION_UNSPEC,
@@ -39,13 +34,13 @@
TEAM_ATTR_OPTION_PORT_IFINDEX,
TEAM_ATTR_OPTION_ARRAY_INDEX,
__TEAM_ATTR_OPTION_MAX,
- TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
+ TEAM_ATTR_OPTION_MAX = (__TEAM_ATTR_OPTION_MAX - 1)
};
enum {
TEAM_ATTR_ITEM_PORT_UNSPEC,
TEAM_ATTR_ITEM_PORT,
__TEAM_ATTR_ITEM_PORT_MAX,
- TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
+ TEAM_ATTR_ITEM_PORT_MAX = (__TEAM_ATTR_ITEM_PORT_MAX - 1)
};
enum {
TEAM_ATTR_PORT_UNSPEC,
@@ -56,9 +51,14 @@
TEAM_ATTR_PORT_DUPLEX,
TEAM_ATTR_PORT_REMOVED,
__TEAM_ATTR_PORT_MAX,
- TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
+ TEAM_ATTR_PORT_MAX = (__TEAM_ATTR_PORT_MAX - 1)
};
-#define TEAM_GENL_NAME "team"
-#define TEAM_GENL_VERSION 0x1
-#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
+enum {
+ TEAM_CMD_NOOP,
+ TEAM_CMD_OPTIONS_SET,
+ TEAM_CMD_OPTIONS_GET,
+ TEAM_CMD_PORT_LIST_GET,
+ __TEAM_CMD_MAX,
+ TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1)
+};
#endif
diff --git a/libc/kernel/uapi/linux/if_tunnel.h b/libc/kernel/uapi/linux/if_tunnel.h
index e87daf2..fa6825a 100644
--- a/libc/kernel/uapi/linux/if_tunnel.h
+++ b/libc/kernel/uapi/linux/if_tunnel.h
@@ -159,4 +159,26 @@
#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
#define TUNNEL_GTP_OPT __cpu_to_be16(0x8000)
#define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT | TUNNEL_GTP_OPT)
+enum {
+ IP_TUNNEL_CSUM_BIT = 0U,
+ IP_TUNNEL_ROUTING_BIT,
+ IP_TUNNEL_KEY_BIT,
+ IP_TUNNEL_SEQ_BIT,
+ IP_TUNNEL_STRICT_BIT,
+ IP_TUNNEL_REC_BIT,
+ IP_TUNNEL_VERSION_BIT,
+ IP_TUNNEL_NO_KEY_BIT,
+ IP_TUNNEL_DONT_FRAGMENT_BIT,
+ IP_TUNNEL_OAM_BIT,
+ IP_TUNNEL_CRIT_OPT_BIT,
+ IP_TUNNEL_GENEVE_OPT_BIT,
+ IP_TUNNEL_VXLAN_OPT_BIT,
+ IP_TUNNEL_NOCACHE_BIT,
+ IP_TUNNEL_ERSPAN_OPT_BIT,
+ IP_TUNNEL_GTP_OPT_BIT,
+ IP_TUNNEL_VTI_BIT,
+ IP_TUNNEL_SIT_ISATAP_BIT = IP_TUNNEL_VTI_BIT,
+ IP_TUNNEL_PFCP_OPT_BIT,
+ __IP_TUNNEL_FLAG_NUM,
+};
#endif
diff --git a/libc/kernel/uapi/linux/input-event-codes.h b/libc/kernel/uapi/linux/input-event-codes.h
index 0fe5a14..4f93d5e 100644
--- a/libc/kernel/uapi/linux/input-event-codes.h
+++ b/libc/kernel/uapi/linux/input-event-codes.h
@@ -543,6 +543,8 @@
#define KEY_CAMERA_ACCESS_ENABLE 0x24b
#define KEY_CAMERA_ACCESS_DISABLE 0x24c
#define KEY_CAMERA_ACCESS_TOGGLE 0x24d
+#define KEY_ACCESSIBILITY 0x24e
+#define KEY_DO_NOT_DISTURB 0x24f
#define KEY_BRIGHTNESS_MIN 0x250
#define KEY_BRIGHTNESS_MAX 0x251
#define KEY_KBDINPUTASSIST_PREV 0x260
diff --git a/libc/kernel/uapi/linux/io_uring.h b/libc/kernel/uapi/linux/io_uring.h
index 10936f2..5505963 100644
--- a/libc/kernel/uapi/linux/io_uring.h
+++ b/libc/kernel/uapi/linux/io_uring.h
@@ -59,6 +59,7 @@
__u32 waitid_flags;
__u32 futex_flags;
__u32 install_fd_flags;
+ __u32 nop_flags;
};
__u64 user_data;
union {
@@ -85,7 +86,7 @@
};
};
#define IORING_FILE_INDEX_ALLOC (~0U)
-enum {
+enum io_uring_sqe_flags_bit {
IOSQE_FIXED_FILE_BIT,
IOSQE_IO_DRAIN_BIT,
IOSQE_IO_LINK_BIT,
@@ -204,15 +205,19 @@
#define IORING_RECV_MULTISHOT (1U << 1)
#define IORING_RECVSEND_FIXED_BUF (1U << 2)
#define IORING_SEND_ZC_REPORT_USAGE (1U << 3)
+#define IORING_RECVSEND_BUNDLE (1U << 4)
#define IORING_NOTIF_USAGE_ZC_COPIED (1U << 31)
#define IORING_ACCEPT_MULTISHOT (1U << 0)
-enum {
+#define IORING_ACCEPT_DONTWAIT (1U << 1)
+#define IORING_ACCEPT_POLL_FIRST (1U << 2)
+enum io_uring_msg_ring_flags {
IORING_MSG_DATA,
IORING_MSG_SEND_FD,
};
#define IORING_MSG_RING_CQE_SKIP (1U << 0)
#define IORING_MSG_RING_FLAGS_PASS (1U << 1)
#define IORING_FIXED_FD_NO_CLOEXEC (1U << 0)
+#define IORING_NOP_INJECT_RESULT (1U << 0)
struct io_uring_cqe {
__u64 user_data;
__s32 res;
@@ -223,9 +228,7 @@
#define IORING_CQE_F_MORE (1U << 1)
#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
#define IORING_CQE_F_NOTIF (1U << 3)
-enum {
- IORING_CQE_BUFFER_SHIFT = 16,
-};
+#define IORING_CQE_BUFFER_SHIFT 16
#define IORING_OFF_SQ_RING 0ULL
#define IORING_OFF_CQ_RING 0x8000000ULL
#define IORING_OFF_SQES 0x10000000ULL
@@ -289,7 +292,8 @@
#define IORING_FEAT_CQE_SKIP (1U << 11)
#define IORING_FEAT_LINKED_FILE (1U << 12)
#define IORING_FEAT_REG_REG_RING (1U << 13)
-enum {
+#define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)
+enum io_uring_register_op {
IORING_REGISTER_BUFFERS = 0,
IORING_UNREGISTER_BUFFERS = 1,
IORING_REGISTER_FILES = 2,
@@ -322,7 +326,7 @@
IORING_REGISTER_LAST,
IORING_REGISTER_USE_REGISTERED_RING = 1U << 31
};
-enum {
+enum io_wq_type {
IO_WQ_BOUND,
IO_WQ_UNBOUND,
};
@@ -394,7 +398,7 @@
__DECLARE_FLEX_ARRAY(struct io_uring_buf, bufs);
};
};
-enum {
+enum io_uring_register_pbuf_ring_flags {
IOU_PBUF_RING_MMAP = 1,
};
struct io_uring_buf_reg {
@@ -415,7 +419,7 @@
__u8 pad[3];
__u64 resv;
};
-enum {
+enum io_uring_register_restriction_op {
IORING_RESTRICTION_REGISTER_OP = 0,
IORING_RESTRICTION_SQE_OP = 1,
IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2,
@@ -448,7 +452,7 @@
__u32 payloadlen;
__u32 flags;
};
-enum {
+enum io_uring_socket_op {
SOCKET_URING_OP_SIOCINQ = 0,
SOCKET_URING_OP_SIOCOUTQ,
SOCKET_URING_OP_GETSOCKOPT,
diff --git a/libc/kernel/uapi/linux/iommu.h b/libc/kernel/uapi/linux/iommu.h
deleted file mode 100644
index 3a7bf82..0000000
--- a/libc/kernel/uapi/linux/iommu.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This file is auto-generated. Modifications will be lost.
- *
- * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
- * for more information.
- */
-#ifndef _UAPI_IOMMU_H
-#define _UAPI_IOMMU_H
-#include <linux/types.h>
-#define IOMMU_FAULT_PERM_READ (1 << 0)
-#define IOMMU_FAULT_PERM_WRITE (1 << 1)
-#define IOMMU_FAULT_PERM_EXEC (1 << 2)
-#define IOMMU_FAULT_PERM_PRIV (1 << 3)
-enum iommu_fault_type {
- IOMMU_FAULT_DMA_UNRECOV = 1,
- IOMMU_FAULT_PAGE_REQ,
-};
-enum iommu_fault_reason {
- IOMMU_FAULT_REASON_UNKNOWN = 0,
- IOMMU_FAULT_REASON_PASID_FETCH,
- IOMMU_FAULT_REASON_BAD_PASID_ENTRY,
- IOMMU_FAULT_REASON_PASID_INVALID,
- IOMMU_FAULT_REASON_WALK_EABT,
- IOMMU_FAULT_REASON_PTE_FETCH,
- IOMMU_FAULT_REASON_PERMISSION,
- IOMMU_FAULT_REASON_ACCESS,
- IOMMU_FAULT_REASON_OOR_ADDRESS,
-};
-struct iommu_fault_unrecoverable {
- __u32 reason;
-#define IOMMU_FAULT_UNRECOV_PASID_VALID (1 << 0)
-#define IOMMU_FAULT_UNRECOV_ADDR_VALID (1 << 1)
-#define IOMMU_FAULT_UNRECOV_FETCH_ADDR_VALID (1 << 2)
- __u32 flags;
- __u32 pasid;
- __u32 perm;
- __u64 addr;
- __u64 fetch_addr;
-};
-struct iommu_fault_page_request {
-#define IOMMU_FAULT_PAGE_REQUEST_PASID_VALID (1 << 0)
-#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
-#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2)
-#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3)
- __u32 flags;
- __u32 pasid;
- __u32 grpid;
- __u32 perm;
- __u64 addr;
- __u64 private_data[2];
-};
-struct iommu_fault {
- __u32 type;
- __u32 padding;
- union {
- struct iommu_fault_unrecoverable event;
- struct iommu_fault_page_request prm;
- __u8 padding2[56];
- };
-};
-enum iommu_page_response_code {
- IOMMU_PAGE_RESP_SUCCESS = 0,
- IOMMU_PAGE_RESP_INVALID,
- IOMMU_PAGE_RESP_FAILURE,
-};
-struct iommu_page_response {
- __u32 argsz;
-#define IOMMU_PAGE_RESP_VERSION_1 1
- __u32 version;
-#define IOMMU_PAGE_RESP_PASID_VALID (1 << 0)
- __u32 flags;
- __u32 pasid;
- __u32 grpid;
- __u32 code;
-};
-#endif
diff --git a/libc/kernel/uapi/linux/kexec.h b/libc/kernel/uapi/linux/kexec.h
index c5c8623..d34f065 100644
--- a/libc/kernel/uapi/linux/kexec.h
+++ b/libc/kernel/uapi/linux/kexec.h
@@ -10,6 +10,7 @@
#define KEXEC_ON_CRASH 0x00000001
#define KEXEC_PRESERVE_CONTEXT 0x00000002
#define KEXEC_UPDATE_ELFCOREHDR 0x00000004
+#define KEXEC_CRASH_HOTPLUG_SUPPORT 0x00000008
#define KEXEC_ARCH_MASK 0xffff0000
#define KEXEC_FILE_UNLOAD 0x00000001
#define KEXEC_FILE_ON_CRASH 0x00000002
diff --git a/libc/kernel/uapi/linux/landlock.h b/libc/kernel/uapi/linux/landlock.h
index 75d3037..f903ae6 100644
--- a/libc/kernel/uapi/linux/landlock.h
+++ b/libc/kernel/uapi/linux/landlock.h
@@ -39,6 +39,7 @@
#define LANDLOCK_ACCESS_FS_MAKE_SYM (1ULL << 12)
#define LANDLOCK_ACCESS_FS_REFER (1ULL << 13)
#define LANDLOCK_ACCESS_FS_TRUNCATE (1ULL << 14)
+#define LANDLOCK_ACCESS_FS_IOCTL_DEV (1ULL << 15)
#define LANDLOCK_ACCESS_NET_BIND_TCP (1ULL << 0)
#define LANDLOCK_ACCESS_NET_CONNECT_TCP (1ULL << 1)
#endif
diff --git a/libc/kernel/uapi/linux/magic.h b/libc/kernel/uapi/linux/magic.h
index 4d24726..5f2a2a2 100644
--- a/libc/kernel/uapi/linux/magic.h
+++ b/libc/kernel/uapi/linux/magic.h
@@ -41,6 +41,7 @@
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
#define OVERLAYFS_SUPER_MAGIC 0x794c7630
#define FUSE_SUPER_MAGIC 0x65735546
+#define BCACHEFS_SUPER_MAGIC 0xca451a4e
#define MINIX_SUPER_MAGIC 0x137F
#define MINIX_SUPER_MAGIC2 0x138F
#define MINIX2_SUPER_MAGIC 0x2468
diff --git a/libc/kernel/uapi/linux/media-bus-format.h b/libc/kernel/uapi/linux/media-bus-format.h
index 230bfbb..cb36554 100644
--- a/libc/kernel/uapi/linux/media-bus-format.h
+++ b/libc/kernel/uapi/linux/media-bus-format.h
@@ -126,4 +126,11 @@
#define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001
#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001
#define MEDIA_BUS_FMT_METADATA_FIXED 0x7001
+#define MEDIA_BUS_FMT_META_8 0x8001
+#define MEDIA_BUS_FMT_META_10 0x8002
+#define MEDIA_BUS_FMT_META_12 0x8003
+#define MEDIA_BUS_FMT_META_14 0x8004
+#define MEDIA_BUS_FMT_META_16 0x8005
+#define MEDIA_BUS_FMT_META_20 0x8006
+#define MEDIA_BUS_FMT_META_24 0x8007
#endif
diff --git a/libc/kernel/uapi/linux/mptcp.h b/libc/kernel/uapi/linux/mptcp.h
index 3c9ba5e..03d3691 100644
--- a/libc/kernel/uapi/linux/mptcp.h
+++ b/libc/kernel/uapi/linux/mptcp.h
@@ -53,6 +53,10 @@
__u64 mptcpi_bytes_received;
__u64 mptcpi_bytes_acked;
__u8 mptcpi_subflows_total;
+ __u8 reserved[3];
+ __u32 mptcpi_last_data_sent;
+ __u32 mptcpi_last_data_recv;
+ __u32 mptcpi_last_ack_recv;
};
#define MPTCP_RST_EUNSPEC 0
#define MPTCP_RST_EMPTCP 1
diff --git a/libc/kernel/uapi/linux/netdev.h b/libc/kernel/uapi/linux/netdev.h
index cbfe26a..b084297 100644
--- a/libc/kernel/uapi/linux/netdev.h
+++ b/libc/kernel/uapi/linux/netdev.h
@@ -96,6 +96,28 @@
NETDEV_A_QSTATS_TX_PACKETS,
NETDEV_A_QSTATS_TX_BYTES,
NETDEV_A_QSTATS_RX_ALLOC_FAIL,
+ NETDEV_A_QSTATS_RX_HW_DROPS,
+ NETDEV_A_QSTATS_RX_HW_DROP_OVERRUNS,
+ NETDEV_A_QSTATS_RX_CSUM_COMPLETE,
+ NETDEV_A_QSTATS_RX_CSUM_UNNECESSARY,
+ NETDEV_A_QSTATS_RX_CSUM_NONE,
+ NETDEV_A_QSTATS_RX_CSUM_BAD,
+ NETDEV_A_QSTATS_RX_HW_GRO_PACKETS,
+ NETDEV_A_QSTATS_RX_HW_GRO_BYTES,
+ NETDEV_A_QSTATS_RX_HW_GRO_WIRE_PACKETS,
+ NETDEV_A_QSTATS_RX_HW_GRO_WIRE_BYTES,
+ NETDEV_A_QSTATS_RX_HW_DROP_RATELIMITS,
+ NETDEV_A_QSTATS_TX_HW_DROPS,
+ NETDEV_A_QSTATS_TX_HW_DROP_ERRORS,
+ NETDEV_A_QSTATS_TX_CSUM_NONE,
+ NETDEV_A_QSTATS_TX_NEEDS_CSUM,
+ NETDEV_A_QSTATS_TX_HW_GSO_PACKETS,
+ NETDEV_A_QSTATS_TX_HW_GSO_BYTES,
+ NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS,
+ NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES,
+ NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS,
+ NETDEV_A_QSTATS_TX_STOP,
+ NETDEV_A_QSTATS_TX_WAKE,
__NETDEV_A_QSTATS_MAX,
NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
};
diff --git a/libc/kernel/uapi/linux/nfs.h b/libc/kernel/uapi/linux/nfs.h
index 710e8ca..7b18f1f 100644
--- a/libc/kernel/uapi/linux/nfs.h
+++ b/libc/kernel/uapi/linux/nfs.h
@@ -47,7 +47,6 @@
NFSERR_NOSPC = 28,
NFSERR_ROFS = 30,
NFSERR_MLINK = 31,
- NFSERR_OPNOTSUPP = 45,
NFSERR_NAMETOOLONG = 63,
NFSERR_NOTEMPTY = 66,
NFSERR_DQUOT = 69,
diff --git a/libc/kernel/uapi/linux/nfsd_netlink.h b/libc/kernel/uapi/linux/nfsd_netlink.h
index dd3d570..45cb504 100644
--- a/libc/kernel/uapi/linux/nfsd_netlink.h
+++ b/libc/kernel/uapi/linux/nfsd_netlink.h
@@ -27,7 +27,44 @@
NFSD_A_RPC_STATUS_MAX = (__NFSD_A_RPC_STATUS_MAX - 1)
};
enum {
+ NFSD_A_SERVER_THREADS = 1,
+ NFSD_A_SERVER_GRACETIME,
+ NFSD_A_SERVER_LEASETIME,
+ NFSD_A_SERVER_SCOPE,
+ __NFSD_A_SERVER_MAX,
+ NFSD_A_SERVER_MAX = (__NFSD_A_SERVER_MAX - 1)
+};
+enum {
+ NFSD_A_VERSION_MAJOR = 1,
+ NFSD_A_VERSION_MINOR,
+ NFSD_A_VERSION_ENABLED,
+ __NFSD_A_VERSION_MAX,
+ NFSD_A_VERSION_MAX = (__NFSD_A_VERSION_MAX - 1)
+};
+enum {
+ NFSD_A_SERVER_PROTO_VERSION = 1,
+ __NFSD_A_SERVER_PROTO_MAX,
+ NFSD_A_SERVER_PROTO_MAX = (__NFSD_A_SERVER_PROTO_MAX - 1)
+};
+enum {
+ NFSD_A_SOCK_ADDR = 1,
+ NFSD_A_SOCK_TRANSPORT_NAME,
+ __NFSD_A_SOCK_MAX,
+ NFSD_A_SOCK_MAX = (__NFSD_A_SOCK_MAX - 1)
+};
+enum {
+ NFSD_A_SERVER_SOCK_ADDR = 1,
+ __NFSD_A_SERVER_SOCK_MAX,
+ NFSD_A_SERVER_SOCK_MAX = (__NFSD_A_SERVER_SOCK_MAX - 1)
+};
+enum {
NFSD_CMD_RPC_STATUS_GET = 1,
+ NFSD_CMD_THREADS_SET,
+ NFSD_CMD_THREADS_GET,
+ NFSD_CMD_VERSION_SET,
+ NFSD_CMD_VERSION_GET,
+ NFSD_CMD_LISTENER_SET,
+ NFSD_CMD_LISTENER_GET,
__NFSD_CMD_MAX,
NFSD_CMD_MAX = (__NFSD_CMD_MAX - 1)
};
diff --git a/libc/kernel/uapi/linux/nl80211.h b/libc/kernel/uapi/linux/nl80211.h
index ddf2b3b..98180c2 100644
--- a/libc/kernel/uapi/linux/nl80211.h
+++ b/libc/kernel/uapi/linux/nl80211.h
@@ -1423,7 +1423,7 @@
NUM_NL80211_PLINK_STATES,
MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
};
-enum plink_actions {
+enum nl80211_plink_action {
NL80211_PLINK_ACTION_NO_ACTION,
NL80211_PLINK_ACTION_OPEN,
NL80211_PLINK_ACTION_BLOCK,
diff --git a/libc/kernel/uapi/linux/ntsync.h b/libc/kernel/uapi/linux/ntsync.h
new file mode 100644
index 0000000..857b31b
--- /dev/null
+++ b/libc/kernel/uapi/linux/ntsync.h
@@ -0,0 +1,17 @@
+/*
+ * This file is auto-generated. Modifications will be lost.
+ *
+ * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
+ * for more information.
+ */
+#ifndef __LINUX_NTSYNC_H
+#define __LINUX_NTSYNC_H
+#include <linux/types.h>
+struct ntsync_sem_args {
+ __u32 sem;
+ __u32 count;
+ __u32 max;
+};
+#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args)
+#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
+#endif
diff --git a/libc/kernel/uapi/linux/papr_pdsm.h b/libc/kernel/uapi/linux/papr_pdsm.h
new file mode 100644
index 0000000..f466caa
--- /dev/null
+++ b/libc/kernel/uapi/linux/papr_pdsm.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated. Modifications will be lost.
+ *
+ * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
+ * for more information.
+ */
+#ifndef _UAPI_ASM_POWERPC_PAPR_PDSM_H_
+#define _UAPI_ASM_POWERPC_PAPR_PDSM_H_
+#include <linux/types.h>
+#include <linux/ndctl.h>
+#define ND_PDSM_PAYLOAD_MAX_SIZE 184
+#define ND_PDSM_HDR_SIZE (sizeof(struct nd_pkg_pdsm) - ND_PDSM_PAYLOAD_MAX_SIZE)
+#define PAPR_PDSM_DIMM_HEALTHY 0
+#define PAPR_PDSM_DIMM_UNHEALTHY 1
+#define PAPR_PDSM_DIMM_CRITICAL 2
+#define PAPR_PDSM_DIMM_FATAL 3
+#define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1
+#define PDSM_DIMM_DSC_VALID 2
+struct nd_papr_pdsm_health {
+ union {
+ struct {
+ __u32 extension_flags;
+ __u8 dimm_unarmed;
+ __u8 dimm_bad_shutdown;
+ __u8 dimm_bad_restore;
+ __u8 dimm_scrubbed;
+ __u8 dimm_locked;
+ __u8 dimm_encrypted;
+ __u16 dimm_health;
+ __u16 dimm_fuel_gauge;
+ __u64 dimm_dsc;
+ };
+ __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
+ };
+};
+#define PDSM_SMART_INJECT_HEALTH_FATAL (1 << 0)
+#define PDSM_SMART_INJECT_BAD_SHUTDOWN (1 << 1)
+struct nd_papr_pdsm_smart_inject {
+ union {
+ struct {
+ __u32 flags;
+ __u8 fatal_enable;
+ __u8 unsafe_shutdown_enable;
+ };
+ __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
+ };
+};
+enum papr_pdsm {
+ PAPR_PDSM_MIN = 0x0,
+ PAPR_PDSM_HEALTH,
+ PAPR_PDSM_SMART_INJECT,
+ PAPR_PDSM_MAX,
+};
+union nd_pdsm_payload {
+ struct nd_papr_pdsm_health health;
+ struct nd_papr_pdsm_smart_inject smart_inject;
+ __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
+} __attribute__((__packed__));
+struct nd_pkg_pdsm {
+ __s32 cmd_status;
+ __u16 reserved[2];
+ union nd_pdsm_payload payload;
+} __attribute__((__packed__));
+#endif
diff --git a/libc/kernel/uapi/linux/pci_regs.h b/libc/kernel/uapi/linux/pci_regs.h
index e26392b..703d398 100644
--- a/libc/kernel/uapi/linux/pci_regs.h
+++ b/libc/kernel/uapi/linux/pci_regs.h
@@ -963,7 +963,11 @@
#define PCI_DOE_DATA_OBJECT_HEADER_1_TYPE 0x00ff0000
#define PCI_DOE_DATA_OBJECT_HEADER_2_LENGTH 0x0003ffff
#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff
+#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_VER 0x0000ff00
#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff
#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000
#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000
+#define PCI_DVSEC_CXL_PORT 3
+#define PCI_DVSEC_CXL_PORT_CTL 0x0c
+#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001
#endif
diff --git a/libc/kernel/uapi/linux/pkt_cls.h b/libc/kernel/uapi/linux/pkt_cls.h
index b402fa6..6b5143c 100644
--- a/libc/kernel/uapi/linux/pkt_cls.h
+++ b/libc/kernel/uapi/linux/pkt_cls.h
@@ -437,6 +437,7 @@
TCA_FLOWER_KEY_ENC_OPTS_VXLAN,
TCA_FLOWER_KEY_ENC_OPTS_ERSPAN,
TCA_FLOWER_KEY_ENC_OPTS_GTP,
+ TCA_FLOWER_KEY_ENC_OPTS_PFCP,
__TCA_FLOWER_KEY_ENC_OPTS_MAX,
};
#define TCA_FLOWER_KEY_ENC_OPTS_MAX (__TCA_FLOWER_KEY_ENC_OPTS_MAX - 1)
@@ -471,6 +472,13 @@
};
#define TCA_FLOWER_KEY_ENC_OPT_GTP_MAX (__TCA_FLOWER_KEY_ENC_OPT_GTP_MAX - 1)
enum {
+ TCA_FLOWER_KEY_ENC_OPT_PFCP_UNSPEC,
+ TCA_FLOWER_KEY_ENC_OPT_PFCP_TYPE,
+ TCA_FLOWER_KEY_ENC_OPT_PFCP_SEID,
+ __TCA_FLOWER_KEY_ENC_OPT_PFCP_MAX,
+};
+#define TCA_FLOWER_KEY_ENC_OPT_PFCP_MAX (__TCA_FLOWER_KEY_ENC_OPT_PFCP_MAX - 1)
+enum {
TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
TCA_FLOWER_KEY_MPLS_OPTS_LSE,
__TCA_FLOWER_KEY_MPLS_OPTS_MAX,
diff --git a/libc/kernel/uapi/linux/prctl.h b/libc/kernel/uapi/linux/prctl.h
index 48e100b..136a10f 100644
--- a/libc/kernel/uapi/linux/prctl.h
+++ b/libc/kernel/uapi/linux/prctl.h
@@ -190,4 +190,21 @@
#define PR_RISCV_V_VSTATE_CTRL_CUR_MASK 0x3
#define PR_RISCV_V_VSTATE_CTRL_NEXT_MASK 0xc
#define PR_RISCV_V_VSTATE_CTRL_MASK 0x1f
+#define PR_RISCV_SET_ICACHE_FLUSH_CTX 71
+#define PR_RISCV_CTX_SW_FENCEI_ON 0
+#define PR_RISCV_CTX_SW_FENCEI_OFF 1
+#define PR_RISCV_SCOPE_PER_PROCESS 0
+#define PR_RISCV_SCOPE_PER_THREAD 1
+#define PR_PPC_GET_DEXCR 72
+#define PR_PPC_SET_DEXCR 73
+#define PR_PPC_DEXCR_SBHE 0
+#define PR_PPC_DEXCR_IBRTPD 1
+#define PR_PPC_DEXCR_SRAPD 2
+#define PR_PPC_DEXCR_NPHIE 3
+#define PR_PPC_DEXCR_CTRL_EDITABLE 0x1
+#define PR_PPC_DEXCR_CTRL_SET 0x2
+#define PR_PPC_DEXCR_CTRL_CLEAR 0x4
+#define PR_PPC_DEXCR_CTRL_SET_ONEXEC 0x8
+#define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10
+#define PR_PPC_DEXCR_CTRL_MASK 0x1f
#endif
diff --git a/libc/kernel/uapi/linux/snmp.h b/libc/kernel/uapi/linux/snmp.h
index 2f4c65c..0f72302 100644
--- a/libc/kernel/uapi/linux/snmp.h
+++ b/libc/kernel/uapi/linux/snmp.h
@@ -289,6 +289,8 @@
LINUX_MIB_XFRMFWDHDRERROR,
LINUX_MIB_XFRMOUTSTATEINVALID,
LINUX_MIB_XFRMACQUIREERROR,
+ LINUX_MIB_XFRMOUTSTATEDIRERROR,
+ LINUX_MIB_XFRMINSTATEDIRERROR,
__LINUX_MIB_XFRMMAX
};
enum {
diff --git a/libc/kernel/uapi/linux/stat.h b/libc/kernel/uapi/linux/stat.h
index 9974f3e..ff98fd2 100644
--- a/libc/kernel/uapi/linux/stat.h
+++ b/libc/kernel/uapi/linux/stat.h
@@ -68,7 +68,8 @@
__u64 stx_mnt_id;
__u32 stx_dio_mem_align;
__u32 stx_dio_offset_align;
- __u64 __spare3[12];
+ __u64 stx_subvol;
+ __u64 __spare3[11];
};
#define STATX_TYPE 0x00000001U
#define STATX_MODE 0x00000002U
@@ -86,6 +87,7 @@
#define STATX_MNT_ID 0x00001000U
#define STATX_DIOALIGN 0x00002000U
#define STATX_MNT_ID_UNIQUE 0x00004000U
+#define STATX_SUBVOL 0x00008000U
#define STATX__RESERVED 0x80000000U
#define STATX_ALL 0x00000fffU
#define STATX_ATTR_COMPRESSED 0x00000004
diff --git a/libc/kernel/uapi/linux/stddef.h b/libc/kernel/uapi/linux/stddef.h
index aa3a694..dc37c6f 100644
--- a/libc/kernel/uapi/linux/stddef.h
+++ b/libc/kernel/uapi/linux/stddef.h
@@ -19,4 +19,10 @@
#ifndef __counted_by
#define __counted_by(m)
#endif
+#ifndef __counted_by_le
+#define __counted_by_le(m)
+#endif
+#ifndef __counted_by_be
+#define __counted_by_be(m)
+#endif
#endif
diff --git a/libc/kernel/uapi/linux/tcp.h b/libc/kernel/uapi/linux/tcp.h
index cb26f97..c71715c 100644
--- a/libc/kernel/uapi/linux/tcp.h
+++ b/libc/kernel/uapi/linux/tcp.h
@@ -71,6 +71,7 @@
#define TCP_AO_INFO 40
#define TCP_AO_GET_KEYS 41
#define TCP_AO_REPAIR 42
+#define TCP_IS_MPTCP 43
#define TCP_REPAIR_ON 1
#define TCP_REPAIR_OFF 0
#define TCP_REPAIR_OFF_NO_WP - 1
diff --git a/libc/kernel/uapi/linux/tee.h b/libc/kernel/uapi/linux/tee.h
index d4772ee..6e4cff3 100644
--- a/libc/kernel/uapi/linux/tee.h
+++ b/libc/kernel/uapi/linux/tee.h
@@ -18,6 +18,7 @@
#define TEE_MEMREF_NULL (__u64) (- 1)
#define TEE_IMPL_ID_OPTEE 1
#define TEE_IMPL_ID_AMDTEE 2
+#define TEE_IMPL_ID_TSTEE 3
#define TEE_OPTEE_CAP_TZ (1 << 0)
struct tee_ioctl_version_data {
__u32 impl_id;
diff --git a/libc/kernel/uapi/linux/trace_mmap.h b/libc/kernel/uapi/linux/trace_mmap.h
new file mode 100644
index 0000000..e891a7e
--- /dev/null
+++ b/libc/kernel/uapi/linux/trace_mmap.h
@@ -0,0 +1,28 @@
+/*
+ * This file is auto-generated. Modifications will be lost.
+ *
+ * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
+ * for more information.
+ */
+#ifndef _TRACE_MMAP_H_
+#define _TRACE_MMAP_H_
+#include <linux/types.h>
+struct trace_buffer_meta {
+ __u32 meta_page_size;
+ __u32 meta_struct_len;
+ __u32 subbuf_size;
+ __u32 nr_subbufs;
+ struct {
+ __u64 lost_events;
+ __u32 id;
+ __u32 read;
+ } reader;
+ __u64 flags;
+ __u64 entries;
+ __u64 overrun;
+ __u64 read;
+ __u64 Reserved1;
+ __u64 Reserved2;
+};
+#define TRACE_MMAP_IOCTL_GET_READER _IO('R', 0x20)
+#endif
diff --git a/libc/kernel/uapi/linux/v4l2-subdev.h b/libc/kernel/uapi/linux/v4l2-subdev.h
index 9caaa47..b5a0c87 100644
--- a/libc/kernel/uapi/linux/v4l2-subdev.h
+++ b/libc/kernel/uapi/linux/v4l2-subdev.h
@@ -100,9 +100,10 @@
};
struct v4l2_subdev_routing {
__u32 which;
- __u32 num_routes;
+ __u32 len_routes;
__u64 routes;
- __u32 reserved[6];
+ __u32 num_routes;
+ __u32 reserved[11];
};
#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0)
#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH (1ULL << 1)
diff --git a/libc/kernel/uapi/linux/version.h b/libc/kernel/uapi/linux/version.h
index 1563f47..7faa30f 100644
--- a/libc/kernel/uapi/linux/version.h
+++ b/libc/kernel/uapi/linux/version.h
@@ -4,8 +4,8 @@
* See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
* for more information.
*/
-#define LINUX_VERSION_CODE 395520
+#define LINUX_VERSION_CODE 395776
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
#define LINUX_VERSION_MAJOR 6
-#define LINUX_VERSION_PATCHLEVEL 9
+#define LINUX_VERSION_PATCHLEVEL 10
#define LINUX_VERSION_SUBLEVEL 0
diff --git a/libc/kernel/uapi/linux/videodev2.h b/libc/kernel/uapi/linux/videodev2.h
index ed91484..3905949 100644
--- a/libc/kernel/uapi/linux/videodev2.h
+++ b/libc/kernel/uapi/linux/videodev2.h
@@ -249,6 +249,8 @@
#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B')
#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P')
#define V4L2_PIX_FMT_IPU3_Y10 v4l2_fourcc('i', 'p', '3', 'y')
+#define V4L2_PIX_FMT_Y12P v4l2_fourcc('Y', '1', '2', 'P')
+#define V4L2_PIX_FMT_Y14P v4l2_fourcc('Y', '1', '4', 'P')
#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8')
#define V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ')
#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V')
@@ -464,6 +466,7 @@
#define V4L2_FMT_FLAG_CSC_YCBCR_ENC 0x0080
#define V4L2_FMT_FLAG_CSC_HSV_ENC V4L2_FMT_FLAG_CSC_YCBCR_ENC
#define V4L2_FMT_FLAG_CSC_QUANTIZATION 0x0100
+#define V4L2_FMT_FLAG_META_LINE_BASED 0x0200
enum v4l2_frmsizetypes {
V4L2_FRMSIZE_TYPE_DISCRETE = 1,
V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
@@ -563,6 +566,7 @@
#define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5)
#define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS (1 << 6)
#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS (1 << 7)
+#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS (1 << 8)
struct v4l2_plane {
__u32 bytesused;
__u32 length;
@@ -936,7 +940,7 @@
struct v4l2_ctrl_hdr10_cll_info * p_hdr10_cll_info;
struct v4l2_ctrl_hdr10_mastering_display * p_hdr10_mastering_display;
void * ptr;
- };
+ } __attribute__((packed));
} __attribute__((packed));
struct v4l2_ext_controls {
union {
@@ -1311,6 +1315,9 @@
struct v4l2_meta_format {
__u32 dataformat;
__u32 buffersize;
+ __u32 width;
+ __u32 height;
+ __u32 bytesperline;
} __attribute__((packed));
struct v4l2_format {
__u32 type;
@@ -1435,6 +1442,12 @@
__u32 max_num_buffers;
__u32 reserved[5];
};
+struct v4l2_remove_buffers {
+ __u32 index;
+ __u32 count;
+ __u32 type;
+ __u32 reserved[13];
+};
#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
@@ -1517,6 +1530,7 @@
#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
#define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)
#define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl)
+#define VIDIOC_REMOVE_BUFS _IOWR('V', 104, struct v4l2_remove_buffers)
#define BASE_VIDIOC_PRIVATE 192
#define V4L2_PIX_FMT_HM12 V4L2_PIX_FMT_NV12_16L16
#define V4L2_PIX_FMT_SUNXI_TILED_NV12 V4L2_PIX_FMT_NV12_32L32
diff --git a/libc/kernel/uapi/linux/virtio_bt.h b/libc/kernel/uapi/linux/virtio_bt.h
index 2b790ea..8799b66 100644
--- a/libc/kernel/uapi/linux/virtio_bt.h
+++ b/libc/kernel/uapi/linux/virtio_bt.h
@@ -13,7 +13,6 @@
#define VIRTIO_BT_F_CONFIG_V2 3
enum virtio_bt_config_type {
VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,
- VIRTIO_BT_CONFIG_TYPE_AMP = 1,
};
enum virtio_bt_config_vendor {
VIRTIO_BT_CONFIG_VENDOR_NONE = 0,
diff --git a/libc/kernel/uapi/linux/virtio_mem.h b/libc/kernel/uapi/linux/virtio_mem.h
index e90853e..770623a 100644
--- a/libc/kernel/uapi/linux/virtio_mem.h
+++ b/libc/kernel/uapi/linux/virtio_mem.h
@@ -12,6 +12,7 @@
#include <linux/virtio_config.h>
#define VIRTIO_MEM_F_ACPI_PXM 0
#define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1
+#define VIRTIO_MEM_F_PERSISTENT_SUSPEND 2
#define VIRTIO_MEM_REQ_PLUG 0
#define VIRTIO_MEM_REQ_UNPLUG 1
#define VIRTIO_MEM_REQ_UNPLUG_ALL 2
diff --git a/libc/kernel/uapi/linux/virtio_net.h b/libc/kernel/uapi/linux/virtio_net.h
index 7573209..26ff301 100644
--- a/libc/kernel/uapi/linux/virtio_net.h
+++ b/libc/kernel/uapi/linux/virtio_net.h
@@ -33,6 +33,7 @@
#define VIRTIO_NET_F_GUEST_ANNOUNCE 21
#define VIRTIO_NET_F_MQ 22
#define VIRTIO_NET_F_CTRL_MAC_ADDR 23
+#define VIRTIO_NET_F_DEVICE_STATS 50
#define VIRTIO_NET_F_VQ_NOTF_COAL 52
#define VIRTIO_NET_F_NOTF_COAL 53
#define VIRTIO_NET_F_GUEST_USO4 54
@@ -203,4 +204,103 @@
__le16 reserved;
struct virtio_net_ctrl_coal coal;
};
+#define VIRTIO_NET_CTRL_STATS 8
+#define VIRTIO_NET_CTRL_STATS_QUERY 0
+#define VIRTIO_NET_CTRL_STATS_GET 1
+struct virtio_net_stats_capabilities {
+#define VIRTIO_NET_STATS_TYPE_CVQ (1ULL << 32)
+#define VIRTIO_NET_STATS_TYPE_RX_BASIC (1ULL << 0)
+#define VIRTIO_NET_STATS_TYPE_RX_CSUM (1ULL << 1)
+#define VIRTIO_NET_STATS_TYPE_RX_GSO (1ULL << 2)
+#define VIRTIO_NET_STATS_TYPE_RX_SPEED (1ULL << 3)
+#define VIRTIO_NET_STATS_TYPE_TX_BASIC (1ULL << 16)
+#define VIRTIO_NET_STATS_TYPE_TX_CSUM (1ULL << 17)
+#define VIRTIO_NET_STATS_TYPE_TX_GSO (1ULL << 18)
+#define VIRTIO_NET_STATS_TYPE_TX_SPEED (1ULL << 19)
+ __le64 supported_stats_types[1];
+};
+struct virtio_net_ctrl_queue_stats {
+ struct {
+ __le16 vq_index;
+ __le16 reserved[3];
+ __le64 types_bitmap[1];
+ } stats[1];
+};
+struct virtio_net_stats_reply_hdr {
+#define VIRTIO_NET_STATS_TYPE_REPLY_CVQ 32
+#define VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC 0
+#define VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM 1
+#define VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO 2
+#define VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED 3
+#define VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC 16
+#define VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM 17
+#define VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO 18
+#define VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED 19
+ __u8 type;
+ __u8 reserved;
+ __le16 vq_index;
+ __le16 reserved1;
+ __le16 size;
+};
+struct virtio_net_stats_cvq {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 command_num;
+ __le64 ok_num;
+};
+struct virtio_net_stats_rx_basic {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 rx_notifications;
+ __le64 rx_packets;
+ __le64 rx_bytes;
+ __le64 rx_interrupts;
+ __le64 rx_drops;
+ __le64 rx_drop_overruns;
+};
+struct virtio_net_stats_tx_basic {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 tx_notifications;
+ __le64 tx_packets;
+ __le64 tx_bytes;
+ __le64 tx_interrupts;
+ __le64 tx_drops;
+ __le64 tx_drop_malformed;
+};
+struct virtio_net_stats_rx_csum {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 rx_csum_valid;
+ __le64 rx_needs_csum;
+ __le64 rx_csum_none;
+ __le64 rx_csum_bad;
+};
+struct virtio_net_stats_tx_csum {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 tx_csum_none;
+ __le64 tx_needs_csum;
+};
+struct virtio_net_stats_rx_gso {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 rx_gso_packets;
+ __le64 rx_gso_bytes;
+ __le64 rx_gso_packets_coalesced;
+ __le64 rx_gso_bytes_coalesced;
+};
+struct virtio_net_stats_tx_gso {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 tx_gso_packets;
+ __le64 tx_gso_bytes;
+ __le64 tx_gso_segments;
+ __le64 tx_gso_segments_bytes;
+ __le64 tx_gso_packets_noseg;
+ __le64 tx_gso_bytes_noseg;
+};
+struct virtio_net_stats_rx_speed {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 rx_ratelimit_packets;
+ __le64 rx_ratelimit_bytes;
+};
+struct virtio_net_stats_tx_speed {
+ struct virtio_net_stats_reply_hdr hdr;
+ __le64 tx_ratelimit_packets;
+ __le64 tx_ratelimit_bytes;
+};
#endif
diff --git a/libc/kernel/uapi/linux/xfrm.h b/libc/kernel/uapi/linux/xfrm.h
index e2f168d..b8e79e8 100644
--- a/libc/kernel/uapi/linux/xfrm.h
+++ b/libc/kernel/uapi/linux/xfrm.h
@@ -111,6 +111,10 @@
XFRM_POLICY_MASK = 3,
XFRM_POLICY_MAX = 3
};
+enum xfrm_sa_dir {
+ XFRM_SA_DIR_IN = 1,
+ XFRM_SA_DIR_OUT = 2
+};
enum {
XFRM_SHARE_ANY,
XFRM_SHARE_SESSION,
@@ -255,6 +259,7 @@
XFRMA_SET_MARK_MASK,
XFRMA_IF_ID,
XFRMA_MTIMER_THRESH,
+ XFRMA_SA_DIR,
__XFRMA_MAX
#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK
#define XFRMA_MAX (__XFRMA_MAX - 1)
diff --git a/libc/kernel/uapi/misc/pvpanic.h b/libc/kernel/uapi/misc/pvpanic.h
index bc421ae..8e1be62 100644
--- a/libc/kernel/uapi/misc/pvpanic.h
+++ b/libc/kernel/uapi/misc/pvpanic.h
@@ -6,6 +6,8 @@
*/
#ifndef __PVPANIC_H__
#define __PVPANIC_H__
-#define PVPANIC_PANICKED (1 << 0)
-#define PVPANIC_CRASH_LOADED (1 << 1)
+#include <linux/const.h>
+#define PVPANIC_PANICKED _BITUL(0)
+#define PVPANIC_CRASH_LOADED _BITUL(1)
+#define PVPANIC_SHUTDOWN _BITUL(2)
#endif
diff --git a/libc/kernel/uapi/rdma/efa-abi.h b/libc/kernel/uapi/rdma/efa-abi.h
index 2b30941..d4a9089 100644
--- a/libc/kernel/uapi/rdma/efa-abi.h
+++ b/libc/kernel/uapi/rdma/efa-abi.h
@@ -63,11 +63,16 @@
enum {
EFA_QP_DRIVER_TYPE_SRD = 0,
};
+enum {
+ EFA_CREATE_QP_WITH_UNSOLICITED_WRITE_RECV = 1 << 0,
+};
struct efa_ibv_create_qp {
__u32 comp_mask;
__u32 rq_ring_size;
__u32 sq_ring_size;
__u32 driver_qp_type;
+ __u16 flags;
+ __u8 reserved_90[6];
};
struct efa_ibv_create_qp_resp {
__u32 comp_mask;
@@ -95,6 +100,7 @@
EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
+ EFA_QUERY_DEVICE_CAPS_UNSOLICITED_WRITE_RECV = 1 << 6,
};
struct efa_ibv_ex_query_device_resp {
__u32 comp_mask;
diff --git a/libc/kernel/uapi/rdma/hns-abi.h b/libc/kernel/uapi/rdma/hns-abi.h
index 5b0f700..b76e45c 100644
--- a/libc/kernel/uapi/rdma/hns-abi.h
+++ b/libc/kernel/uapi/rdma/hns-abi.h
@@ -68,6 +68,11 @@
__aligned_u64 cap_flags;
__aligned_u64 dwqe_mmap_key;
};
+struct hns_roce_ib_modify_qp_resp {
+ __u8 tc_mode;
+ __u8 priority;
+ __u8 reserved[6];
+};
enum {
HNS_ROCE_EXSGE_FLAGS = 1 << 0,
HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1,
@@ -97,6 +102,7 @@
};
struct hns_roce_ib_create_ah_resp {
__u8 dmac[6];
- __u8 reserved[2];
+ __u8 priority;
+ __u8 tc_mode;
};
#endif
diff --git a/libc/kernel/uapi/rdma/mana-abi.h b/libc/kernel/uapi/rdma/mana-abi.h
index 73967b4..7347175 100644
--- a/libc/kernel/uapi/rdma/mana-abi.h
+++ b/libc/kernel/uapi/rdma/mana-abi.h
@@ -9,8 +9,18 @@
#include <linux/types.h>
#include <rdma/ib_user_ioctl_verbs.h>
#define MANA_IB_UVERBS_ABI_VERSION 1
+enum mana_ib_create_cq_flags {
+ MANA_IB_CREATE_RNIC_CQ = 1 << 0,
+};
struct mana_ib_create_cq {
__aligned_u64 buf_addr;
+ __u16 flags;
+ __u16 reserved0;
+ __u32 reserved1;
+};
+struct mana_ib_create_cq_resp {
+ __u32 cqid;
+ __u32 reserved;
};
struct mana_ib_create_qp {
__aligned_u64 sq_buf_addr;
diff --git a/libc/kernel/uapi/rdma/rdma_netlink.h b/libc/kernel/uapi/rdma/rdma_netlink.h
index 2fe8c30..912a3c0 100644
--- a/libc/kernel/uapi/rdma/rdma_netlink.h
+++ b/libc/kernel/uapi/rdma/rdma_netlink.h
@@ -304,6 +304,8 @@
RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX,
RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC,
RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE,
+ RDMA_NLDEV_ATTR_DRIVER_DETAILS,
+ RDMA_NLDEV_ATTR_RES_SUBTYPE,
RDMA_NLDEV_ATTR_MAX
};
enum rdma_nl_counter_mode {
diff --git a/libc/kernel/uapi/sound/asoc.h b/libc/kernel/uapi/sound/asoc.h
index 8718b46..f7992cb 100644
--- a/libc/kernel/uapi/sound/asoc.h
+++ b/libc/kernel/uapi/sound/asoc.h
@@ -336,48 +336,4 @@
__le32 flags;
struct snd_soc_tplg_private priv;
} __attribute__((packed));
-struct snd_soc_tplg_manifest_v4 {
- __le32 size;
- __le32 control_elems;
- __le32 widget_elems;
- __le32 graph_elems;
- __le32 pcm_elems;
- __le32 dai_link_elems;
- struct snd_soc_tplg_private priv;
-} __attribute__((__packed__));
-struct snd_soc_tplg_stream_caps_v4 {
- __le32 size;
- char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
- __le64 formats;
- __le32 rates;
- __le32 rate_min;
- __le32 rate_max;
- __le32 channels_min;
- __le32 channels_max;
- __le32 periods_min;
- __le32 periods_max;
- __le32 period_size_min;
- __le32 period_size_max;
- __le32 buffer_size_min;
- __le32 buffer_size_max;
-} __attribute__((__packed__));
-struct snd_soc_tplg_pcm_v4 {
- __le32 size;
- char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
- char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
- __le32 pcm_id;
- __le32 dai_id;
- __le32 playback;
- __le32 capture;
- __le32 compress;
- struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
- __le32 num_streams;
- struct snd_soc_tplg_stream_caps_v4 caps[2];
-} __attribute__((__packed__));
-struct snd_soc_tplg_link_config_v4 {
- __le32 size;
- __le32 id;
- struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
- __le32 num_streams;
-} __attribute__((__packed__));
#endif
diff --git a/libc/kernel/uapi/sound/skl-tplg-interface.h b/libc/kernel/uapi/sound/skl-tplg-interface.h
index c620295..d613c7f 100644
--- a/libc/kernel/uapi/sound/skl-tplg-interface.h
+++ b/libc/kernel/uapi/sound/skl-tplg-interface.h
@@ -109,66 +109,4 @@
SKL_TYPE_TUPLE,
SKL_TYPE_DATA
};
-struct skl_dfw_v4_module_pin {
- __u16 module_id;
- __u16 instance_id;
-} __attribute__((__packed__));
-struct skl_dfw_v4_module_fmt {
- __u32 channels;
- __u32 freq;
- __u32 bit_depth;
- __u32 valid_bit_depth;
- __u32 ch_cfg;
- __u32 interleaving_style;
- __u32 sample_type;
- __u32 ch_map;
-} __attribute__((__packed__));
-struct skl_dfw_v4_module_caps {
- __u32 set_params : 2;
- __u32 rsvd : 30;
- __u32 param_id;
- __u32 caps_size;
- __u32 caps[HDA_SST_CFG_MAX];
-} __attribute__((__packed__));
-struct skl_dfw_v4_pipe {
- __u8 pipe_id;
- __u8 pipe_priority;
- __u16 conn_type : 4;
- __u16 rsvd : 4;
- __u16 memory_pages : 8;
-} __attribute__((__packed__));
-struct skl_dfw_v4_module {
- char uuid[SKL_UUID_STR_SZ];
- __u16 module_id;
- __u16 instance_id;
- __u32 max_mcps;
- __u32 mem_pages;
- __u32 obs;
- __u32 ibs;
- __u32 vbus_id;
- __u32 max_in_queue : 8;
- __u32 max_out_queue : 8;
- __u32 time_slot : 8;
- __u32 core_id : 4;
- __u32 rsvd1 : 4;
- __u32 module_type : 8;
- __u32 conn_type : 4;
- __u32 dev_type : 4;
- __u32 hw_conn_type : 4;
- __u32 rsvd2 : 12;
- __u32 params_fixup : 8;
- __u32 converter : 8;
- __u32 input_pin_type : 1;
- __u32 output_pin_type : 1;
- __u32 is_dynamic_in_pin : 1;
- __u32 is_dynamic_out_pin : 1;
- __u32 is_loadable : 1;
- __u32 rsvd3 : 11;
- struct skl_dfw_v4_pipe pipe;
- struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];
- struct skl_dfw_v4_module_fmt out_fmt[MAX_OUT_QUEUE];
- struct skl_dfw_v4_module_pin in_pin[MAX_IN_QUEUE];
- struct skl_dfw_v4_module_pin out_pin[MAX_OUT_QUEUE];
- struct skl_dfw_v4_module_caps caps;
-} __attribute__((__packed__));
#endif
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index 35e67c8..8bb84eb 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -670,6 +670,7 @@
mprotect;
mrand48;
mremap;
+ mseal; # introduced=36
msync;
munlock;
munlockall;
@@ -953,6 +954,7 @@
setvbuf;
setxattr;
shutdown;
+ sig2str; # introduced=36
sigaction;
sigaddset;
sigaltstack;
@@ -995,6 +997,7 @@
stdout; # var introduced=23
stpcpy;
stpncpy;
+ str2sig; # introduced=36
strcasecmp;
strcasecmp_l; # introduced=23
strcasestr;
diff --git a/libc/private/CachedProperty.h b/libc/private/CachedProperty.h
index bd67d74..7accdb3 100644
--- a/libc/private/CachedProperty.h
+++ b/libc/private/CachedProperty.h
@@ -29,9 +29,7 @@
#pragma once
#include <string.h>
-
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
+#include <sys/system_properties.h>
// Cached system property lookup. For code that needs to read the same property multiple times,
// this class helps optimize those lookups.
diff --git a/libc/stdio/fmemopen.cpp b/libc/stdio/fmemopen.cpp
index 6e333ba..f069da4 100644
--- a/libc/stdio/fmemopen.cpp
+++ b/libc/stdio/fmemopen.cpp
@@ -33,8 +33,8 @@
#include "local.h"
-// See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html
-// and http://man7.org/linux/man-pages/man3/fmemopen.3.html for documentation.
+// See https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/fmemopen.html
+// and https://man7.org/linux/man-pages/man3/fmemopen.3.html for documentation.
struct fmemopen_cookie {
char* buf;
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 62efea1..a60468e 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -51,11 +51,7 @@
struct __sbuf {
unsigned char* _base;
-#if defined(__LP64__)
size_t _size;
-#else
- int _size;
-#endif
};
struct __sFILE {
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index f18cd81..37b9665 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -1079,6 +1079,26 @@
return __sflush(fp);
}
+int fpurge(FILE* fp) {
+ CHECK_FP(fp);
+
+ ScopedFileLock sfl(fp);
+
+ if (fp->_flags == 0) {
+ // Already freed!
+ errno = EBADF;
+ return EOF;
+ }
+
+ if (HASUB(fp)) FREEUB(fp);
+ WCIO_FREE(fp);
+ fp->_p = fp->_bf._base;
+ fp->_r = 0;
+ fp->_w = fp->_flags & (__SLBF | __SNBF) ? 0 : fp->_bf._size;
+ return 0;
+}
+__strong_alias(__fpurge, fpurge);
+
size_t fread(void* buf, size_t size, size_t count, FILE* fp) {
CHECK_FP(fp);
ScopedFileLock sfl(fp);
diff --git a/libc/stdio/stdio_ext.cpp b/libc/stdio/stdio_ext.cpp
index 99a8af7..3eb2f33 100644
--- a/libc/stdio/stdio_ext.cpp
+++ b/libc/stdio/stdio_ext.cpp
@@ -59,10 +59,6 @@
return (fp->_flags & __SLBF) != 0;
}
-void __fpurge(FILE* fp) {
- fpurge(fp);
-}
-
size_t __fpending(FILE* fp) {
return fp->_p - fp->_bf._base;
}
diff --git a/libc/tzcode/strptime.c b/libc/tzcode/strptime.c
index ae7881e..5f91e46 100644
--- a/libc/tzcode/strptime.c
+++ b/libc/tzcode/strptime.c
@@ -97,6 +97,7 @@
return(_strptime(buf, fmt, tm, 1));
}
DEF_WEAK(strptime);
+__strong_alias(strptime_l, strptime);
static char *
_strptime(const char *buf, const char *fmt, struct tm *tm, int initialize)
diff --git a/libc/upstream-openbsd/lib/libc/gen/fnmatch.c b/libc/upstream-openbsd/lib/libc/gen/fnmatch.c
index ff6b26e..3ec0222 100644
--- a/libc/upstream-openbsd/lib/libc/gen/fnmatch.c
+++ b/libc/upstream-openbsd/lib/libc/gen/fnmatch.c
@@ -46,11 +46,11 @@
*
* Derived from The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008
* as described in;
- * http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html
+ * https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/fnmatch.html
*
* Filename pattern matches defined in section 2.13, "Pattern Matching Notation"
* from chapter 2. "Shell Command Language"
- * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
+ * https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/V3_chap02.html#tag_18_13
* where; 1. A bracket expression starting with an unquoted <circumflex> '^'
* character CONTINUES to specify a non-matching list; 2. an explicit <period> '.'
* in a bracket expression matching list, e.g. "[.abc]" does NOT match a leading
@@ -61,7 +61,7 @@
*
* Bracket expansion defined in section 9.3.5, "RE Bracket Expression",
* from chapter 9, "Regular Expressions"
- * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05
+ * https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/V1_chap09.html#tag_09_03_05
* with no support for collating symbols, equivalence class expressions or
* character class expressions. A partial range expression with a leading
* hyphen following a valid range expression will match only the ordinary
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fpurge.c b/libc/upstream-openbsd/lib/libc/stdio/fpurge.c
deleted file mode 100644
index 8dd8a91..0000000
--- a/libc/upstream-openbsd/lib/libc/stdio/fpurge.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* $OpenBSD: fpurge.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-/*
- * fpurge: like fflush, but without writing anything: leave the
- * given FILE's buffer empty.
- */
-int
-fpurge(FILE *fp)
-{
- FLOCKFILE(fp);
- if (!fp->_flags) {
- FUNLOCKFILE(fp);
- errno = EBADF;
- return(EOF);
- }
-
- if (HASUB(fp))
- FREEUB(fp);
- WCIO_FREE(fp);
- fp->_p = fp->_bf._base;
- fp->_r = 0;
- fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
- FUNLOCKFILE(fp);
- return (0);
-}
-DEF_WEAK(fpurge);
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index 613c781..73ae2ef 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -46,9 +46,6 @@
#include <string>
#include <unordered_map>
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
-
class ConfigParser {
public:
enum {
diff --git a/tests/headers/posix/signal_h.c b/tests/headers/posix/signal_h.c
index c2e544e..82751f4 100644
--- a/tests/headers/posix/signal_h.c
+++ b/tests/headers/posix/signal_h.c
@@ -63,6 +63,10 @@
MACRO(SIGEV_SIGNAL);
MACRO(SIGEV_THREAD);
+#if !defined(__GLIBC__) // Our glibc is too old.
+ MACRO(SIG2STR_MAX);
+#endif
+
TYPE(union sigval);
STRUCT_MEMBER(union sigval, int, sival_int);
STRUCT_MEMBER(union sigval, void*, sival_ptr);
@@ -205,6 +209,9 @@
FUNCTION(pthread_kill, int (*f)(pthread_t, int));
FUNCTION(pthread_sigmask, int (*f)(int, const sigset_t*, sigset_t*));
FUNCTION(raise, int (*f)(int));
+#if !defined(__GLIBC__) // Our glibc is too old.
+ FUNCTION(sig2str, int (*f)(int, char*));
+#endif
FUNCTION(sigaction, int (*f)(int, const struct sigaction*, struct sigaction*));
FUNCTION(sigaddset, int (*f)(sigset_t*, int));
FUNCTION(sigaltstack, int (*f)(const stack_t*, stack_t*));
@@ -226,4 +233,7 @@
FUNCTION(sigtimedwait, int (*f)(const sigset_t*, siginfo_t*, const struct timespec*));
FUNCTION(sigwait, int (*f)(const sigset_t*, int*));
FUNCTION(sigwaitinfo, int (*f)(const sigset_t*, siginfo_t*));
+#if !defined(__GLIBC__) // Our glibc is too old.
+ FUNCTION(str2sig, int (*f)(const char*, int*));
+#endif
}
diff --git a/tests/signal_test.cpp b/tests/signal_test.cpp
index de126da..c1719dc 100644
--- a/tests/signal_test.cpp
+++ b/tests/signal_test.cpp
@@ -982,3 +982,94 @@
ASSERT_EQ(-1, killpg(-1, SIGKILL));
ASSERT_ERRNO(EINVAL);
}
+
+TEST(signal, sig2str) {
+#if defined(__BIONIC__)
+ char str[SIG2STR_MAX];
+
+ // A regular signal.
+ ASSERT_EQ(0, sig2str(SIGHUP, str));
+ ASSERT_STREQ("HUP", str);
+
+ // A real-time signal.
+ ASSERT_EQ(0, sig2str(SIGRTMIN + 4, str));
+ ASSERT_STREQ("RTMIN+4", str);
+ ASSERT_EQ(0, sig2str(SIGRTMAX - 4, str));
+ ASSERT_STREQ("RTMAX-4", str);
+ // Special cases.
+ ASSERT_EQ(0, sig2str(SIGRTMAX, str));
+ ASSERT_STREQ("RTMAX", str);
+ ASSERT_EQ(0, sig2str(SIGRTMIN, str));
+ ASSERT_STREQ("RTMIN", str);
+ // One of the signals the C library keeps to itself.
+ ASSERT_EQ(-1, sig2str(32, str)); // __SIGRTMIN
+
+ // Errors.
+ ASSERT_EQ(-1, sig2str(-1, str)); // Too small.
+ ASSERT_EQ(-1, sig2str(0, str)); // Still too small.
+ ASSERT_EQ(-1, sig2str(1234, str)); // Too large.
+#else
+ GTEST_SKIP() << "our old glibc doesn't have sig2str";
+#endif
+}
+
+TEST(signal, str2sig) {
+#if defined(__BIONIC__)
+ int sig;
+
+ // A regular signal, by number.
+ sig = -1;
+ ASSERT_EQ(0, str2sig("9", &sig));
+ ASSERT_EQ(SIGKILL, sig);
+
+ // A regular signal, by name.
+ sig = -1;
+ ASSERT_EQ(0, str2sig("HUP", &sig));
+ ASSERT_EQ(SIGHUP, sig);
+
+ // A real-time signal, by number.
+ sig = -1;
+ ASSERT_EQ(0, str2sig("64", &sig));
+ ASSERT_EQ(SIGRTMAX, sig);
+
+ // A real-time signal, by name and offset.
+ sig = -1;
+ ASSERT_EQ(0, str2sig("RTMAX-4", &sig));
+ ASSERT_EQ(SIGRTMAX - 4, sig);
+ sig = -1;
+ ASSERT_EQ(0, str2sig("RTMIN+4", &sig));
+ ASSERT_EQ(SIGRTMIN + 4, sig);
+ // Unspecified by POSIX, but we try to be reasonable.
+ sig = -1;
+ ASSERT_EQ(0, str2sig("RTMAX-0", &sig));
+ ASSERT_EQ(SIGRTMAX, sig);
+ sig = -1;
+ ASSERT_EQ(0, str2sig("RTMIN+0", &sig));
+ ASSERT_EQ(SIGRTMIN, sig);
+ // One of the signals the C library keeps to itself, numerically.
+ ASSERT_EQ(-1, str2sig("32", &sig)); // __SIGRTMIN
+
+ // Special cases.
+ sig = -1;
+ ASSERT_EQ(0, str2sig("RTMAX", &sig));
+ ASSERT_EQ(SIGRTMAX, sig);
+ sig = -1;
+ ASSERT_EQ(0, str2sig("RTMIN", &sig));
+ ASSERT_EQ(SIGRTMIN, sig);
+
+ // Errors.
+ ASSERT_EQ(-1, str2sig("SIGHUP", &sig)); // No "SIG" prefix allowed.
+ ASSERT_EQ(-1, str2sig("-1", &sig)); // Too small.
+ ASSERT_EQ(-1, str2sig("0", &sig)); // Still too small.
+ ASSERT_EQ(-1, str2sig("1234", &sig)); // Too large.
+ ASSERT_EQ(-1, str2sig("RTMAX-666", &sig)); // Offset too small.
+ ASSERT_EQ(-1, str2sig("RTMIN+666", &sig)); // Offset too large.
+ ASSERT_EQ(-1, str2sig("RTMAX-+1", &sig)); // Silly.
+ ASSERT_EQ(-1, str2sig("RTMIN+-1", &sig)); // Silly.
+ ASSERT_EQ(-1, str2sig("HUPs", &sig)); // Trailing junk.
+ ASSERT_EQ(-1, str2sig("2b", &sig)); // Trailing junk.
+ ASSERT_EQ(-1, str2sig("RTMIN+2b", &sig)); // Trailing junk.
+#else
+ GTEST_SKIP() << "our old glibc doesn't have str2sig";
+#endif
+}
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index 3216066..fac9b9b 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -519,7 +519,7 @@
TEST(stdlib, system_NULL) {
// "The system() function shall always return non-zero when command is NULL."
- // http://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html
+ // https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/system.html
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
ASSERT_NE(0, system(nullptr));
diff --git a/tests/sys_mman_test.cpp b/tests/sys_mman_test.cpp
index 40c85f2..54a0b64 100644
--- a/tests/sys_mman_test.cpp
+++ b/tests/sys_mman_test.cpp
@@ -320,3 +320,30 @@
close(fd);
#endif
}
+
+TEST(sys_mseal, mseal) {
+#if defined(__GLIBC__)
+ GTEST_SKIP() << "needs glibc 2.40";
+#else
+ void* map = mmap(nullptr, kPageSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ ASSERT_NE(MAP_FAILED, map);
+
+#if defined(__LP64__)
+ int rc = mseal(map, kPageSize, 0);
+ if (rc == -1) {
+ ASSERT_ERRNO(ENOSYS);
+ GTEST_SKIP() << "needs kernel with mseal(2)";
+ }
+ ASSERT_EQ(-1, mprotect(map, kPageSize, PROT_READ));
+ ASSERT_ERRNO(EPERM);
+#else
+ // No mseal() for ILP32.
+ errno = 0;
+ ASSERT_EQ(-1, mseal(map, kPageSize, 0));
+ ASSERT_ERRNO(ENOSYS);
+ GTEST_SKIP() << "mseal(2) is LP64-only";
+#endif
+
+ // We can't munmap() our test mapping if mseal() actually succeeded :-)
+#endif
+}
diff --git a/tests/system_properties_test.cpp b/tests/system_properties_test.cpp
index f11f509..5b5e009 100644
--- a/tests/system_properties_test.cpp
+++ b/tests/system_properties_test.cpp
@@ -33,10 +33,9 @@
#if defined(__BIONIC__)
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <stdlib.h>
-#include <sys/_system_properties.h>
#include <sys/mount.h>
+#include <sys/system_properties.h>
#include <system_properties/system_properties.h>
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index 387d23b..a811fd8 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -556,7 +556,7 @@
} else {
// If the subject sequence begins with a <hyphen-minus>, the value resulting
// from the conversion shall be negated.
- // http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtoul.html
+ // https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/strtoul.html
ASSERT_EQ(std::numeric_limits<T>::max(), fn(min_str, nullptr, 0)) << min_str;
}
ASSERT_EQ(std::numeric_limits<T>::max(), fn(max_str, nullptr, 0)) << max_str;