musl: update to 1.2.2

This commit is contained in:
Isaac Freund
2021-02-09 22:15:21 +01:00
committed by Andrew Kelley
parent a2ec77041b
commit 6dc2236054
187 changed files with 2487 additions and 749 deletions

View File

@@ -365,6 +365,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -37,4 +37,14 @@
#define HWCAP2_SVEPMULL (1 << 3)
#define HWCAP2_SVEBITPERM (1 << 4)
#define HWCAP2_SVESHA3 (1 << 5)
#define HWCAP2_SVESM4 (1 << 6)
#define HWCAP2_SVESM4 (1 << 6)
#define HWCAP2_FLAGM2 (1 << 7)
#define HWCAP2_FRINT (1 << 8)
#define HWCAP2_SVEI8MM (1 << 9)
#define HWCAP2_SVEF32MM (1 << 10)
#define HWCAP2_SVEF64MM (1 << 11)
#define HWCAP2_SVEBF16 (1 << 12)
#define HWCAP2_I8MM (1 << 13)
#define HWCAP2_BF16 (1 << 14)
#define HWCAP2_DGH (1 << 15)
#define HWCAP2_RNG (1 << 16)

View File

@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
typedef unsigned long gregset_t[34];
typedef struct {
long double vregs[32];
__uint128_t vregs[32];
unsigned int fpsr;
unsigned int fpcr;
} fpregset_t;
@@ -34,7 +34,7 @@ struct fpsimd_context {
struct _aarch64_ctx head;
unsigned int fpsr;
unsigned int fpcr;
long double vregs[32];
__uint128_t vregs[32];
};
struct esr_context {
struct _aarch64_ctx head;

View File

@@ -289,6 +289,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define SYS_io_setup 0
#define SYS_io_destroy 1
@@ -580,4 +584,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -6,7 +6,7 @@ struct user_regs_struct {
};
struct user_fpsimd_struct {
long double vregs[32];
__uint128_t vregs[32];
unsigned int fpsr;
unsigned int fpcr;
};

View File

@@ -350,6 +350,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -389,6 +389,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define __ARM_NR_breakpoint 0x0f0001
#define __ARM_NR_cacheflush 0x0f0002
@@ -787,4 +791,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -13,7 +13,7 @@
#define O_ASYNC 020000
#define O_DIRECT 040000
#define O_LARGEFILE 0
#define O_LARGEFILE 0100000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000
@@ -30,11 +30,17 @@
#define F_SETSIG 10
#define F_GETSIG 11
#if __LONG_MAX == 0x7fffffffL
#define F_GETLK 12
#define F_SETLK 13
#define F_SETLKW 14
#else
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#endif
#define F_SETOWN_EX 15
#define F_GETOWN_EX 16
#define F_GETOWNER_UIDS 17
#define F_GETOWNER_UIDS 17

View File

@@ -603,6 +603,7 @@ typedef struct {
#define PT_GNU_EH_FRAME 0x6474e550
#define PT_GNU_STACK 0x6474e551
#define PT_GNU_RELRO 0x6474e552
#define PT_GNU_PROPERTY 0x6474e553
#define PT_LOSUNW 0x6ffffffa
#define PT_SUNWBSS 0x6ffffffa
#define PT_SUNWSTACK 0x6ffffffb
@@ -1085,6 +1086,7 @@ typedef struct {
#define NT_GNU_BUILD_ID 3
#define NT_GNU_GOLD_VERSION 4
#define NT_GNU_PROPERTY_TYPE_0 5

View File

@@ -59,6 +59,7 @@
#define ETH_P_PREAUTH 0x88C7
#define ETH_P_TIPC 0x88CA
#define ETH_P_LLDP 0x88CC
#define ETH_P_MRP 0x88E3
#define ETH_P_MACSEC 0x88E5
#define ETH_P_8021AH 0x88E7
#define ETH_P_MVRP 0x88F5

View File

@@ -101,8 +101,10 @@ uint16_t ntohs(uint16_t);
#define IPPROTO_MH 135
#define IPPROTO_UDPLITE 136
#define IPPROTO_MPLS 137
#define IPPROTO_ETHERNET 143
#define IPPROTO_RAW 255
#define IPPROTO_MAX 256
#define IPPROTO_MPTCP 262
#define IPPROTO_MAX 263
#define IN6_IS_ADDR_UNSPECIFIED(a) \
(((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \
@@ -200,6 +202,7 @@ uint16_t ntohs(uint16_t);
#define IP_CHECKSUM 23
#define IP_BIND_ADDRESS_NO_PORT 24
#define IP_RECVFRAGSIZE 25
#define IP_RECVERR_RFC4884 26
#define IP_MULTICAST_IF 32
#define IP_MULTICAST_TTL 33
#define IP_MULTICAST_LOOP 34

View File

@@ -78,6 +78,8 @@ enum {
TCP_NLA_DSACK_DUPS,
TCP_NLA_REORD_SEEN,
TCP_NLA_SRTT,
TCP_NLA_TIMEOUT_REHASH,
TCP_NLA_BYTES_NOTSENT,
};
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
@@ -181,6 +183,13 @@ struct tcphdr {
#define TCP_CA_Recovery 3
#define TCP_CA_Loss 4
enum tcp_fastopen_client_fail {
TFO_STATUS_UNSPEC,
TFO_COOKIE_UNAVAILABLE,
TFO_DATA_NOT_ACKED,
TFO_SYN_RETRANSMITTED,
};
struct tcp_info {
uint8_t tcpi_state;
uint8_t tcpi_ca_state;
@@ -189,7 +198,7 @@ struct tcp_info {
uint8_t tcpi_backoff;
uint8_t tcpi_options;
uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
uint8_t tcpi_delivery_rate_app_limited : 1;
uint8_t tcpi_delivery_rate_app_limited : 1, tcpi_fastopen_client_fail : 2;
uint32_t tcpi_rto;
uint32_t tcpi_ato;
uint32_t tcpi_snd_mss;
@@ -240,14 +249,15 @@ struct tcp_info {
#define TCP_MD5SIG_MAXKEYLEN 80
#define TCP_MD5SIG_FLAG_PREFIX 1
#define TCP_MD5SIG_FLAG_PREFIX 0x1
#define TCP_MD5SIG_FLAG_IFINDEX 0x2
struct tcp_md5sig {
struct sockaddr_storage tcpm_addr;
uint8_t tcpm_flags;
uint8_t tcpm_prefixlen;
uint16_t tcpm_keylen;
uint32_t __tcpm_pad;
int tcpm_ifindex;
uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
};
@@ -275,6 +285,8 @@ struct tcp_zerocopy_receive {
uint64_t address;
uint32_t length;
uint32_t recv_skip_hint;
uint32_t inq;
int32_t err;
};
#endif

View File

@@ -35,6 +35,7 @@ struct udphdr {
#define UDP_ENCAP_GTP0 4
#define UDP_ENCAP_GTP1U 5
#define UDP_ENCAP_RXRPC 6
#define TCP_ENCAP_ESPINTCP 7
#define SOL_UDP 17

View File

@@ -49,6 +49,7 @@ int sched_yield(void);
#ifdef _GNU_SOURCE
#define CSIGNAL 0x000000ff
#define CLONE_NEWTIME 0x00000080
#define CLONE_VM 0x00000100
#define CLONE_FS 0x00000200
#define CLONE_FILES 0x00000400

View File

@@ -180,14 +180,24 @@ struct sigevent {
union sigval sigev_value;
int sigev_signo;
int sigev_notify;
void (*sigev_notify_function)(union sigval);
pthread_attr_t *sigev_notify_attributes;
char __pad[56-3*sizeof(long)];
union {
char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
pid_t sigev_notify_thread_id;
struct {
void (*sigev_notify_function)(union sigval);
pthread_attr_t *sigev_notify_attributes;
} __sev_thread;
} __sev_fields;
};
#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
#define SIGEV_SIGNAL 0
#define SIGEV_NONE 1
#define SIGEV_THREAD 2
#define SIGEV_THREAD_ID 4
int __libc_current_sigrtmin(void);
int __libc_current_sigrtmax(void);

View File

@@ -145,6 +145,7 @@ int getloadavg(double *, int);
int clearenv(void);
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFCONTINUED(s) ((s) == 0xffff)
void *reallocarray (void *, size_t, size_t);
#endif
#ifdef _GNU_SOURCE

View File

@@ -55,8 +55,9 @@ struct fanotify_response {
#define FAN_OPEN_PERM 0x10000
#define FAN_ACCESS_PERM 0x20000
#define FAN_OPEN_EXEC_PERM 0x40000
#define FAN_ONDIR 0x40000000
#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
@@ -70,6 +71,9 @@ struct fanotify_response {
#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
@@ -88,6 +92,8 @@ struct fanotify_response {
#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

View File

@@ -4,6 +4,8 @@
extern "C" {
#endif
#define __NEED_struct_winsize
#include <bits/alltypes.h>
#include <bits/ioctl.h>
@@ -47,13 +49,6 @@ extern "C" {
#define TIOCSER_TEMT 1
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
#define SIOCADDRT 0x890B
#define SIOCDELRT 0x890C
#define SIOCRTMSG 0x890D

View File

@@ -101,6 +101,7 @@ extern "C" {
#ifdef _GNU_SOURCE
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
#define MREMAP_DONTUNMAP 4
#define MLOCK_ONFAULT 0x01

View File

@@ -5,7 +5,9 @@
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
@@ -17,6 +19,7 @@ extern "C" {
#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)

View File

@@ -158,6 +158,9 @@ struct prctl_mm_map {
#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

View File

@@ -10,6 +10,7 @@ extern "C" {
#define GRND_NONBLOCK 0x0001
#define GRND_RANDOM 0x0002
#define GRND_INSECURE 0x0004
ssize_t getrandom(void *, size_t, unsigned);

View File

@@ -8,6 +8,7 @@ extern "C" {
#include <features.h>
#define __NEED_pid_t
#define __NEED_struct_winsize
#include <bits/alltypes.h>
@@ -27,6 +28,9 @@ int cfsetispeed (struct termios *, speed_t);
int tcgetattr (int, struct termios *);
int tcsetattr (int, int, const struct termios *);
int tcgetwinsize (int, struct winsize *);
int tcsetwinsize (int, const struct winsize *);
int tcsendbreak (int, int);
int tcdrain (int);
int tcflush (int, int);

View File

@@ -82,6 +82,7 @@ unsigned sleep(unsigned);
int pause(void);
pid_t fork(void);
pid_t _Fork(void);
int execve(const char *, char *const [], char *const []);
int execv(const char *, char *const []);
int execle(const char *, const char *, ...);
@@ -190,6 +191,7 @@ int syncfs(int);
int euidaccess(const char *, int);
int eaccess(const char *, int);
ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
pid_t gettid(void);
#endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)

View File

@@ -380,6 +380,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -426,6 +426,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define SYS_restart_syscall 0
#define SYS_exit 1
@@ -852,4 +856,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -350,6 +350,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -408,6 +408,10 @@
#define __NR_fspick 4433
#define __NR_pidfd_open 4434
#define __NR_clone3 4435
#define __NR_close_range 4436
#define __NR_openat2 4437
#define __NR_pidfd_getfd 4438
#define __NR_faccessat2 4439
#define SYS_syscall 4000
#define SYS_exit 4001
@@ -818,4 +822,8 @@
#define SYS_fsmount 4432
#define SYS_fspick 4433
#define SYS_pidfd_open 4434
#define SYS_clone3 4435
#define SYS_clone3 4435
#define SYS_close_range 4436
#define SYS_openat2 4437
#define SYS_pidfd_getfd 4438
#define SYS_faccessat2 4439

View File

@@ -355,6 +355,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -13,7 +13,7 @@
#define O_ASYNC 010000
#define O_DIRECT 0100000
#define O_LARGEFILE 0
#define O_LARGEFILE 020000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000

View File

@@ -338,6 +338,10 @@
#define __NR_fspick 5433
#define __NR_pidfd_open 5434
#define __NR_clone3 5435
#define __NR_close_range 5436
#define __NR_openat2 5437
#define __NR_pidfd_getfd 5438
#define __NR_faccessat2 5439
#define SYS_read 5000
#define SYS_write 5001
@@ -678,4 +682,8 @@
#define SYS_fsmount 5432
#define SYS_fspick 5433
#define SYS_pidfd_open 5434
#define SYS_clone3 5435
#define SYS_clone3 5435
#define SYS_close_range 5436
#define SYS_openat2 5437
#define SYS_pidfd_getfd 5438
#define SYS_faccessat2 5439

View File

@@ -353,6 +353,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -415,6 +415,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define SYS_restart_syscall 0
#define SYS_exit 1
@@ -832,4 +836,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -349,6 +349,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -387,6 +387,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define SYS_restart_syscall 0
#define SYS_exit 1
@@ -776,4 +780,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -355,6 +355,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -60,10 +60,10 @@ struct sigaltstack {
size_t ss_size;
};
typedef struct ucontext_t
typedef struct __ucontext
{
unsigned long uc_flags;
struct ucontext_t *uc_link;
struct __ucontext *uc_link;
stack_t uc_stack;
sigset_t uc_sigmask;
mcontext_t uc_mcontext;

View File

@@ -289,6 +289,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define __NR_sysriscv __NR_arch_specific_syscall
#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
@@ -583,5 +587,9 @@
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439
#define SYS_sysriscv __NR_arch_specific_syscall
#define SYS_riscv_flush_icache (__NR_sysriscv + 15)

View File

@@ -13,11 +13,19 @@ typedef int wchar_t;
#endif
#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 1
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef double float_t;
#define __DEFINED_float_t
#endif
#else
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
#endif
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
@@ -344,6 +352,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -1,4 +1,8 @@
#define FLT_EVAL_METHOD 1
#ifdef __FLT_EVAL_METHOD__
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
#else
#define FLT_EVAL_METHOD 0
#endif
#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L

View File

@@ -352,6 +352,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define SYS_exit 1
#define SYS_fork 2
@@ -706,4 +710,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -357,6 +357,12 @@ struct iovec { void *iov_base; size_t iov_len; };
#endif
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
#define __DEFINED_struct_winsize
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t

View File

@@ -345,6 +345,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define SYS_read 0
#define SYS_write 1
@@ -692,4 +696,8 @@
#define SYS_fsmount 432
#define SYS_fspick 433
#define SYS_pidfd_open 434
#define SYS_clone3 435
#define SYS_clone3 435
#define SYS_close_range 436
#define SYS_openat2 437
#define SYS_pidfd_getfd 438
#define SYS_faccessat2 439

View File

@@ -38,3 +38,13 @@
#define HWCAP2_SVEBITPERM (1 << 4)
#define HWCAP2_SVESHA3 (1 << 5)
#define HWCAP2_SVESM4 (1 << 6)
#define HWCAP2_FLAGM2 (1 << 7)
#define HWCAP2_FRINT (1 << 8)
#define HWCAP2_SVEI8MM (1 << 9)
#define HWCAP2_SVEF32MM (1 << 10)
#define HWCAP2_SVEF64MM (1 << 11)
#define HWCAP2_SVEBF16 (1 << 12)
#define HWCAP2_I8MM (1 << 13)
#define HWCAP2_BF16 (1 << 14)
#define HWCAP2_DGH (1 << 15)
#define HWCAP2_RNG (1 << 16)

View File

@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
typedef unsigned long gregset_t[34];
typedef struct {
long double vregs[32];
__uint128_t vregs[32];
unsigned int fpsr;
unsigned int fpcr;
} fpregset_t;
@@ -34,7 +34,7 @@ struct fpsimd_context {
struct _aarch64_ctx head;
unsigned int fpsr;
unsigned int fpcr;
long double vregs[32];
__uint128_t vregs[32];
};
struct esr_context {
struct _aarch64_ctx head;

View File

@@ -289,4 +289,8 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439

View File

@@ -6,7 +6,7 @@ struct user_regs_struct {
};
struct user_fpsimd_struct {
long double vregs[32];
__uint128_t vregs[32];
unsigned int fpsr;
unsigned int fpcr;
};

View File

@@ -1,12 +1,11 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
char *self;
__asm__ ("mrs %0,tpidr_el0" : "=r"(self));
return (void*)(self - sizeof(struct pthread));
uintptr_t tp;
__asm__ ("mrs %0,tpidr_el0" : "=r"(tp));
return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 16
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
#define MC_PC pc

View File

@@ -389,6 +389,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define __ARM_NR_breakpoint 0x0f0001
#define __ARM_NR_cacheflush 0x0f0002

View File

@@ -1,11 +1,11 @@
#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
|| __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
static inline pthread_t __pthread_self()
static inline uintptr_t __get_tp()
{
char *p;
__asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(p) );
return (void *)(p-sizeof(struct pthread));
uintptr_t tp;
__asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(tp) );
return tp;
}
#else
@@ -16,18 +16,17 @@ static inline pthread_t __pthread_self()
#define BLX "blx"
#endif
static inline pthread_t __pthread_self()
static inline uintptr_t __get_tp()
{
extern hidden uintptr_t __a_gettp_ptr;
register uintptr_t p __asm__("r0");
__asm__ ( BLX " %1" : "=r"(p) : "r"(__a_gettp_ptr) : "cc", "lr" );
return (void *)(p-sizeof(struct pthread));
register uintptr_t tp __asm__("r0");
__asm__ ( BLX " %1" : "=r"(tp) : "r"(__a_gettp_ptr) : "cc", "lr" );
return tp;
}
#endif
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 8
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
#define MC_PC arm_pc

View File

@@ -30,9 +30,15 @@
#define F_SETSIG 10
#define F_GETSIG 11
#if __LONG_MAX == 0x7fffffffL
#define F_GETLK 12
#define F_SETLK 13
#define F_SETLKW 14
#else
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#endif
#define F_SETOWN_EX 15
#define F_GETOWN_EX 16

View File

@@ -426,4 +426,8 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439

View File

@@ -1,10 +1,8 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
struct pthread *self;
__asm__ ("movl %%gs:0,%0" : "=r" (self) );
return self;
uintptr_t tp;
__asm__ ("movl %%gs:0,%0" : "=r" (tp) );
return tp;
}
#define TP_ADJ(p) (p)
#define MC_PC gregs[REG_EIP]

View File

@@ -87,5 +87,3 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a
#define VDSO_CGT32_VER "LINUX_2.6"
#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define SYSCALL_USE_SOCKETCALL

View File

@@ -408,4 +408,8 @@
#define __NR_fspick 4433
#define __NR_pidfd_open 4434
#define __NR_clone3 4435
#define __NR_close_range 4436
#define __NR_openat2 4437
#define __NR_pidfd_getfd 4438
#define __NR_faccessat2 4439

View File

@@ -1,19 +1,19 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
#if __mips_isa_rev < 2
register char *tp __asm__("$3");
register uintptr_t tp __asm__("$3");
__asm__ (".word 0x7c03e83b" : "=r" (tp) );
#else
char *tp;
uintptr_t tp;
__asm__ ("rdhwr %0, $29" : "=r" (tp) );
#endif
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
#define TP_OFFSET 0x7000
#define DTP_OFFSET 0x8000
#define MC_PC pc

View File

@@ -149,3 +149,5 @@ static inline long __syscall7(long n, long a, long b, long c, long d, long e, lo
#define SO_SNDTIMEO_OLD 0x1005
#define SO_RCVTIMEO_OLD 0x1006
#undef SYS_socketcall

View File

@@ -13,7 +13,7 @@
#define O_ASYNC 010000
#define O_DIRECT 0100000
#define O_LARGEFILE 0
#define O_LARGEFILE 020000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000

View File

@@ -338,4 +338,8 @@
#define __NR_fspick 5433
#define __NR_pidfd_open 5434
#define __NR_clone3 5435
#define __NR_close_range 5436
#define __NR_openat2 5437
#define __NR_pidfd_getfd 5438
#define __NR_faccessat2 5439

View File

@@ -1,19 +1,19 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
#if __mips_isa_rev < 2
register char *tp __asm__("$3");
register uintptr_t tp __asm__("$3");
__asm__ (".word 0x7c03e83b" : "=r" (tp) );
#else
char *tp;
uintptr_t tp;
__asm__ ("rdhwr %0, $29" : "=r" (tp) );
#endif
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
#define TP_OFFSET 0x7000
#define DTP_OFFSET 0x8000
#define MC_PC pc

View File

@@ -415,4 +415,8 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439

View File

@@ -1,18 +1,16 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
register char *tp __asm__("r2");
register uintptr_t tp __asm__("r2");
__asm__ ("" : "=r" (tp) );
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
#define TP_OFFSET 0x7000
#define DTP_OFFSET 0x8000
// the kernel calls the ip "nip", it's the first saved value after the 32
// GPRs.
#define MC_PC gregs[32]
#define CANARY canary_at_end

View File

@@ -387,4 +387,8 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439

View File

@@ -1,18 +1,16 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
register char *tp __asm__("r13");
register uintptr_t tp __asm__("r13");
__asm__ ("" : "=r" (tp) );
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
#define TP_OFFSET 0x7000
#define DTP_OFFSET 0x8000
// the kernel calls the ip "nip", it's the first saved value after the 32
// GPRs.
#define MC_PC gp_regs[32]
#define CANARY canary_at_end

View File

@@ -1,38 +0,0 @@
#define O_CREAT 0100
#define O_EXCL 0200
#define O_NOCTTY 0400
#define O_TRUNC 01000
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_DSYNC 010000
#define O_SYNC 04010000
#define O_RSYNC 04010000
#define O_DIRECTORY 0200000
#define O_NOFOLLOW 0400000
#define O_CLOEXEC 02000000
#define O_ASYNC 020000
#define O_DIRECT 040000
#define O_LARGEFILE 0100000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000
#define O_NDELAY O_NONBLOCK
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
#define F_GETFL 3
#define F_SETFL 4
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#define F_SETOWN 8
#define F_GETOWN 9
#define F_SETSIG 10
#define F_GETSIG 11
#define F_SETOWN_EX 15
#define F_GETOWN_EX 16
#define F_GETOWNER_UIDS 17

View File

@@ -60,10 +60,10 @@ struct sigaltstack {
size_t ss_size;
};
typedef struct ucontext_t
typedef struct __ucontext
{
unsigned long uc_flags;
struct ucontext_t *uc_link;
struct __ucontext *uc_link;
stack_t uc_stack;
sigset_t uc_sigmask;
mcontext_t uc_mcontext;

View File

@@ -289,6 +289,10 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439
#define __NR_sysriscv __NR_arch_specific_syscall
#define __NR_riscv_flush_icache (__NR_sysriscv + 15)

View File

@@ -1,13 +1,12 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
char *tp;
uintptr_t tp;
__asm__ __volatile__("mv %0, tp" : "=r"(tp));
return (void *)(tp - sizeof(struct pthread));
return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
#define TP_ADJ(p) ((char *)p + sizeof(struct pthread))
#define DTP_OFFSET 0x800

View File

@@ -9,7 +9,11 @@
TYPEDEF int wchar_t;
#endif
#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 1
TYPEDEF double float_t;
#else
TYPEDEF float float_t;
#endif
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;

View File

@@ -1,4 +1,8 @@
#define FLT_EVAL_METHOD 1
#ifdef __FLT_EVAL_METHOD__
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
#else
#define FLT_EVAL_METHOD 0
#endif
#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L

View File

@@ -352,4 +352,8 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439

View File

@@ -1,14 +1,12 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
struct pthread *self;
uintptr_t tp;
__asm__ (
"ear %0, %%a0\n"
"sllg %0, %0, 32\n"
"ear %0, %%a1\n"
: "=r"(self));
return self;
: "=r"(tp));
return tp;
}
#define TP_ADJ(p) (p)
#define MC_PC psw.addr

View File

@@ -72,5 +72,3 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
register long r7 __asm__("r7") = f;
__asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7));
}
#define SYSCALL_USE_SOCKETCALL

View File

@@ -345,4 +345,8 @@
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
#define __NR_close_range 436
#define __NR_openat2 437
#define __NR_pidfd_getfd 438
#define __NR_faccessat2 439

View File

@@ -1,10 +1,8 @@
static inline struct pthread *__pthread_self()
static inline uintptr_t __get_tp()
{
struct pthread *self;
__asm__ ("mov %%fs:0,%0" : "=r" (self) );
return self;
uintptr_t tp;
__asm__ ("mov %%fs:0,%0" : "=r" (tp) );
return tp;
}
#define TP_ADJ(p) (p)
#define MC_PC gregs[REG_RIP]

View File

@@ -77,6 +77,8 @@ TYPEDEF struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
STRUCT iovec { void *iov_base; size_t iov_len; };
STRUCT winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
TYPEDEF unsigned socklen_t;
TYPEDEF unsigned short sa_family_t;

View File

@@ -603,6 +603,7 @@ typedef struct {
#define PT_GNU_EH_FRAME 0x6474e550
#define PT_GNU_STACK 0x6474e551
#define PT_GNU_RELRO 0x6474e552
#define PT_GNU_PROPERTY 0x6474e553
#define PT_LOSUNW 0x6ffffffa
#define PT_SUNWBSS 0x6ffffffa
#define PT_SUNWSTACK 0x6ffffffb
@@ -1085,6 +1086,7 @@ typedef struct {
#define NT_GNU_BUILD_ID 3
#define NT_GNU_GOLD_VERSION 4
#define NT_GNU_PROPERTY_TYPE_0 5

View File

@@ -59,6 +59,7 @@
#define ETH_P_PREAUTH 0x88C7
#define ETH_P_TIPC 0x88CA
#define ETH_P_LLDP 0x88CC
#define ETH_P_MRP 0x88E3
#define ETH_P_MACSEC 0x88E5
#define ETH_P_8021AH 0x88E7
#define ETH_P_MVRP 0x88F5

View File

@@ -101,8 +101,10 @@ uint16_t ntohs(uint16_t);
#define IPPROTO_MH 135
#define IPPROTO_UDPLITE 136
#define IPPROTO_MPLS 137
#define IPPROTO_ETHERNET 143
#define IPPROTO_RAW 255
#define IPPROTO_MAX 256
#define IPPROTO_MPTCP 262
#define IPPROTO_MAX 263
#define IN6_IS_ADDR_UNSPECIFIED(a) \
(((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \
@@ -200,6 +202,7 @@ uint16_t ntohs(uint16_t);
#define IP_CHECKSUM 23
#define IP_BIND_ADDRESS_NO_PORT 24
#define IP_RECVFRAGSIZE 25
#define IP_RECVERR_RFC4884 26
#define IP_MULTICAST_IF 32
#define IP_MULTICAST_TTL 33
#define IP_MULTICAST_LOOP 34

View File

@@ -78,6 +78,8 @@ enum {
TCP_NLA_DSACK_DUPS,
TCP_NLA_REORD_SEEN,
TCP_NLA_SRTT,
TCP_NLA_TIMEOUT_REHASH,
TCP_NLA_BYTES_NOTSENT,
};
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
@@ -181,6 +183,13 @@ struct tcphdr {
#define TCP_CA_Recovery 3
#define TCP_CA_Loss 4
enum tcp_fastopen_client_fail {
TFO_STATUS_UNSPEC,
TFO_COOKIE_UNAVAILABLE,
TFO_DATA_NOT_ACKED,
TFO_SYN_RETRANSMITTED,
};
struct tcp_info {
uint8_t tcpi_state;
uint8_t tcpi_ca_state;
@@ -189,7 +198,7 @@ struct tcp_info {
uint8_t tcpi_backoff;
uint8_t tcpi_options;
uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
uint8_t tcpi_delivery_rate_app_limited : 1;
uint8_t tcpi_delivery_rate_app_limited : 1, tcpi_fastopen_client_fail : 2;
uint32_t tcpi_rto;
uint32_t tcpi_ato;
uint32_t tcpi_snd_mss;
@@ -240,14 +249,15 @@ struct tcp_info {
#define TCP_MD5SIG_MAXKEYLEN 80
#define TCP_MD5SIG_FLAG_PREFIX 1
#define TCP_MD5SIG_FLAG_PREFIX 0x1
#define TCP_MD5SIG_FLAG_IFINDEX 0x2
struct tcp_md5sig {
struct sockaddr_storage tcpm_addr;
uint8_t tcpm_flags;
uint8_t tcpm_prefixlen;
uint16_t tcpm_keylen;
uint32_t __tcpm_pad;
int tcpm_ifindex;
uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
};
@@ -275,6 +285,8 @@ struct tcp_zerocopy_receive {
uint64_t address;
uint32_t length;
uint32_t recv_skip_hint;
uint32_t inq;
int32_t err;
};
#endif

View File

@@ -35,6 +35,7 @@ struct udphdr {
#define UDP_ENCAP_GTP0 4
#define UDP_ENCAP_GTP1U 5
#define UDP_ENCAP_RXRPC 6
#define TCP_ENCAP_ESPINTCP 7
#define SOL_UDP 17

View File

@@ -49,6 +49,7 @@ int sched_yield(void);
#ifdef _GNU_SOURCE
#define CSIGNAL 0x000000ff
#define CLONE_NEWTIME 0x00000080
#define CLONE_VM 0x00000100
#define CLONE_FS 0x00000200
#define CLONE_FILES 0x00000400

View File

@@ -180,14 +180,24 @@ struct sigevent {
union sigval sigev_value;
int sigev_signo;
int sigev_notify;
void (*sigev_notify_function)(union sigval);
pthread_attr_t *sigev_notify_attributes;
char __pad[56-3*sizeof(long)];
union {
char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
pid_t sigev_notify_thread_id;
struct {
void (*sigev_notify_function)(union sigval);
pthread_attr_t *sigev_notify_attributes;
} __sev_thread;
} __sev_fields;
};
#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
#define SIGEV_SIGNAL 0
#define SIGEV_NONE 1
#define SIGEV_THREAD 2
#define SIGEV_THREAD_ID 4
int __libc_current_sigrtmin(void);
int __libc_current_sigrtmax(void);

View File

@@ -145,6 +145,7 @@ int getloadavg(double *, int);
int clearenv(void);
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFCONTINUED(s) ((s) == 0xffff)
void *reallocarray (void *, size_t, size_t);
#endif
#ifdef _GNU_SOURCE

View File

@@ -55,8 +55,9 @@ struct fanotify_response {
#define FAN_OPEN_PERM 0x10000
#define FAN_ACCESS_PERM 0x20000
#define FAN_OPEN_EXEC_PERM 0x40000
#define FAN_ONDIR 0x40000000
#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
@@ -70,6 +71,9 @@ struct fanotify_response {
#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
@@ -88,6 +92,8 @@ struct fanotify_response {
#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

View File

@@ -4,6 +4,8 @@
extern "C" {
#endif
#define __NEED_struct_winsize
#include <bits/alltypes.h>
#include <bits/ioctl.h>
@@ -47,13 +49,6 @@ extern "C" {
#define TIOCSER_TEMT 1
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
#define SIOCADDRT 0x890B
#define SIOCDELRT 0x890C
#define SIOCRTMSG 0x890D

View File

@@ -101,6 +101,7 @@ extern "C" {
#ifdef _GNU_SOURCE
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
#define MREMAP_DONTUNMAP 4
#define MLOCK_ONFAULT 0x01

View File

@@ -5,7 +5,9 @@
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
@@ -17,6 +19,7 @@ extern "C" {
#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)

View File

@@ -158,6 +158,9 @@ struct prctl_mm_map {
#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

View File

@@ -10,6 +10,7 @@ extern "C" {
#define GRND_NONBLOCK 0x0001
#define GRND_RANDOM 0x0002
#define GRND_INSECURE 0x0004
ssize_t getrandom(void *, size_t, unsigned);

View File

@@ -8,6 +8,7 @@ extern "C" {
#include <features.h>
#define __NEED_pid_t
#define __NEED_struct_winsize
#include <bits/alltypes.h>
@@ -27,6 +28,9 @@ int cfsetispeed (struct termios *, speed_t);
int tcgetattr (int, struct termios *);
int tcsetattr (int, int, const struct termios *);
int tcgetwinsize (int, struct winsize *);
int tcsetwinsize (int, const struct winsize *);
int tcsendbreak (int, int);
int tcdrain (int);
int tcflush (int, int);

View File

@@ -82,6 +82,7 @@ unsigned sleep(unsigned);
int pause(void);
pid_t fork(void);
pid_t _Fork(void);
int execve(const char *, char *const [], char *const []);
int execv(const char *, char *const []);
int execle(const char *, const char *, ...);
@@ -190,6 +191,7 @@ int syncfs(int);
int euidaccess(const char *, int);
int eaccess(const char *, int);
ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
pid_t gettid(void);
#endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)

View File

@@ -105,6 +105,9 @@ in6addr_loopback:
.globl _Exit
.type _Exit, %function;
_Exit:
.globl _Fork
.type _Fork, %function;
_Fork:
.weak _IO_feof_unlocked
.type _IO_feof_unlocked, %function;
_IO_feof_unlocked:
@@ -2116,6 +2119,9 @@ getsubopt:
.globl gettext
.type gettext, %function;
gettext:
.globl gettid
.type gettid, %function;
gettid:
.globl gettimeofday
.type gettimeofday, %function;
gettimeofday:
@@ -2728,7 +2734,7 @@ lutimes:
.weak madvise
.type madvise, %function;
madvise:
.globl malloc
.weak malloc
.type malloc, %function;
malloc:
.globl malloc_usable_size
@@ -3709,6 +3715,9 @@ readv:
.globl realloc
.type realloc, %function;
realloc:
.globl reallocarray
.type reallocarray, %function;
reallocarray:
.globl realpath
.type realpath, %function;
realpath:
@@ -4543,6 +4552,9 @@ tcgetpgrp:
.globl tcgetsid
.type tcgetsid, %function;
tcgetsid:
.globl tcgetwinsize
.type tcgetwinsize, %function;
tcgetwinsize:
.globl tcsendbreak
.type tcsendbreak, %function;
tcsendbreak:
@@ -4552,6 +4564,9 @@ tcsetattr:
.globl tcsetpgrp
.type tcsetpgrp, %function;
tcsetpgrp:
.globl tcsetwinsize
.type tcsetwinsize, %function;
tcsetwinsize:
.globl tdelete
.type tdelete, %function;
tdelete:

View File

@@ -9,6 +9,12 @@
#include "syscall.h"
#include "atomic.h"
#include "pthread_impl.h"
#include "aio_impl.h"
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc __libc_realloc
#define free __libc_free
/* The following is a threads-based implementation of AIO with minimal
* dependence on implementation details. Most synchronization is
@@ -70,6 +76,10 @@ static struct aio_queue *****map;
static volatile int aio_fd_cnt;
volatile int __aio_fut;
static size_t io_thread_stack_size;
#define MAX(a,b) ((a)>(b) ? (a) : (b))
static struct aio_queue *__aio_get_queue(int fd, int need)
{
if (fd < 0) {
@@ -84,6 +94,10 @@ static struct aio_queue *__aio_get_queue(int fd, int need)
pthread_rwlock_unlock(&maplock);
if (fcntl(fd, F_GETFD) < 0) return 0;
pthread_rwlock_wrlock(&maplock);
if (!io_thread_stack_size) {
unsigned long val = __getauxval(AT_MINSIGSTKSZ);
io_thread_stack_size = MAX(MINSIGSTKSZ+2048, val+512);
}
if (!map) map = calloc(sizeof *map, (-1U/2+1)>>24);
if (!map) goto out;
if (!map[a]) map[a] = calloc(sizeof **map, 256);
@@ -259,15 +273,6 @@ static void *io_thread_func(void *ctx)
return 0;
}
static size_t io_thread_stack_size = MINSIGSTKSZ+2048;
static pthread_once_t init_stack_size_once;
static void init_stack_size()
{
unsigned long val = __getauxval(AT_MINSIGSTKSZ);
if (val > MINSIGSTKSZ) io_thread_stack_size = val + 512;
}
static int submit(struct aiocb *cb, int op)
{
int ret = 0;
@@ -293,7 +298,6 @@ static int submit(struct aiocb *cb, int op)
else
pthread_attr_init(&a);
} else {
pthread_once(&init_stack_size_once, init_stack_size);
pthread_attr_init(&a);
pthread_attr_setstacksize(&a, io_thread_stack_size);
pthread_attr_setguardsize(&a, 0);
@@ -392,6 +396,20 @@ int __aio_close(int fd)
return fd;
}
void __aio_atfork(int who)
{
if (who<0) {
pthread_rwlock_rdlock(&maplock);
return;
}
if (who>0 && map) for (int a=0; a<(-1U/2+1)>>24; a++)
if (map[a]) for (int b=0; b<256; b++)
if (map[a][b]) for (int c=0; c<256; c++)
if (map[a][b][c]) for (int d=0; d<256; d++)
map[a][b][c][d] = 0;
pthread_rwlock_unlock(&maplock);
}
weak_alias(aio_cancel, aio_cancel64);
weak_alias(aio_error, aio_error64);
weak_alias(aio_fsync, aio_fsync64);

View File

@@ -3,6 +3,7 @@
#include <time.h>
#include "atomic.h"
#include "pthread_impl.h"
#include "aio_impl.h"
int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec *ts)
{

View File

@@ -15,7 +15,7 @@
* No copyright is claimed, and the software is hereby placed in the public
* domain. In case this attempt to disclaim copyright and place the software
* in the public domain is deemed null and void, then the software is
* Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
* Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
* general public under the following terms:
*
* Redistribution and use in source and binary forms, with or without
@@ -31,12 +31,12 @@
* you place this code and any modifications you make under a license
* of your choice.
*
* This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
* "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
* ideas. The password hashing algorithm was designed by David Mazieres
* <dm at lcs.mit.edu>. For more information on the level of compatibility,
* please refer to the comments in BF_set_key() below and to the included
* crypt(3) man page.
* This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
* "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
* some of his ideas. The password hashing algorithm was designed by David
* Mazieres <dm at lcs.mit.edu>. For information on the level of
* compatibility for bcrypt hash prefixes other than "$2b$", please refer to
* the comments in BF_set_key() below and to the included crypt(3) man page.
*
* There's a paper on the algorithm that explains its design decisions:
*
@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
* Valid combinations of settings are:
*
* Prefix "$2a$": bug = 0, safety = 0x10000
* Prefix "$2b$": bug = 0, safety = 0
* Prefix "$2x$": bug = 1, safety = 0
* Prefix "$2y$": bug = 0, safety = 0
*/
@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
initial[0] ^= sign;
}
static const unsigned char flags_by_subtype[26] = {
2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
};
static char *BF_crypt(const char *key, const char *setting,
char *output, BF_word min)
{
static const unsigned char flags_by_subtype[26] =
{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
struct {
BF_ctx ctx;
BF_key expanded_key;
@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
{
const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
static const char test_hash[2][34] =
{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
static const char test_hashes[2][34] = {
"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
};
const char *test_hash = test_hashes[0];
char *retval;
const char *p;
int ok;
@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
* detected by the self-test.
*/
memcpy(buf.s, test_setting, sizeof(buf.s));
if (retval)
if (retval) {
unsigned int flags = flags_by_subtype[setting[2] - 'a'];
test_hash = test_hashes[flags & 1];
buf.s[2] = setting[2];
}
memset(buf.o, 0x55, sizeof(buf.o));
buf.o[sizeof(buf.o) - 1] = 0;
p = BF_crypt(test_key, buf.s, buf.o, 1);
@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
ok = (p == buf.o &&
!memcmp(p, buf.s, 7 + 22) &&
!memcmp(p + (7 + 22),
test_hash[buf.s[2] & 1],
test_hash,
31 + 1 + 1 + 1));
{

View File

@@ -67,7 +67,7 @@ void *__copy_tls(unsigned char *mem)
}
#endif
dtv[0] = libc.tls_cnt;
td->dtv = td->dtv_copy = dtv;
td->dtv = dtv;
return td;
}

View File

@@ -9,7 +9,7 @@ void __init_ssp(void *entropy)
if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
__pthread_self()->CANARY = __stack_chk_guard;
__pthread_self()->canary = __stack_chk_guard;
}
void __stack_chk_fail(void)

View File

@@ -6,8 +6,6 @@
#include "lock.h"
#include "ksigaction.h"
hidden volatile int __abort_lock[1];
_Noreturn void abort(void)
{
raise(SIGABRT);

View File

@@ -0,0 +1,3 @@
#include "pthread_impl.h"
volatile int __abort_lock[1];

Some files were not shown because too many files have changed in this diff Show More