From 655ad88e65298014a2a37aae88a5b2f9ab3e36f7 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 23 Aug 2022 19:05:32 -0700 Subject: [PATCH] Remove some linux-specific musl headers (#17704) We don't implement any of the functions declared in these headers, so there is not real use them, and I think it can be misleading to allow them to be included at compile time. See #17638 --- ChangeLog.md | 3 + .../lib/sanitizer_common/sanitizer_linux.cpp | 2 +- .../lib/libc/musl/arch/emscripten/bits/reg.h | 21 +-- system/lib/libc/musl/arch/generic/bits/io.h | 0 system/lib/libc/musl/arch/generic/bits/kd.h | 1 - .../lib/libc/musl/arch/generic/bits/ptrace.h | 0 .../libc/musl/arch/generic/bits/soundcard.h | 1 - system/lib/libc/musl/arch/generic/bits/vt.h | 1 - system/lib/libc/musl/include/sys/auxv.h | 17 -- system/lib/libc/musl/include/sys/cachectl.h | 22 --- system/lib/libc/musl/include/sys/epoll.h | 69 ------- system/lib/libc/musl/include/sys/eventfd.h | 26 --- system/lib/libc/musl/include/sys/fanotify.h | 111 ------------ system/lib/libc/musl/include/sys/fsuid.h | 20 --- system/lib/libc/musl/include/sys/inotify.h | 58 ------ system/lib/libc/musl/include/sys/io.h | 17 -- system/lib/libc/musl/include/sys/kd.h | 1 - system/lib/libc/musl/include/sys/klog.h | 14 -- .../lib/libc/musl/include/sys/personality.h | 49 ----- system/lib/libc/musl/include/sys/prctl.h | 170 ------------------ system/lib/libc/musl/include/sys/ptrace.h | 138 -------------- system/lib/libc/musl/include/sys/quota.h | 102 ----------- system/lib/libc/musl/include/sys/reboot.h | 20 --- system/lib/libc/musl/include/sys/signalfd.h | 49 ----- system/lib/libc/musl/include/sys/soundcard.h | 1 - system/lib/libc/musl/include/sys/swap.h | 21 --- system/lib/libc/musl/include/sys/timerfd.h | 32 ---- system/lib/libc/musl/include/sys/timex.h | 103 ----------- system/lib/libc/musl/include/sys/vt.h | 1 - system/lib/libc/musl/src/include/sys/auxv.h | 10 -- system/lib/update_musl.py | 26 ++- test/fs/test_mmap.c | 1 - tools/system_libs.py | 1 + 33 files changed, 34 insertions(+), 1074 deletions(-) delete mode 100644 system/lib/libc/musl/arch/generic/bits/io.h delete mode 100644 system/lib/libc/musl/arch/generic/bits/kd.h delete mode 100644 system/lib/libc/musl/arch/generic/bits/ptrace.h delete mode 100644 system/lib/libc/musl/arch/generic/bits/soundcard.h delete mode 100644 system/lib/libc/musl/arch/generic/bits/vt.h delete mode 100644 system/lib/libc/musl/include/sys/auxv.h delete mode 100644 system/lib/libc/musl/include/sys/cachectl.h delete mode 100644 system/lib/libc/musl/include/sys/epoll.h delete mode 100644 system/lib/libc/musl/include/sys/eventfd.h delete mode 100644 system/lib/libc/musl/include/sys/fanotify.h delete mode 100644 system/lib/libc/musl/include/sys/fsuid.h delete mode 100644 system/lib/libc/musl/include/sys/inotify.h delete mode 100644 system/lib/libc/musl/include/sys/io.h delete mode 100644 system/lib/libc/musl/include/sys/kd.h delete mode 100644 system/lib/libc/musl/include/sys/klog.h delete mode 100644 system/lib/libc/musl/include/sys/personality.h delete mode 100644 system/lib/libc/musl/include/sys/prctl.h delete mode 100644 system/lib/libc/musl/include/sys/ptrace.h delete mode 100644 system/lib/libc/musl/include/sys/quota.h delete mode 100644 system/lib/libc/musl/include/sys/reboot.h delete mode 100644 system/lib/libc/musl/include/sys/signalfd.h delete mode 100644 system/lib/libc/musl/include/sys/soundcard.h delete mode 100644 system/lib/libc/musl/include/sys/swap.h delete mode 100644 system/lib/libc/musl/include/sys/timerfd.h delete mode 100644 system/lib/libc/musl/include/sys/timex.h delete mode 100644 system/lib/libc/musl/include/sys/vt.h delete mode 100644 system/lib/libc/musl/src/include/sys/auxv.h diff --git a/ChangeLog.md b/ChangeLog.md index 168fe154c9b98..fb6a78796c238 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -25,6 +25,9 @@ See docs/process.md for more on how version tagging works. wasm/JS interface. These function are no longer exported in all cases. If your code directly calls these functions from JS, you can add them to `-sEXPORTED_RUNTIME_METHODS`. +- Several linux-specific headers were removed from the emscripten sysroot. None + of the functionality in these headers was ever supported by emscripten. For + example `sys/soundcard.h` and `sys/ptrace.h`. (#17704) 3.1.19 - 08/17/2022 ------------------- diff --git a/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp index 4a782ebb69b12..33e7f017aac83 100644 --- a/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp +++ b/system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp @@ -59,7 +59,7 @@ #include #include #include -#if !SANITIZER_SOLARIS +#if !SANITIZER_SOLARIS && !SANITIZER_EMSCRIPTEN #include #endif #include diff --git a/system/lib/libc/musl/arch/emscripten/bits/reg.h b/system/lib/libc/musl/arch/emscripten/bits/reg.h index 8bc2582d0229d..1c4987c775f11 100644 --- a/system/lib/libc/musl/arch/emscripten/bits/reg.h +++ b/system/lib/libc/musl/arch/emscripten/bits/reg.h @@ -1,19 +1,6 @@ #undef __WORDSIZE +#ifdef __wasm64__ +#define __WORDSIZE 64 +#else #define __WORDSIZE 32 -#define EBX 0 -#define ECX 1 -#define EDX 2 -#define ESI 3 -#define EDI 4 -#define EBP 5 -#define EAX 6 -#define DS 7 -#define ES 8 -#define FS 9 -#define GS 10 -#define ORIG_EAX 11 -#define EIP 12 -#define CS 13 -#define EFL 14 -#define UESP 15 -#define SS 16 +#endif diff --git a/system/lib/libc/musl/arch/generic/bits/io.h b/system/lib/libc/musl/arch/generic/bits/io.h deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/system/lib/libc/musl/arch/generic/bits/kd.h b/system/lib/libc/musl/arch/generic/bits/kd.h deleted file mode 100644 index 33b873f49c261..0000000000000 --- a/system/lib/libc/musl/arch/generic/bits/kd.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/system/lib/libc/musl/arch/generic/bits/ptrace.h b/system/lib/libc/musl/arch/generic/bits/ptrace.h deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/system/lib/libc/musl/arch/generic/bits/soundcard.h b/system/lib/libc/musl/arch/generic/bits/soundcard.h deleted file mode 100644 index fade986fe4212..0000000000000 --- a/system/lib/libc/musl/arch/generic/bits/soundcard.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/system/lib/libc/musl/arch/generic/bits/vt.h b/system/lib/libc/musl/arch/generic/bits/vt.h deleted file mode 100644 index 834abfbc8fbb4..0000000000000 --- a/system/lib/libc/musl/arch/generic/bits/vt.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/system/lib/libc/musl/include/sys/auxv.h b/system/lib/libc/musl/include/sys/auxv.h deleted file mode 100644 index ddccf57ff6f38..0000000000000 --- a/system/lib/libc/musl/include/sys/auxv.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SYS_AUXV_H -#define _SYS_AUXV_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -unsigned long getauxval(unsigned long); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/cachectl.h b/system/lib/libc/musl/include/sys/cachectl.h deleted file mode 100644 index f3b896a8e059e..0000000000000 --- a/system/lib/libc/musl/include/sys/cachectl.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SYS_CACHECTL_H -#define _SYS_CACHECTL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define ICACHE (1<<0) -#define DCACHE (1<<1) -#define BCACHE (ICACHE|DCACHE) -#define CACHEABLE 0 -#define UNCACHEABLE 1 - -int cachectl(void *, int, int); -int cacheflush(void *, int, int); -int _flush_cache(void *, int, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/epoll.h b/system/lib/libc/musl/include/sys/epoll.h deleted file mode 100644 index ac81a8418a0cc..0000000000000 --- a/system/lib/libc/musl/include/sys/epoll.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _SYS_EPOLL_H -#define _SYS_EPOLL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#define __NEED_sigset_t - -#include - -#define EPOLL_CLOEXEC O_CLOEXEC -#define EPOLL_NONBLOCK O_NONBLOCK - -enum EPOLL_EVENTS { __EPOLL_DUMMY }; -#define EPOLLIN 0x001 -#define EPOLLPRI 0x002 -#define EPOLLOUT 0x004 -#define EPOLLRDNORM 0x040 -#define EPOLLNVAL 0x020 -#define EPOLLRDBAND 0x080 -#define EPOLLWRNORM 0x100 -#define EPOLLWRBAND 0x200 -#define EPOLLMSG 0x400 -#define EPOLLERR 0x008 -#define EPOLLHUP 0x010 -#define EPOLLRDHUP 0x2000 -#define EPOLLEXCLUSIVE (1U<<28) -#define EPOLLWAKEUP (1U<<29) -#define EPOLLONESHOT (1U<<30) -#define EPOLLET (1U<<31) - -#define EPOLL_CTL_ADD 1 -#define EPOLL_CTL_DEL 2 -#define EPOLL_CTL_MOD 3 - -typedef union epoll_data { - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; -} epoll_data_t; - -struct epoll_event { - uint32_t events; - epoll_data_t data; -} -#ifdef __x86_64__ -__attribute__ ((__packed__)) -#endif -; - - -int epoll_create(int); -int epoll_create1(int); -int epoll_ctl(int, int, int, struct epoll_event *); -int epoll_wait(int, struct epoll_event *, int, int); -int epoll_pwait(int, struct epoll_event *, int, int, const sigset_t *); - - -#ifdef __cplusplus -} -#endif - -#endif /* sys/epoll.h */ diff --git a/system/lib/libc/musl/include/sys/eventfd.h b/system/lib/libc/musl/include/sys/eventfd.h deleted file mode 100644 index dc5c88f041fb5..0000000000000 --- a/system/lib/libc/musl/include/sys/eventfd.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _SYS_EVENTFD_H -#define _SYS_EVENTFD_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef uint64_t eventfd_t; - -#define EFD_SEMAPHORE 1 -#define EFD_CLOEXEC O_CLOEXEC -#define EFD_NONBLOCK O_NONBLOCK - -int eventfd(unsigned int, int); -int eventfd_read(int, eventfd_t *); -int eventfd_write(int, eventfd_t); - - -#ifdef __cplusplus -} -#endif - -#endif /* sys/eventfd.h */ diff --git a/system/lib/libc/musl/include/sys/fanotify.h b/system/lib/libc/musl/include/sys/fanotify.h deleted file mode 100644 index 10e5f15e24b1d..0000000000000 --- a/system/lib/libc/musl/include/sys/fanotify.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef _FANOTIFY_H -#define _FANOTIFY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct fanotify_event_metadata { - unsigned event_len; - unsigned char vers; - unsigned char reserved; - unsigned short metadata_len; - unsigned long long mask -#ifdef __GNUC__ - __attribute__((__aligned__(8))) -#endif - ; - int fd; - int pid; -}; - -struct fanotify_event_info_header { - unsigned char info_type; - unsigned char pad; - unsigned short len; -}; - -struct fanotify_event_info_fid { - struct fanotify_event_info_header hdr; - fsid_t fsid; - unsigned char handle[]; -}; - -struct fanotify_response { - int fd; - unsigned response; -}; - -#define FAN_ACCESS 0x01 -#define FAN_MODIFY 0x02 -#define FAN_ATTRIB 0x04 -#define FAN_CLOSE_WRITE 0x08 -#define FAN_CLOSE_NOWRITE 0x10 -#define FAN_OPEN 0x20 -#define FAN_MOVED_FROM 0x40 -#define FAN_MOVED_TO 0x80 -#define FAN_CREATE 0x100 -#define FAN_DELETE 0x200 -#define FAN_DELETE_SELF 0x400 -#define FAN_MOVE_SELF 0x800 -#define FAN_OPEN_EXEC 0x1000 -#define FAN_Q_OVERFLOW 0x4000 -#define FAN_OPEN_PERM 0x10000 -#define FAN_ACCESS_PERM 0x20000 -#define FAN_OPEN_EXEC_PERM 0x40000 -#define FAN_DIR_MODIFY 0x00080000 -#define FAN_EVENT_ON_CHILD 0x08000000 -#define FAN_ONDIR 0x40000000 -#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) -#define FAN_MOVE (FAN_MOVED_FROM | FAN_MOVED_TO) -#define FAN_CLOEXEC 0x01 -#define FAN_NONBLOCK 0x02 -#define FAN_CLASS_NOTIF 0 -#define FAN_CLASS_CONTENT 0x04 -#define FAN_CLASS_PRE_CONTENT 0x08 -#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT) -#define FAN_UNLIMITED_QUEUE 0x10 -#define FAN_UNLIMITED_MARKS 0x20 -#define FAN_ENABLE_AUDIT 0x40 -#define FAN_REPORT_TID 0x100 -#define FAN_REPORT_FID 0x200 -#define FAN_REPORT_DIR_FID 0x00000400 -#define FAN_REPORT_NAME 0x00000800 -#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME) -#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS) -#define FAN_MARK_ADD 0x01 -#define FAN_MARK_REMOVE 0x02 -#define FAN_MARK_DONT_FOLLOW 0x04 -#define FAN_MARK_ONLYDIR 0x08 -#define FAN_MARK_IGNORED_MASK 0x20 -#define FAN_MARK_IGNORED_SURV_MODIFY 0x40 -#define FAN_MARK_FLUSH 0x80 -#define FAN_MARK_INODE 0x00 -#define FAN_MARK_MOUNT 0x10 -#define FAN_MARK_FILESYSTEM 0x100 -#define FAN_MARK_TYPE_MASK (FAN_MARK_INODE | FAN_MARK_MOUNT | FAN_MARK_FILESYSTEM) -#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_DONT_FOLLOW | FAN_MARK_ONLYDIR | FAN_MARK_MOUNT | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY | FAN_MARK_FLUSH) -#define FAN_ALL_EVENTS (FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN) -#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_ACCESS_PERM) -#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_Q_OVERFLOW) -#define FANOTIFY_METADATA_VERSION 3 -#define FAN_EVENT_INFO_TYPE_FID 1 -#define FAN_EVENT_INFO_TYPE_DFID_NAME 2 -#define FAN_EVENT_INFO_TYPE_DFID 3 -#define FAN_ALLOW 0x01 -#define FAN_DENY 0x02 -#define FAN_AUDIT 0x10 -#define FAN_NOFD -1 -#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) -#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, (struct fanotify_event_metadata*)(((char *)(meta)) + (meta)->event_len)) -#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && (long)(meta)->event_len <= (long)(len)) - -int fanotify_init(unsigned, unsigned); -int fanotify_mark(int, unsigned, unsigned long long, int, const char *); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/system/lib/libc/musl/include/sys/fsuid.h b/system/lib/libc/musl/include/sys/fsuid.h deleted file mode 100644 index c7a9b8faa7954..0000000000000 --- a/system/lib/libc/musl/include/sys/fsuid.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _SYS_FSUID_H -#define _SYS_FSUID_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define __NEED_uid_t -#define __NEED_gid_t - -#include - -int setfsuid(uid_t); -int setfsgid(gid_t); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/inotify.h b/system/lib/libc/musl/include/sys/inotify.h deleted file mode 100644 index 69b5863199228..0000000000000 --- a/system/lib/libc/musl/include/sys/inotify.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _SYS_INOTIFY_H -#define _SYS_INOTIFY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -struct inotify_event { - int wd; - uint32_t mask, cookie, len; - char name[]; -}; - -#define IN_CLOEXEC O_CLOEXEC -#define IN_NONBLOCK O_NONBLOCK - -#define IN_ACCESS 0x00000001 -#define IN_MODIFY 0x00000002 -#define IN_ATTRIB 0x00000004 -#define IN_CLOSE_WRITE 0x00000008 -#define IN_CLOSE_NOWRITE 0x00000010 -#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) -#define IN_OPEN 0x00000020 -#define IN_MOVED_FROM 0x00000040 -#define IN_MOVED_TO 0x00000080 -#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) -#define IN_CREATE 0x00000100 -#define IN_DELETE 0x00000200 -#define IN_DELETE_SELF 0x00000400 -#define IN_MOVE_SELF 0x00000800 -#define IN_ALL_EVENTS 0x00000fff - -#define IN_UNMOUNT 0x00002000 -#define IN_Q_OVERFLOW 0x00004000 -#define IN_IGNORED 0x00008000 - -#define IN_ONLYDIR 0x01000000 -#define IN_DONT_FOLLOW 0x02000000 -#define IN_EXCL_UNLINK 0x04000000 -#define IN_MASK_CREATE 0x10000000 -#define IN_MASK_ADD 0x20000000 - -#define IN_ISDIR 0x40000000 -#define IN_ONESHOT 0x80000000 - -int inotify_init(void); -int inotify_init1(int); -int inotify_add_watch(int, const char *, uint32_t); -int inotify_rm_watch(int, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/io.h b/system/lib/libc/musl/include/sys/io.h deleted file mode 100644 index 16658cecae9b2..0000000000000 --- a/system/lib/libc/musl/include/sys/io.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SYS_IO_H -#define _SYS_IO_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -int iopl(int); -int ioperm(unsigned long, unsigned long, int); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/system/lib/libc/musl/include/sys/kd.h b/system/lib/libc/musl/include/sys/kd.h deleted file mode 100644 index 42122b9c3a4c4..0000000000000 --- a/system/lib/libc/musl/include/sys/kd.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/system/lib/libc/musl/include/sys/klog.h b/system/lib/libc/musl/include/sys/klog.h deleted file mode 100644 index aa66684e3fd8e..0000000000000 --- a/system/lib/libc/musl/include/sys/klog.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _SYS_KLOG_H -#define _SYS_KLOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -int klogctl (int, char *, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/personality.h b/system/lib/libc/musl/include/sys/personality.h deleted file mode 100644 index 411dc47563928..0000000000000 --- a/system/lib/libc/musl/include/sys/personality.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _PERSONALITY_H -#define _PERSONALITY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define UNAME26 0x0020000 -#define ADDR_NO_RANDOMIZE 0x0040000 -#define FDPIC_FUNCPTRS 0x0080000 -#define MMAP_PAGE_ZERO 0x0100000 -#define ADDR_COMPAT_LAYOUT 0x0200000 -#define READ_IMPLIES_EXEC 0x0400000 -#define ADDR_LIMIT_32BIT 0x0800000 -#define SHORT_INODE 0x1000000 -#define WHOLE_SECONDS 0x2000000 -#define STICKY_TIMEOUTS 0x4000000 -#define ADDR_LIMIT_3GB 0x8000000 - -#define PER_LINUX 0 -#define PER_LINUX_32BIT ADDR_LIMIT_32BIT -#define PER_LINUX_FDPIC FDPIC_FUNCPTRS -#define PER_SVR4 (1 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO) -#define PER_SVR3 (2 | STICKY_TIMEOUTS | SHORT_INODE) -#define PER_SCOSVR3 (3 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE) -#define PER_OSR5 (3 | STICKY_TIMEOUTS | WHOLE_SECONDS) -#define PER_WYSEV386 (4 | STICKY_TIMEOUTS | SHORT_INODE) -#define PER_ISCR4 (5 | STICKY_TIMEOUTS) -#define PER_BSD 6 -#define PER_SUNOS (6 | STICKY_TIMEOUTS) -#define PER_XENIX (7 | STICKY_TIMEOUTS | SHORT_INODE) -#define PER_LINUX32 8 -#define PER_LINUX32_3GB (8 | ADDR_LIMIT_3GB) -#define PER_IRIX32 (9 | STICKY_TIMEOUTS) -#define PER_IRIXN32 (0xa | STICKY_TIMEOUTS) -#define PER_IRIX64 (0x0b | STICKY_TIMEOUTS) -#define PER_RISCOS 0xc -#define PER_SOLARIS (0xd | STICKY_TIMEOUTS) -#define PER_UW7 (0xe | STICKY_TIMEOUTS | MMAP_PAGE_ZERO) -#define PER_OSF4 0xf -#define PER_HPUX 0x10 -#define PER_MASK 0xff - -int personality(unsigned long); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/system/lib/libc/musl/include/sys/prctl.h b/system/lib/libc/musl/include/sys/prctl.h deleted file mode 100644 index 4b9fcc050802c..0000000000000 --- a/system/lib/libc/musl/include/sys/prctl.h +++ /dev/null @@ -1,170 +0,0 @@ -#ifndef _SYS_PRCTL_H -#define _SYS_PRCTL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define PR_SET_PDEATHSIG 1 -#define PR_GET_PDEATHSIG 2 -#define PR_GET_DUMPABLE 3 -#define PR_SET_DUMPABLE 4 -#define PR_GET_UNALIGN 5 -#define PR_SET_UNALIGN 6 -#define PR_UNALIGN_NOPRINT 1 -#define PR_UNALIGN_SIGBUS 2 -#define PR_GET_KEEPCAPS 7 -#define PR_SET_KEEPCAPS 8 -#define PR_GET_FPEMU 9 -#define PR_SET_FPEMU 10 -#define PR_FPEMU_NOPRINT 1 -#define PR_FPEMU_SIGFPE 2 -#define PR_GET_FPEXC 11 -#define PR_SET_FPEXC 12 -#define PR_FP_EXC_SW_ENABLE 0x80 -#define PR_FP_EXC_DIV 0x010000 -#define PR_FP_EXC_OVF 0x020000 -#define PR_FP_EXC_UND 0x040000 -#define PR_FP_EXC_RES 0x080000 -#define PR_FP_EXC_INV 0x100000 -#define PR_FP_EXC_DISABLED 0 -#define PR_FP_EXC_NONRECOV 1 -#define PR_FP_EXC_ASYNC 2 -#define PR_FP_EXC_PRECISE 3 -#define PR_GET_TIMING 13 -#define PR_SET_TIMING 14 -#define PR_TIMING_STATISTICAL 0 -#define PR_TIMING_TIMESTAMP 1 -#define PR_SET_NAME 15 -#define PR_GET_NAME 16 -#define PR_GET_ENDIAN 19 -#define PR_SET_ENDIAN 20 -#define PR_ENDIAN_BIG 0 -#define PR_ENDIAN_LITTLE 1 -#define PR_ENDIAN_PPC_LITTLE 2 -#define PR_GET_SECCOMP 21 -#define PR_SET_SECCOMP 22 -#define PR_CAPBSET_READ 23 -#define PR_CAPBSET_DROP 24 -#define PR_GET_TSC 25 -#define PR_SET_TSC 26 -#define PR_TSC_ENABLE 1 -#define PR_TSC_SIGSEGV 2 -#define PR_GET_SECUREBITS 27 -#define PR_SET_SECUREBITS 28 -#define PR_SET_TIMERSLACK 29 -#define PR_GET_TIMERSLACK 30 - -#define PR_TASK_PERF_EVENTS_DISABLE 31 -#define PR_TASK_PERF_EVENTS_ENABLE 32 - -#define PR_MCE_KILL 33 -#define PR_MCE_KILL_CLEAR 0 -#define PR_MCE_KILL_SET 1 -#define PR_MCE_KILL_LATE 0 -#define PR_MCE_KILL_EARLY 1 -#define PR_MCE_KILL_DEFAULT 2 -#define PR_MCE_KILL_GET 34 - -#define PR_SET_MM 35 -#define PR_SET_MM_START_CODE 1 -#define PR_SET_MM_END_CODE 2 -#define PR_SET_MM_START_DATA 3 -#define PR_SET_MM_END_DATA 4 -#define PR_SET_MM_START_STACK 5 -#define PR_SET_MM_START_BRK 6 -#define PR_SET_MM_BRK 7 -#define PR_SET_MM_ARG_START 8 -#define PR_SET_MM_ARG_END 9 -#define PR_SET_MM_ENV_START 10 -#define PR_SET_MM_ENV_END 11 -#define PR_SET_MM_AUXV 12 -#define PR_SET_MM_EXE_FILE 13 -#define PR_SET_MM_MAP 14 -#define PR_SET_MM_MAP_SIZE 15 - -struct prctl_mm_map { - uint64_t start_code; - uint64_t end_code; - uint64_t start_data; - uint64_t end_data; - uint64_t start_brk; - uint64_t brk; - uint64_t start_stack; - uint64_t arg_start; - uint64_t arg_end; - uint64_t env_start; - uint64_t env_end; - uint64_t *auxv; - uint32_t auxv_size; - uint32_t exe_fd; -}; - -#define PR_SET_PTRACER 0x59616d61 -#define PR_SET_PTRACER_ANY (-1UL) - -#define PR_SET_CHILD_SUBREAPER 36 -#define PR_GET_CHILD_SUBREAPER 37 - -#define PR_SET_NO_NEW_PRIVS 38 -#define PR_GET_NO_NEW_PRIVS 39 - -#define PR_GET_TID_ADDRESS 40 - -#define PR_SET_THP_DISABLE 41 -#define PR_GET_THP_DISABLE 42 - -#define PR_MPX_ENABLE_MANAGEMENT 43 -#define PR_MPX_DISABLE_MANAGEMENT 44 - -#define PR_SET_FP_MODE 45 -#define PR_GET_FP_MODE 46 -#define PR_FP_MODE_FR (1 << 0) -#define PR_FP_MODE_FRE (1 << 1) - -#define PR_CAP_AMBIENT 47 -#define PR_CAP_AMBIENT_IS_SET 1 -#define PR_CAP_AMBIENT_RAISE 2 -#define PR_CAP_AMBIENT_LOWER 3 -#define PR_CAP_AMBIENT_CLEAR_ALL 4 - -#define PR_SVE_SET_VL 50 -#define PR_SVE_SET_VL_ONEXEC (1 << 18) -#define PR_SVE_GET_VL 51 -#define PR_SVE_VL_LEN_MASK 0xffff -#define PR_SVE_VL_INHERIT (1 << 17) - -#define PR_GET_SPECULATION_CTRL 52 -#define PR_SET_SPECULATION_CTRL 53 -#define PR_SPEC_STORE_BYPASS 0 -#define PR_SPEC_INDIRECT_BRANCH 1 -#define PR_SPEC_NOT_AFFECTED 0 -#define PR_SPEC_PRCTL (1UL << 0) -#define PR_SPEC_ENABLE (1UL << 1) -#define PR_SPEC_DISABLE (1UL << 2) -#define PR_SPEC_FORCE_DISABLE (1UL << 3) -#define PR_SPEC_DISABLE_NOEXEC (1UL << 4) - -#define PR_PAC_RESET_KEYS 54 -#define PR_PAC_APIAKEY (1UL << 0) -#define PR_PAC_APIBKEY (1UL << 1) -#define PR_PAC_APDAKEY (1UL << 2) -#define PR_PAC_APDBKEY (1UL << 3) -#define PR_PAC_APGAKEY (1UL << 4) - -#define PR_SET_TAGGED_ADDR_CTRL 55 -#define PR_GET_TAGGED_ADDR_CTRL 56 -#define PR_TAGGED_ADDR_ENABLE (1UL << 0) - -#define PR_SET_IO_FLUSHER 57 -#define PR_GET_IO_FLUSHER 58 - -int prctl (int, ...); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/ptrace.h b/system/lib/libc/musl/include/sys/ptrace.h deleted file mode 100644 index 5d62a9859aac6..0000000000000 --- a/system/lib/libc/musl/include/sys/ptrace.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef _SYS_PTRACE_H -#define _SYS_PTRACE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define PTRACE_TRACEME 0 -#define PT_TRACE_ME PTRACE_TRACEME - -#define PTRACE_PEEKTEXT 1 -#define PTRACE_PEEKDATA 2 -#define PTRACE_PEEKUSER 3 -#define PTRACE_POKETEXT 4 -#define PTRACE_POKEDATA 5 -#define PTRACE_POKEUSER 6 -#define PTRACE_CONT 7 -#define PTRACE_KILL 8 -#define PTRACE_SINGLESTEP 9 -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 -#define PTRACE_GETFPREGS 14 -#define PTRACE_SETFPREGS 15 -#define PTRACE_ATTACH 16 -#define PTRACE_DETACH 17 -#define PTRACE_GETFPXREGS 18 -#define PTRACE_SETFPXREGS 19 -#define PTRACE_SYSCALL 24 -#define PTRACE_SETOPTIONS 0x4200 -#define PTRACE_GETEVENTMSG 0x4201 -#define PTRACE_GETSIGINFO 0x4202 -#define PTRACE_SETSIGINFO 0x4203 -#define PTRACE_GETREGSET 0x4204 -#define PTRACE_SETREGSET 0x4205 -#define PTRACE_SEIZE 0x4206 -#define PTRACE_INTERRUPT 0x4207 -#define PTRACE_LISTEN 0x4208 -#define PTRACE_PEEKSIGINFO 0x4209 -#define PTRACE_GETSIGMASK 0x420a -#define PTRACE_SETSIGMASK 0x420b -#define PTRACE_SECCOMP_GET_FILTER 0x420c -#define PTRACE_SECCOMP_GET_METADATA 0x420d -#define PTRACE_GET_SYSCALL_INFO 0x420e - -#define PT_READ_I PTRACE_PEEKTEXT -#define PT_READ_D PTRACE_PEEKDATA -#define PT_READ_U PTRACE_PEEKUSER -#define PT_WRITE_I PTRACE_POKETEXT -#define PT_WRITE_D PTRACE_POKEDATA -#define PT_WRITE_U PTRACE_POKEUSER -#define PT_CONTINUE PTRACE_CONT -#define PT_KILL PTRACE_KILL -#define PT_STEP PTRACE_SINGLESTEP -#define PT_GETREGS PTRACE_GETREGS -#define PT_SETREGS PTRACE_SETREGS -#define PT_GETFPREGS PTRACE_GETFPREGS -#define PT_SETFPREGS PTRACE_SETFPREGS -#define PT_ATTACH PTRACE_ATTACH -#define PT_DETACH PTRACE_DETACH -#define PT_GETFPXREGS PTRACE_GETFPXREGS -#define PT_SETFPXREGS PTRACE_SETFPXREGS -#define PT_SYSCALL PTRACE_SYSCALL -#define PT_SETOPTIONS PTRACE_SETOPTIONS -#define PT_GETEVENTMSG PTRACE_GETEVENTMSG -#define PT_GETSIGINFO PTRACE_GETSIGINFO -#define PT_SETSIGINFO PTRACE_SETSIGINFO - -#define PTRACE_O_TRACESYSGOOD 0x00000001 -#define PTRACE_O_TRACEFORK 0x00000002 -#define PTRACE_O_TRACEVFORK 0x00000004 -#define PTRACE_O_TRACECLONE 0x00000008 -#define PTRACE_O_TRACEEXEC 0x00000010 -#define PTRACE_O_TRACEVFORKDONE 0x00000020 -#define PTRACE_O_TRACEEXIT 0x00000040 -#define PTRACE_O_TRACESECCOMP 0x00000080 -#define PTRACE_O_EXITKILL 0x00100000 -#define PTRACE_O_SUSPEND_SECCOMP 0x00200000 -#define PTRACE_O_MASK 0x003000ff - -#define PTRACE_EVENT_FORK 1 -#define PTRACE_EVENT_VFORK 2 -#define PTRACE_EVENT_CLONE 3 -#define PTRACE_EVENT_EXEC 4 -#define PTRACE_EVENT_VFORK_DONE 5 -#define PTRACE_EVENT_EXIT 6 -#define PTRACE_EVENT_SECCOMP 7 -#define PTRACE_EVENT_STOP 128 - -#define PTRACE_PEEKSIGINFO_SHARED 1 - -#define PTRACE_SYSCALL_INFO_NONE 0 -#define PTRACE_SYSCALL_INFO_ENTRY 1 -#define PTRACE_SYSCALL_INFO_EXIT 2 -#define PTRACE_SYSCALL_INFO_SECCOMP 3 - -#include - -struct __ptrace_peeksiginfo_args { - uint64_t off; - uint32_t flags; - int32_t nr; -}; - -struct __ptrace_seccomp_metadata { - uint64_t filter_off; - uint64_t flags; -}; - -struct __ptrace_syscall_info { - uint8_t op; - uint8_t __pad[3]; - uint32_t arch; - uint64_t instruction_pointer; - uint64_t stack_pointer; - union { - struct { - uint64_t nr; - uint64_t args[6]; - } entry; - struct { - int64_t rval; - uint8_t is_error; - } exit; - struct { - uint64_t nr; - uint64_t args[6]; - uint32_t ret_data; - } seccomp; - }; -}; - -long ptrace(int, ...); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/system/lib/libc/musl/include/sys/quota.h b/system/lib/libc/musl/include/sys/quota.h deleted file mode 100644 index 3ed73785df4c6..0000000000000 --- a/system/lib/libc/musl/include/sys/quota.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef _SYS_QUOTA_H -#define _SYS_QUOTA_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define _LINUX_QUOTA_VERSION 2 - -#define dbtob(num) ((num) << 10) -#define btodb(num) ((num) >> 10) -#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / 1024) - -#define MAX_IQ_TIME 604800 -#define MAX_DQ_TIME 604800 - -#define MAXQUOTAS 2 -#define USRQUOTA 0 -#define GRPQUOTA 1 - -#define INITQFNAMES { "user", "group", "undefined" }; - -#define QUOTAFILENAME "quota" -#define QUOTAGROUP "staff" - -#define NR_DQHASH 43 -#define NR_DQUOTS 256 - -#define SUBCMDMASK 0x00ff -#define SUBCMDSHIFT 8 -#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK)) - -#define Q_SYNC 0x800001 -#define Q_QUOTAON 0x800002 -#define Q_QUOTAOFF 0x800003 -#define Q_GETFMT 0x800004 -#define Q_GETINFO 0x800005 -#define Q_SETINFO 0x800006 -#define Q_GETQUOTA 0x800007 -#define Q_SETQUOTA 0x800008 - -#define QFMT_VFS_OLD 1 -#define QFMT_VFS_V0 2 -#define QFMT_OCFS2 3 -#define QFMT_VFS_V1 4 - -#define QIF_BLIMITS 1 -#define QIF_SPACE 2 -#define QIF_ILIMITS 4 -#define QIF_INODES 8 -#define QIF_BTIME 16 -#define QIF_ITIME 32 -#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) -#define QIF_USAGE (QIF_SPACE | QIF_INODES) -#define QIF_TIMES (QIF_BTIME | QIF_ITIME) -#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES) - -struct dqblk { - uint64_t dqb_bhardlimit; - uint64_t dqb_bsoftlimit; - uint64_t dqb_curspace; - uint64_t dqb_ihardlimit; - uint64_t dqb_isoftlimit; - uint64_t dqb_curinodes; - uint64_t dqb_btime; - uint64_t dqb_itime; - uint32_t dqb_valid; -}; - -#define dq_bhardlimit dq_dqb.dqb_bhardlimit -#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit -#define dq_curspace dq_dqb.dqb_curspace -#define dq_valid dq_dqb.dqb_valid -#define dq_ihardlimit dq_dqb.dqb_ihardlimit -#define dq_isoftlimit dq_dqb.dqb_isoftlimit -#define dq_curinodes dq_dqb.dqb_curinodes -#define dq_btime dq_dqb.dqb_btime -#define dq_itime dq_dqb.dqb_itime - -#define dqoff(UID) ((long long)(UID) * sizeof (struct dqblk)) - -#define IIF_BGRACE 1 -#define IIF_IGRACE 2 -#define IIF_FLAGS 4 -#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS) - -struct dqinfo { - uint64_t dqi_bgrace; - uint64_t dqi_igrace; - uint32_t dqi_flags; - uint32_t dqi_valid; -}; - -int quotactl(int, const char *, int, char *); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/reboot.h b/system/lib/libc/musl/include/sys/reboot.h deleted file mode 100644 index 9702eddba4ba2..0000000000000 --- a/system/lib/libc/musl/include/sys/reboot.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _SYS_REBOOT_H -#define _SYS_REBOOT_H -#ifdef __cplusplus -extern "C" { -#endif - -#define RB_AUTOBOOT 0x01234567 -#define RB_HALT_SYSTEM 0xcdef0123 -#define RB_ENABLE_CAD 0x89abcdef -#define RB_DISABLE_CAD 0 -#define RB_POWER_OFF 0x4321fedc -#define RB_SW_SUSPEND 0xd000fce2 -#define RB_KEXEC 0x45584543 - -int reboot(int); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/system/lib/libc/musl/include/sys/signalfd.h b/system/lib/libc/musl/include/sys/signalfd.h deleted file mode 100644 index e881e2cfddcc7..0000000000000 --- a/system/lib/libc/musl/include/sys/signalfd.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _SYS_SIGNALFD_H -#define _SYS_SIGNALFD_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define __NEED_sigset_t - -#include - -#define SFD_CLOEXEC O_CLOEXEC -#define SFD_NONBLOCK O_NONBLOCK - -int signalfd(int, const sigset_t *, int); - -struct signalfd_siginfo { - uint32_t ssi_signo; - int32_t ssi_errno; - int32_t ssi_code; - uint32_t ssi_pid; - uint32_t ssi_uid; - int32_t ssi_fd; - uint32_t ssi_tid; - uint32_t ssi_band; - uint32_t ssi_overrun; - uint32_t ssi_trapno; - int32_t ssi_status; - int32_t ssi_int; - uint64_t ssi_ptr; - uint64_t ssi_utime; - uint64_t ssi_stime; - uint64_t ssi_addr; - uint16_t ssi_addr_lsb; - uint16_t __pad2; - int32_t ssi_syscall; - uint64_t ssi_call_addr; - uint32_t ssi_arch; - uint8_t __pad[128-14*4-5*8-2*2]; -}; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/soundcard.h b/system/lib/libc/musl/include/sys/soundcard.h deleted file mode 100644 index 5ca776461e084..0000000000000 --- a/system/lib/libc/musl/include/sys/soundcard.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/system/lib/libc/musl/include/sys/swap.h b/system/lib/libc/musl/include/sys/swap.h deleted file mode 100644 index 11c0f9296179d..0000000000000 --- a/system/lib/libc/musl/include/sys/swap.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _SYS_SWAP_H -#define _SYS_SWAP_H - -#ifdef __cplusplus -extern "C" { -#endif - - -#define SWAP_FLAG_PREFER 0x8000 -#define SWAP_FLAG_PRIO_MASK 0x7fff -#define SWAP_FLAG_PRIO_SHIFT 0 -#define SWAP_FLAG_DISCARD 0x10000 - -int swapon (const char *, int); -int swapoff (const char *); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/timerfd.h b/system/lib/libc/musl/include/sys/timerfd.h deleted file mode 100644 index 1b832cdd8f8fa..0000000000000 --- a/system/lib/libc/musl/include/sys/timerfd.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _SYS_TIMERFD_H -#define _SYS_TIMERFD_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define TFD_NONBLOCK O_NONBLOCK -#define TFD_CLOEXEC O_CLOEXEC - -#define TFD_TIMER_ABSTIME 1 -#define TFD_TIMER_CANCEL_ON_SET (1 << 1) - -struct itimerspec; - -int timerfd_create(int, int); -int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *); -int timerfd_gettime(int, struct itimerspec *); - -#if _REDIR_TIME64 -__REDIR(timerfd_settime, __timerfd_settime64); -__REDIR(timerfd_gettime, __timerfd_gettime64); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/timex.h b/system/lib/libc/musl/include/sys/timex.h deleted file mode 100644 index 8b417e1be258c..0000000000000 --- a/system/lib/libc/musl/include/sys/timex.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef _SYS_TIMEX_H -#define _SYS_TIMEX_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define __NEED_clockid_t - -#include - -#include - -struct ntptimeval { - struct timeval time; - long maxerror, esterror; -}; - -struct timex { - unsigned modes; - long offset, freq, maxerror, esterror; - int status; - long constant, precision, tolerance; - struct timeval time; - long tick, ppsfreq, jitter; - int shift; - long stabil, jitcnt, calcnt, errcnt, stbcnt; - int tai; - int __padding[11]; -}; - -#define ADJ_OFFSET 0x0001 -#define ADJ_FREQUENCY 0x0002 -#define ADJ_MAXERROR 0x0004 -#define ADJ_ESTERROR 0x0008 -#define ADJ_STATUS 0x0010 -#define ADJ_TIMECONST 0x0020 -#define ADJ_TAI 0x0080 -#define ADJ_SETOFFSET 0x0100 -#define ADJ_MICRO 0x1000 -#define ADJ_NANO 0x2000 -#define ADJ_TICK 0x4000 -#define ADJ_OFFSET_SINGLESHOT 0x8001 -#define ADJ_OFFSET_SS_READ 0xa001 - -#define MOD_OFFSET ADJ_OFFSET -#define MOD_FREQUENCY ADJ_FREQUENCY -#define MOD_MAXERROR ADJ_MAXERROR -#define MOD_ESTERROR ADJ_ESTERROR -#define MOD_STATUS ADJ_STATUS -#define MOD_TIMECONST ADJ_TIMECONST -#define MOD_CLKB ADJ_TICK -#define MOD_CLKA ADJ_OFFSET_SINGLESHOT -#define MOD_TAI ADJ_TAI -#define MOD_MICRO ADJ_MICRO -#define MOD_NANO ADJ_NANO - -#define STA_PLL 0x0001 -#define STA_PPSFREQ 0x0002 -#define STA_PPSTIME 0x0004 -#define STA_FLL 0x0008 - -#define STA_INS 0x0010 -#define STA_DEL 0x0020 -#define STA_UNSYNC 0x0040 -#define STA_FREQHOLD 0x0080 - -#define STA_PPSSIGNAL 0x0100 -#define STA_PPSJITTER 0x0200 -#define STA_PPSWANDER 0x0400 -#define STA_PPSERROR 0x0800 - -#define STA_CLOCKERR 0x1000 -#define STA_NANO 0x2000 -#define STA_MODE 0x4000 -#define STA_CLK 0x8000 - -#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ - STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) - -#define TIME_OK 0 -#define TIME_INS 1 -#define TIME_DEL 2 -#define TIME_OOP 3 -#define TIME_WAIT 4 -#define TIME_ERROR 5 -#define TIME_BAD TIME_ERROR - -#define MAXTC 6 - -int adjtimex(struct timex *); -int clock_adjtime(clockid_t, struct timex *); - -#if _REDIR_TIME64 -__REDIR(adjtimex, __adjtimex_time64); -__REDIR(clock_adjtime, __clock_adjtime64); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/system/lib/libc/musl/include/sys/vt.h b/system/lib/libc/musl/include/sys/vt.h deleted file mode 100644 index 5000de499fa27..0000000000000 --- a/system/lib/libc/musl/include/sys/vt.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/system/lib/libc/musl/src/include/sys/auxv.h b/system/lib/libc/musl/src/include/sys/auxv.h deleted file mode 100644 index 9358a4a5d8c58..0000000000000 --- a/system/lib/libc/musl/src/include/sys/auxv.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef SYS_AUXV_H -#define SYS_AUXV_H - -#include "../../../include/sys/auxv.h" - -#include - -hidden unsigned long __getauxval(unsigned long); - -#endif diff --git a/system/lib/update_musl.py b/system/lib/update_musl.py index 45fc95acc890d..bd4bdc3cc1b1a 100755 --- a/system/lib/update_musl.py +++ b/system/lib/update_musl.py @@ -34,6 +34,30 @@ 'arm', 'x32', 'sh', 'i386', 'x86_64', 'aarch64', 'riscv64', 's390x', 'mips', 'mips64', 'mipsn32', 'powerpc', 'powerpc64', 'm68k', 'microblaze', 'or1k') +exclude_files = ( + 'sendfile.h', + 'auxv.h', + 'personality.h', + 'klog.h', + 'fanotify.h', + 'vt.h', + 'swap.h', + 'reboot.h', + 'quota.h', + 'kd.h', + 'io.h', + 'fsuid.h', + 'epoll.h', + 'inotify.h', + 'timerfd.h', + 'timex.h', + 'cachectl.h', + 'soundcard.h', + 'eventfd.h', + 'signalfd.h', + 'ptrace.h', + 'prctl.h', +) if len(sys.argv) > 1: @@ -43,7 +67,7 @@ def should_ignore(name): - return name in exclude_dirs or name[0] == '.' + return name in exclude_dirs or name[0] == '.' or name in exclude_files def ignore(dirname, contents): diff --git a/test/fs/test_mmap.c b/test/fs/test_mmap.c index dc086800fbcb4..78cd815cbe226 100644 --- a/test/fs/test_mmap.c +++ b/test/fs/test_mmap.c @@ -15,7 +15,6 @@ #include #include #include -#include #include void test_mmap_read() { diff --git a/tools/system_libs.py b/tools/system_libs.py index 2d90e3abe5f26..da85077c0fad4 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -810,6 +810,7 @@ def get_files(self): 'alarm.c', 'syscall.c', 'popen.c', 'pclose.c', 'getgrouplist.c', 'initgroups.c', 'wordexp.c', 'timer_create.c', 'getentropy.c', + 'getauxval.c', # 'process' exclusion 'fork.c', 'vfork.c', 'posix_spawn.c', 'posix_spawnp.c', 'execve.c', 'waitid.c', 'system.c', '_Fork.c',