Merge pull request #16098 from ziglang/musl-v1.2.4

update musl from v1.2.3 to v1.2.4
This commit is contained in:
jacobly0 2023-06-20 23:14:22 -04:00 committed by GitHub
commit e2eabbbc51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
223 changed files with 1121 additions and 758 deletions

View File

@ -49,7 +49,7 @@ int aio_fsync(int, struct aiocb *);
int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict); int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define aiocb64 aiocb #define aiocb64 aiocb
#define aio_read64 aio_read #define aio_read64 aio_read
#define aio_write64 aio_write #define aio_write64 aio_write

View File

@ -188,6 +188,36 @@ typedef enum __ns_type {
ns_t_sink = 40, ns_t_sink = 40,
ns_t_opt = 41, ns_t_opt = 41,
ns_t_apl = 42, ns_t_apl = 42,
ns_t_ds = 43,
ns_t_sshfp = 44,
ns_t_ipseckey = 45,
ns_t_rrsig = 46,
ns_t_nsec = 47,
ns_t_dnskey = 48,
ns_t_dhcid = 49,
ns_t_nsec3 = 50,
ns_t_nsec3param = 51,
ns_t_tlsa = 52,
ns_t_smimea = 53,
ns_t_hip = 55,
ns_t_ninfo = 56,
ns_t_rkey = 57,
ns_t_talink = 58,
ns_t_cds = 59,
ns_t_cdnskey = 60,
ns_t_openpgpkey = 61,
ns_t_csync = 62,
ns_t_spf = 99,
ns_t_uinfo = 100,
ns_t_uid = 101,
ns_t_gid = 102,
ns_t_unspec = 103,
ns_t_nid = 104,
ns_t_l32 = 105,
ns_t_l64 = 106,
ns_t_lp = 107,
ns_t_eui48 = 108,
ns_t_eui64 = 109,
ns_t_tkey = 249, ns_t_tkey = 249,
ns_t_tsig = 250, ns_t_tsig = 250,
ns_t_ixfr = 251, ns_t_ixfr = 251,
@ -196,6 +226,11 @@ typedef enum __ns_type {
ns_t_maila = 254, ns_t_maila = 254,
ns_t_any = 255, ns_t_any = 255,
ns_t_zxfr = 256, ns_t_zxfr = 256,
ns_t_uri = 256,
ns_t_caa = 257,
ns_t_avc = 258,
ns_t_ta = 32768,
ns_t_dlv = 32769,
ns_t_max = 65536 ns_t_max = 65536
} ns_type; } ns_type;
@ -430,12 +465,48 @@ typedef struct {
#define T_NAPTR ns_t_naptr #define T_NAPTR ns_t_naptr
#define T_A6 ns_t_a6 #define T_A6 ns_t_a6
#define T_DNAME ns_t_dname #define T_DNAME ns_t_dname
#define T_DS ns_t_ds
#define T_SSHFP ns_t_sshfp
#define T_IPSECKEY ns_t_ipseckey
#define T_RRSIG ns_t_rrsig
#define T_NSEC ns_t_nsec
#define T_DNSKEY ns_t_dnskey
#define T_DHCID ns_t_dhcid
#define T_NSEC3 ns_t_nsec3
#define T_NSEC3PARAM ns_t_nsec3param
#define T_TLSA ns_t_tlsa
#define T_SMIMEA ns_t_smimea
#define T_HIP ns_t_hip
#define T_NINFO ns_t_ninfo
#define T_RKEY ns_t_rkey
#define T_TALINK ns_t_talink
#define T_CDS ns_t_cds
#define T_CDNSKEY ns_t_cdnskey
#define T_OPENPGPKEY ns_t_openpgpkey
#define T_CSYNC ns_t_csync
#define T_SPF ns_t_spf
#define T_UINFO ns_t_uinfo
#define T_UID ns_t_uid
#define T_GID ns_t_gid
#define T_UNSPEC ns_t_unspec
#define T_NID ns_t_nid
#define T_L32 ns_t_l32
#define T_L64 ns_t_l64
#define T_LP ns_t_lp
#define T_EUI48 ns_t_eui48
#define T_EUI64 ns_t_eui64
#define T_TKEY ns_t_tkey
#define T_TSIG ns_t_tsig #define T_TSIG ns_t_tsig
#define T_IXFR ns_t_ixfr #define T_IXFR ns_t_ixfr
#define T_AXFR ns_t_axfr #define T_AXFR ns_t_axfr
#define T_MAILB ns_t_mailb #define T_MAILB ns_t_mailb
#define T_MAILA ns_t_maila #define T_MAILA ns_t_maila
#define T_ANY ns_t_any #define T_ANY ns_t_any
#define T_URI ns_t_uri
#define T_CAA ns_t_caa
#define T_AVC ns_t_avc
#define T_TA ns_t_ta
#define T_DLV ns_t_dlv
#define C_IN ns_c_in #define C_IN ns_c_in
#define C_CHAOS ns_c_chaos #define C_CHAOS ns_c_chaos

View File

@ -56,7 +56,7 @@ int getdents(int, struct dirent *, size_t);
int versionsort(const struct dirent **, const struct dirent **); int versionsort(const struct dirent **, const struct dirent **);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define dirent64 dirent #define dirent64 dirent
#define readdir64 readdir #define readdir64 readdir
#define readdir64_r readdir_r #define readdir64_r readdir_r

View File

@ -385,7 +385,8 @@ typedef struct {
#define SHT_PREINIT_ARRAY 16 #define SHT_PREINIT_ARRAY 16
#define SHT_GROUP 17 #define SHT_GROUP 17
#define SHT_SYMTAB_SHNDX 18 #define SHT_SYMTAB_SHNDX 18
#define SHT_NUM 19 #define SHT_RELR 19
#define SHT_NUM 20
#define SHT_LOOS 0x60000000 #define SHT_LOOS 0x60000000
#define SHT_GNU_ATTRIBUTES 0x6ffffff5 #define SHT_GNU_ATTRIBUTES 0x6ffffff5
#define SHT_GNU_HASH 0x6ffffff6 #define SHT_GNU_HASH 0x6ffffff6
@ -436,6 +437,7 @@ typedef struct {
} Elf64_Chdr; } Elf64_Chdr;
#define ELFCOMPRESS_ZLIB 1 #define ELFCOMPRESS_ZLIB 1
#define ELFCOMPRESS_ZSTD 2
#define ELFCOMPRESS_LOOS 0x60000000 #define ELFCOMPRESS_LOOS 0x60000000
#define ELFCOMPRESS_HIOS 0x6fffffff #define ELFCOMPRESS_HIOS 0x6fffffff
#define ELFCOMPRESS_LOPROC 0x70000000 #define ELFCOMPRESS_LOPROC 0x70000000
@ -754,7 +756,10 @@ typedef struct {
#define DT_PREINIT_ARRAY 32 #define DT_PREINIT_ARRAY 32
#define DT_PREINIT_ARRAYSZ 33 #define DT_PREINIT_ARRAYSZ 33
#define DT_SYMTAB_SHNDX 34 #define DT_SYMTAB_SHNDX 34
#define DT_NUM 35 #define DT_RELRSZ 35
#define DT_RELR 36
#define DT_RELRENT 37
#define DT_NUM 38
#define DT_LOOS 0x6000000d #define DT_LOOS 0x6000000d
#define DT_HIOS 0x6ffff000 #define DT_HIOS 0x6ffff000
#define DT_LOPROC 0x70000000 #define DT_LOPROC 0x70000000

View File

@ -195,7 +195,7 @@ ssize_t tee(int, int, size_t, unsigned);
#define loff_t off_t #define loff_t off_t
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define F_GETLK64 F_GETLK #define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK #define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW #define F_SETLKW64 F_SETLKW

View File

@ -29,7 +29,7 @@ struct FTW {
int ftw(const char *, int (*)(const char *, const struct stat *, int), int); int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int); int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define ftw64 ftw #define ftw64 ftw
#define nftw64 nftw #define nftw64 nftw
#endif #endif

View File

@ -39,7 +39,7 @@ void globfree(glob_t *);
#define GLOB_NOMATCH 3 #define GLOB_NOMATCH 3
#define GLOB_NOSYS 4 #define GLOB_NOSYS 4
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define glob64 glob #define glob64 glob
#define globfree64 globfree #define globfree64 globfree
#define glob64_t glob_t #define glob64_t glob_t

View File

@ -44,6 +44,7 @@ struct addrinfo {
#define EAI_NONAME -2 #define EAI_NONAME -2
#define EAI_AGAIN -3 #define EAI_AGAIN -3
#define EAI_FAIL -4 #define EAI_FAIL -4
#define EAI_NODATA -5
#define EAI_FAMILY -6 #define EAI_FAMILY -6
#define EAI_SOCKTYPE -7 #define EAI_SOCKTYPE -7
#define EAI_SERVICE -8 #define EAI_SERVICE -8

View File

@ -124,7 +124,7 @@ __CPU_op_func_S(XOR, ^)
#define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
#define CPU_FREE(set) free(set) #define CPU_FREE(set) free(set)
#define CPU_SETSIZE 128 #define CPU_SETSIZE 1024
#define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set) #define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set)
#define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set) #define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set)

View File

@ -205,7 +205,7 @@ typedef struct _IO_cookie_io_functions_t {
FILE *fopencookie(void *, const char *, cookie_io_functions_t); FILE *fopencookie(void *, const char *, cookie_io_functions_t);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define tmpfile64 tmpfile #define tmpfile64 tmpfile
#define fopen64 fopen #define fopen64 fopen
#define freopen64 freopen #define freopen64 freopen

View File

@ -95,7 +95,7 @@ size_t __ctype_get_mb_cur_max(void);
#define WTERMSIG(s) ((s) & 0x7f) #define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s) #define WSTOPSIG(s) WEXITSTATUS(s)
#define WIFEXITED(s) (!WTERMSIG(s)) #define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
int posix_memalign (void **, size_t, size_t); int posix_memalign (void **, size_t, size_t);
@ -163,7 +163,7 @@ double strtod_l(const char *__restrict, char **__restrict, struct __locale_struc
long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define mkstemp64 mkstemp #define mkstemp64 mkstemp
#define mkostemp64 mkostemp #define mkostemp64 mkostemp
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)

View File

@ -73,6 +73,7 @@ char *strsignal(int);
char *strerror_l (int, locale_t); char *strerror_l (int, locale_t);
int strcoll_l (const char *, const char *, locale_t); int strcoll_l (const char *, const char *, locale_t);
size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
void *memmem(const void *, size_t, const void *, size_t);
#endif #endif
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
@ -92,7 +93,6 @@ void explicit_bzero (void *, size_t);
int strverscmp (const char *, const char *); int strverscmp (const char *, const char *);
char *strchrnul(const char *, int); char *strchrnul(const char *, int);
char *strcasestr(const char *, const char *); char *strcasestr(const char *, const char *);
void *memmem(const void *, size_t, const void *, size_t);
void *memrchr(const void *, int, size_t); void *memrchr(const void *, int, size_t);
void *mempcpy(void *, const void *, size_t); void *mempcpy(void *, const void *, size_t);
#ifndef __cplusplus #ifndef __cplusplus

View File

@ -5,6 +5,7 @@
extern "C" { extern "C" {
#endif #endif
#include <features.h>
#define __NEED_size_t #define __NEED_size_t
#define __NEED_locale_t #define __NEED_locale_t

View File

@ -141,7 +141,7 @@ int mincore (void *, size_t, unsigned char *);
int shm_open (const char *, int, mode_t); int shm_open (const char *, int, mode_t);
int shm_unlink (const char *); int shm_unlink (const char *);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define mmap64 mmap #define mmap64 mmap
#define off64_t off_t #define off64_t off_t
#endif #endif

View File

@ -95,7 +95,7 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
#define RLIM_NLIMITS RLIMIT_NLIMITS #define RLIM_NLIMITS RLIMIT_NLIMITS
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define RLIM64_INFINITY RLIM_INFINITY #define RLIM64_INFINITY RLIM_INFINITY
#define RLIM64_SAVED_CUR RLIM_SAVED_CUR #define RLIM64_SAVED_CUR RLIM_SAVED_CUR
#define RLIM64_SAVED_MAX RLIM_SAVED_MAX #define RLIM64_SAVED_MAX RLIM_SAVED_MAX

View File

@ -10,7 +10,7 @@ extern "C" {
ssize_t sendfile(int, int, off_t *, size_t); ssize_t sendfile(int, int, off_t *, size_t);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define sendfile64 sendfile #define sendfile64 sendfile
#define off64_t off_t #define off64_t off_t
#endif #endif

View File

@ -98,7 +98,7 @@ int lchmod(const char *, mode_t);
#define S_IEXEC S_IXUSR #define S_IEXEC S_IXUSR
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define stat64 stat #define stat64 stat
#define fstat64 fstat #define fstat64 fstat
#define lstat64 lstat #define lstat64 lstat

View File

@ -18,7 +18,7 @@ typedef struct __fsid_t {
int statfs (const char *, struct statfs *); int statfs (const char *, struct statfs *);
int fstatfs (int, struct statfs *); int fstatfs (int, struct statfs *);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define statfs64 statfs #define statfs64 statfs
#define fstatfs64 fstatfs #define fstatfs64 fstatfs
#define fsblkcnt64_t fsblkcnt_t #define fsblkcnt64_t fsblkcnt_t

View File

@ -42,7 +42,7 @@ int fstatvfs (int, struct statvfs *);
#define ST_NODIRATIME 2048 #define ST_NODIRATIME 2048
#define ST_RELATIME 4096 #define ST_RELATIME 4096
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define statvfs64 statvfs #define statvfs64 statvfs
#define fstatvfs64 fstatvfs #define fstatvfs64 fstatvfs
#define fsblkcnt64_t fsblkcnt_t #define fsblkcnt64_t fsblkcnt_t

View File

@ -71,7 +71,7 @@ typedef unsigned long long u_quad_t;
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define blkcnt64_t blkcnt_t #define blkcnt64_t blkcnt_t
#define fsblkcnt64_t fsblkcnt_t #define fsblkcnt64_t fsblkcnt_t
#define fsfilcnt64_t fsfilcnt_t #define fsfilcnt64_t fsfilcnt_t

View File

@ -29,7 +29,7 @@ ssize_t writev (int, const struct iovec *, int);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
ssize_t preadv (int, const struct iovec *, int, off_t); ssize_t preadv (int, const struct iovec *, int, off_t);
ssize_t pwritev (int, const struct iovec *, int, off_t); ssize_t pwritev (int, const struct iovec *, int, off_t);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define preadv64 preadv #define preadv64 preadv
#define pwritev64 pwritev #define pwritev64 pwritev
#define off64_t off_t #define off64_t off_t

View File

@ -50,7 +50,7 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
#define WSTOPSIG(s) WEXITSTATUS(s) #define WSTOPSIG(s) WEXITSTATUS(s)
#define WCOREDUMP(s) ((s) & 0x80) #define WCOREDUMP(s) ((s) & 0x80)
#define WIFEXITED(s) (!WTERMSIG(s)) #define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#define WIFCONTINUED(s) ((s) == 0xffff) #define WIFCONTINUED(s) ((s) == 0xffff)

View File

@ -198,7 +198,7 @@ ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
pid_t gettid(void); pid_t gettid(void);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define lseek64 lseek #define lseek64 lseek
#define pread64 pread #define pread64 pread
#define pwrite64 pwrite #define pwrite64 pwrite
@ -425,6 +425,8 @@ pid_t gettid(void);
#define _SC_XOPEN_STREAMS 246 #define _SC_XOPEN_STREAMS 246
#define _SC_THREAD_ROBUST_PRIO_INHERIT 247 #define _SC_THREAD_ROBUST_PRIO_INHERIT 247
#define _SC_THREAD_ROBUST_PRIO_PROTECT 248 #define _SC_THREAD_ROBUST_PRIO_PROTECT 248
#define _SC_MINSIGSTKSZ 249
#define _SC_SIGSTKSZ 250
#define _CS_PATH 0 #define _CS_PATH 0
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
@ -467,6 +469,8 @@ pid_t gettid(void);
#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147 #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147
#define _CS_V6_ENV 1148 #define _CS_V6_ENV 1148
#define _CS_V7_ENV 1149 #define _CS_V7_ENV 1149
#define _CS_POSIX_V7_THREADS_CFLAGS 1150
#define _CS_POSIX_V7_THREADS_LDFLAGS 1151
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -66,7 +66,6 @@ typedef struct __ucontext {
#define SA_RESTART 0x10000000 #define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000 #define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000 #define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#undef SIG_BLOCK #undef SIG_BLOCK
#undef SIG_UNBLOCK #undef SIG_UNBLOCK

View File

@ -85,7 +85,6 @@ typedef struct __ucontext {
#define SA_RESTART 0x10000000 #define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000 #define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000 #define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#undef SIG_BLOCK #undef SIG_BLOCK
#undef SIG_UNBLOCK #undef SIG_UNBLOCK

View File

@ -76,7 +76,6 @@ typedef struct __ucontext
#define SA_RESTART 0x10000000 #define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000 #define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000 #define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#endif #endif

View File

@ -101,3 +101,10 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
#define SYSCALL_FADVISE_6_ARG #define SYSCALL_FADVISE_6_ARG
#define SYSCALL_IPC_BROKEN_MODE #define SYSCALL_IPC_BROKEN_MODE
#define VDSO_USEFUL
#define VDSO_CGT32_SYM "__vdso_clock_gettime"
#define VDSO_CGT32_VER "LINUX_2.6"
#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define VDSO_CGT_WORKAROUND 1

View File

@ -1 +0,0 @@
COMPAT_SRC_DIRS = compat/time32

View File

@ -1 +0,0 @@
COMPAT_SRC_DIRS = compat/time32

View File

@ -1 +0,0 @@
COMPAT_SRC_DIRS = compat/time32

View File

@ -66,7 +66,6 @@ typedef struct __ucontext {
#define SA_RESTART 0x10000000 #define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000 #define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000 #define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#undef SIG_BLOCK #undef SIG_BLOCK
#undef SIG_UNBLOCK #undef SIG_UNBLOCK

View File

@ -4,10 +4,7 @@ struct k_sigaction {
unsigned flags; unsigned flags;
void (*handler)(int); void (*handler)(int);
unsigned long mask[4]; unsigned long mask[4];
/* The following field is past the end of the structure the void *unused;
* kernel will read or write, and exists only to avoid having
* mips-specific preprocessor conditionals in sigaction.c. */
void (*restorer)();
}; };
hidden void __restore(), __restore_rt(); hidden void __restore(), __restore_rt();

View File

@ -29,6 +29,7 @@
#define NEED_MIPS_GOT_RELOCS 1 #define NEED_MIPS_GOT_RELOCS 1
#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \ #define CRTJMP(pc,sp) __asm__ __volatile__( \

View File

@ -85,7 +85,6 @@ typedef struct __ucontext {
#define SA_RESTART 0x10000000 #define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000 #define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000 #define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#undef SIG_BLOCK #undef SIG_BLOCK
#undef SIG_UNBLOCK #undef SIG_UNBLOCK

View File

@ -4,7 +4,7 @@ struct k_sigaction {
unsigned flags; unsigned flags;
void (*handler)(int); void (*handler)(int);
unsigned long mask[2]; unsigned long mask[2];
void (*restorer)(); void *unused;
}; };
hidden void __restore(), __restore_rt(); hidden void __restore(), __restore_rt();

View File

@ -38,6 +38,7 @@
#define NEED_MIPS_GOT_RELOCS 1 #define NEED_MIPS_GOT_RELOCS 1
#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \ #define CRTJMP(pc,sp) __asm__ __volatile__( \

View File

@ -1 +0,0 @@
COMPAT_SRC_DIRS = compat/time32

View File

@ -76,7 +76,6 @@ typedef struct __ucontext
#define SA_RESTART 0x10000000 #define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000 #define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000 #define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#endif #endif

View File

@ -3,22 +3,22 @@
struct stat32; struct stat32;
int __fxstat64(int ver, int fd, struct stat32 *buf) int __fxstat(int ver, int fd, struct stat32 *buf)
{ {
return __fstat_time32(fd, buf); return __fstat_time32(fd, buf);
} }
int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf, int flag) int __fxstatat(int ver, int fd, const char *path, struct stat32 *buf, int flag)
{ {
return __fstatat_time32(fd, path, buf, flag); return __fstatat_time32(fd, path, buf, flag);
} }
int __lxstat64(int ver, const char *path, struct stat32 *buf) int __lxstat(int ver, const char *path, struct stat32 *buf)
{ {
return __lstat_time32(path, buf); return __lstat_time32(path, buf);
} }
int __xstat64(int ver, const char *path, struct stat32 *buf) int __xstat(int ver, const char *path, struct stat32 *buf)
{ {
return __stat_time32(path, buf); return __stat_time32(path, buf);
} }

View File

@ -7,5 +7,3 @@ int __aio_suspend_time32(const struct aiocb *const cbs[], int cnt, const struct
return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){ return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){
.tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
} }
weak_alias(aio_suspend, aio_suspend64);

View File

@ -13,5 +13,3 @@ int __fstat_time32(int fd, struct stat32 *restrict st32)
if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
return r; return r;
} }
weak_alias(fstat, fstat64);

View File

@ -13,5 +13,3 @@ int __fstatat_time32(int fd, const char *restrict path, struct stat32 *restrict
if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
return r; return r;
} }
weak_alias(fstatat, fstatat64);

View File

@ -13,5 +13,3 @@ int __lstat_time32(const char *restrict path, struct stat32 *restrict st32)
if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
return r; return r;
} }
weak_alias(lstat, lstat64);

View File

@ -13,5 +13,3 @@ int __stat_time32(const char *restrict path, struct stat32 *restrict st32)
if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
return r; return r;
} }
weak_alias(stat, stat64);

View File

@ -49,7 +49,7 @@ int aio_fsync(int, struct aiocb *);
int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict); int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define aiocb64 aiocb #define aiocb64 aiocb
#define aio_read64 aio_read #define aio_read64 aio_read
#define aio_write64 aio_write #define aio_write64 aio_write

View File

@ -188,6 +188,36 @@ typedef enum __ns_type {
ns_t_sink = 40, ns_t_sink = 40,
ns_t_opt = 41, ns_t_opt = 41,
ns_t_apl = 42, ns_t_apl = 42,
ns_t_ds = 43,
ns_t_sshfp = 44,
ns_t_ipseckey = 45,
ns_t_rrsig = 46,
ns_t_nsec = 47,
ns_t_dnskey = 48,
ns_t_dhcid = 49,
ns_t_nsec3 = 50,
ns_t_nsec3param = 51,
ns_t_tlsa = 52,
ns_t_smimea = 53,
ns_t_hip = 55,
ns_t_ninfo = 56,
ns_t_rkey = 57,
ns_t_talink = 58,
ns_t_cds = 59,
ns_t_cdnskey = 60,
ns_t_openpgpkey = 61,
ns_t_csync = 62,
ns_t_spf = 99,
ns_t_uinfo = 100,
ns_t_uid = 101,
ns_t_gid = 102,
ns_t_unspec = 103,
ns_t_nid = 104,
ns_t_l32 = 105,
ns_t_l64 = 106,
ns_t_lp = 107,
ns_t_eui48 = 108,
ns_t_eui64 = 109,
ns_t_tkey = 249, ns_t_tkey = 249,
ns_t_tsig = 250, ns_t_tsig = 250,
ns_t_ixfr = 251, ns_t_ixfr = 251,
@ -196,6 +226,11 @@ typedef enum __ns_type {
ns_t_maila = 254, ns_t_maila = 254,
ns_t_any = 255, ns_t_any = 255,
ns_t_zxfr = 256, ns_t_zxfr = 256,
ns_t_uri = 256,
ns_t_caa = 257,
ns_t_avc = 258,
ns_t_ta = 32768,
ns_t_dlv = 32769,
ns_t_max = 65536 ns_t_max = 65536
} ns_type; } ns_type;
@ -430,12 +465,48 @@ typedef struct {
#define T_NAPTR ns_t_naptr #define T_NAPTR ns_t_naptr
#define T_A6 ns_t_a6 #define T_A6 ns_t_a6
#define T_DNAME ns_t_dname #define T_DNAME ns_t_dname
#define T_DS ns_t_ds
#define T_SSHFP ns_t_sshfp
#define T_IPSECKEY ns_t_ipseckey
#define T_RRSIG ns_t_rrsig
#define T_NSEC ns_t_nsec
#define T_DNSKEY ns_t_dnskey
#define T_DHCID ns_t_dhcid
#define T_NSEC3 ns_t_nsec3
#define T_NSEC3PARAM ns_t_nsec3param
#define T_TLSA ns_t_tlsa
#define T_SMIMEA ns_t_smimea
#define T_HIP ns_t_hip
#define T_NINFO ns_t_ninfo
#define T_RKEY ns_t_rkey
#define T_TALINK ns_t_talink
#define T_CDS ns_t_cds
#define T_CDNSKEY ns_t_cdnskey
#define T_OPENPGPKEY ns_t_openpgpkey
#define T_CSYNC ns_t_csync
#define T_SPF ns_t_spf
#define T_UINFO ns_t_uinfo
#define T_UID ns_t_uid
#define T_GID ns_t_gid
#define T_UNSPEC ns_t_unspec
#define T_NID ns_t_nid
#define T_L32 ns_t_l32
#define T_L64 ns_t_l64
#define T_LP ns_t_lp
#define T_EUI48 ns_t_eui48
#define T_EUI64 ns_t_eui64
#define T_TKEY ns_t_tkey
#define T_TSIG ns_t_tsig #define T_TSIG ns_t_tsig
#define T_IXFR ns_t_ixfr #define T_IXFR ns_t_ixfr
#define T_AXFR ns_t_axfr #define T_AXFR ns_t_axfr
#define T_MAILB ns_t_mailb #define T_MAILB ns_t_mailb
#define T_MAILA ns_t_maila #define T_MAILA ns_t_maila
#define T_ANY ns_t_any #define T_ANY ns_t_any
#define T_URI ns_t_uri
#define T_CAA ns_t_caa
#define T_AVC ns_t_avc
#define T_TA ns_t_ta
#define T_DLV ns_t_dlv
#define C_IN ns_c_in #define C_IN ns_c_in
#define C_CHAOS ns_c_chaos #define C_CHAOS ns_c_chaos

View File

@ -56,7 +56,7 @@ int getdents(int, struct dirent *, size_t);
int versionsort(const struct dirent **, const struct dirent **); int versionsort(const struct dirent **, const struct dirent **);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define dirent64 dirent #define dirent64 dirent
#define readdir64 readdir #define readdir64 readdir
#define readdir64_r readdir_r #define readdir64_r readdir_r

View File

@ -385,7 +385,8 @@ typedef struct {
#define SHT_PREINIT_ARRAY 16 #define SHT_PREINIT_ARRAY 16
#define SHT_GROUP 17 #define SHT_GROUP 17
#define SHT_SYMTAB_SHNDX 18 #define SHT_SYMTAB_SHNDX 18
#define SHT_NUM 19 #define SHT_RELR 19
#define SHT_NUM 20
#define SHT_LOOS 0x60000000 #define SHT_LOOS 0x60000000
#define SHT_GNU_ATTRIBUTES 0x6ffffff5 #define SHT_GNU_ATTRIBUTES 0x6ffffff5
#define SHT_GNU_HASH 0x6ffffff6 #define SHT_GNU_HASH 0x6ffffff6
@ -436,6 +437,7 @@ typedef struct {
} Elf64_Chdr; } Elf64_Chdr;
#define ELFCOMPRESS_ZLIB 1 #define ELFCOMPRESS_ZLIB 1
#define ELFCOMPRESS_ZSTD 2
#define ELFCOMPRESS_LOOS 0x60000000 #define ELFCOMPRESS_LOOS 0x60000000
#define ELFCOMPRESS_HIOS 0x6fffffff #define ELFCOMPRESS_HIOS 0x6fffffff
#define ELFCOMPRESS_LOPROC 0x70000000 #define ELFCOMPRESS_LOPROC 0x70000000
@ -754,7 +756,10 @@ typedef struct {
#define DT_PREINIT_ARRAY 32 #define DT_PREINIT_ARRAY 32
#define DT_PREINIT_ARRAYSZ 33 #define DT_PREINIT_ARRAYSZ 33
#define DT_SYMTAB_SHNDX 34 #define DT_SYMTAB_SHNDX 34
#define DT_NUM 35 #define DT_RELRSZ 35
#define DT_RELR 36
#define DT_RELRENT 37
#define DT_NUM 38
#define DT_LOOS 0x6000000d #define DT_LOOS 0x6000000d
#define DT_HIOS 0x6ffff000 #define DT_HIOS 0x6ffff000
#define DT_LOPROC 0x70000000 #define DT_LOPROC 0x70000000

View File

@ -195,7 +195,7 @@ ssize_t tee(int, int, size_t, unsigned);
#define loff_t off_t #define loff_t off_t
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define F_GETLK64 F_GETLK #define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK #define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW #define F_SETLKW64 F_SETLKW

View File

@ -29,7 +29,7 @@ struct FTW {
int ftw(const char *, int (*)(const char *, const struct stat *, int), int); int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int); int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define ftw64 ftw #define ftw64 ftw
#define nftw64 nftw #define nftw64 nftw
#endif #endif

View File

@ -39,7 +39,7 @@ void globfree(glob_t *);
#define GLOB_NOMATCH 3 #define GLOB_NOMATCH 3
#define GLOB_NOSYS 4 #define GLOB_NOSYS 4
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define glob64 glob #define glob64 glob
#define globfree64 globfree #define globfree64 globfree
#define glob64_t glob_t #define glob64_t glob_t

View File

@ -44,6 +44,7 @@ struct addrinfo {
#define EAI_NONAME -2 #define EAI_NONAME -2
#define EAI_AGAIN -3 #define EAI_AGAIN -3
#define EAI_FAIL -4 #define EAI_FAIL -4
#define EAI_NODATA -5
#define EAI_FAMILY -6 #define EAI_FAMILY -6
#define EAI_SOCKTYPE -7 #define EAI_SOCKTYPE -7
#define EAI_SERVICE -8 #define EAI_SERVICE -8

View File

@ -124,7 +124,7 @@ __CPU_op_func_S(XOR, ^)
#define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
#define CPU_FREE(set) free(set) #define CPU_FREE(set) free(set)
#define CPU_SETSIZE 128 #define CPU_SETSIZE 1024
#define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set) #define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set)
#define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set) #define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set)

View File

@ -205,7 +205,7 @@ typedef struct _IO_cookie_io_functions_t {
FILE *fopencookie(void *, const char *, cookie_io_functions_t); FILE *fopencookie(void *, const char *, cookie_io_functions_t);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define tmpfile64 tmpfile #define tmpfile64 tmpfile
#define fopen64 fopen #define fopen64 fopen
#define freopen64 freopen #define freopen64 freopen

View File

@ -95,7 +95,7 @@ size_t __ctype_get_mb_cur_max(void);
#define WTERMSIG(s) ((s) & 0x7f) #define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s) #define WSTOPSIG(s) WEXITSTATUS(s)
#define WIFEXITED(s) (!WTERMSIG(s)) #define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
int posix_memalign (void **, size_t, size_t); int posix_memalign (void **, size_t, size_t);
@ -163,7 +163,7 @@ double strtod_l(const char *__restrict, char **__restrict, struct __locale_struc
long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define mkstemp64 mkstemp #define mkstemp64 mkstemp
#define mkostemp64 mkostemp #define mkostemp64 mkostemp
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)

View File

@ -73,6 +73,7 @@ char *strsignal(int);
char *strerror_l (int, locale_t); char *strerror_l (int, locale_t);
int strcoll_l (const char *, const char *, locale_t); int strcoll_l (const char *, const char *, locale_t);
size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
void *memmem(const void *, size_t, const void *, size_t);
#endif #endif
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
@ -92,7 +93,6 @@ void explicit_bzero (void *, size_t);
int strverscmp (const char *, const char *); int strverscmp (const char *, const char *);
char *strchrnul(const char *, int); char *strchrnul(const char *, int);
char *strcasestr(const char *, const char *); char *strcasestr(const char *, const char *);
void *memmem(const void *, size_t, const void *, size_t);
void *memrchr(const void *, int, size_t); void *memrchr(const void *, int, size_t);
void *mempcpy(void *, const void *, size_t); void *mempcpy(void *, const void *, size_t);
#ifndef __cplusplus #ifndef __cplusplus

View File

@ -5,6 +5,7 @@
extern "C" { extern "C" {
#endif #endif
#include <features.h>
#define __NEED_size_t #define __NEED_size_t
#define __NEED_locale_t #define __NEED_locale_t

View File

@ -141,7 +141,7 @@ int mincore (void *, size_t, unsigned char *);
int shm_open (const char *, int, mode_t); int shm_open (const char *, int, mode_t);
int shm_unlink (const char *); int shm_unlink (const char *);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define mmap64 mmap #define mmap64 mmap
#define off64_t off_t #define off64_t off_t
#endif #endif

View File

@ -95,7 +95,7 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
#define RLIM_NLIMITS RLIMIT_NLIMITS #define RLIM_NLIMITS RLIMIT_NLIMITS
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define RLIM64_INFINITY RLIM_INFINITY #define RLIM64_INFINITY RLIM_INFINITY
#define RLIM64_SAVED_CUR RLIM_SAVED_CUR #define RLIM64_SAVED_CUR RLIM_SAVED_CUR
#define RLIM64_SAVED_MAX RLIM_SAVED_MAX #define RLIM64_SAVED_MAX RLIM_SAVED_MAX

View File

@ -10,7 +10,7 @@ extern "C" {
ssize_t sendfile(int, int, off_t *, size_t); ssize_t sendfile(int, int, off_t *, size_t);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define sendfile64 sendfile #define sendfile64 sendfile
#define off64_t off_t #define off64_t off_t
#endif #endif

View File

@ -98,7 +98,7 @@ int lchmod(const char *, mode_t);
#define S_IEXEC S_IXUSR #define S_IEXEC S_IXUSR
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define stat64 stat #define stat64 stat
#define fstat64 fstat #define fstat64 fstat
#define lstat64 lstat #define lstat64 lstat

View File

@ -18,7 +18,7 @@ typedef struct __fsid_t {
int statfs (const char *, struct statfs *); int statfs (const char *, struct statfs *);
int fstatfs (int, struct statfs *); int fstatfs (int, struct statfs *);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define statfs64 statfs #define statfs64 statfs
#define fstatfs64 fstatfs #define fstatfs64 fstatfs
#define fsblkcnt64_t fsblkcnt_t #define fsblkcnt64_t fsblkcnt_t

View File

@ -42,7 +42,7 @@ int fstatvfs (int, struct statvfs *);
#define ST_NODIRATIME 2048 #define ST_NODIRATIME 2048
#define ST_RELATIME 4096 #define ST_RELATIME 4096
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define statvfs64 statvfs #define statvfs64 statvfs
#define fstatvfs64 fstatvfs #define fstatvfs64 fstatvfs
#define fsblkcnt64_t fsblkcnt_t #define fsblkcnt64_t fsblkcnt_t

View File

@ -71,7 +71,7 @@ typedef unsigned long long u_quad_t;
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define blkcnt64_t blkcnt_t #define blkcnt64_t blkcnt_t
#define fsblkcnt64_t fsblkcnt_t #define fsblkcnt64_t fsblkcnt_t
#define fsfilcnt64_t fsfilcnt_t #define fsfilcnt64_t fsfilcnt_t

View File

@ -29,7 +29,7 @@ ssize_t writev (int, const struct iovec *, int);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
ssize_t preadv (int, const struct iovec *, int, off_t); ssize_t preadv (int, const struct iovec *, int, off_t);
ssize_t pwritev (int, const struct iovec *, int, off_t); ssize_t pwritev (int, const struct iovec *, int, off_t);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define preadv64 preadv #define preadv64 preadv
#define pwritev64 pwritev #define pwritev64 pwritev
#define off64_t off_t #define off64_t off_t

View File

@ -50,7 +50,7 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
#define WSTOPSIG(s) WEXITSTATUS(s) #define WSTOPSIG(s) WEXITSTATUS(s)
#define WCOREDUMP(s) ((s) & 0x80) #define WCOREDUMP(s) ((s) & 0x80)
#define WIFEXITED(s) (!WTERMSIG(s)) #define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001U)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#define WIFCONTINUED(s) ((s) == 0xffff) #define WIFCONTINUED(s) ((s) == 0xffff)

View File

@ -198,7 +198,7 @@ ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
pid_t gettid(void); pid_t gettid(void);
#endif #endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #if defined(_LARGEFILE64_SOURCE)
#define lseek64 lseek #define lseek64 lseek
#define pread64 pread #define pread64 pread
#define pwrite64 pwrite #define pwrite64 pwrite
@ -425,6 +425,8 @@ pid_t gettid(void);
#define _SC_XOPEN_STREAMS 246 #define _SC_XOPEN_STREAMS 246
#define _SC_THREAD_ROBUST_PRIO_INHERIT 247 #define _SC_THREAD_ROBUST_PRIO_INHERIT 247
#define _SC_THREAD_ROBUST_PRIO_PROTECT 248 #define _SC_THREAD_ROBUST_PRIO_PROTECT 248
#define _SC_MINSIGSTKSZ 249
#define _SC_SIGSTKSZ 250
#define _CS_PATH 0 #define _CS_PATH 0
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
@ -467,6 +469,8 @@ pid_t gettid(void);
#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147 #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147
#define _CS_V6_ENV 1148 #define _CS_V6_ENV 1148
#define _CS_V7_ENV 1149 #define _CS_V7_ENV 1149
#define _CS_POSIX_V7_THREADS_CFLAGS 1150
#define _CS_POSIX_V7_THREADS_LDFLAGS 1151
#ifdef __cplusplus #ifdef __cplusplus
} }

233
lib/libc/musl/libc.S vendored
View File

@ -168,7 +168,7 @@ _IO_putc:
.weak _IO_putc_unlocked .weak _IO_putc_unlocked
.type _IO_putc_unlocked, %function; .type _IO_putc_unlocked, %function;
_IO_putc_unlocked: _IO_putc_unlocked:
#if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl ___tls_get_addr .globl ___tls_get_addr
.type ___tls_get_addr, %function; .type ___tls_get_addr, %function;
___tls_get_addr: ___tls_get_addr:
@ -187,7 +187,7 @@ __aio_suspend_time64:
.globl __assert_fail .globl __assert_fail
.type __assert_fail, %function; .type __assert_fail, %function;
__assert_fail: __assert_fail:
#if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl __cachectl .globl __cachectl
.type __cachectl, %function; .type __cachectl, %function;
__cachectl: __cachectl:
@ -313,10 +313,10 @@ __fseterr:
.type __fsetlocking, %function; .type __fsetlocking, %function;
__fsetlocking: __fsetlocking:
#ifdef PTR32 #ifdef PTR32
.globl __fstat_time64 .weak __fstat_time64
.type __fstat_time64, %function; .type __fstat_time64, %function;
__fstat_time64: __fstat_time64:
.globl __fstatat_time64 .weak __fstatat_time64
.type __fstatat_time64, %function; .type __fstatat_time64, %function;
__fstatat_time64: __fstatat_time64:
.globl __ftime64 .globl __ftime64
@ -338,22 +338,12 @@ __fwritable:
.globl __fwriting .globl __fwriting
.type __fwriting, %function; .type __fwriting, %function;
__fwriting: __fwriting:
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc)
.globl __fxstat .globl __fxstat
.type __fxstat, %function; .type __fxstat, %function;
__fxstat: __fxstat:
#endif
WEAK64 __fxstat64
.type __fxstat64, %function;
__fxstat64:
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc)
.globl __fxstatat .globl __fxstatat
.type __fxstatat, %function; .type __fxstatat, %function;
__fxstatat: __fxstatat:
#endif
WEAK64 __fxstatat64
.type __fxstatat64, %function;
__fxstatat64:
.weak __getdelim .weak __getdelim
.type __getdelim, %function; .type __getdelim, %function;
__getdelim: __getdelim:
@ -508,7 +498,7 @@ __localtime64:
.type __localtime64_r, %function; .type __localtime64_r, %function;
__localtime64_r: __localtime64_r:
#endif #endif
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl __longjmp .globl __longjmp
.type __longjmp, %function; .type __longjmp, %function;
__longjmp: __longjmp:
@ -521,14 +511,9 @@ __lstat_time64:
.type __lutimes_time64, %function; .type __lutimes_time64, %function;
__lutimes_time64: __lutimes_time64:
#endif #endif
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc)
.globl __lxstat .globl __lxstat
.type __lxstat, %function; .type __lxstat, %function;
__lxstat: __lxstat:
#endif
WEAK64 __lxstat64
.type __lxstat64, %function;
__lxstat64:
#ifdef PTR32 #ifdef PTR32
.globl __mktime64 .globl __mktime64
.type __mktime64, %function; .type __mktime64, %function;
@ -591,7 +576,17 @@ __recvmmsg_time64:
.globl __res_state .globl __res_state
.type __res_state, %function; .type __res_state, %function;
__res_state: __res_state:
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl __restore
.type __restore, %function;
__restore:
#endif
#if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl __restore_rt
.type __restore_rt, %function;
__restore_rt:
#endif
#if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl __riscv_flush_icache .globl __riscv_flush_icache
.type __riscv_flush_icache, %function; .type __riscv_flush_icache, %function;
__riscv_flush_icache: __riscv_flush_icache:
@ -792,27 +787,27 @@ __xpg_basename:
.weak __xpg_strerror_r .weak __xpg_strerror_r
.type __xpg_strerror_r, %function; .type __xpg_strerror_r, %function;
__xpg_strerror_r: __xpg_strerror_r:
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc)
.globl __xstat .globl __xstat
.type __xstat, %function; .type __xstat, %function;
__xstat: __xstat:
#endif
WEAK64 __xstat64
.type __xstat64, %function;
__xstat64:
.weak _dl_debug_state .weak _dl_debug_state
.type _dl_debug_state, %function; .type _dl_debug_state, %function;
_dl_debug_state: _dl_debug_state:
.globl _dlstart .globl _dlstart
.type _dlstart, %function; .type _dlstart, %function;
_dlstart: _dlstart:
#if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl _dlstart_data
.type _dlstart_data, %function;
_dlstart_data:
#endif
.globl _exit .globl _exit
.type _exit, %function; .type _exit, %function;
_exit: _exit:
.weak _fini .weak _fini
.type _fini, %function; .type _fini, %function;
_fini: _fini:
#if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl _flush_cache .globl _flush_cache
.type _flush_cache, %function; .type _flush_cache, %function;
_flush_cache: _flush_cache:
@ -886,45 +881,24 @@ adjtimex:
.globl aio_cancel .globl aio_cancel
.type aio_cancel, %function; .type aio_cancel, %function;
aio_cancel: aio_cancel:
.weak aio_cancel64
.type aio_cancel64, %function;
aio_cancel64:
.globl aio_error .globl aio_error
.type aio_error, %function; .type aio_error, %function;
aio_error: aio_error:
.weak aio_error64
.type aio_error64, %function;
aio_error64:
.globl aio_fsync .globl aio_fsync
.type aio_fsync, %function; .type aio_fsync, %function;
aio_fsync: aio_fsync:
.weak aio_fsync64
.type aio_fsync64, %function;
aio_fsync64:
.globl aio_read .globl aio_read
.type aio_read, %function; .type aio_read, %function;
aio_read: aio_read:
.weak aio_read64
.type aio_read64, %function;
aio_read64:
.globl aio_return .globl aio_return
.type aio_return, %function; .type aio_return, %function;
aio_return: aio_return:
.weak aio_return64
.type aio_return64, %function;
aio_return64:
.globl aio_suspend .globl aio_suspend
.type aio_suspend, %function; .type aio_suspend, %function;
aio_suspend: aio_suspend:
.weak aio_suspend64
.type aio_suspend64, %function;
aio_suspend64:
.globl aio_write .globl aio_write
.type aio_write, %function; .type aio_write, %function;
aio_write: aio_write:
.weak aio_write64
.type aio_write64, %function;
aio_write64:
.globl alarm .globl alarm
.type alarm, %function; .type alarm, %function;
alarm: alarm:
@ -934,10 +908,7 @@ aligned_alloc:
.globl alphasort .globl alphasort
.type alphasort, %function; .type alphasort, %function;
alphasort: alphasort:
.weak alphasort64 #if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.type alphasort64, %function;
alphasort64:
#if !defined(ARCH_riscv64) && !defined(ARCH_mips) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.globl arch_prctl .globl arch_prctl
.type arch_prctl, %function; .type arch_prctl, %function;
arch_prctl: arch_prctl:
@ -1062,12 +1033,12 @@ cabsf:
.globl cabsl .globl cabsl
.type cabsl, %function; .type cabsl, %function;
cabsl: cabsl:
#if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.weak cachectl .weak cachectl
.type cachectl, %function; .type cachectl, %function;
cachectl: cachectl:
#endif #endif
#if !defined(ARCH_riscv64) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.weak cacheflush .weak cacheflush
.type cacheflush, %function; .type cacheflush, %function;
cacheflush: cacheflush:
@ -1384,9 +1355,6 @@ creall:
.globl creat .globl creat
.type creat, %function; .type creat, %function;
creat: creat:
.weak creat64
.type creat64, %function;
creat64:
.globl crypt .globl crypt
.type crypt, %function; .type crypt, %function;
crypt: crypt:
@ -1729,9 +1697,6 @@ faccessat:
.globl fallocate .globl fallocate
.type fallocate, %function; .type fallocate, %function;
fallocate: fallocate:
.weak fallocate64
.type fallocate64, %function;
fallocate64:
.globl fanotify_init .globl fanotify_init
.type fanotify_init, %function; .type fanotify_init, %function;
fanotify_init: fanotify_init:
@ -1858,9 +1823,6 @@ fgetln:
.globl fgetpos .globl fgetpos
.type fgetpos, %function; .type fgetpos, %function;
fgetpos: fgetpos:
.weak fgetpos64
.type fgetpos64, %function;
fgetpos64:
.globl fgetpwent .globl fgetpwent
.type fgetpwent, %function; .type fgetpwent, %function;
fgetpwent: fgetpwent:
@ -1966,9 +1928,6 @@ fnmatch:
.globl fopen .globl fopen
.type fopen, %function; .type fopen, %function;
fopen: fopen:
.weak fopen64
.type fopen64, %function;
fopen64:
.globl fopencookie .globl fopencookie
.type fopencookie, %function; .type fopencookie, %function;
fopencookie: fopencookie:
@ -2035,9 +1994,6 @@ fremovexattr:
.globl freopen .globl freopen
.type freopen, %function; .type freopen, %function;
freopen: freopen:
.weak freopen64
.type freopen64, %function;
freopen64:
.globl frexp .globl frexp
.type frexp, %function; .type frexp, %function;
frexp: frexp:
@ -2056,42 +2012,24 @@ fseek:
.weak fseeko .weak fseeko
.type fseeko, %function; .type fseeko, %function;
fseeko: fseeko:
.weak fseeko64
.type fseeko64, %function;
fseeko64:
.globl fsetpos .globl fsetpos
.type fsetpos, %function; .type fsetpos, %function;
fsetpos: fsetpos:
.weak fsetpos64
.type fsetpos64, %function;
fsetpos64:
.globl fsetxattr .globl fsetxattr
.type fsetxattr, %function; .type fsetxattr, %function;
fsetxattr: fsetxattr:
.globl fstat WEAK64 fstat
.type fstat, %function; .type fstat, %function;
fstat: fstat:
.weak fstat64 WEAK64 fstatat
.type fstat64, %function;
fstat64:
.globl fstatat
.type fstatat, %function; .type fstatat, %function;
fstatat: fstatat:
.weak fstatat64
.type fstatat64, %function;
fstatat64:
.weak fstatfs .weak fstatfs
.type fstatfs, %function; .type fstatfs, %function;
fstatfs: fstatfs:
.weak fstatfs64
.type fstatfs64, %function;
fstatfs64:
.globl fstatvfs .globl fstatvfs
.type fstatvfs, %function; .type fstatvfs, %function;
fstatvfs: fstatvfs:
.weak fstatvfs64
.type fstatvfs64, %function;
fstatvfs64:
.globl fsync .globl fsync
.type fsync, %function; .type fsync, %function;
fsync: fsync:
@ -2101,9 +2039,6 @@ ftell:
.weak ftello .weak ftello
.type ftello, %function; .type ftello, %function;
ftello: ftello:
.weak ftello64
.type ftello64, %function;
ftello64:
.globl ftime .globl ftime
.type ftime, %function; .type ftime, %function;
ftime: ftime:
@ -2113,18 +2048,12 @@ ftok:
.globl ftruncate .globl ftruncate
.type ftruncate, %function; .type ftruncate, %function;
ftruncate: ftruncate:
.weak ftruncate64
.type ftruncate64, %function;
ftruncate64:
.globl ftrylockfile .globl ftrylockfile
.type ftrylockfile, %function; .type ftrylockfile, %function;
ftrylockfile: ftrylockfile:
.globl ftw .globl ftw
.type ftw, %function; .type ftw, %function;
ftw: ftw:
.weak ftw64
.type ftw64, %function;
ftw64:
.globl funlockfile .globl funlockfile
.type funlockfile, %function; .type funlockfile, %function;
funlockfile: funlockfile:
@ -2203,9 +2132,6 @@ getdelim:
.globl getdents .globl getdents
.type getdents, %function; .type getdents, %function;
getdents: getdents:
.weak getdents64
.type getdents64, %function;
getdents64:
.globl getdomainname .globl getdomainname
.type getdomainname, %function; .type getdomainname, %function;
getdomainname: getdomainname:
@ -2380,9 +2306,6 @@ getresuid:
.globl getrlimit .globl getrlimit
.type getrlimit, %function; .type getrlimit, %function;
getrlimit: getrlimit:
.weak getrlimit64
.type getrlimit64, %function;
getrlimit64:
.globl getrusage .globl getrusage
.type getrusage, %function; .type getrusage, %function;
getrusage: getrusage:
@ -2479,15 +2402,9 @@ getxattr:
.globl glob .globl glob
.type glob, %function; .type glob, %function;
glob: glob:
.weak glob64
.type glob64, %function;
glob64:
.globl globfree .globl globfree
.type globfree, %function; .type globfree, %function;
globfree: globfree:
.weak globfree64
.type globfree64, %function;
globfree64:
.globl gmtime .globl gmtime
.type gmtime, %function; .type gmtime, %function;
gmtime: gmtime:
@ -2632,12 +2549,12 @@ insque:
.globl ioctl .globl ioctl
.type ioctl, %function; .type ioctl, %function;
ioctl: ioctl:
#if !defined(ARCH_riscv64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_mips64) && !defined(ARCH_aarch64)
.globl ioperm .globl ioperm
.type ioperm, %function; .type ioperm, %function;
ioperm: ioperm:
#endif #endif
#if !defined(ARCH_riscv64) && !defined(ARCH_aarch64) #if !defined(ARCH_riscv64) && !defined(ARCH_mips64) && !defined(ARCH_aarch64)
.globl iopl .globl iopl
.type iopl, %function; .type iopl, %function;
iopl: iopl:
@ -2897,9 +2814,6 @@ linkat:
.globl lio_listio .globl lio_listio
.type lio_listio, %function; .type lio_listio, %function;
lio_listio: lio_listio:
.weak lio_listio64
.type lio_listio64, %function;
lio_listio64:
.globl listen .globl listen
.type listen, %function; .type listen, %function;
listen: listen:
@ -2945,9 +2859,6 @@ localtime_r:
.globl lockf .globl lockf
.type lockf, %function; .type lockf, %function;
lockf: lockf:
.weak lockf64
.type lockf64, %function;
lockf64:
.globl log .globl log
.type log, %function; .type log, %function;
log: log:
@ -3029,18 +2940,12 @@ lsearch:
.weak lseek .weak lseek
.type lseek, %function; .type lseek, %function;
lseek: lseek:
.weak lseek64
.type lseek64, %function;
lseek64:
.globl lsetxattr .globl lsetxattr
.type lsetxattr, %function; .type lsetxattr, %function;
lsetxattr: lsetxattr:
.globl lstat .globl lstat
.type lstat, %function; .type lstat, %function;
lstat: lstat:
.weak lstat64
.type lstat64, %function;
lstat64:
.globl lutimes .globl lutimes
.type lutimes, %function; .type lutimes, %function;
lutimes: lutimes:
@ -3146,27 +3051,15 @@ mknodat:
.globl mkostemp .globl mkostemp
.type mkostemp, %function; .type mkostemp, %function;
mkostemp: mkostemp:
.weak mkostemp64
.type mkostemp64, %function;
mkostemp64:
.weak mkostemps .weak mkostemps
.type mkostemps, %function; .type mkostemps, %function;
mkostemps: mkostemps:
.weak mkostemps64
.type mkostemps64, %function;
mkostemps64:
.globl mkstemp .globl mkstemp
.type mkstemp, %function; .type mkstemp, %function;
mkstemp: mkstemp:
.weak mkstemp64
.type mkstemp64, %function;
mkstemp64:
.globl mkstemps .globl mkstemps
.type mkstemps, %function; .type mkstemps, %function;
mkstemps: mkstemps:
.weak mkstemps64
.type mkstemps64, %function;
mkstemps64:
.globl mktemp .globl mktemp
.type mktemp, %function; .type mktemp, %function;
mktemp: mktemp:
@ -3185,9 +3078,6 @@ mlockall:
.weak mmap .weak mmap
.type mmap, %function; .type mmap, %function;
mmap: mmap:
.weak mmap64
.type mmap64, %function;
mmap64:
.globl modf .globl modf
.type modf, %function; .type modf, %function;
modf: modf:
@ -3329,9 +3219,6 @@ nexttowardl:
.globl nftw .globl nftw
.type nftw, %function; .type nftw, %function;
nftw: nftw:
.weak nftw64
.type nftw64, %function;
nftw64:
.globl ngettext .globl ngettext
.type ngettext, %function; .type ngettext, %function;
ngettext: ngettext:
@ -3380,9 +3267,6 @@ ntohs:
.globl open .globl open
.type open, %function; .type open, %function;
open: open:
.weak open64
.type open64, %function;
open64:
.globl open_by_handle_at .globl open_by_handle_at
.type open_by_handle_at, %function; .type open_by_handle_at, %function;
open_by_handle_at: open_by_handle_at:
@ -3395,9 +3279,6 @@ open_wmemstream:
.globl openat .globl openat
.type openat, %function; .type openat, %function;
openat: openat:
.weak openat64
.type openat64, %function;
openat64:
.globl opendir .globl opendir
.type opendir, %function; .type opendir, %function;
opendir: opendir:
@ -3443,15 +3324,9 @@ posix_close:
.globl posix_fadvise .globl posix_fadvise
.type posix_fadvise, %function; .type posix_fadvise, %function;
posix_fadvise: posix_fadvise:
.weak posix_fadvise64
.type posix_fadvise64, %function;
posix_fadvise64:
.globl posix_fallocate .globl posix_fallocate
.type posix_fallocate, %function; .type posix_fallocate, %function;
posix_fallocate: posix_fallocate:
.weak posix_fallocate64
.type posix_fallocate64, %function;
posix_fallocate64:
.globl posix_madvise .globl posix_madvise
.type posix_madvise, %function; .type posix_madvise, %function;
posix_madvise: posix_madvise:
@ -3557,24 +3432,15 @@ prctl:
.globl pread .globl pread
.type pread, %function; .type pread, %function;
pread: pread:
.weak pread64
.type pread64, %function;
pread64:
.globl preadv .globl preadv
.type preadv, %function; .type preadv, %function;
preadv: preadv:
.weak preadv64
.type preadv64, %function;
preadv64:
.globl printf .globl printf
.type printf, %function; .type printf, %function;
printf: printf:
.globl prlimit .globl prlimit
.type prlimit, %function; .type prlimit, %function;
prlimit: prlimit:
.weak prlimit64
.type prlimit64, %function;
prlimit64:
.globl process_vm_readv .globl process_vm_readv
.type process_vm_readv, %function; .type process_vm_readv, %function;
process_vm_readv: process_vm_readv:
@ -3971,15 +3837,9 @@ putwchar_unlocked:
.globl pwrite .globl pwrite
.type pwrite, %function; .type pwrite, %function;
pwrite: pwrite:
.weak pwrite64
.type pwrite64, %function;
pwrite64:
.globl pwritev .globl pwritev
.type pwritev, %function; .type pwritev, %function;
pwritev: pwritev:
.weak pwritev64
.type pwritev64, %function;
pwritev64:
.globl qsort .globl qsort
.type qsort, %function; .type qsort, %function;
qsort: qsort:
@ -4013,12 +3873,6 @@ readahead:
.globl readdir .globl readdir
.type readdir, %function; .type readdir, %function;
readdir: readdir:
.weak readdir64
.type readdir64, %function;
readdir64:
.weak readdir64_r
.type readdir64_r, %function;
readdir64_r:
.globl readdir_r .globl readdir_r
.type readdir_r, %function; .type readdir_r, %function;
readdir_r: readdir_r:
@ -4139,7 +3993,7 @@ rintf:
.globl rintl .globl rintl
.type rintl, %function; .type rintl, %function;
rintl: rintl:
#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) #if !defined(ARCH_mips) && !defined(ARCH_mips64) && !defined(ARCH_x86) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
.weak riscv_flush_icache .weak riscv_flush_icache
.type riscv_flush_icache, %function; .type riscv_flush_icache, %function;
riscv_flush_icache: riscv_flush_icache:
@ -4186,9 +4040,6 @@ scalbnl:
.globl scandir .globl scandir
.type scandir, %function; .type scandir, %function;
scandir: scandir:
.weak scandir64
.type scandir64, %function;
scandir64:
.globl scanf .globl scanf
.type scanf, %function; .type scanf, %function;
scanf: scanf:
@ -4285,9 +4136,6 @@ send:
.globl sendfile .globl sendfile
.type sendfile, %function; .type sendfile, %function;
sendfile: sendfile:
.weak sendfile64
.type sendfile64, %function;
sendfile64:
.globl sendmmsg .globl sendmmsg
.type sendmmsg, %function; .type sendmmsg, %function;
sendmmsg: sendmmsg:
@ -4393,9 +4241,6 @@ setreuid:
.globl setrlimit .globl setrlimit
.type setrlimit, %function; .type setrlimit, %function;
setrlimit: setrlimit:
.weak setrlimit64
.type setrlimit64, %function;
setrlimit64:
.globl setservent .globl setservent
.type setservent, %function; .type setservent, %function;
setservent: setservent:
@ -4612,21 +4457,12 @@ sscanf:
.globl stat .globl stat
.type stat, %function; .type stat, %function;
stat: stat:
.weak stat64
.type stat64, %function;
stat64:
.weak statfs .weak statfs
.type statfs, %function; .type statfs, %function;
statfs: statfs:
.weak statfs64
.type statfs64, %function;
statfs64:
.globl statvfs .globl statvfs
.type statvfs, %function; .type statvfs, %function;
statvfs: statvfs:
.weak statvfs64
.type statvfs64, %function;
statvfs64:
.globl stime .globl stime
.type stime, %function; .type stime, %function;
stime: stime:
@ -4984,9 +4820,6 @@ timespec_get:
.globl tmpfile .globl tmpfile
.type tmpfile, %function; .type tmpfile, %function;
tmpfile: tmpfile:
.weak tmpfile64
.type tmpfile64, %function;
tmpfile64:
.globl tmpnam .globl tmpnam
.type tmpnam, %function; .type tmpnam, %function;
tmpnam: tmpnam:
@ -5029,9 +4862,6 @@ trunc:
.globl truncate .globl truncate
.type truncate, %function; .type truncate, %function;
truncate: truncate:
.weak truncate64
.type truncate64, %function;
truncate64:
.globl truncf .globl truncf
.type truncf, %function; .type truncf, %function;
truncf: truncf:
@ -5152,9 +4982,6 @@ verrx:
.globl versionsort .globl versionsort
.type versionsort, %function; .type versionsort, %function;
versionsort: versionsort:
.weak versionsort64
.type versionsort64, %function;
versionsort64:
.globl vfork .globl vfork
.type vfork, %function; .type vfork, %function;
vfork: vfork:

View File

@ -82,6 +82,8 @@ static size_t io_thread_stack_size;
static struct aio_queue *__aio_get_queue(int fd, int need) static struct aio_queue *__aio_get_queue(int fd, int need)
{ {
sigset_t allmask, origmask;
int masked = 0;
if (fd < 0) { if (fd < 0) {
errno = EBADF; errno = EBADF;
return 0; return 0;
@ -93,6 +95,9 @@ static struct aio_queue *__aio_get_queue(int fd, int need)
if ((!map || !map[a] || !map[a][b] || !map[a][b][c] || !(q=map[a][b][c][d])) && need) { if ((!map || !map[a] || !map[a][b] || !map[a][b][c] || !(q=map[a][b][c][d])) && need) {
pthread_rwlock_unlock(&maplock); pthread_rwlock_unlock(&maplock);
if (fcntl(fd, F_GETFD) < 0) return 0; if (fcntl(fd, F_GETFD) < 0) return 0;
sigfillset(&allmask);
masked = 1;
pthread_sigmask(SIG_BLOCK, &allmask, &origmask);
pthread_rwlock_wrlock(&maplock); pthread_rwlock_wrlock(&maplock);
if (!io_thread_stack_size) { if (!io_thread_stack_size) {
unsigned long val = __getauxval(AT_MINSIGSTKSZ); unsigned long val = __getauxval(AT_MINSIGSTKSZ);
@ -119,6 +124,7 @@ static struct aio_queue *__aio_get_queue(int fd, int need)
if (q) pthread_mutex_lock(&q->lock); if (q) pthread_mutex_lock(&q->lock);
out: out:
pthread_rwlock_unlock(&maplock); pthread_rwlock_unlock(&maplock);
if (masked) pthread_sigmask(SIG_SETMASK, &origmask, 0);
return q; return q;
} }
@ -401,18 +407,26 @@ void __aio_atfork(int who)
if (who<0) { if (who<0) {
pthread_rwlock_rdlock(&maplock); pthread_rwlock_rdlock(&maplock);
return; return;
} else if (!who) {
pthread_rwlock_unlock(&maplock);
return;
} }
if (who>0 && map) for (int a=0; a<(-1U/2+1)>>24; a++) aio_fd_cnt = 0;
if (pthread_rwlock_tryrdlock(&maplock)) {
/* Obtaining lock may fail if _Fork was called nor via
* fork. In this case, no further aio is possible from
* child and we can just null out map so __aio_close
* does not attempt to do anything. */
map = 0;
return;
}
if (map) for (int a=0; a<(-1U/2+1)>>24; a++)
if (map[a]) for (int b=0; b<256; b++) 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]) for (int c=0; c<256; c++)
if (map[a][b][c]) for (int d=0; d<256; d++) if (map[a][b][c]) for (int d=0; d<256; d++)
map[a][b][c][d] = 0; map[a][b][c][d] = 0;
pthread_rwlock_unlock(&maplock); /* Re-initialize the rwlock rather than unlocking since there
* may have been more than one reference on it in the parent.
* We are not a lock holder anyway; the thread in the parent was. */
pthread_rwlock_init(&maplock, 0);
} }
weak_alias(aio_cancel, aio_cancel64);
weak_alias(aio_error, aio_error64);
weak_alias(aio_fsync, aio_fsync64);
weak_alias(aio_read, aio_read64);
weak_alias(aio_write, aio_write64);
weak_alias(aio_return, aio_return64);

View File

@ -9,7 +9,7 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
{ {
int i, tid = 0, ret, expect = 0; int i, tid = 0, ret, expect = 0;
struct timespec at; struct timespec at;
volatile int dummy_fut, *pfut; volatile int dummy_fut = 0, *pfut;
int nzcnt = 0; int nzcnt = 0;
const struct aiocb *cb = 0; const struct aiocb *cb = 0;
@ -73,7 +73,3 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
} }
} }
} }
#if !_REDIR_TIME64
weak_alias(aio_suspend, aio_suspend64);
#endif

View File

@ -139,5 +139,3 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
return 0; return 0;
} }
weak_alias(lio_listio, lio_listio64);

View File

@ -7,7 +7,7 @@ size_t confstr(int name, char *buf, size_t len)
const char *s = ""; const char *s = "";
if (!name) { if (!name) {
s = "/bin:/usr/bin"; s = "/bin:/usr/bin";
} else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) { } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>35U) {
errno = EINVAL; errno = EINVAL;
return 0; return 0;
} }

View File

@ -4,6 +4,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <signal.h> #include <signal.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <sys/auxv.h>
#include "syscall.h" #include "syscall.h"
#include "libc.h" #include "libc.h"
@ -19,6 +20,8 @@
#define JT_AVPHYS_PAGES JT(9) #define JT_AVPHYS_PAGES JT(9)
#define JT_ZERO JT(10) #define JT_ZERO JT(10)
#define JT_DELAYTIMER_MAX JT(11) #define JT_DELAYTIMER_MAX JT(11)
#define JT_MINSIGSTKSZ JT(12)
#define JT_SIGSTKSZ JT(13)
#define RLIM(x) (-32768|(RLIMIT_ ## x)) #define RLIM(x) (-32768|(RLIMIT_ ## x))
@ -165,6 +168,9 @@ long sysconf(int name)
[_SC_XOPEN_STREAMS] = JT_ZERO, [_SC_XOPEN_STREAMS] = JT_ZERO,
[_SC_THREAD_ROBUST_PRIO_INHERIT] = -1, [_SC_THREAD_ROBUST_PRIO_INHERIT] = -1,
[_SC_THREAD_ROBUST_PRIO_PROTECT] = -1, [_SC_THREAD_ROBUST_PRIO_PROTECT] = -1,
[_SC_MINSIGSTKSZ] = JT_MINSIGSTKSZ,
[_SC_SIGSTKSZ] = JT_SIGSTKSZ,
}; };
if (name >= sizeof(values)/sizeof(values[0]) || !values[name]) { if (name >= sizeof(values)/sizeof(values[0]) || !values[name]) {
@ -212,6 +218,13 @@ long sysconf(int name)
mem *= si.mem_unit; mem *= si.mem_unit;
mem /= PAGE_SIZE; mem /= PAGE_SIZE;
return (mem > LONG_MAX) ? LONG_MAX : mem; return (mem > LONG_MAX) ? LONG_MAX : mem;
case JT_MINSIGSTKSZ & 255:
case JT_SIGSTKSZ & 255: ;
long val = __getauxval(AT_MINSIGSTKSZ);
if (val < MINSIGSTKSZ) val = MINSIGSTKSZ;
if (values[name] == JT_SIGSTKSZ)
val += SIGSTKSZ - MINSIGSTKSZ;
return val;
case JT_ZERO & 255: case JT_ZERO & 255:
return 0; return 0;
} }

View File

@ -5,5 +5,3 @@ int alphasort(const struct dirent **a, const struct dirent **b)
{ {
return strcoll((*a)->d_name, (*b)->d_name); return strcoll((*a)->d_name, (*b)->d_name);
} }
weak_alias(alphasort, alphasort64);

View File

@ -25,5 +25,3 @@ struct dirent *readdir(DIR *dir)
dir->tell = de->d_off; dir->tell = de->d_off;
return de; return de;
} }
weak_alias(readdir, readdir64);

View File

@ -25,5 +25,3 @@ int readdir_r(DIR *restrict dir, struct dirent *restrict buf, struct dirent **re
*result = buf; *result = buf;
return 0; return 0;
} }
weak_alias(readdir_r, readdir64_r);

View File

@ -43,5 +43,3 @@ int scandir(const char *path, struct dirent ***res,
*res = names; *res = names;
return cnt; return cnt;
} }
weak_alias(scandir, scandir64);

View File

@ -6,6 +6,3 @@ int versionsort(const struct dirent **a, const struct dirent **b)
{ {
return strverscmp((*a)->d_name, (*b)->d_name); return strverscmp((*a)->d_name, (*b)->d_name);
} }
#undef versionsort64
weak_alias(versionsort, versionsort64);

View File

@ -4,5 +4,3 @@ int creat(const char *filename, mode_t mode)
{ {
return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode); return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode);
} }
weak_alias(creat, creat64);

View File

@ -19,5 +19,3 @@ int open(const char *filename, int flags, ...)
return __syscall_ret(fd); return __syscall_ret(fd);
} }
weak_alias(open, open64);

View File

@ -15,5 +15,3 @@ int openat(int fd, const char *filename, int flags, ...)
return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode); return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode);
} }
weak_alias(openat, openat64);

View File

@ -14,5 +14,3 @@ int posix_fadvise(int fd, off_t base, off_t len, int advice)
__SYSCALL_LL_E(len), advice); __SYSCALL_LL_E(len), advice);
#endif #endif
} }
weak_alias(posix_fadvise, posix_fadvise64);

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