cc,wasi: remove unused headers and sources

This commit is contained in:
Jakub Konka
2021-05-19 22:26:23 +02:00
parent 6d5002028a
commit f291b8b9bc
624 changed files with 0 additions and 35900 deletions
-1200
View File
@@ -1,1200 +0,0 @@
_CLOCK_MONOTONIC
_CLOCK_PROCESS_CPUTIME_ID
_CLOCK_REALTIME
_CLOCK_THREAD_CPUTIME_ID
_Exit
_IO_feof_unlocked
_IO_ferror_unlocked
_IO_getc
_IO_getc_unlocked
_IO_putc
_IO_putc_unlocked
__EINVAL
__ENOMEM
__SIG_ERR
__SIG_IGN
__asctime_r
__assert_fail
__c_dot_utf8
__c_dot_utf8_locale
__c_locale
__clock
__clock_gettime
__cos
__cosdf
__cosl
__crypt_blowfish
__crypt_des
__crypt_md5
__crypt_r
__crypt_sha256
__crypt_sha512
__ctype_b_loc
__ctype_get_mb_cur_max
__ctype_tolower_loc
__ctype_toupper_loc
__cxa_atexit
__cxa_finalize
__des_setkey
__do_des
__duplocale
__env_rm_add
__env_rm_add
__env_rm_add
__env_rm_add
__exp2f_data
__exp_data
__expo2
__expo2f
__fbufsize
__fclose_ca
__fdopen
__fesetround
__fgetwc_unlocked
__flbf
__floatscan
__fmodeflags
__fopen_rb_ca
__fpending
__fpurge
__fputwc_unlocked
__freadable
__freadahead
__freading
__freadptr
__freadptrinc
__freelocale
__fseeko
__fseeko_unlocked
__fseterr
__fsetlocking
__fsmu8
__ftello
__ftello_unlocked
__funcs_on_exit
__funcs_on_exit
__funcs_on_quick_exit
__funcs_on_quick_exit
__fwritable
__fwritex
__fwriting
__get_locale
__getdelim
__getentropy
__getopt_msg
__gmtime_r
__hwcap
__inet_aton
__intscan
__invtrigl_R
__isalnum_l
__isalpha_l
__isatty
__isblank_l
__iscntrl_l
__isdigit_l
__isgraph_l
__islower_l
__isoc99_fscanf
__isoc99_fwscanf
__isoc99_scanf
__isoc99_sscanf
__isoc99_swscanf
__isoc99_vfscanf
__isoc99_vfwscanf
__isoc99_vscanf
__isoc99_vsscanf
__isoc99_vswscanf
__isoc99_vwscanf
__isoc99_wscanf
__isprint_l
__ispunct_l
__isspace_l
__isupper_l
__iswalnum_l
__iswalpha_l
__iswblank_l
__iswcntrl_l
__iswctype_l
__iswdigit_l
__iswgraph_l
__iswlower_l
__iswprint_l
__iswpunct_l
__iswspace_l
__iswupper_l
__iswxdigit_l
__isxdigit_l
__lctrans
__lctrans_cur
__lctrans_impl
__lctrans_impl
__ldexp_cexp
__ldexp_cexpf
__lgamma_r
__lgammaf_r
__lgammal_r
__libc
__libc_calloc
__libc_free
__libc_malloc
__loc_is_allocated
__localtime_r
__log2_data
__log2f_data
__log_data
__logf_data
__lseek
__main_argc_argv
__main_void
__math_divzero
__math_divzerof
__math_invalid
__math_invalidf
__math_invalidl
__math_oflow
__math_oflowf
__math_uflow
__math_uflowf
__math_xflow
__math_xflowf
__memrchr
__mo_lookup
__month_to_secs
__newlocale
__nl_langinfo
__nl_langinfo_l
__ofl_add
__ofl_lock
__ofl_unlock
__optpos
__optreset
__original_main
__overflow
__p1evll
__pio2_hi
__pio2_lo
__pleval
__polevll
__posix_getopt
__pow_log_data
__powf_log2_data
__progname
__progname_full
__putenv
__rand48_step
__reallocarray
__rem_pio2
__rem_pio2_large
__rem_pio2f
__rem_pio2l
__rsqrt_tab
__secs_to_tm
__secs_to_zone
__seed48
__shgetc
__shlim
__signgam
__sin
__sindf
__sinl
__small_printf
__stderr_FILE
__stderr_used
__stderr_used
__stderr_used
__stdin_FILE
__stdin_used
__stdin_used
__stdio_close
__stdio_exit
__stdio_exit
__stdio_exit_needed
__stdio_read
__stdio_seek
__stdio_write
__stdout_FILE
__stdout_used
__stdout_used
__stdout_used
__stdout_write
__stpcpy
__stpncpy
__strcasecmp_l
__strchrnul
__strcoll_l
__strerror_l
__strftime_fmt_1
__strftime_l
__strncasecmp_l
__strtoimax_internal
__strtol_internal
__strtoll_internal
__strtoul_internal
__strtoull_internal
__strtoumax_internal
__strxfrm_l
__sysinfo
__sysv_signal
__tan
__tandf
__tanl
__tm_to_secs
__tm_to_tzname
__tolower_l
__toread
__toread_needs_stdio_exit
__toupper_l
__towctrans_l
__towlower_l
__towrite
__towrite_needs_stdio_exit
__towupper_l
__tre_mem_alloc_impl
__tre_mem_destroy
__tre_mem_new_impl
__tsearch_balance
__uflow
__unlist_locked_file
__uselocale
__utc
__wasi_args_get
__wasi_args_sizes_get
__wasi_clock_res_get
__wasi_clock_time_get
__wasi_environ_get
__wasi_environ_sizes_get
__wasi_fd_advise
__wasi_fd_allocate
__wasi_fd_close
__wasi_fd_datasync
__wasi_fd_fdstat_get
__wasi_fd_fdstat_set_flags
__wasi_fd_fdstat_set_rights
__wasi_fd_filestat_get
__wasi_fd_filestat_set_size
__wasi_fd_filestat_set_times
__wasi_fd_pread
__wasi_fd_prestat_dir_name
__wasi_fd_prestat_get
__wasi_fd_pwrite
__wasi_fd_read
__wasi_fd_readdir
__wasi_fd_renumber
__wasi_fd_seek
__wasi_fd_sync
__wasi_fd_tell
__wasi_fd_write
__wasi_path_create_directory
__wasi_path_filestat_get
__wasi_path_filestat_set_times
__wasi_path_link
__wasi_path_open
__wasi_path_readlink
__wasi_path_remove_directory
__wasi_path_rename
__wasi_path_symlink
__wasi_path_unlink_file
__wasi_poll_oneoff
__wasi_proc_exit
__wasi_proc_raise
__wasi_random_get
__wasi_sched_yield
__wasi_sock_recv
__wasi_sock_send
__wasi_sock_shutdown
__wasilibc_access
__wasilibc_cwd
__wasilibc_ensure_environ
__wasilibc_environ
__wasilibc_environ
__wasilibc_fd_renumber
__wasilibc_find_abspath
__wasilibc_find_relpath
__wasilibc_find_relpath_alloc
__wasilibc_initialize_environ
__wasilibc_link
__wasilibc_link_newat
__wasilibc_link_oldat
__wasilibc_nocwd___wasilibc_rmdirat
__wasilibc_nocwd___wasilibc_unlinkat
__wasilibc_nocwd_faccessat
__wasilibc_nocwd_fstatat
__wasilibc_nocwd_linkat
__wasilibc_nocwd_mkdirat_nomode
__wasilibc_nocwd_openat_nomode
__wasilibc_nocwd_opendirat
__wasilibc_nocwd_readlinkat
__wasilibc_nocwd_renameat
__wasilibc_nocwd_scandirat
__wasilibc_nocwd_symlinkat
__wasilibc_nocwd_utimensat
__wasilibc_open_nomode
__wasilibc_register_preopened_fd
__wasilibc_rename_newat
__wasilibc_rename_oldat
__wasilibc_rmdirat
__wasilibc_stat
__wasilibc_tell
__wasilibc_unlinkat
__wasilibc_utimens
__wasm_call_dtors
__wcscoll_l
__wcsftime_l
__wcsxfrm_l
__wctrans_l
__wctype_l
__xpg_basename
__xpg_strerror_r
__year_to_secs
_environ
_exit
_flushlbf
_initialize
_start
_start
a64l
abort
abs
access
acos
acosf
acosh
acoshf
acoshl
acosl
aligned_alloc
alphasort
alphasort64
arc4random
arc4random_buf
arc4random_uniform
asctime
asctime_r
asin
asinf
asinh
asinhf
asinhl
asinl
asprintf
at_quick_exit
atan
atan2
atan2f
atan2l
atanf
atanh
atanhf
atanhl
atanl
atexit
atof
atoi
atol
atoll
basename
bcmp
bcopy
bsd_signal
bsearch
btowc
bzero
c16rtomb
c32rtomb
cabs
cabsf
cabsl
cacos
cacosf
cacosh
cacoshf
cacoshl
cacosl
calloc
carg
cargf
cargl
casin
casinf
casinh
casinhf
casinhl
casinl
catan
catanf
catanh
catanhf
catanhl
catanl
catclose
catgets
catopen
cbrt
cbrtf
cbrtl
ccos
ccosf
ccosh
ccoshf
ccoshl
ccosl
ceil
ceilf
ceill
cexp
cexpf
cexpl
chdir
cimag
cimagf
cimagl
clearenv
clearerr
clearerr_unlocked
clock
clock_getres
clock_gettime
clock_nanosleep
clog
clogf
clogl
close
closedir
confstr
conj
conjf
conjl
copysign
copysignf
copysignl
cos
cosf
cosh
coshf
coshl
cosl
cpow
cpowf
cpowl
cproj
cprojf
cprojl
creal
crealf
creall
creat
creat64
crypt
crypt_r
csin
csinf
csinh
csinhf
csinhl
csinl
csqrt
csqrtf
csqrtl
ctan
ctanf
ctanh
ctanhf
ctanhl
ctanl
ctime
ctime_r
difftime
dirfd
dirname
div
dprintf
drand48
drem
dremf
duplocale
ecvt
encrypt
environ
erand48
erf
erfc
erfcf
erfcl
erff
erfl
errno
exit
exp
exp10
exp10f
exp10l
exp2
exp2f
exp2l
expf
expl
explicit_bzero
expm1
expm1f
expm1l
fabs
fabsf
fabsl
faccessat
fclose
fcntl
fcvt
fdatasync
fdclosedir
fdim
fdimf
fdiml
fdopen
fdopendir
feclearexcept
fegetenv
fegetexceptflag
fegetround
feholdexcept
feof
feof_unlocked
feraiseexcept
ferror
ferror_unlocked
fesetenv
fesetexceptflag
fesetround
fetestexcept
feupdateenv
fflush
fflush_unlocked
ffs
ffsl
ffsll
fgetc
fgetc_unlocked
fgetln
fgetpos
fgetpos64
fgets
fgets_unlocked
fgetwc
fgetwc_unlocked
fgetws
fgetws_unlocked
fileno
fileno_unlocked
finite
finitef
floor
floorf
floorl
fma
fmaf
fmal
fmax
fmaxf
fmaxl
fmemopen
fmin
fminf
fminl
fmod
fmodf
fmodl
fmtmsg
fnmatch
fopen
fopen64
fopencookie
fpathconf
fprintf
fpurge
fputc
fputc_unlocked
fputs
fputs_unlocked
fputwc
fputwc_unlocked
fputws
fputws_unlocked
fread
fread_unlocked
free
freelocale
freopen
freopen64
frexp
frexpf
frexpl
fscanf
fseek
fseeko
fseeko64
fsetpos
fsetpos64
fstat
fstatat
fsync
ftell
ftello
ftello64
ftime
ftruncate
futimens
fwide
fwprintf
fwrite
fwrite_unlocked
fwscanf
gcvt
get_avphys_pages
get_nprocs
get_nprocs_conf
get_phys_pages
getc
getc_unlocked
getchar
getchar_unlocked
getcwd
getdate
getdate_err
getdelim
getdomainname
getentropy
getenv
gethostid
getline
getopt
getopt_long
getopt_long_only
getpid
getrusage
getsockopt
getsubopt
gettimeofday
getw
getwc
getwc_unlocked
getwchar
getwchar_unlocked
glob
glob64
globfree
globfree64
gmtime
gmtime_r
hcreate
hcreate_r
hdestroy
hdestroy_r
hsearch
hsearch_r
htonl
htons
hypot
hypotf
hypotl
iconv
iconv_close
iconv_open
ilogb
ilogbf
ilogbl
imaxabs
imaxdiv
in6addr_any
in6addr_loopback
index
inet_aton
inet_ntop
inet_pton
initstate
insque
ioctl
iprintf
isalnum
isalnum_l
isalpha
isalpha_l
isascii
isatty
isblank
isblank_l
iscntrl
iscntrl_l
isdigit
isdigit_l
isgraph
isgraph_l
islower
islower_l
isprint
isprint_l
ispunct
ispunct_l
isspace
isspace_l
isupper
isupper_l
iswalnum
iswalnum_l
iswalpha
iswalpha_l
iswblank
iswblank_l
iswcntrl
iswcntrl_l
iswctype
iswctype_l
iswdigit
iswdigit_l
iswgraph
iswgraph_l
iswlower
iswlower_l
iswprint
iswprint_l
iswpunct
iswpunct_l
iswspace
iswspace_l
iswupper
iswupper_l
iswxdigit
iswxdigit_l
isxdigit
isxdigit_l
j0
j0f
j1
j1f
jn
jnf
jrand48
l64a
labs
lcong48
ldexp
ldexpf
ldexpl
ldiv
lfind
lgamma
lgamma_r
lgammaf
lgammaf_r
lgammal
lgammal_r
link
linkat
llabs
lldiv
llrint
llrintf
llrintl
llround
llroundf
llroundl
localeconv
localtime
localtime_r
log
log10
log10f
log10l
log1p
log1pf
log1pl
log2
log2f
log2l
logb
logbf
logbl
logf
logl
lrand48
lrint
lrintf
lrintl
lround
lroundf
lroundl
lsearch
lseek
lstat
malloc
malloc_usable_size
mblen
mbrlen
mbrtoc16
mbrtoc32
mbrtowc
mbsinit
mbsnrtowcs
mbsrtowcs
mbstowcs
mbtowc
memccpy
memchr
memcmp
memcpy
memmem
memmove
mempcpy
memrchr
memset
mkdir
mkdirat
mktime
mmap
modf
modff
modfl
mrand48
munmap
nan
nanf
nanl
nanosleep
nearbyint
nearbyintf
nearbyintl
newlocale
nextafter
nextafterf
nextafterl
nexttoward
nexttowardf
nexttowardl
nftw
nftw64
nl_langinfo
nl_langinfo_l
nrand48
ntohl
ntohs
open
open_memstream
open_wmemstream
openat
opendir
opendirat
optarg
opterr
optind
optopt
optreset
pathconf
perror
poll
posix_close
posix_fadvise
posix_fallocate
posix_memalign
pow
pow10
pow10f
pow10l
powf
powl
pread
preadv
printf
program_invocation_name
program_invocation_short_name
pselect
psignal
putc
putc_unlocked
putchar
putchar_unlocked
putenv
puts
putw
putwc
putwc_unlocked
putwchar
putwchar_unlocked
pwrite
pwritev
qsort
quick_exit
raise
rand
rand_r
random
read
readdir
readlink
readlinkat
readv
realloc
reallocarray
recv
regcomp
regerror
regexec
regfree
remainder
remainderf
remainderl
remove
remque
remquo
remquof
remquol
rename
renameat
rewind
rewinddir
rindex
rint
rintf
rintl
rmdir
round
roundf
roundl
sbrk
scalb
scalbf
scalbln
scalblnf
scalblnl
scalbn
scalbnf
scalbnl
scandir
scandirat
scanf
sched_yield
seed48
seekdir
select
send
setbuf
setbuffer
setenv
setkey
setlinebuf
setlocale
setstate
setvbuf
shutdown
signal
signgam
significand
significandf
sin
sincos
sincosf
sincosl
sinf
sinh
sinhf
sinhl
sinl
sleep
snprintf
sprintf
sqrt
sqrtf
sqrtl
srand
srand48
srandom
sscanf
stat
stderr
stdin
stdout
stpcpy
stpncpy
strcasecmp
strcasecmp_l
strcasestr
strcat
strchr
strchrnul
strcmp
strcoll
strcoll_l
strcpy
strcspn
strdup
strerror
strerror_l
strerror_r
strfmon
strfmon_l
strftime
strftime_l
strlcat
strlcpy
strlen
strncasecmp
strncasecmp_l
strncat
strncmp
strncpy
strndup
strnlen
strpbrk
strptime
strrchr
strsep
strsignal
strspn
strstr
strtod
strtod_l
strtof
strtof_l
strtoimax
strtok
strtok_r
strtol
strtold
strtold_l
strtoll
strtoul
strtoull
strtoumax
strverscmp
strxfrm
strxfrm_l
swab
swprintf
swscanf
symlink
symlinkat
sysconf
tan
tanf
tanh
tanhf
tanhl
tanl
tdelete
tdestroy
telldir
tfind
tgamma
tgammaf
tgammal
time
timegm
times
timespec_get
toascii
tolower
tolower_l
toupper
toupper_l
towctrans
towctrans_l
towlower
towlower_l
towupper
towupper_l
trunc
truncate
truncf
truncl
tsearch
twalk
uname
ungetc
ungetwc
unlink
unlinkat
unsetenv
uselocale
usleep
utime
utimensat
vasprintf
vdprintf
versionsort
versionsort64
vfprintf
vfscanf
vfwprintf
vfwscanf
vprintf
vscanf
vsnprintf
vsprintf
vsscanf
vswprintf
vswscanf
vwprintf
vwscanf
wcpcpy
wcpncpy
wcrtomb
wcscasecmp
wcscasecmp_l
wcscat
wcschr
wcscmp
wcscoll
wcscoll_l
wcscpy
wcscspn
wcsdup
wcsftime
wcsftime_l
wcslen
wcsncasecmp
wcsncasecmp_l
wcsncat
wcsncmp
wcsncpy
wcsnlen
wcsnrtombs
wcspbrk
wcsrchr
wcsrtombs
wcsspn
wcsstr
wcstod
wcstof
wcstoimax
wcstok
wcstol
wcstold
wcstoll
wcstombs
wcstoul
wcstoull
wcstoumax
wcswcs
wcswidth
wcsxfrm
wcsxfrm_l
wctob
wctomb
wctrans
wctrans_l
wctype
wctype_l
wcwidth
wmemchr
wmemcmp
wmemcpy
wmemmove
wmemset
wprintf
write
writev
wscanf
y0
y0f
y1
y1f
yn
ynf
-170
View File
@@ -1,170 +0,0 @@
#include <__errno.h>
#include <__errno_values.h>
#include <__fd_set.h>
#include <__function___isatty.h>
#include <__functions_malloc.h>
#include <__functions_memcpy.h>
#include <__header_dirent.h>
#include <__header_fcntl.h>
#include <__header_inttypes.h>
#include <__header_netinet_in.h>
#include <__header_poll.h>
#include <__header_stdlib.h>
#include <__header_string.h>
#include <__header_sys_ioctl.h>
#include <__header_sys_resource.h>
#include <__header_sys_socket.h>
#include <__header_sys_stat.h>
#include <__header_time.h>
#include <__header_unistd.h>
#include <__macro_FD_SETSIZE.h>
#include <__macro_PAGESIZE.h>
#include <__mode_t.h>
#include <__seek.h>
#include <__struct_dirent.h>
#include <__struct_in6_addr.h>
#include <__struct_in_addr.h>
#include <__struct_iovec.h>
#include <__struct_msghdr.h>
#include <__struct_pollfd.h>
#include <__struct_rusage.h>
#include <__struct_sockaddr.h>
#include <__struct_sockaddr_in.h>
#include <__struct_sockaddr_in6.h>
#include <__struct_sockaddr_storage.h>
#include <__struct_sockaddr_un.h>
#include <__struct_stat.h>
#include <__struct_timespec.h>
#include <__struct_timeval.h>
#include <__struct_tm.h>
#include <__struct_tms.h>
#include <__typedef_DIR.h>
#include <__typedef_blkcnt_t.h>
#include <__typedef_blksize_t.h>
#include <__typedef_clock_t.h>
#include <__typedef_clockid_t.h>
#include <__typedef_dev_t.h>
#include <__typedef_fd_set.h>
#include <__typedef_gid_t.h>
#include <__typedef_in_addr_t.h>
#include <__typedef_in_port_t.h>
#include <__typedef_ino_t.h>
#include <__typedef_mode_t.h>
#include <__typedef_nfds_t.h>
#include <__typedef_nlink_t.h>
#include <__typedef_off_t.h>
#include <__typedef_sa_family_t.h>
#include <__typedef_sigset_t.h>
#include <__typedef_socklen_t.h>
#include <__typedef_ssize_t.h>
#include <__typedef_suseconds_t.h>
#include <__typedef_time_t.h>
#include <__typedef_uid_t.h>
#include <alloca.h>
#include <ar.h>
#include <arpa/ftp.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <arpa/nameser_compat.h>
#include <arpa/telnet.h>
#include <arpa/tftp.h>
#include <assert.h>
#include <byteswap.h>
#include <complex.h>
#include <cpio.h>
#include <crypt.h>
#include <ctype.h>
#include <dirent.h>
#include <endian.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <features.h>
#include <fenv.h>
#include <float.h>
#include <fmtmsg.h>
#include <fnmatch.h>
#include <ftw.h>
#include <getopt.h>
#include <glob.h>
#include <iconv.h>
#include <ifaddrs.h>
#include <inttypes.h>
#include <iso646.h>
#include <langinfo.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <malloc.h>
#include <math.h>
#include <memory.h>
#include <monetary.h>
#include <mqueue.h>
#include <netinet/icmp6.h>
#include <netinet/igmp.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/ip_icmp.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <netpacket/packet.h>
#include <nl_types.h>
#include <poll.h>
#include <regex.h>
#include <sched.h>
#include <search.h>
#include <semaphore.h>
#include <stdalign.h>
#include <stdbool.h>
#include <stdc-predef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h>
#include <strings.h>
#include <stropts.h>
#include <sys/dir.h>
#include <sys/errno.h>
#include <sys/eventfd.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/poll.h>
#include <sys/random.h>
#include <sys/reg.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/stropts.h>
#include <sys/syscall.h>
#include <sys/sysinfo.h>
#include <sys/time.h>
#include <sys/timeb.h>
#include <sys/timex.h>
#include <sys/ttydefaults.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/utsname.h>
#include <syscall.h>
#include <sysexits.h>
#include <tar.h>
#include <tgmath.h>
#include <threads.h>
#include <time.h>
#include <uchar.h>
#include <unistd.h>
#include <utime.h>
#include <values.h>
#include <wasi/api.h>
#include <wasi/libc-environ.h>
#include <wasi/libc-find-relpath.h>
#include <wasi/libc-nocwd.h>
#include <wasi/libc.h>
#include <wchar.h>
#include <wctype.h>
-3384
View File
@@ -1,3384 +0,0 @@
#define ABDAY_1 0x20000
#define ABDAY_2 0x20001
#define ABDAY_3 0x20002
#define ABDAY_4 0x20003
#define ABDAY_5 0x20004
#define ABDAY_6 0x20005
#define ABDAY_7 0x20006
#define ABMON_1 0x2000E
#define ABMON_10 0x20017
#define ABMON_11 0x20018
#define ABMON_12 0x20019
#define ABMON_2 0x2000F
#define ABMON_3 0x20010
#define ABMON_4 0x20011
#define ABMON_5 0x20012
#define ABMON_6 0x20013
#define ABMON_7 0x20014
#define ABMON_8 0x20015
#define ABMON_9 0x20016
#define ABORT 238
#define ACK 04
#define ADD ns_uop_add
#define ADJ_ESTERROR 0x0008
#define ADJ_FREQUENCY 0x0002
#define ADJ_MAXERROR 0x0004
#define ADJ_MICRO 0x1000
#define ADJ_NANO 0x2000
#define ADJ_OFFSET 0x0001
#define ADJ_OFFSET_SINGLESHOT 0x8001
#define ADJ_OFFSET_SS_READ 0xa001
#define ADJ_SETOFFSET 0x0100
#define ADJ_STATUS 0x0010
#define ADJ_TAI 0x0080
#define ADJ_TICK 0x4000
#define ADJ_TIMECONST 0x0020
#define AF_INET 1
#define AF_INET6 2
#define AF_UNIX 3
#define AF_UNSPEC 0
#define ALT_DIGITS 0x2002F
#define AM_STR 0x20026
#define ANYMARK 0x01
#define AO 245
#define AREGTYPE '\0'
#define ARFMAG "`\n"
#define ARG_MAX 131072
#define ARMAG "!<arch>\n"
#define AT_EACCESS (0x0)
#define AT_FDCWD (-2)
#define AT_REMOVEDIR (0x4)
#define AT_SYMLINK_FOLLOW (0x2)
#define AT_SYMLINK_NOFOLLOW (0x1)
#define AUTHTYPE_CNT 5
#define AUTHTYPE_KERBEROS_V4 1
#define AUTHTYPE_KERBEROS_V5 2
#define AUTHTYPE_MINK 4
#define AUTHTYPE_NAME(x) authtype_names[x]
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
#define AUTHTYPE_NULL 0
#define AUTHTYPE_SPX 3
#define AUTHTYPE_TEST 99
#define AUTH_HOW_MASK 2
#define AUTH_HOW_MUTUAL 2
#define AUTH_HOW_ONE_WAY 0
#define AUTH_WHO_CLIENT 0
#define AUTH_WHO_MASK 1
#define AUTH_WHO_SERVER 1
#define AYT 246
#define BIG_ENDIAN __BIG_ENDIAN
#define BITSPERBYTE CHAR_BIT
#define BLKTYPE '4'
#define BLK_BYTECOUNT 2
#define BLK_EOF 0x40
#define BLK_EOR 0x80
#define BLK_ERRORS 0x20
#define BLK_RESTART 0x10
#define BREAK 243
#define BUFSIZ 1024
#define BYTE_ORDER __BYTE_ORDER
#define CANBSIZ 255
#define CBRK CEOL
#define CDISCARD CTRL('o')
#define CDSUSP CTRL('y')
#define CEOF CTRL('d')
#define CEOL '\0'
#define CEOT CEOF
#define CERASE 0177
#define CFLUSH CDISCARD
#define CHARBITS (sizeof(char) * 8)
#define CHARCLASS_NAME_MAX 14
#define CHAR_BIT 8
#define CHAR_MAX 127
#define CHAR_MIN (-128)
#define CHRTYPE '3'
#define CINTR CTRL('c')
#define CKILL CTRL('u')
#define CLNEXT CTRL('v')
#define CLOCKS_PER_SEC ((clock_t)1000000000)
#define CLOCK_MONOTONIC (&_CLOCK_MONOTONIC)
#define CLOCK_PROCESS_CPUTIME_ID (&_CLOCK_PROCESS_CPUTIME_ID)
#define CLOCK_REALTIME (&_CLOCK_REALTIME)
#define CLOCK_THREAD_CPUTIME_ID (&_CLOCK_THREAD_CPUTIME_ID)
#define CMIN 1
#define CMPLX(x,y) __CMPLX(x, y, double)
#define CMPLXF(x,y) __CMPLX(x, y, float)
#define CMPLXL(x,y) __CMPLX(x, y, long double)
#define CODESET 14
#define COLL_WEIGHTS_MAX 2
#define COMPLETE 2
#define CONTINUE 3
#define CONTTYPE '7'
#define CQUIT 034
#define CREPRINT CTRL('r')
#define CRNCYSTR 0x4000F
#define CRPRNT CREPRINT
#define CSTART CTRL('q')
#define CSTATUS '\0'
#define CSTOP CTRL('s')
#define CSUSP CTRL('z')
#define CTIME 0
#define CTRL(x) ((x)&037)
#define CWERASE CTRL('w')
#define C_ANY ns_c_any
#define C_CHAOS ns_c_chaos
#define C_HS ns_c_hs
#define C_IN ns_c_in
#define C_IRGRP 000040
#define C_IROTH 000004
#define C_IRUSR 000400
#define C_ISBLK 060000
#define C_ISCHR 020000
#define C_ISCTG 0110000
#define C_ISDIR 040000
#define C_ISFIFO 010000
#define C_ISGID 002000
#define C_ISLNK 0120000
#define C_ISREG 0100000
#define C_ISSOCK 0140000
#define C_ISUID 004000
#define C_ISVTX 001000
#define C_IWGRP 000020
#define C_IWOTH 000002
#define C_IWUSR 000200
#define C_IXGRP 000010
#define C_IXOTH 000001
#define C_IXUSR 000100
#define C_NONE ns_c_none
#define DATA 03
#define DAY_1 0x20007
#define DAY_2 0x20008
#define DAY_3 0x20009
#define DAY_4 0x2000A
#define DAY_5 0x2000B
#define DAY_6 0x2000C
#define DAY_7 0x2000D
#define DBL_DECIMAL_DIG 17
#define DBL_DIG 15
#define DBL_EPSILON 2.22044604925031308085e-16
#define DBL_HAS_SUBNORM 1
#define DBL_MANT_DIG 53
#define DBL_MAX 1.79769313486231570815e+308
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.22507385850720138309e-308
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
#define DBL_TRUE_MIN 4.94065645841246544177e-324
#define DECIMAL_DIG 36
#define DELAYTIMER_MAX 0x7fffffff
#define DELETE ns_uop_delete
#define DEV_BSIZE 512
#define DIRTYPE '5'
#define DM 242
#define DMAXEXP DBL_MAX_EXP
#define DMINEXP DBL_MIN_EXP
#define DO 253
#define DONT 254
#define DOUBLEBITS (sizeof(double) * 8)
#define DT_BLK __WASI_FILETYPE_BLOCK_DEVICE
#define DT_CHR __WASI_FILETYPE_CHARACTER_DEVICE
#define DT_DIR __WASI_FILETYPE_DIRECTORY
#define DT_FIFO __WASI_FILETYPE_SOCKET_STREAM
#define DT_LNK __WASI_FILETYPE_SYMBOLIC_LINK
#define DT_REG __WASI_FILETYPE_REGULAR_FILE
#define DT_UNKNOWN __WASI_FILETYPE_UNKNOWN
#define D_FMT 0x20029
#define D_T_FMT 0x20028
#define E2BIG __WASI_ERRNO_2BIG
#define EACCES __WASI_ERRNO_ACCES
#define EACCESS 2
#define EADDRINUSE __WASI_ERRNO_ADDRINUSE
#define EADDRNOTAVAIL __WASI_ERRNO_ADDRNOTAVAIL
#define EAFNOSUPPORT __WASI_ERRNO_AFNOSUPPORT
#define EAGAIN __WASI_ERRNO_AGAIN
#define EALREADY __WASI_ERRNO_ALREADY
#define EBADF __WASI_ERRNO_BADF
#define EBADID 5
#define EBADMSG __WASI_ERRNO_BADMSG
#define EBADOP 4
#define EBUSY __WASI_ERRNO_BUSY
#define EC 247
#define ECANCELED __WASI_ERRNO_CANCELED
#define ECHILD __WASI_ERRNO_CHILD
#define ECONNABORTED __WASI_ERRNO_CONNABORTED
#define ECONNREFUSED __WASI_ERRNO_CONNREFUSED
#define ECONNRESET __WASI_ERRNO_CONNRESET
#define EDEADLK __WASI_ERRNO_DEADLK
#define EDESTADDRREQ __WASI_ERRNO_DESTADDRREQ
#define EDOM __WASI_ERRNO_DOM
#define EDQUOT __WASI_ERRNO_DQUOT
#define EEXIST __WASI_ERRNO_EXIST
#define EEXISTS 6
#define EFAULT __WASI_ERRNO_FAULT
#define EFBIG __WASI_ERRNO_FBIG
#define EFD_CLOEXEC O_CLOEXEC
#define EFD_NONBLOCK O_NONBLOCK
#define EFD_SEMAPHORE 1
#define EHOSTUNREACH __WASI_ERRNO_HOSTUNREACH
#define EIDRM __WASI_ERRNO_IDRM
#define EILSEQ __WASI_ERRNO_ILSEQ
#define EINPROGRESS __WASI_ERRNO_INPROGRESS
#define EINTR __WASI_ERRNO_INTR
#define EINVAL __WASI_ERRNO_INVAL
#define EIO __WASI_ERRNO_IO
#define EISCONN __WASI_ERRNO_ISCONN
#define EISDIR __WASI_ERRNO_ISDIR
#define EL 248
#define ELOOP __WASI_ERRNO_LOOP
#define EMFILE __WASI_ERRNO_MFILE
#define EMLINK __WASI_ERRNO_MLINK
#define EMSGSIZE __WASI_ERRNO_MSGSIZE
#define EMULTIHOP __WASI_ERRNO_MULTIHOP
#define ENAMETOOLONG __WASI_ERRNO_NAMETOOLONG
#define ENCRYPT_CNT 9
#define ENCRYPT_DEC_KEYID 8
#define ENCRYPT_ENC_KEYID 7
#define ENCRYPT_END 4
#define ENCRYPT_IS 0
#define ENCRYPT_NAME(x) encrypt_names[x]
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
#define ENCRYPT_REPLY 2
#define ENCRYPT_REQEND 6
#define ENCRYPT_REQSTART 5
#define ENCRYPT_START 3
#define ENCRYPT_SUPPORT 1
#define ENCTYPE_ANY 0
#define ENCTYPE_CNT 3
#define ENCTYPE_DES_CFB64 1
#define ENCTYPE_DES_OFB64 2
#define ENCTYPE_NAME(x) enctype_names[x]
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
#define ENETDOWN __WASI_ERRNO_NETDOWN
#define ENETRESET __WASI_ERRNO_NETRESET
#define ENETUNREACH __WASI_ERRNO_NETUNREACH
#define ENFILE __WASI_ERRNO_NFILE
#define ENOBUFS __WASI_ERRNO_NOBUFS
#define ENODEV __WASI_ERRNO_NODEV
#define ENOENT __WASI_ERRNO_NOENT
#define ENOEXEC __WASI_ERRNO_NOEXEC
#define ENOLCK __WASI_ERRNO_NOLCK
#define ENOLINK __WASI_ERRNO_NOLINK
#define ENOMEM __WASI_ERRNO_NOMEM
#define ENOMSG __WASI_ERRNO_NOMSG
#define ENOPROTOOPT __WASI_ERRNO_NOPROTOOPT
#define ENOSPACE 3
#define ENOSPC __WASI_ERRNO_NOSPC
#define ENOSYS __WASI_ERRNO_NOSYS
#define ENOTCAPABLE __WASI_ERRNO_NOTCAPABLE
#define ENOTCONN __WASI_ERRNO_NOTCONN
#define ENOTDIR __WASI_ERRNO_NOTDIR
#define ENOTEMPTY __WASI_ERRNO_NOTEMPTY
#define ENOTFOUND 1
#define ENOTRECOVERABLE __WASI_ERRNO_NOTRECOVERABLE
#define ENOTSOCK __WASI_ERRNO_NOTSOCK
#define ENOTSUP __WASI_ERRNO_NOTSUP
#define ENOTTY __WASI_ERRNO_NOTTY
#define ENOUSER 7
#define ENV_ESC 2
#define ENV_USERVAR 3
#define ENXIO __WASI_ERRNO_NXIO
#define EOF (-1)
#define EOPNOTSUPP ENOTSUP
#define EOR 239
#define EOVERFLOW __WASI_ERRNO_OVERFLOW
#define EOWNERDEAD __WASI_ERRNO_OWNERDEAD
#define EPERM __WASI_ERRNO_PERM
#define EPIPE __WASI_ERRNO_PIPE
#define EPROTO __WASI_ERRNO_PROTO
#define EPROTONOSUPPORT __WASI_ERRNO_PROTONOSUPPORT
#define EPROTOTYPE __WASI_ERRNO_PROTOTYPE
#define ERA 0x2002C
#define ERANGE __WASI_ERRNO_RANGE
#define ERA_D_FMT 0x2002E
#define ERA_D_T_FMT 0x20030
#define ERA_T_FMT 0x20031
#define EROFS __WASI_ERRNO_ROFS
#define ERROR 05
#define ESPIPE __WASI_ERRNO_SPIPE
#define ESRCH __WASI_ERRNO_SRCH
#define ESTALE __WASI_ERRNO_STALE
#define ETIMEDOUT __WASI_ERRNO_TIMEDOUT
#define ETXTBSY __WASI_ERRNO_TXTBSY
#define EUNDEF 0
#define EWOULDBLOCK EAGAIN
#define EXDEV __WASI_ERRNO_XDEV
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define EX_CANTCREAT 73
#define EX_CONFIG 78
#define EX_DATAERR 65
#define EX_IOERR 74
#define EX_NOHOST 68
#define EX_NOINPUT 66
#define EX_NOPERM 77
#define EX_NOUSER 67
#define EX_OK 0
#define EX_OSERR 71
#define EX_OSFILE 72
#define EX_PROTOCOL 76
#define EX_SOFTWARE 70
#define EX_TEMPFAIL 75
#define EX_UNAVAILABLE 69
#define EX_USAGE 64
#define EX__BASE 64
#define EX__MAX 78
#define FD_CLOEXEC (1)
#define FD_CLR(fd,set) (FD_CLR((fd), (set)))
#define FD_COPY(from,to) (FD_COPY((from), (to)))
#define FD_ISSET(fd,set) (FD_ISSET((fd), (set)))
#define FD_SET(fd,set) (FD_SET((fd), (set)))
#define FD_SETSIZE 1024
#define FD_ZERO(set) (FD_ZERO((set)))
#define FE_ALL_EXCEPT 0
#define FE_DFL_ENV ((const fenv_t *) -1)
#define FE_TONEAREST 0
#define FIFOTYPE '6'
#define FILENAME_MAX 4096
#define FILESIZEBITS 64
#define FIONBIO 2
#define FIONREAD 1
#define FLOATBITS (sizeof(float) * 8)
#define FLT_DECIMAL_DIG 9
#define FLT_DIG 6
#define FLT_EPSILON 1.1920928955078125e-07F
#define FLT_EVAL_METHOD 0
#define FLT_HAS_SUBNORM 1
#define FLT_MANT_DIG 24
#define FLT_MAX 3.40282346638528859812e+38F
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MIN 1.17549435082228750797e-38F
#define FLT_MIN_10_EXP (-37)
#define FLT_MIN_EXP (-125)
#define FLT_RADIX 2
#define FLT_ROUNDS (__builtin_flt_rounds())
#define FLT_TRUE_MIN 1.40129846432481707092e-45F
#define FLUSHBAND 0x04
#define FLUSHR 0x01
#define FLUSHRW 0x03
#define FLUSHW 0x02
#define FMAXEXP FLT_MAX_EXP
#define FMINEXP FLT_MIN_EXP
#define FMNAMESZ 8
#define FNM_CASEFOLD 0x10
#define FNM_FILE_NAME FNM_PATHNAME
#define FNM_LEADING_DIR 0x8
#define FNM_NOESCAPE 0x2
#define FNM_NOMATCH 1
#define FNM_NOSYS (-1)
#define FNM_PATHNAME 0x1
#define FNM_PERIOD 0x4
#define FOPEN_MAX 1000
#define FORMERR ns_r_formerr
#define FORM_C 3
#define FORM_N 1
#define FORM_T 2
#define FP_ILOGB0 FP_ILOGBNAN
#define FP_ILOGBNAN (-1-0x7fffffff)
#define FP_INFINITE 1
#define FP_NAN 0
#define FP_NORMAL 4
#define FP_SUBNORMAL 3
#define FP_ZERO 2
#define FSETLOCKING_BYCALLER 2
#define FSETLOCKING_INTERNAL 1
#define FSETLOCKING_QUERY 0
#define FTW_CHDIR 4
#define FTW_D 2
#define FTW_DEPTH 8
#define FTW_DNR 3
#define FTW_DP 6
#define FTW_F 1
#define FTW_MOUNT 2
#define FTW_NS 4
#define FTW_PHYS 1
#define FTW_SL 5
#define FTW_SLN 7
#define F_GETFD (1)
#define F_GETFL (3)
#define F_LOCK 1
#define F_OK (0)
#define F_SETFD (2)
#define F_SETFL (4)
#define F_TEST 3
#define F_TLOCK 2
#define F_ULOCK 0
#define GA 249
#define GETLONG NS_GET32
#define GETSHORT NS_GET16
#define GLOB_ABORTED 2
#define GLOB_APPEND 0x20
#define GLOB_DOOFFS 0x08
#define GLOB_ERR 0x01
#define GLOB_MARK 0x02
#define GLOB_NOCHECK 0x10
#define GLOB_NOESCAPE 0x40
#define GLOB_NOMATCH 3
#define GLOB_NOSORT 0x04
#define GLOB_NOSPACE 1
#define GLOB_NOSYS 4
#define GLOB_PERIOD 0x80
#define GROUP_FILTER_SIZE(numsrc) (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) + (numsrc) * sizeof(struct sockaddr_storage))
#define HFIXEDSZ NS_HFIXEDSZ
#define HIBITL MINLONG
#define HIBITS MINSHORT
#define HOST_NAME_MAX 255
#define HUGE 3.40282346638528859812e+38F
#define HUGE_VAL ((double)INFINITY)
#define HUGE_VALF INFINITY
#define HUGE_VALL ((long double)INFINITY)
#define I _Complex_I
#define IAC 255
#define ICMP6_DST_UNREACH 1
#define ICMP6_DST_UNREACH_ADDR 3
#define ICMP6_DST_UNREACH_ADMIN 1
#define ICMP6_DST_UNREACH_BEYONDSCOPE 2
#define ICMP6_DST_UNREACH_NOPORT 4
#define ICMP6_DST_UNREACH_NOROUTE 0
#define ICMP6_ECHO_REPLY 129
#define ICMP6_ECHO_REQUEST 128
#define ICMP6_FILTER 1
#define ICMP6_FILTER_BLOCK 1
#define ICMP6_FILTER_BLOCKOTHERS 3
#define ICMP6_FILTER_PASS 2
#define ICMP6_FILTER_PASSONLY 4
#define ICMP6_FILTER_SETBLOCK(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))))
#define ICMP6_FILTER_SETBLOCKALL(filterp) memset (filterp, 0xFF, sizeof (struct icmp6_filter));
#define ICMP6_FILTER_SETPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
#define ICMP6_FILTER_SETPASSALL(filterp) memset (filterp, 0, sizeof (struct icmp6_filter));
#define ICMP6_FILTER_WILLBLOCK(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
#define ICMP6_FILTER_WILLPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
#define ICMP6_INFOMSG_MASK 0x80
#define ICMP6_PACKET_TOO_BIG 2
#define ICMP6_PARAMPROB_HEADER 0
#define ICMP6_PARAMPROB_NEXTHEADER 1
#define ICMP6_PARAMPROB_OPTION 2
#define ICMP6_PARAM_PROB 4
#define ICMP6_ROUTER_RENUMBERING 138
#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
#define ICMP6_RR_FLAGS_PREVDONE 0x08
#define ICMP6_RR_FLAGS_REQRESULT 0x40
#define ICMP6_RR_FLAGS_SPECSITE 0x10
#define ICMP6_RR_FLAGS_TEST 0x80
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
#define ICMP6_TIME_EXCEEDED 3
#define ICMP6_TIME_EXCEED_REASSEMBLY 1
#define ICMP6_TIME_EXCEED_TRANSIT 0
#define ICMP_ADDRESS 17
#define ICMP_ADDRESSREPLY 18
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8)
#define ICMP_DEST_UNREACH 3
#define ICMP_ECHO 8
#define ICMP_ECHOREPLY 0
#define ICMP_EXC_FRAGTIME 1
#define ICMP_EXC_TTL 0
#define ICMP_FRAG_NEEDED 4
#define ICMP_HOST_ANO 10
#define ICMP_HOST_ISOLATED 8
#define ICMP_HOST_UNKNOWN 7
#define ICMP_HOST_UNREACH 1
#define ICMP_HOST_UNR_TOS 12
#define ICMP_INFOTYPE(type) ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
#define ICMP_INFO_REPLY 16
#define ICMP_INFO_REQUEST 15
#define ICMP_IREQ 15
#define ICMP_IREQREPLY 16
#define ICMP_MASKLEN 12
#define ICMP_MASKREPLY 18
#define ICMP_MASKREQ 17
#define ICMP_MAXTYPE 18
#define ICMP_MINLEN 8
#define ICMP_NET_ANO 9
#define ICMP_NET_UNKNOWN 6
#define ICMP_NET_UNREACH 0
#define ICMP_NET_UNR_TOS 11
#define ICMP_PARAMETERPROB 12
#define ICMP_PARAMPROB 12
#define ICMP_PARAMPROB_OPTABSENT 1
#define ICMP_PKT_FILTERED 13
#define ICMP_PORT_UNREACH 3
#define ICMP_PREC_CUTOFF 15
#define ICMP_PREC_VIOLATION 14
#define ICMP_PROT_UNREACH 2
#define ICMP_REDIRECT 5
#define ICMP_REDIRECT_HOST 1
#define ICMP_REDIRECT_NET 0
#define ICMP_REDIRECT_TOSHOST 3
#define ICMP_REDIRECT_TOSNET 2
#define ICMP_REDIR_HOST 1
#define ICMP_REDIR_HOSTTOS 3
#define ICMP_REDIR_NET 0
#define ICMP_REDIR_NETTOS 2
#define ICMP_ROUTERADVERT 9
#define ICMP_ROUTERSOLICIT 10
#define ICMP_SOURCEQUENCH 4
#define ICMP_SOURCE_QUENCH 4
#define ICMP_SR_FAILED 5
#define ICMP_TIMESTAMP 13
#define ICMP_TIMESTAMPREPLY 14
#define ICMP_TIME_EXCEEDED 11
#define ICMP_TIMXCEED 11
#define ICMP_TIMXCEED_INTRANS 0
#define ICMP_TIMXCEED_REASS 1
#define ICMP_TSLEN (8 + 3 * sizeof (n_time))
#define ICMP_TSTAMP 13
#define ICMP_TSTAMPREPLY 14
#define ICMP_UNREACH 3
#define ICMP_UNREACH_FILTER_PROHIB 13
#define ICMP_UNREACH_HOST 1
#define ICMP_UNREACH_HOST_PRECEDENCE 14
#define ICMP_UNREACH_HOST_PROHIB 10
#define ICMP_UNREACH_HOST_UNKNOWN 7
#define ICMP_UNREACH_ISOLATED 8
#define ICMP_UNREACH_NEEDFRAG 4
#define ICMP_UNREACH_NET 0
#define ICMP_UNREACH_NET_PROHIB 9
#define ICMP_UNREACH_NET_UNKNOWN 6
#define ICMP_UNREACH_PORT 3
#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
#define ICMP_UNREACH_PROTOCOL 2
#define ICMP_UNREACH_SRCFAIL 5
#define ICMP_UNREACH_TOSHOST 12
#define ICMP_UNREACH_TOSNET 11
#define IGMP_AWAKENING_MEMBER 5
#define IGMP_DELAYING_MEMBER 1
#define IGMP_DVMRP 0x13
#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
#define IGMP_IDLE_MEMBER 2
#define IGMP_LAZY_MEMBER 3
#define IGMP_MAX_HOST_REPORT_DELAY 10
#define IGMP_MEMBERSHIP_QUERY 0x11
#define IGMP_MINLEN 8
#define IGMP_MTRACE 0x1f
#define IGMP_MTRACE_RESP 0x1e
#define IGMP_PIM 0x14
#define IGMP_SLEEPING_MEMBER 4
#define IGMP_TIMER_SCALE 10
#define IGMP_TRACE 0x15
#define IGMP_V1_MEMBERSHIP_REPORT 0x12
#define IGMP_V2_LEAVE_GROUP 0x17
#define IGMP_V2_MEMBERSHIP_REPORT 0x16
#define IGMP_v1_ROUTER 1
#define IGMP_v2_ROUTER 2
#define IN6ADDRSZ NS_IN6ADDRSZ
#define IN6ADDR_ANY_INIT { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
#define IN6ADDR_LOOPBACK_INIT { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } }
#define IN6_ARE_ADDR_EQUAL(a,b) __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b))
#define IN6_IS_ADDR_LINKLOCAL(a) ((((uint8_t *) (a))[0]) == 0xfe && (((uint8_t *) (a))[1] & 0xc0) == 0x80)
#define IN6_IS_ADDR_LOOPBACK(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint32_t *) (a))[2] == 0 && ((uint8_t *) (a))[12] == 0 && ((uint8_t *) (a))[13] == 0 && ((uint8_t *) (a))[14] == 0 && ((uint8_t *) (a))[15] == 1 )
#define IN6_IS_ADDR_MC_GLOBAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe))
#define IN6_IS_ADDR_MC_LINKLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x2))
#define IN6_IS_ADDR_MC_NODELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x1))
#define IN6_IS_ADDR_MC_ORGLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x8))
#define IN6_IS_ADDR_MC_SITELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x5))
#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff)
#define IN6_IS_ADDR_SITELOCAL(a) ((((uint8_t *) (a))[0]) == 0xfe && (((uint8_t *) (a))[1] & 0xc0) == 0xc0)
#define IN6_IS_ADDR_UNSPECIFIED(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint32_t *) (a))[2] == 0 && ((uint32_t *) (a))[3] == 0)
#define IN6_IS_ADDR_V4COMPAT(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint32_t *) (a))[2] == 0 && ((uint8_t *) (a))[15] > 1)
#define IN6_IS_ADDR_V4MAPPED(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint8_t *) (a))[8] == 0 && ((uint8_t *) (a))[9] == 0 && ((uint8_t *) (a))[10] == 0xff && ((uint8_t *) (a))[11] == 0xff)
#define INADDRSZ NS_INADDRSZ
#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
#define INADDR_ALLSNOOPERS_GROUP ((in_addr_t) 0xe000006a)
#define INADDR_ANY ((in_addr_t) 0x00000000)
#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
#define INADDR_NONE ((in_addr_t) 0xffffffff)
#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
#define INDIR_MASK NS_CMPRSFLGS
#define INET6_ADDRSTRLEN 46
#define INET_ADDRSTRLEN 16
#define INFINITY 1e5000f
#define INT16SZ NS_INT16SZ
#define INT16_C(c) c
#define INT16_MAX (0x7fff)
#define INT16_MIN (-1-0x7fff)
#define INT32SZ NS_INT32SZ
#define INT32_C(c) c
#define INT32_MAX (0x7fffffff)
#define INT32_MIN (-1-0x7fffffff)
#define INT64_C(c) c ## LL
#define INT64_MAX (0x7fffffffffffffff)
#define INT64_MIN (-1-0x7fffffffffffffff)
#define INT8SZ NS_INT8SZ
#define INT8_C(c) c
#define INT8_MAX (0x7f)
#define INT8_MIN (-1-0x7f)
#define INTBITS (sizeof(int) * 8)
#define INTMAX_C(c) c ## LL
#define INTMAX_MAX INT64_MAX
#define INTMAX_MIN INT64_MIN
#define INTPTR_MAX INT32_MAX
#define INTPTR_MIN INT32_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MAX INT64_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST8_MIN INT8_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MAX INT64_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST8_MIN INT8_MIN
#define INT_MAX 0x7fffffff
#define INT_MIN (-1-0x7fffffff)
#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
#define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0)
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
#define IN_CLASSA_MAX 128
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
#define IN_CLASSB_MAX 65536
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
#define IN_LOOPBACKNET 127
#define IN_MULTICAST(a) IN_CLASSD(a)
#define IOV_MAX 1024
#define IP 244
#define IP6F_MORE_FRAG 0x0100
#define IP6F_OFF_MASK 0xf8ff
#define IP6F_RESERVED_MASK 0x0600
#define IP6OPT_JUMBO 0xc2
#define IP6OPT_JUMBO_LEN 6
#define IP6OPT_NSAP_ADDR 0xc3
#define IP6OPT_PAD1 0
#define IP6OPT_PADN 1
#define IP6OPT_ROUTER_ALERT 0x05
#define IP6OPT_TUNNEL_LIMIT 0x04
#define IP6OPT_TYPE(o) ((o) & 0xc0)
#define IP6OPT_TYPE_DISCARD 0x40
#define IP6OPT_TYPE_FORCEICMP 0x80
#define IP6OPT_TYPE_ICMP 0xc0
#define IP6OPT_TYPE_MUTABLE 0x20
#define IP6OPT_TYPE_SKIP 0x00
#define IP6_ALERT_AN 0x0200
#define IP6_ALERT_MLD 0x0000
#define IP6_ALERT_RSVP 0x0100
#define IPDEFTTL 64
#define IPFRAGTTL 60
#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
#define IPOPT_CLASS_MASK 0x60
#define IPOPT_CONTROL 0x00
#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
#define IPOPT_COPY 0x80
#define IPOPT_DEBMEAS 0x40
#define IPOPT_END IPOPT_EOL
#define IPOPT_EOL 0
#define IPOPT_LSRR 131
#define IPOPT_MEASUREMENT IPOPT_DEBMEAS
#define IPOPT_MINOFF 4
#define IPOPT_NOOP IPOPT_NOP
#define IPOPT_NOP 1
#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
#define IPOPT_NUMBER_MASK 0x1f
#define IPOPT_OFFSET 2
#define IPOPT_OLEN 1
#define IPOPT_OPTVAL 0
#define IPOPT_RA 148
#define IPOPT_RESERVED1 0x20
#define IPOPT_RESERVED2 0x60
#define IPOPT_RR 7
#define IPOPT_SATID 136
#define IPOPT_SEC IPOPT_SECURITY
#define IPOPT_SECURITY 130
#define IPOPT_SECUR_CONFID 0xf135
#define IPOPT_SECUR_EFTO 0x789a
#define IPOPT_SECUR_MMMM 0xbc4d
#define IPOPT_SECUR_RESTR 0xaf13
#define IPOPT_SECUR_SECRET 0xd788
#define IPOPT_SECUR_TOPSECRET 0x6bc5
#define IPOPT_SECUR_UNCLASS 0x0000
#define IPOPT_SID IPOPT_SATID
#define IPOPT_SSRR 137
#define IPOPT_TIMESTAMP IPOPT_TS
#define IPOPT_TS 68
#define IPOPT_TS_PRESPEC 3
#define IPOPT_TS_TSANDADDR 1
#define IPOPT_TS_TSONLY 0
#define IPPORT_RESERVED 1024
#define IPPROTO_ICMP 1
#define IPPROTO_IP 0
#define IPPROTO_IPV6 41
#define IPPROTO_RAW 255
#define IPPROTO_TCP 6
#define IPPROTO_UDP 17
#define IPTOS_CLASS(x) ((x) & IPTOS_CLASS_MASK)
#define IPTOS_CLASS_CS0 0x00
#define IPTOS_CLASS_CS1 0x20
#define IPTOS_CLASS_CS2 0x40
#define IPTOS_CLASS_CS3 0x60
#define IPTOS_CLASS_CS4 0x80
#define IPTOS_CLASS_CS5 0xa0
#define IPTOS_CLASS_CS6 0xc0
#define IPTOS_CLASS_CS7 0xe0
#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0
#define IPTOS_CLASS_MASK 0xe0
#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK)
#define IPTOS_DSCP_AF11 0x28
#define IPTOS_DSCP_AF12 0x30
#define IPTOS_DSCP_AF13 0x38
#define IPTOS_DSCP_AF21 0x48
#define IPTOS_DSCP_AF22 0x50
#define IPTOS_DSCP_AF23 0x58
#define IPTOS_DSCP_AF31 0x68
#define IPTOS_DSCP_AF32 0x70
#define IPTOS_DSCP_AF33 0x78
#define IPTOS_DSCP_AF41 0x88
#define IPTOS_DSCP_AF42 0x90
#define IPTOS_DSCP_AF43 0x98
#define IPTOS_DSCP_EF 0xb8
#define IPTOS_DSCP_MASK 0xfc
#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK)
#define IPTOS_ECN_CE 0x03
#define IPTOS_ECN_ECT0 0x02
#define IPTOS_ECN_ECT1 0x01
#define IPTOS_ECN_MASK 0x03
#define IPTOS_ECN_NOT_ECT 0x00
#define IPTOS_LOWCOST 0x02
#define IPTOS_LOWDELAY 0x10
#define IPTOS_MINCOST IPTOS_LOWCOST
#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
#define IPTOS_PREC_CRITIC_ECP 0xa0
#define IPTOS_PREC_FLASH 0x60
#define IPTOS_PREC_FLASHOVERRIDE 0x80
#define IPTOS_PREC_IMMEDIATE 0x40
#define IPTOS_PREC_INTERNETCONTROL 0xc0
#define IPTOS_PREC_MASK 0xe0
#define IPTOS_PREC_NETCONTROL 0xe0
#define IPTOS_PREC_PRIORITY 0x20
#define IPTOS_PREC_ROUTINE 0x00
#define IPTOS_RELIABILITY 0x04
#define IPTOS_THROUGHPUT 0x08
#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
#define IPTOS_TOS_MASK 0x1E
#define IPTTLDEC 1
#define IPV6_2292DSTOPTS 4
#define IPV6_2292HOPLIMIT 8
#define IPV6_2292HOPOPTS 3
#define IPV6_2292PKTINFO 2
#define IPV6_2292PKTOPTIONS 6
#define IPV6_2292RTHDR 5
#define IPV6_ADDRFORM 1
#define IPV6_ADDR_PREFERENCES 72
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
#define IPV6_AUTHHDR 10
#define IPV6_AUTOFLOWLABEL 70
#define IPV6_CHECKSUM 7
#define IPV6_DONTFRAG 62
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
#define IPV6_DSTOPTS 59
#define IPV6_FREEBIND 78
#define IPV6_HDRINCL 36
#define IPV6_HOPLIMIT 52
#define IPV6_HOPOPTS 54
#define IPV6_IPSEC_POLICY 34
#define IPV6_JOIN_ANYCAST 27
#define IPV6_JOIN_GROUP 20
#define IPV6_LEAVE_ANYCAST 28
#define IPV6_LEAVE_GROUP 21
#define IPV6_MINHOPCOUNT 73
#define IPV6_MTU 24
#define IPV6_MTU_DISCOVER 23
#define IPV6_MULTICAST_ALL 29
#define IPV6_MULTICAST_HOPS 18
#define IPV6_MULTICAST_IF 17
#define IPV6_MULTICAST_LOOP 19
#define IPV6_NEXTHOP 9
#define IPV6_ORIGDSTADDR 74
#define IPV6_PATHMTU 61
#define IPV6_PKTINFO 50
#define IPV6_PMTUDISC_DO 2
#define IPV6_PMTUDISC_DONT 0
#define IPV6_PMTUDISC_INTERFACE 4
#define IPV6_PMTUDISC_OMIT 5
#define IPV6_PMTUDISC_PROBE 3
#define IPV6_PMTUDISC_WANT 1
#define IPV6_PREFER_SRC_CGA 0x0008
#define IPV6_PREFER_SRC_COA 0x0004
#define IPV6_PREFER_SRC_HOME 0x0400
#define IPV6_PREFER_SRC_NONCGA 0x0800
#define IPV6_PREFER_SRC_PUBLIC 0x0002
#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
#define IPV6_PREFER_SRC_TMP 0x0001
#define IPV6_RECVDSTOPTS 58
#define IPV6_RECVERR 25
#define IPV6_RECVFRAGSIZE 77
#define IPV6_RECVHOPLIMIT 51
#define IPV6_RECVHOPOPTS 53
#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
#define IPV6_RECVPATHMTU 60
#define IPV6_RECVPKTINFO 49
#define IPV6_RECVRTHDR 56
#define IPV6_RECVTCLASS 66
#define IPV6_ROUTER_ALERT 22
#define IPV6_ROUTER_ALERT_ISOLATE 30
#define IPV6_RTHDR 57
#define IPV6_RTHDRDSTOPTS 55
#define IPV6_RTHDR_LOOSE 0
#define IPV6_RTHDR_STRICT 1
#define IPV6_RTHDR_TYPE_0 0
#define IPV6_RXDSTOPTS IPV6_DSTOPTS
#define IPV6_RXHOPOPTS IPV6_HOPOPTS
#define IPV6_TCLASS 67
#define IPV6_TRANSPARENT 75
#define IPV6_UNICAST_HOPS 16
#define IPV6_UNICAST_IF 76
#define IPV6_V6ONLY 26
#define IPV6_XFRM_POLICY 35
#define IPVERSION 4
#define IP_ADD_MEMBERSHIP 35
#define IP_ADD_SOURCE_MEMBERSHIP 39
#define IP_BIND_ADDRESS_NO_PORT 24
#define IP_BLOCK_SOURCE 38
#define IP_CHECKSUM 23
#define IP_DEFAULT_MULTICAST_LOOP 1
#define IP_DEFAULT_MULTICAST_TTL 1
#define IP_DF 0x4000
#define IP_DROP_MEMBERSHIP 36
#define IP_DROP_SOURCE_MEMBERSHIP 40
#define IP_FREEBIND 15
#define IP_HDRINCL 3
#define IP_IPSEC_POLICY 16
#define IP_MAXPACKET 65535
#define IP_MAX_MEMBERSHIPS 20
#define IP_MF 0x2000
#define IP_MINTTL 21
#define IP_MSFILTER 41
#define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter) - sizeof(struct in_addr) + (numsrc) * sizeof(struct in_addr))
#define IP_MSS 576
#define IP_MTU 14
#define IP_MTU_DISCOVER 10
#define IP_MULTICAST_ALL 49
#define IP_MULTICAST_IF 32
#define IP_MULTICAST_LOOP 34
#define IP_MULTICAST_TTL 33
#define IP_NODEFRAG 22
#define IP_OFFMASK 0x1fff
#define IP_OPTIONS 4
#define IP_ORIGDSTADDR 20
#define IP_PASSSEC 18
#define IP_PKTINFO 8
#define IP_PKTOPTIONS 9
#define IP_PMTUDISC 10
#define IP_PMTUDISC_DO 2
#define IP_PMTUDISC_DONT 0
#define IP_PMTUDISC_INTERFACE 4
#define IP_PMTUDISC_OMIT 5
#define IP_PMTUDISC_PROBE 3
#define IP_PMTUDISC_WANT 1
#define IP_RECVERR 11
#define IP_RECVERR_RFC4884 26
#define IP_RECVFRAGSIZE 25
#define IP_RECVOPTS 6
#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
#define IP_RECVRETOPTS IP_RETOPTS
#define IP_RECVTOS 13
#define IP_RECVTTL 12
#define IP_RETOPTS 7
#define IP_RF 0x8000
#define IP_ROUTER_ALERT 5
#define IP_TOS 1
#define IP_TRANSPARENT 19
#define IP_TTL 2
#define IP_UNBLOCK_SOURCE 37
#define IP_UNICAST_IF 50
#define IP_XFRM_POLICY 17
#define IQUERY ns_o_iquery
#define I_ATMARK (__SID |31)
#define I_CANPUT (__SID |34)
#define I_CKBAND (__SID |29)
#define I_FDINSERT (__SID |16)
#define I_FIND (__SID |11)
#define I_FLUSH (__SID | 5)
#define I_FLUSHBAND (__SID |28)
#define I_GETBAND (__SID |30)
#define I_GETCLTIME (__SID |33)
#define I_GETSIG (__SID |10)
#define I_GRDOPT (__SID | 7)
#define I_GWROPT (__SID |20)
#define I_LINK (__SID |12)
#define I_LIST (__SID |21)
#define I_LOOK (__SID | 4)
#define I_NREAD (__SID | 1)
#define I_PEEK (__SID |15)
#define I_PLINK (__SID |22)
#define I_POP (__SID | 3)
#define I_PUNLINK (__SID |23)
#define I_PUSH (__SID | 2)
#define I_RECVFD (__SID |14)
#define I_SENDFD (__SID |17)
#define I_SETCLTIME (__SID |32)
#define I_SETSIG (__SID | 9)
#define I_SRDOPT (__SID | 6)
#define I_STR (__SID | 8)
#define I_SWROPT (__SID |19)
#define I_UNLINK (__SID |13)
#define LASTMARK 0x02
#define LC_ALL 6
#define LC_ALL_MASK 0x7fffffff
#define LC_COLLATE 3
#define LC_COLLATE_MASK (1<<LC_COLLATE)
#define LC_CTYPE 0
#define LC_CTYPE_MASK (1<<LC_CTYPE)
#define LC_GLOBAL_LOCALE ((locale_t)-1)
#define LC_MESSAGES 5
#define LC_MESSAGES_MASK (1<<LC_MESSAGES)
#define LC_MONETARY 4
#define LC_MONETARY_MASK (1<<LC_MONETARY)
#define LC_NUMERIC 1
#define LC_NUMERIC_MASK (1<<LC_NUMERIC)
#define LC_TIME 2
#define LC_TIME_MASK (1<<LC_TIME)
#define LDBL_DECIMAL_DIG DECIMAL_DIG
#define LDBL_DIG 33
#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
#define LDBL_HAS_SUBNORM 1
#define LDBL_MANT_DIG 113
#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
#define LDBL_MAX_10_EXP 4932
#define LDBL_MAX_EXP 16384
#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MIN_EXP (-16381)
#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
#define LFLOW_OFF 0
#define LFLOW_ON 1
#define LFLOW_RESTART_ANY 2
#define LFLOW_RESTART_XON 3
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define LLONG_MAX 0x7fffffffffffffffLL
#define LLONG_MIN (-LLONG_MAX-1)
#define LM_FORWARDMASK 2
#define LM_MODE 1
#define LM_SLC 3
#define LNKTYPE '1'
#define LOCK_EX 2
#define LOCK_NB 4
#define LOCK_SH 1
#define LOCK_UN 8
#define LONGBITS (sizeof(long) * 8)
#define LONG_BIT 32
#define LONG_MAX __LONG_MAX
#define LONG_MIN (-LONG_MAX-1)
#define L_INCR 1
#define L_SET 0
#define L_XTND 2
#define L_ctermid 20
#define L_cuserid 20
#define MAGIC "070707"
#define MATH_ERREXCEPT 2
#define MATH_ERRNO 1
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MAXCDNAME NS_MAXCDNAME
#define MAXDNAME NS_MAXDNAME
#define MAXDOUBLE DBL_MAX
#define MAXFLOAT FLT_MAX
#define MAXHOSTNAMELEN 64
#define MAXINT INT_MAX
#define MAXLABEL NS_MAXLABEL
#define MAXLONG LONG_MAX
#define MAXNAMLEN 255
#define MAXPATHLEN 4096
#define MAXSHORT SHRT_MAX
#define MAXSYMLINKS 20
#define MAXTC 6
#define MAXTTL 255
#define MAX_IPOPTLEN 40
#define MB_CUR_MAX (__ctype_get_mb_cur_max())
#define MB_LEN_MAX 4
#define MCAST_BLOCK_SOURCE 43
#define MCAST_EXCLUDE 0
#define MCAST_INCLUDE 1
#define MCAST_JOIN_GROUP 42
#define MCAST_JOIN_SOURCE_GROUP 46
#define MCAST_LEAVE_GROUP 45
#define MCAST_LEAVE_SOURCE_GROUP 47
#define MCAST_MSFILTER 48
#define MCAST_UNBLOCK_SOURCE 44
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MINDOUBLE DBL_MIN
#define MINFLOAT FLT_MIN
#define MININT INT_MIN
#define MINLONG LONG_MIN
#define MINSHORT SHRT_MIN
#define MLD_LISTENER_QUERY 130
#define MLD_LISTENER_REDUCTION 132
#define MLD_LISTENER_REPORT 131
#define MM_APPL 8
#define MM_CONSOLE 512
#define MM_ERROR 2
#define MM_FIRM 4
#define MM_HALT 1
#define MM_HARD 1
#define MM_INFO 4
#define MM_NOCON 4
#define MM_NOMSG 1
#define MM_NOSEV 0
#define MM_NOTOK (-1)
#define MM_NRECOV 128
#define MM_NULLACT ((char*)0)
#define MM_NULLLBL ((char*)0)
#define MM_NULLMC 0L
#define MM_NULLSEV 0
#define MM_NULLTAG ((char*)0)
#define MM_NULLTXT ((char*)0)
#define MM_OK 0
#define MM_OPSYS 32
#define MM_PRINT 256
#define MM_RECOVER 64
#define MM_SOFT 2
#define MM_UTIL 16
#define MM_WARNING 3
#define MODE_ACK 0x04
#define MODE_B 2
#define MODE_C 3
#define MODE_ECHO 0x0200
#define MODE_EDIT 0x01
#define MODE_FLOW 0x0100
#define MODE_FORCE 0x1000
#define MODE_INBIN 0x0400
#define MODE_LIT_ECHO 0x10
#define MODE_MASK 0x1f
#define MODE_OUTBIN 0x0800
#define MODE_S 1
#define MODE_SOFT_TAB 0x08
#define MODE_TRAPSIG 0x02
#define MOD_CLKA ADJ_OFFSET_SINGLESHOT
#define MOD_CLKB ADJ_TICK
#define MOD_ESTERROR ADJ_ESTERROR
#define MOD_FREQUENCY ADJ_FREQUENCY
#define MOD_MAXERROR ADJ_MAXERROR
#define MOD_MICRO ADJ_MICRO
#define MOD_NANO ADJ_NANO
#define MOD_OFFSET ADJ_OFFSET
#define MOD_STATUS ADJ_STATUS
#define MOD_TAI ADJ_TAI
#define MOD_TIMECONST ADJ_TIMECONST
#define MON_1 0x2001A
#define MON_10 0x20023
#define MON_11 0x20024
#define MON_12 0x20025
#define MON_2 0x2001B
#define MON_3 0x2001C
#define MON_4 0x2001D
#define MON_5 0x2001E
#define MON_6 0x2001F
#define MON_7 0x20020
#define MON_8 0x20021
#define MON_9 0x20022
#define MORECTL 1
#define MOREDATA 2
#define MSG_ANY 0x02
#define MSG_BAND 0x04
#define MSG_HIPRI 0x01
#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
#define MSG_TRUNC __WASI_RIFLAGS_RECV_DATA_TRUNCATED
#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
#define MUXID_ALL (-1)
#define M_1_PI 0.31830988618379067154
#define M_2_PI 0.63661977236758134308
#define M_2_SQRTPI 1.12837916709551257390
#define M_E 2.7182818284590452354
#define M_LN10 2.30258509299404568402
#define M_LN2 0.69314718055994530942
#define M_LOG10E 0.43429448190325182765
#define M_LOG2E 1.4426950408889634074
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.78539816339744830962
#define M_SQRT1_2 0.70710678118654752440
#define M_SQRT2 1.41421356237309504880
#define NAMESERVER_PORT NS_DEFAULTPORT
#define NAME_MAX 255
#define NAN (0.0f/0.0f)
#define NBBY 8
#define NCARGS 131072
#define NDEBUG 1
#define ND_NA_FLAG_OVERRIDE 0x00000020
#define ND_NA_FLAG_ROUTER 0x00000080
#define ND_NA_FLAG_SOLICITED 0x00000040
#define ND_NEIGHBOR_ADVERT 136
#define ND_NEIGHBOR_SOLICIT 135
#define ND_OPT_HOME_AGENT_INFO 8
#define ND_OPT_MTU 5
#define ND_OPT_PI_FLAG_AUTO 0x40
#define ND_OPT_PI_FLAG_ONLINK 0x80
#define ND_OPT_PI_FLAG_RADDR 0x20
#define ND_OPT_PREFIX_INFORMATION 3
#define ND_OPT_REDIRECTED_HEADER 4
#define ND_OPT_RTR_ADV_INTERVAL 7
#define ND_OPT_SOURCE_LINKADDR 1
#define ND_OPT_TARGET_LINKADDR 2
#define ND_RA_FLAG_HOME_AGENT 0x20
#define ND_RA_FLAG_MANAGED 0x80
#define ND_RA_FLAG_OTHER 0x40
#define ND_REDIRECT 137
#define ND_ROUTER_ADVERT 134
#define ND_ROUTER_SOLICIT 133
#define NEW_ENV_VALUE 1
#define NEW_ENV_VAR 0
#define NGROUPS 32
#define NGROUPS_MAX 32
#define NL_ARGMAX 9
#define NL_CAT_LOCALE 1
#define NL_LANGMAX 32
#define NL_LOCALE_NAME(cat) _NL_LOCALE_NAME(cat)
#define NL_MSGMAX 32767
#define NL_NMAX 16
#define NL_SETD 1
#define NL_SETMAX 255
#define NL_TEXTMAX 2048
#define NOERROR ns_r_noerror
#define NOEXPR 0x50001
#define NOFILE 256
#define NOGROUP (-1)
#define NOP 241
#define NOSTR 0x50003
#define NOTAUTH ns_r_notauth
#define NOTIMP ns_r_notimpl
#define NOTZONE ns_r_notzone
#define NR_ICMP_TYPES 18
#define NR_ICMP_UNREACH 15
#define NSLC 18
#define NS_ALG_DH 2
#define NS_ALG_DSA 3
#define NS_ALG_DSS NS_ALG_DSA
#define NS_ALG_EXPIRE_ONLY 253
#define NS_ALG_MD5RSA 1
#define NS_ALG_PRIVATE_OID 254
#define NS_CMPRSFLGS 0xc0
#define NS_DEFAULTPORT 53
#define NS_DSA_MAX_BYTES 405
#define NS_DSA_MIN_SIZE 213
#define NS_DSA_SIG_SIZE 41
#define NS_GET16(s,cp) (void)((s) = ns_get16(((cp)+=2)-2))
#define NS_GET32(l,cp) (void)((l) = ns_get32(((cp)+=4)-4))
#define NS_HFIXEDSZ 12
#define NS_IN6ADDRSZ 16
#define NS_INADDRSZ 4
#define NS_INT16SZ 2
#define NS_INT32SZ 4
#define NS_INT8SZ 1
#define NS_KEY_EXTENDED_FLAGS 0x1000
#define NS_KEY_NAME_ENTITY 0x0200
#define NS_KEY_NAME_RESERVED 0x0300
#define NS_KEY_NAME_TYPE 0x0300
#define NS_KEY_NAME_USER 0x0000
#define NS_KEY_NAME_ZONE 0x0100
#define NS_KEY_NO_AUTH 0x8000
#define NS_KEY_NO_CONF 0x4000
#define NS_KEY_PROT_ANY 255
#define NS_KEY_PROT_DNSSEC 3
#define NS_KEY_PROT_EMAIL 2
#define NS_KEY_PROT_IPSEC 4
#define NS_KEY_PROT_TLS 1
#define NS_KEY_RESERVED10 0x0020
#define NS_KEY_RESERVED11 0x0010
#define NS_KEY_RESERVED2 0x2000
#define NS_KEY_RESERVED4 0x0800
#define NS_KEY_RESERVED5 0x0400
#define NS_KEY_RESERVED8 0x0080
#define NS_KEY_RESERVED9 0x0040
#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | NS_KEY_RESERVED4 | NS_KEY_RESERVED5 | NS_KEY_RESERVED8 | NS_KEY_RESERVED9 | NS_KEY_RESERVED10 | NS_KEY_RESERVED11 )
#define NS_KEY_RESERVED_BITMASK2 0xFFFF
#define NS_KEY_SIGNATORYMASK 0x000F
#define NS_KEY_TYPEMASK 0xC000
#define NS_KEY_TYPE_AUTH_CONF 0x0000
#define NS_KEY_TYPE_AUTH_ONLY 0x4000
#define NS_KEY_TYPE_CONF_ONLY 0x8000
#define NS_KEY_TYPE_NO_KEY 0xC000
#define NS_MAXCDNAME 255
#define NS_MAXDNAME 1025
#define NS_MAXLABEL 63
#define NS_MAXMSG 65535
#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
#define NS_MD5RSA_MAX_BITS 4096
#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
#define NS_MD5RSA_MIN_BITS 512
#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
#define NS_NOTIFY_OP ns_o_notify
#define NS_NXT_BITS 8
#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
#define NS_NXT_BIT_SET(n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
#define NS_NXT_MAX 127
#define NS_OPT_DNSSEC_OK 0x8000U
#define NS_OPT_NSID 3
#define NS_PACKETSZ 512
#define NS_PUT16(s,cp) ns_put16((s), ((cp)+=2)-2)
#define NS_PUT32(l,cp) ns_put32((l), ((cp)+=4)-4)
#define NS_QFIXEDSZ 4
#define NS_RRFIXEDSZ 10
#define NS_SIG_ALG 2
#define NS_SIG_EXPIR 8
#define NS_SIG_FOOT 16
#define NS_SIG_LABELS 3
#define NS_SIG_OTTL 4
#define NS_SIG_SIGNED 12
#define NS_SIG_SIGNER 18
#define NS_SIG_TYPE 0
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
#define NS_TSIG_ERROR_FORMERR -12
#define NS_TSIG_ERROR_NO_SPACE -11
#define NS_TSIG_ERROR_NO_TSIG -10
#define NS_TSIG_FUDGE 300
#define NS_TSIG_TCP_COUNT 100
#define NS_UPDATE_OP ns_o_update
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
#define NULL ((void*)0)
#define NXDOMAIN ns_r_nxdomain
#define NXRRSET ns_r_nxrrset
#define NZERO 20
#define OLD_ENV_VALUE 0
#define OLD_ENV_VAR 1
#define ONCE_FLAG_INIT 0
#define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH)
#define O_APPEND __WASI_FDFLAGS_APPEND
#define O_CLOEXEC (0)
#define O_CREAT (__WASI_OFLAGS_CREAT << 12)
#define O_DIRECTORY (__WASI_OFLAGS_DIRECTORY << 12)
#define O_DSYNC __WASI_FDFLAGS_DSYNC
#define O_EXCL (__WASI_OFLAGS_EXCL << 12)
#define O_EXEC (0x02000000)
#define O_NOCTTY (0)
#define O_NOFOLLOW (0x01000000)
#define O_NONBLOCK __WASI_FDFLAGS_NONBLOCK
#define O_RDONLY (0x04000000)
#define O_RDWR (O_RDONLY | O_WRONLY)
#define O_RSYNC __WASI_FDFLAGS_RSYNC
#define O_SEARCH (0x08000000)
#define O_SYNC __WASI_FDFLAGS_SYNC
#define O_TRUNC (__WASI_OFLAGS_TRUNC << 12)
#define O_TTY_INIT (0)
#define O_WRONLY (0x10000000)
#define PACKETSZ NS_PACKETSZ
#define PACKET_ADD_MEMBERSHIP 1
#define PACKET_AUXDATA 8
#define PACKET_BROADCAST 1
#define PACKET_COPY_THRESH 7
#define PACKET_DROP_MEMBERSHIP 2
#define PACKET_FANOUT 18
#define PACKET_FANOUT_DATA 22
#define PACKET_FASTROUTE 6
#define PACKET_HDRLEN 11
#define PACKET_HOST 0
#define PACKET_IGNORE_OUTGOING 23
#define PACKET_LOOPBACK 5
#define PACKET_LOSS 14
#define PACKET_MR_ALLMULTI 2
#define PACKET_MR_MULTICAST 0
#define PACKET_MR_PROMISC 1
#define PACKET_MR_UNICAST 3
#define PACKET_MULTICAST 2
#define PACKET_ORIGDEV 9
#define PACKET_OTHERHOST 3
#define PACKET_OUTGOING 4
#define PACKET_QDISC_BYPASS 20
#define PACKET_RECV_OUTPUT 3
#define PACKET_RESERVE 12
#define PACKET_ROLLOVER_STATS 21
#define PACKET_RX_RING 5
#define PACKET_STATISTICS 6
#define PACKET_TIMESTAMP 17
#define PACKET_TX_HAS_OFF 19
#define PACKET_TX_RING 13
#define PACKET_TX_TIMESTAMP 16
#define PACKET_VERSION 10
#define PACKET_VNET_HDR 15
#define PAGESIZE (0x10000)
#define PAGE_SIZE PAGESIZE
#define PATH_MAX 4096
#define PDP_ENDIAN __PDP_ENDIAN
#define PM_STR 0x20027
#define POLLERR 0x1000
#define POLLHUP 0x2000
#define POLLIN POLLRDNORM
#define POLLNVAL 0x4000
#define POLLOUT POLLWRNORM
#define POLLRDNORM 0x1
#define POLLWRNORM 0x2
#define POSIX_CLOSE_RESTART 0
#define POSIX_FADV_DONTNEED __WASI_ADVICE_DONTNEED
#define POSIX_FADV_NOREUSE __WASI_ADVICE_NOREUSE
#define POSIX_FADV_NORMAL __WASI_ADVICE_NORMAL
#define POSIX_FADV_RANDOM __WASI_ADVICE_RANDOM
#define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL
#define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED
#define PRELIM 1
#define PRIX16 __UINT16_FMTX__
#define PRIX32 __UINT32_FMTX__
#define PRIX64 __UINT64_FMTX__
#define PRIX8 __UINT8_FMTX__
#define PRIXFAST16 __UINT_FAST16_FMTX__
#define PRIXFAST32 __UINT_FAST32_FMTX__
#define PRIXFAST64 __UINT_FAST64_FMTX__
#define PRIXFAST8 __UINT_FAST8_FMTX__
#define PRIXLEAST16 __UINT_LEAST16_FMTX__
#define PRIXLEAST32 __UINT_LEAST32_FMTX__
#define PRIXLEAST64 __UINT_LEAST64_FMTX__
#define PRIXLEAST8 __UINT_LEAST8_FMTX__
#define PRIXMAX __UINTMAX_FMTX__
#define PRIXPTR __UINTPTR_FMTX__
#define PRId16 __INT16_FMTd__
#define PRId32 __INT32_FMTd__
#define PRId64 __INT64_FMTd__
#define PRId8 __INT8_FMTd__
#define PRIdFAST16 __INT_FAST16_FMTd__
#define PRIdFAST32 __INT_FAST32_FMTd__
#define PRIdFAST64 __INT_FAST64_FMTd__
#define PRIdFAST8 __INT_FAST8_FMTd__
#define PRIdLEAST16 __INT_LEAST16_FMTd__
#define PRIdLEAST32 __INT_LEAST32_FMTd__
#define PRIdLEAST64 __INT_LEAST64_FMTd__
#define PRIdLEAST8 __INT_LEAST8_FMTd__
#define PRIdMAX __INTMAX_FMTd__
#define PRIdPTR __INTPTR_FMTd__
#define PRIi16 __INT16_FMTi__
#define PRIi32 __INT32_FMTi__
#define PRIi64 __INT64_FMTi__
#define PRIi8 __INT8_FMTi__
#define PRIiFAST16 __INT_FAST16_FMTi__
#define PRIiFAST32 __INT_FAST32_FMTi__
#define PRIiFAST64 __INT_FAST64_FMTi__
#define PRIiFAST8 __INT_FAST8_FMTi__
#define PRIiLEAST16 __INT_LEAST16_FMTi__
#define PRIiLEAST32 __INT_LEAST32_FMTi__
#define PRIiLEAST64 __INT_LEAST64_FMTi__
#define PRIiLEAST8 __INT_LEAST8_FMTi__
#define PRIiMAX __INTMAX_FMTi__
#define PRIiPTR __INTPTR_FMTi__
#define PRIo16 __UINT16_FMTo__
#define PRIo32 __UINT32_FMTo__
#define PRIo64 __UINT64_FMTo__
#define PRIo8 __UINT8_FMTo__
#define PRIoFAST16 __UINT_FAST16_FMTo__
#define PRIoFAST32 __UINT_FAST32_FMTo__
#define PRIoFAST64 __UINT_FAST64_FMTo__
#define PRIoFAST8 __UINT_FAST8_FMTo__
#define PRIoLEAST16 __UINT_LEAST16_FMTo__
#define PRIoLEAST32 __UINT_LEAST32_FMTo__
#define PRIoLEAST64 __UINT_LEAST64_FMTo__
#define PRIoLEAST8 __UINT_LEAST8_FMTo__
#define PRIoMAX __UINTMAX_FMTo__
#define PRIoPTR __UINTPTR_FMTo__
#define PRIu16 __UINT16_FMTu__
#define PRIu32 __UINT32_FMTu__
#define PRIu64 __UINT64_FMTu__
#define PRIu8 __UINT8_FMTu__
#define PRIuFAST16 __UINT_FAST16_FMTu__
#define PRIuFAST32 __UINT_FAST32_FMTu__
#define PRIuFAST64 __UINT_FAST64_FMTu__
#define PRIuFAST8 __UINT_FAST8_FMTu__
#define PRIuLEAST16 __UINT_LEAST16_FMTu__
#define PRIuLEAST32 __UINT_LEAST32_FMTu__
#define PRIuLEAST64 __UINT_LEAST64_FMTu__
#define PRIuLEAST8 __UINT_LEAST8_FMTu__
#define PRIuMAX __UINTMAX_FMTu__
#define PRIuPTR __UINTPTR_FMTu__
#define PRIx16 __UINT16_FMTx__
#define PRIx32 __UINT32_FMTx__
#define PRIx64 __UINT64_FMTx__
#define PRIx8 __UINT8_FMTx__
#define PRIxFAST16 __UINT_FAST16_FMTx__
#define PRIxFAST32 __UINT_FAST32_FMTx__
#define PRIxFAST64 __UINT_FAST64_FMTx__
#define PRIxFAST8 __UINT_FAST8_FMTx__
#define PRIxLEAST16 __UINT_LEAST16_FMTx__
#define PRIxLEAST32 __UINT_LEAST32_FMTx__
#define PRIxLEAST64 __UINT_LEAST64_FMTx__
#define PRIxLEAST8 __UINT_LEAST8_FMTx__
#define PRIxMAX __UINTMAX_FMTx__
#define PRIxPTR __UINTPTR_FMTx__
#define PTRBITS (sizeof(char *) * 8)
#define PTRDIFF_MAX INT32_MAX
#define PTRDIFF_MIN INT32_MIN
#define PUTLONG NS_PUT32
#define PUTSHORT NS_PUT16
#define QFIXEDSZ NS_QFIXEDSZ
#define QUERY ns_o_query
#define RADIXCHAR 0x10000
#define RAND_MAX (0x7fffffff)
#define REC_EOF '\002'
#define REC_EOR '\001'
#define REC_ESC '\377'
#define REFUSED ns_r_refused
#define REGTYPE '0'
#define REG_BADBR 10
#define REG_BADPAT 2
#define REG_BADRPT 13
#define REG_EBRACE 9
#define REG_EBRACK 7
#define REG_ECOLLATE 3
#define REG_ECTYPE 4
#define REG_EESCAPE 5
#define REG_ENOSYS -1
#define REG_EPAREN 8
#define REG_ERANGE 11
#define REG_ESPACE 12
#define REG_ESUBREG 6
#define REG_EXTENDED 1
#define REG_ICASE 2
#define REG_NEWLINE 4
#define REG_NOMATCH 1
#define REG_NOSUB 8
#define REG_NOTBOL 1
#define REG_NOTEOL 2
#define REG_OK 0
#define RE_DUP_MAX 255
#define RMSGD 0x0001
#define RMSGN 0x0002
#define RNORM 0x0000
#define RPM_PCO_ADD 1
#define RPM_PCO_CHANGE 2
#define RPM_PCO_SETGLOBAL 3
#define RPROTDAT 0x0004
#define RPROTDIS 0x0008
#define RPROTMASK 0x001C
#define RPROTNORM 0x0010
#define RRFIXEDSZ NS_RRFIXEDSZ
#define RRQ 01
#define RS_HIPRI 0x01
#define RUSAGE_CHILDREN 2
#define RUSAGE_SELF 1
#define R_OK (4)
#define SARMAG 8
#define SB 250
#define SCHAR_MAX 127
#define SCHAR_MIN (-128)
#define SCNd16 __INT16_FMTd__
#define SCNd32 __INT32_FMTd__
#define SCNd64 __INT64_FMTd__
#define SCNd8 __INT8_FMTd__
#define SCNdFAST16 __INT_FAST16_FMTd__
#define SCNdFAST32 __INT_FAST32_FMTd__
#define SCNdFAST64 __INT_FAST64_FMTd__
#define SCNdFAST8 __INT_FAST8_FMTd__
#define SCNdLEAST16 __INT_LEAST16_FMTd__
#define SCNdLEAST32 __INT_LEAST32_FMTd__
#define SCNdLEAST64 __INT_LEAST64_FMTd__
#define SCNdLEAST8 __INT_LEAST8_FMTd__
#define SCNdMAX __INTMAX_FMTd__
#define SCNdPTR __INTPTR_FMTd__
#define SCNi16 __INT16_FMTi__
#define SCNi32 __INT32_FMTi__
#define SCNi64 __INT64_FMTi__
#define SCNi8 __INT8_FMTi__
#define SCNiFAST16 __INT_FAST16_FMTi__
#define SCNiFAST32 __INT_FAST32_FMTi__
#define SCNiFAST64 __INT_FAST64_FMTi__
#define SCNiFAST8 __INT_FAST8_FMTi__
#define SCNiLEAST16 __INT_LEAST16_FMTi__
#define SCNiLEAST32 __INT_LEAST32_FMTi__
#define SCNiLEAST64 __INT_LEAST64_FMTi__
#define SCNiLEAST8 __INT_LEAST8_FMTi__
#define SCNiMAX __INTMAX_FMTi__
#define SCNiPTR __INTPTR_FMTi__
#define SCNo16 __UINT16_FMTo__
#define SCNo32 __UINT32_FMTo__
#define SCNo64 __UINT64_FMTo__
#define SCNo8 __UINT8_FMTo__
#define SCNoFAST16 __UINT_FAST16_FMTo__
#define SCNoFAST32 __UINT_FAST32_FMTo__
#define SCNoFAST64 __UINT_FAST64_FMTo__
#define SCNoFAST8 __UINT_FAST8_FMTo__
#define SCNoLEAST16 __UINT_LEAST16_FMTo__
#define SCNoLEAST32 __UINT_LEAST32_FMTo__
#define SCNoLEAST64 __UINT_LEAST64_FMTo__
#define SCNoLEAST8 __UINT_LEAST8_FMTo__
#define SCNoMAX __UINTMAX_FMTo__
#define SCNoPTR __UINTPTR_FMTo__
#define SCNu16 __UINT16_FMTu__
#define SCNu32 __UINT32_FMTu__
#define SCNu64 __UINT64_FMTu__
#define SCNu8 __UINT8_FMTu__
#define SCNuFAST16 __UINT_FAST16_FMTu__
#define SCNuFAST32 __UINT_FAST32_FMTu__
#define SCNuFAST64 __UINT_FAST64_FMTu__
#define SCNuFAST8 __UINT_FAST8_FMTu__
#define SCNuLEAST16 __UINT_LEAST16_FMTu__
#define SCNuLEAST32 __UINT_LEAST32_FMTu__
#define SCNuLEAST64 __UINT_LEAST64_FMTu__
#define SCNuLEAST8 __UINT_LEAST8_FMTu__
#define SCNuMAX __UINTMAX_FMTu__
#define SCNuPTR __UINTPTR_FMTu__
#define SCNx16 __UINT16_FMTx__
#define SCNx32 __UINT32_FMTx__
#define SCNx64 __UINT64_FMTx__
#define SCNx8 __UINT8_FMTx__
#define SCNxFAST16 __UINT_FAST16_FMTx__
#define SCNxFAST32 __UINT_FAST32_FMTx__
#define SCNxFAST64 __UINT_FAST64_FMTx__
#define SCNxFAST8 __UINT_FAST8_FMTx__
#define SCNxLEAST16 __UINT_LEAST16_FMTx__
#define SCNxLEAST32 __UINT_LEAST32_FMTx__
#define SCNxLEAST64 __UINT_LEAST64_FMTx__
#define SCNxLEAST8 __UINT_LEAST8_FMTx__
#define SCNxMAX __UINTMAX_FMTx__
#define SCNxPTR __UINTPTR_FMTx__
#define SE 240
#define SEEK_CUR __WASI_WHENCE_CUR
#define SEEK_END __WASI_WHENCE_END
#define SEEK_SET __WASI_WHENCE_SET
#define SEGSIZE 512
#define SEM_FAILED ((sem_t *)0)
#define SERVFAIL ns_r_servfail
#define SHORTBITS (sizeof(short) * 8)
#define SHRT_MAX 0x7fff
#define SHRT_MIN (-1-0x7fff)
#define SHUT_RD __WASI_SDFLAGS_RD
#define SHUT_RDWR (SHUT_RD | SHUT_WR)
#define SHUT_WR __WASI_SDFLAGS_WR
#define SIG_ATOMIC_MAX INT32_MAX
#define SIG_ATOMIC_MIN INT32_MIN
#define SIZE_MAX UINT32_MAX
#define SI_LOAD_SHIFT 16
#define SLC_ABORT 7
#define SLC_ACK 0x80
#define SLC_AO 4
#define SLC_AYT 5
#define SLC_BRK 2
#define SLC_CANTCHANGE 1
#define SLC_DEFAULT 3
#define SLC_EC 10
#define SLC_EL 11
#define SLC_EOF 8
#define SLC_EOR 6
#define SLC_EW 12
#define SLC_FLAGS 1
#define SLC_FLUSHIN 0x40
#define SLC_FLUSHOUT 0x20
#define SLC_FORW1 17
#define SLC_FORW2 18
#define SLC_FUNC 0
#define SLC_IP 3
#define SLC_LEVELBITS 0x03
#define SLC_LNEXT 14
#define SLC_NAME(x) slc_names[x]
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
#define SLC_NAMES SLC_NAMELIST
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
#define SLC_NOSUPPORT 0
#define SLC_RP 13
#define SLC_SUSP 9
#define SLC_SYNCH 1
#define SLC_VALUE 2
#define SLC_VARIABLE 2
#define SLC_XOFF 16
#define SLC_XON 15
#define SNDPIPE 0x002
#define SNDZERO 0x001
#define SOCK_CLOEXEC (0x00002000)
#define SOCK_DGRAM __WASI_FILETYPE_SOCKET_DGRAM
#define SOCK_NONBLOCK (0x00004000)
#define SOCK_STREAM __WASI_FILETYPE_SOCKET_STREAM
#define SOL_SOCKET 0x7fffffff
#define SOL_TCP 6
#define SOL_UDP 17
#define SO_TYPE 3
#define SSIZE_MAX LONG_MAX
#define STATUS ns_o_status
#define STA_CLK 0x8000
#define STA_CLOCKERR 0x1000
#define STA_DEL 0x0020
#define STA_FLL 0x0008
#define STA_FREQHOLD 0x0080
#define STA_INS 0x0010
#define STA_MODE 0x4000
#define STA_NANO 0x2000
#define STA_PLL 0x0001
#define STA_PPSERROR 0x0800
#define STA_PPSFREQ 0x0002
#define STA_PPSJITTER 0x0200
#define STA_PPSSIGNAL 0x0100
#define STA_PPSTIME 0x0004
#define STA_PPSWANDER 0x0400
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
#define STA_UNSYNC 0x0040
#define STDERR_FILENO 2
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STRU_F 1
#define STRU_P 3
#define STRU_R 2
#define SUN_LEN(s) (2+strlen((s)->sun_path))
#define SUSP 237
#define SYMLOOP_MAX 40
#define SYMTYPE '2'
#define SYNCH 242
#define S_ADDT ns_s_ar
#define S_BANDURG 0x0200
#define S_ERROR 0x0010
#define S_HANGUP 0x0020
#define S_HIPRI 0x0002
#define S_IEXEC S_IXUSR
#define S_IFBLK (0x6000)
#define S_IFCHR (0x2000)
#define S_IFDIR (0x4000)
#define S_IFIFO (0xc000)
#define S_IFLNK (0xa000)
#define S_IFMT (S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK)
#define S_IFREG (0x8000)
#define S_IFSOCK (0xc000)
#define S_INPUT 0x0001
#define S_IREAD S_IRUSR
#define S_IRGRP (0x20)
#define S_IROTH (0x4)
#define S_IRUSR (0x100)
#define S_IRWXG (S_IXGRP | S_IWGRP | S_IRGRP)
#define S_IRWXO (S_IXOTH | S_IWOTH | S_IROTH)
#define S_IRWXU (S_IXUSR | S_IWUSR | S_IRUSR)
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
#define S_ISGID (0x400)
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
#define S_ISUID (0x800)
#define S_ISVTX (0x200)
#define S_IWGRP (0x10)
#define S_IWOTH (0x2)
#define S_IWRITE S_IWUSR
#define S_IWUSR (0x80)
#define S_IXGRP (0x8)
#define S_IXOTH (0x1)
#define S_IXUSR (0x40)
#define S_MSG 0x0008
#define S_OUTPUT 0x0004
#define S_PREREQ ns_s_pr
#define S_RDBAND 0x0080
#define S_RDNORM 0x0040
#define S_UPDATE ns_s_ud
#define S_WRBAND 0x0100
#define S_WRNORM S_OUTPUT
#define S_ZONE ns_s_zn
#define TCPI_OPT_ECN 8
#define TCPI_OPT_SACK 2
#define TCPI_OPT_TIMESTAMPS 1
#define TCPI_OPT_WSCALE 4
#define TCPOLEN_MAXSEG 4
#define TCPOLEN_SACK_PERMITTED 2
#define TCPOLEN_TIMESTAMP 10
#define TCPOLEN_WINDOW 3
#define TCPOPT_EOL 0
#define TCPOPT_MAXSEG 2
#define TCPOPT_NOP 1
#define TCPOPT_SACK 5
#define TCPOPT_SACK_PERMITTED 4
#define TCPOPT_TIMESTAMP 8
#define TCPOPT_WINDOW 3
#define TCP_CA_CWR 2
#define TCP_CA_Disorder 1
#define TCP_CA_Loss 4
#define TCP_CA_Open 0
#define TCP_CA_Recovery 3
#define TCP_CC_INFO 26
#define TCP_CLOSE 7
#define TCP_CLOSE_WAIT 8
#define TCP_CLOSING 11
#define TCP_CM_INQ TCP_INQ
#define TCP_CONGESTION 13
#define TCP_CORK 3
#define TCP_DEFER_ACCEPT 9
#define TCP_ENCAP_ESPINTCP 7
#define TCP_ESTABLISHED 1
#define TCP_FASTOPEN 23
#define TCP_FASTOPEN_CONNECT 30
#define TCP_FASTOPEN_KEY 33
#define TCP_FASTOPEN_NO_COOKIE 34
#define TCP_FIN_WAIT1 4
#define TCP_FIN_WAIT2 5
#define TCP_INFO 11
#define TCP_INQ 36
#define TCP_KEEPCNT 6
#define TCP_KEEPIDLE 4
#define TCP_KEEPINTVL 5
#define TCP_LAST_ACK 9
#define TCP_LINGER2 8
#define TCP_LISTEN 10
#define TCP_MAXSEG 2
#define TCP_MD5SIG 14
#define TCP_MD5SIG_EXT 32
#define TCP_MD5SIG_FLAG_IFINDEX 0x2
#define TCP_MD5SIG_FLAG_PREFIX 0x1
#define TCP_MD5SIG_MAXKEYLEN 80
#define TCP_NODELAY 1
#define TCP_NOTSENT_LOWAT 25
#define TCP_QUEUE_SEQ 21
#define TCP_QUICKACK 12
#define TCP_REPAIR 19
#define TCP_REPAIR_OFF 0
#define TCP_REPAIR_OFF_NO_WP -1
#define TCP_REPAIR_ON 1
#define TCP_REPAIR_OPTIONS 22
#define TCP_REPAIR_QUEUE 20
#define TCP_REPAIR_WINDOW 29
#define TCP_SAVED_SYN 28
#define TCP_SAVE_SYN 27
#define TCP_SYNCNT 7
#define TCP_SYN_RECV 3
#define TCP_SYN_SENT 2
#define TCP_THIN_DUPACK 17
#define TCP_THIN_LINEAR_TIMEOUTS 16
#define TCP_TIMESTAMP 24
#define TCP_TIME_WAIT 6
#define TCP_TX_DELAY 37
#define TCP_ULP 31
#define TCP_USER_TIMEOUT 18
#define TCP_WINDOW_CLAMP 10
#define TCP_ZEROCOPY_RECEIVE 35
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
#define TELCMD_FIRST xEOF
#define TELCMD_LAST IAC
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && (unsigned int)(x) >= TELCMD_FIRST)
#define TELOPT_3270REGIME 29
#define TELOPT_AUTHENTICATION 37
#define TELOPT_BINARY 0
#define TELOPT_BM 19
#define TELOPT_DET 20
#define TELOPT_ECHO 1
#define TELOPT_ENCRYPT 38
#define TELOPT_EOR 25
#define TELOPT_EXOPL 255
#define TELOPT_LFLOW 33
#define TELOPT_LINEMODE 34
#define TELOPT_LOGOUT 18
#define TELOPT_NAMS 4
#define TELOPT_NAOCRD 10
#define TELOPT_NAOFFD 13
#define TELOPT_NAOHTD 12
#define TELOPT_NAOHTS 11
#define TELOPT_NAOL 8
#define TELOPT_NAOLFD 16
#define TELOPT_NAOP 9
#define TELOPT_NAOVTD 15
#define TELOPT_NAOVTS 14
#define TELOPT_NAWS 31
#define TELOPT_NEW_ENVIRON 39
#define TELOPT_OLD_ENVIRON 36
#define TELOPT_OUTMRK 27
#define TELOPT_RCP 2
#define TELOPT_RCTE 7
#define TELOPT_SGA 3
#define TELOPT_SNDLOC 23
#define TELOPT_STATUS 5
#define TELOPT_SUPDUP 21
#define TELOPT_SUPDUPOUTPUT 22
#define TELOPT_TM 6
#define TELOPT_TSPEED 32
#define TELOPT_TTYLOC 28
#define TELOPT_TTYPE 24
#define TELOPT_TUID 26
#define TELOPT_X3PAD 30
#define TELOPT_XASCII 17
#define TELOPT_XDISPLOC 35
#define TELQUAL_INFO 2
#define TELQUAL_IS 0
#define TELQUAL_NAME 3
#define TELQUAL_REPLY 2
#define TELQUAL_SEND 1
#define TGEXEC 00010
#define TGREAD 00040
#define TGWRITE 00020
#define THOUSEP 0x10001
#define TH_ACK 0x10
#define TH_FIN 0x01
#define TH_PUSH 0x08
#define TH_RST 0x04
#define TH_SYN 0x02
#define TH_URG 0x20
#define TIMER_ABSTIME __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME
#define TIMESPEC_TO_TIMEVAL(tv,ts) ( (tv)->tv_sec = (ts)->tv_sec, (tv)->tv_usec = (ts)->tv_nsec / 1000, (void)0 )
#define TIMEVAL_TO_TIMESPEC(tv,ts) ( (ts)->tv_sec = (tv)->tv_sec, (ts)->tv_nsec = (tv)->tv_usec * 1000, (void)0 )
#define TIME_BAD TIME_ERROR
#define TIME_DEL 2
#define TIME_ERROR 5
#define TIME_INS 1
#define TIME_OK 0
#define TIME_OOP 3
#define TIME_UTC 1
#define TIME_WAIT 4
#define TMAGIC "ustar"
#define TMAGLEN 6
#define TOEXEC 00001
#define TOREAD 00004
#define TOWRITE 00002
#define TRANSIENT 4
#define TSGID 02000
#define TSS_DTOR_ITERATIONS 4
#define TSUID 04000
#define TSVTX 01000
#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
#define TTYDEF_SPEED (B9600)
#define TTY_NAME_MAX 32
#define TUEXEC 00100
#define TUREAD 00400
#define TUWRITE 00200
#define TVERSION "00"
#define TVERSLEN 2
#define TYPE_A 1
#define TYPE_E 2
#define TYPE_I 3
#define TYPE_L 4
#define TZNAME_MAX 6
#define T_A ns_t_a
#define T_A6 ns_t_a6
#define T_AAAA ns_t_aaaa
#define T_AFSDB ns_t_afsdb
#define T_ANY ns_t_any
#define T_ATMA ns_t_atma
#define T_AXFR ns_t_axfr
#define T_CNAME ns_t_cname
#define T_DNAME ns_t_dname
#define T_EID ns_t_eid
#define T_FMT 0x2002A
#define T_FMT_AMPM 0x2002B
#define T_GPOS ns_t_gpos
#define T_HINFO ns_t_hinfo
#define T_ISDN ns_t_isdn
#define T_IXFR ns_t_ixfr
#define T_KEY ns_t_key
#define T_LOC ns_t_loc
#define T_MAILA ns_t_maila
#define T_MAILB ns_t_mailb
#define T_MB ns_t_mb
#define T_MD ns_t_md
#define T_MF ns_t_mf
#define T_MG ns_t_mg
#define T_MINFO ns_t_minfo
#define T_MR ns_t_mr
#define T_MX ns_t_mx
#define T_NAPTR ns_t_naptr
#define T_NIMLOC ns_t_nimloc
#define T_NS ns_t_ns
#define T_NSAP ns_t_nsap
#define T_NSAP_PTR ns_t_nsap_ptr
#define T_NULL ns_t_null
#define T_NXT ns_t_nxt
#define T_PTR ns_t_ptr
#define T_PX ns_t_px
#define T_RP ns_t_rp
#define T_RT ns_t_rt
#define T_SIG ns_t_sig
#define T_SOA ns_t_soa
#define T_SRV ns_t_srv
#define T_TSIG ns_t_tsig
#define T_TXT ns_t_txt
#define T_WKS ns_t_wks
#define T_X25 ns_t_x25
#define UCHAR_MAX 255
#define UDP_CORK 1
#define UDP_ENCAP 100
#define UDP_ENCAP_ESPINUDP 2
#define UDP_ENCAP_ESPINUDP_NON_IKE 1
#define UDP_ENCAP_GTP0 4
#define UDP_ENCAP_GTP1U 5
#define UDP_ENCAP_L2TPINUDP 3
#define UDP_ENCAP_RXRPC 6
#define UDP_GRO 104
#define UDP_NO_CHECK6_RX 102
#define UDP_NO_CHECK6_TX 101
#define UDP_SEGMENT 103
#define UINT16_C(c) c
#define UINT16_MAX (0xffff)
#define UINT32_C(c) c ## U
#define UINT32_MAX (0xffffffffu)
#define UINT64_C(c) c ## ULL
#define UINT64_MAX (0xffffffffffffffffu)
#define UINT8_C(c) c
#define UINT8_MAX (0xff)
#define UINTMAX_C(c) c ## ULL
#define UINTMAX_MAX UINT64_MAX
#define UINTPTR_MAX UINT32_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_MAX 0xffffffffU
#define UIO_MAXIOV 1024
#define ULLONG_MAX (2ULL*LLONG_MAX+1)
#define ULONG_MAX (2UL*LONG_MAX+1)
#define USHRT_MAX 0xffff
#define UTIME_NOW (-1)
#define UTIME_OMIT (-2)
#define WCHAR_MAX (0x7fffffff+L'\0')
#define WCHAR_MIN (-1-0x7fffffff+L'\0')
#define WEOF 0xffffffffU
#define WILL 251
#define WINT_MAX UINT32_MAX
#define WINT_MIN 0U
#define WONT 252
#define WORD_BIT 32
#define WRQ 02
#define W_OK (2)
#define X_OK (1)
#define YESEXPR 0x50000
#define YESSTR 0x50002
#define YXDOMAIN ns_r_yxdomain
#define YXRRSET ns_r_yxrrset
#define _ALLOCA_H
#define _ALL_SOURCE 1
#define _ARPA_FTP_H
#define _ARPA_INET_H
#define _ARPA_NAMESER_H
#define _ARPA_TELNET_H
#define _ARPA_TFTP_H
#define _AR_H
#define _BYTESWAP_H
#define _COMPLEX_H
#define _CPIO_H
#define _CRYPT_H
#define _CS_GNU_LIBC_VERSION 2
#define _CS_GNU_LIBPTHREAD_VERSION 3
#define _CS_PATH 0
#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS 4
#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 1116
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 1117
#define _CS_POSIX_V6_ILP32_OFF32_LIBS 1118
#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS 1119
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 1120
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 1121
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 1122
#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS 1123
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 1124
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 1125
#define _CS_POSIX_V6_LP64_OFF64_LIBS 1126
#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS 1127
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 1128
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 1129
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 1130
#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS 1131
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 1132
#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 1133
#define _CS_POSIX_V7_ILP32_OFF32_LIBS 1134
#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS 1135
#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 1136
#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 1137
#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 1138
#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS 1139
#define _CS_POSIX_V7_LP64_OFF64_CFLAGS 1140
#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 1141
#define _CS_POSIX_V7_LP64_OFF64_LIBS 1142
#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS 1143
#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 1144
#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 1145
#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 1146
#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147
#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 5
#define _CS_V6_ENV 1148
#define _CS_V7_ENV 1149
#define _CTYPE_H
#define _Complex_I (0.0f+1.0fi)
#define _DIRENT_H
#define _DIRENT_HAVE_D_TYPE
#define _ENDIAN_H
#define _ERRNO_H
#define _ERR_H
#define _FCNTL_H
#define _FEATURES_H
#define _FENV_H
#define _FLOAT_H
#define _FMTMSG_H
#define _FNMATCH_H
#define _FTW_H
#define _GETOPT_H
#define _GLOB_H
#define _GNU_SOURCE 1
#define _ICONV_H
#define _IFADDRS_H
#define _ILP32 1
#define _INTTYPES_H
#define _IOFBF 0
#define _IOLBF 1
#define _IONBF 2
#define _ISO646_H
#define _LANGINFO_H
#define _LIBGEN_H
#define _LIMITS_H
#define _LOCALE_H
#define _MALLOC_H
#define _MATH_H
#define _MONETARY_H
#define _MQUEUE_H
#define _NETINET_ICMP6_H
#define _NETINET_IGMP_H
#define _NETINET_IN_H
#define _NETINET_IN_SYSTM_H
#define _NETINET_IP6_H
#define _NETINET_IP_H
#define _NETINET_IP_ICMP_H
#define _NETINET_TCP_H
#define _NETINET_UDP_H
#define _NETPACKET_PACKET_H
#define _NL_LOCALE_NAME(cat) (((cat)<<16) | 0xffff)
#define _NL_TYPES_H
#define _PC_2_SYMLINKS 20
#define _PC_ALLOC_SIZE_MIN 18
#define _PC_ASYNC_IO 10
#define _PC_CHOWN_RESTRICTED 6
#define _PC_FILESIZEBITS 13
#define _PC_LINK_MAX 0
#define _PC_MAX_CANON 1
#define _PC_MAX_INPUT 2
#define _PC_NAME_MAX 3
#define _PC_NO_TRUNC 7
#define _PC_PATH_MAX 4
#define _PC_PIPE_BUF 5
#define _PC_PRIO_IO 11
#define _PC_REC_INCR_XFER_SIZE 14
#define _PC_REC_MAX_XFER_SIZE 15
#define _PC_REC_MIN_XFER_SIZE 16
#define _PC_REC_XFER_ALIGN 17
#define _PC_SOCK_MAXBUF 12
#define _PC_SYMLINK_MAX 19
#define _PC_SYNC_IO 9
#define _PC_VDISABLE 8
#define _POLL_H
#define _POSIX2_BC_BASE_MAX 99
#define _POSIX2_BC_DIM_MAX 2048
#define _POSIX2_BC_SCALE_MAX 99
#define _POSIX2_BC_STRING_MAX 1000
#define _POSIX2_CHARCLASS_NAME_MAX 14
#define _POSIX2_COLL_WEIGHTS_MAX 2
#define _POSIX2_C_BIND _POSIX_VERSION
#define _POSIX2_EXPR_NEST_MAX 32
#define _POSIX2_LINE_MAX 2048
#define _POSIX2_RE_DUP_MAX 255
#define _POSIX2_VERSION _POSIX_VERSION
#define _POSIX_ADVISORY_INFO _POSIX_VERSION
#define _POSIX_AIO_LISTIO_MAX 2
#define _POSIX_AIO_MAX 1
#define _POSIX_ARG_MAX 4096
#define _POSIX_BARRIERS _POSIX_VERSION
#define _POSIX_CHILD_MAX 25
#define _POSIX_CHOWN_RESTRICTED 1
#define _POSIX_CLOCKRES_MIN 20000000
#define _POSIX_CLOCK_SELECTION _POSIX_VERSION
#define _POSIX_CPUTIME _POSIX_VERSION
#define _POSIX_DELAYTIMER_MAX 32
#define _POSIX_FSYNC _POSIX_VERSION
#define _POSIX_HOST_NAME_MAX 255
#define _POSIX_IPV6 _POSIX_VERSION
#define _POSIX_LINK_MAX 8
#define _POSIX_LOGIN_NAME_MAX 9
#define _POSIX_MAX_CANON 255
#define _POSIX_MAX_INPUT 255
#define _POSIX_MONOTONIC_CLOCK _POSIX_VERSION
#define _POSIX_MQ_OPEN_MAX 8
#define _POSIX_MQ_PRIO_MAX 32
#define _POSIX_NAME_MAX 14
#define _POSIX_NGROUPS_MAX 8
#define _POSIX_NO_TRUNC 1
#define _POSIX_OPEN_MAX 20
#define _POSIX_PATH_MAX 256
#define _POSIX_PIPE_BUF 512
#define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION
#define _POSIX_REALTIME_SIGNALS _POSIX_VERSION
#define _POSIX_REGEXP 1
#define _POSIX_RE_DUP_MAX 255
#define _POSIX_RTSIG_MAX 8
#define _POSIX_SEM_NSEMS_MAX 256
#define _POSIX_SEM_VALUE_MAX 32767
#define _POSIX_SIGQUEUE_MAX 32
#define _POSIX_SPIN_LOCKS _POSIX_VERSION
#define _POSIX_SSIZE_MAX 32767
#define _POSIX_SS_REPL_MAX 4
#define _POSIX_STREAM_MAX 8
#define _POSIX_SYMLINK_MAX 255
#define _POSIX_SYMLOOP_MAX 8
#define _POSIX_THREADS _POSIX_VERSION
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
#define _POSIX_THREAD_CPUTIME _POSIX_VERSION
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 128
#define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION
#define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION
#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
#define _POSIX_THREAD_THREADS_MAX 64
#define _POSIX_TIMEOUTS _POSIX_VERSION
#define _POSIX_TIMERS _POSIX_VERSION
#define _POSIX_TIMER_MAX 32
#define _POSIX_TRACE_EVENT_NAME_MAX 30
#define _POSIX_TRACE_NAME_MAX 8
#define _POSIX_TRACE_SYS_MAX 8
#define _POSIX_TRACE_USER_EVENT_MAX 32
#define _POSIX_TTY_NAME_MAX 9
#define _POSIX_TZNAME_MAX 6
#define _POSIX_V6_ILP32_OFFBIG (1)
#define _POSIX_V7_ILP32_OFFBIG (1)
#define _POSIX_VDISABLE 0
#define _POSIX_VERSION 200809L
#define _PTRDIFF_T
#define _REGEX_H
#define _SCHED_H
#define _SC_2_CHAR_TERM 95
#define _SC_2_C_BIND 47
#define _SC_2_C_DEV 48
#define _SC_2_FORT_DEV 49
#define _SC_2_FORT_RUN 50
#define _SC_2_LOCALEDEF 52
#define _SC_2_PBS 168
#define _SC_2_PBS_ACCOUNTING 169
#define _SC_2_PBS_CHECKPOINT 175
#define _SC_2_PBS_LOCATE 170
#define _SC_2_PBS_MESSAGE 171
#define _SC_2_PBS_TRACK 172
#define _SC_2_SW_DEV 51
#define _SC_2_UPE 97
#define _SC_2_VERSION 46
#define _SC_ADVISORY_INFO 132
#define _SC_AIO_LISTIO_MAX 23
#define _SC_AIO_MAX 24
#define _SC_AIO_PRIO_DELTA_MAX 25
#define _SC_ARG_MAX 0
#define _SC_ASYNCHRONOUS_IO 12
#define _SC_ATEXIT_MAX 87
#define _SC_AVPHYS_PAGES 86
#define _SC_BARRIERS 133
#define _SC_BC_BASE_MAX 36
#define _SC_BC_DIM_MAX 37
#define _SC_BC_SCALE_MAX 38
#define _SC_BC_STRING_MAX 39
#define _SC_CHILD_MAX 1
#define _SC_CLK_TCK 2
#define _SC_CLOCK_SELECTION 137
#define _SC_COLL_WEIGHTS_MAX 40
#define _SC_CPUTIME 138
#define _SC_DELAYTIMER_MAX 26
#define _SC_EXPR_NEST_MAX 42
#define _SC_FSYNC 15
#define _SC_GETGR_R_SIZE_MAX 69
#define _SC_GETPW_R_SIZE_MAX 70
#define _SC_HOST_NAME_MAX 180
#define _SC_IOV_MAX 60
#define _SC_IPV6 235
#define _SC_JOB_CONTROL 7
#define _SC_LINE_MAX 43
#define _SC_LOGIN_NAME_MAX 71
#define _SC_MAPPED_FILES 16
#define _SC_MEMLOCK 17
#define _SC_MEMLOCK_RANGE 18
#define _SC_MEMORY_PROTECTION 19
#define _SC_MESSAGE_PASSING 20
#define _SC_MONOTONIC_CLOCK 149
#define _SC_MQ_OPEN_MAX 27
#define _SC_MQ_PRIO_MAX 28
#define _SC_NGROUPS_MAX 3
#define _SC_NPROCESSORS_CONF 83
#define _SC_NPROCESSORS_ONLN 84
#define _SC_NZERO 109
#define _SC_OPEN_MAX 4
#define _SC_PAGESIZE 30
#define _SC_PAGE_SIZE 30
#define _SC_PASS_MAX 88
#define _SC_PHYS_PAGES 85
#define _SC_PRIORITIZED_IO 13
#define _SC_PRIORITY_SCHEDULING 10
#define _SC_RAW_SOCKETS 236
#define _SC_READER_WRITER_LOCKS 153
#define _SC_REALTIME_SIGNALS 9
#define _SC_REGEXP 155
#define _SC_RE_DUP_MAX 44
#define _SC_RTSIG_MAX 31
#define _SC_SAVED_IDS 8
#define _SC_SEMAPHORES 21
#define _SC_SEM_NSEMS_MAX 32
#define _SC_SEM_VALUE_MAX 33
#define _SC_SHARED_MEMORY_OBJECTS 22
#define _SC_SHELL 157
#define _SC_SIGQUEUE_MAX 34
#define _SC_SPAWN 159
#define _SC_SPIN_LOCKS 154
#define _SC_SPORADIC_SERVER 160
#define _SC_SS_REPL_MAX 241
#define _SC_STREAMS 174
#define _SC_STREAM_MAX 5
#define _SC_SYMLOOP_MAX 173
#define _SC_SYNCHRONIZED_IO 14
#define _SC_THREADS 67
#define _SC_THREAD_ATTR_STACKADDR 77
#define _SC_THREAD_ATTR_STACKSIZE 78
#define _SC_THREAD_CPUTIME 139
#define _SC_THREAD_DESTRUCTOR_ITERATIONS 73
#define _SC_THREAD_KEYS_MAX 74
#define _SC_THREAD_PRIORITY_SCHEDULING 79
#define _SC_THREAD_PRIO_INHERIT 80
#define _SC_THREAD_PRIO_PROTECT 81
#define _SC_THREAD_PROCESS_SHARED 82
#define _SC_THREAD_ROBUST_PRIO_INHERIT 247
#define _SC_THREAD_ROBUST_PRIO_PROTECT 248
#define _SC_THREAD_SAFE_FUNCTIONS 68
#define _SC_THREAD_SPORADIC_SERVER 161
#define _SC_THREAD_STACK_MIN 75
#define _SC_THREAD_THREADS_MAX 76
#define _SC_TIMEOUTS 164
#define _SC_TIMERS 11
#define _SC_TIMER_MAX 35
#define _SC_TRACE 181
#define _SC_TRACE_EVENT_FILTER 182
#define _SC_TRACE_EVENT_NAME_MAX 242
#define _SC_TRACE_INHERIT 183
#define _SC_TRACE_LOG 184
#define _SC_TRACE_NAME_MAX 243
#define _SC_TRACE_SYS_MAX 244
#define _SC_TRACE_USER_EVENT_MAX 245
#define _SC_TTY_NAME_MAX 72
#define _SC_TYPED_MEMORY_OBJECTS 165
#define _SC_TZNAME_MAX 6
#define _SC_UIO_MAXIOV 60
#define _SC_V6_ILP32_OFF32 176
#define _SC_V6_ILP32_OFFBIG 177
#define _SC_V6_LP64_OFF64 178
#define _SC_V6_LPBIG_OFFBIG 179
#define _SC_V7_ILP32_OFF32 237
#define _SC_V7_ILP32_OFFBIG 238
#define _SC_V7_LP64_OFF64 239
#define _SC_V7_LPBIG_OFFBIG 240
#define _SC_VERSION 29
#define _SC_XBS5_ILP32_OFF32 125
#define _SC_XBS5_ILP32_OFFBIG 126
#define _SC_XBS5_LP64_OFF64 127
#define _SC_XBS5_LPBIG_OFFBIG 128
#define _SC_XOPEN_CRYPT 92
#define _SC_XOPEN_ENH_I18N 93
#define _SC_XOPEN_LEGACY 129
#define _SC_XOPEN_REALTIME 130
#define _SC_XOPEN_REALTIME_THREADS 131
#define _SC_XOPEN_SHM 94
#define _SC_XOPEN_STREAMS 246
#define _SC_XOPEN_UNIX 91
#define _SC_XOPEN_VERSION 89
#define _SC_XOPEN_XCU_VERSION 90
#define _SC_XOPEN_XPG2 98
#define _SC_XOPEN_XPG3 99
#define _SC_XOPEN_XPG4 100
#define _SEARCH_H
#define _SEMAPHORE_H
#define _SIZE_T
#define _STDALIGN_H
#define _STDBOOL_H
#define _STDC_PREDEF_H
#define _STDINT_H
#define _STDIO_EXT_H
#define _STDIO_H
#define _STDLIB_H
#define _STDNORETURN_H
#define _STRINGS_H
#define _STRING_H
#define _STROPTS_H
#define _SYSEXITS_H
#define _SYS_EVENTFD_H
#define _SYS_FILE_H
#define _SYS_IOCTL_H
#define _SYS_PARAM_H
#define _SYS_RANDOM_H
#define _SYS_REG_H
#define _SYS_SELECT_H
#define _SYS_SOCKET_H
#define _SYS_STAT_H
#define _SYS_SYSCALL_H
#define _SYS_SYSINFO_H
#define _SYS_TIMEB_H
#define _SYS_TIMEX_H
#define _SYS_TIME_H
#define _SYS_TTYDEFAULTS_H
#define _SYS_TYPES_H
#define _SYS_UIO_H
#define _SYS_UN_H
#define _SYS_UTSNAME_H
#define _TAR_H
#define _TGMATH_H
#define _THREADS_H
#define _TIME_H
#define _UCHAR_H
#define _UNISTD_H
#define _UTIME_H
#define _VALUES_H
#define _VA_LIST
#define _WCHAR_H
#define _WCHAR_T
#define _WCTYPE_H
#define _WINT_T
#define _XOPEN_ENH_I18N 1
#define _XOPEN_IOV_MAX 16
#define _XOPEN_NAME_MAX 255
#define _XOPEN_PATH_MAX 1024
#define _XOPEN_UNIX 1
#define _XOPEN_VERSION 700
#define __ARE_4_EQUAL(a,b) (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) ))
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_CONSUME 1
#define __ATOMIC_RELAXED 0
#define __ATOMIC_RELEASE 3
#define __ATOMIC_SEQ_CST 5
#define __BIGGEST_ALIGNMENT__ 16
#define __BIG_ENDIAN 4321
#define __BIND 19950621
#define __BYTE_ORDER __BYTE_ORDER__
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __CHAR16_TYPE__ unsigned short
#define __CHAR32_TYPE__ unsigned int
#define __CHAR_BIT__ 8
#define __compiler_ATOMIC_BOOL_LOCK_FREE 2
#define __compiler_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __compiler_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __compiler_ATOMIC_CHAR_LOCK_FREE 2
#define __compiler_ATOMIC_INT_LOCK_FREE 2
#define __compiler_ATOMIC_LLONG_LOCK_FREE 2
#define __compiler_ATOMIC_LONG_LOCK_FREE 2
#define __compiler_ATOMIC_POINTER_LOCK_FREE 2
#define __compiler_ATOMIC_SHORT_LOCK_FREE 2
#define __compiler_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __CLANG_MAX_ALIGN_T_DEFINED
#define __CMPLX(x,y,t) (__builtin_complex((t)(x), (t)(y)))
#define __CONSTANT_CFSTRINGS__ 1
#define __DBLCX(x) (__IS_CX(x) && sizeof(x) == sizeof(double complex))
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_DIG__ 15
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
#define __DEFINED_FILE
#define __DEFINED___isoc_va_list
#define __DEFINED_blkcnt_t
#define __DEFINED_blksize_t
#define __DEFINED_clock_t
#define __DEFINED_clockid_t
#define __DEFINED_cnd_t
#define __DEFINED_dev_t
#define __DEFINED_double_t
#define __DEFINED_float_t
#define __DEFINED_fsblkcnt_t
#define __DEFINED_fsfilcnt_t
#define __DEFINED_gid_t
#define __DEFINED_id_t
#define __DEFINED_ino_t
#define __DEFINED_int16_t
#define __DEFINED_int32_t
#define __DEFINED_int64_t
#define __DEFINED_int8_t
#define __DEFINED_intmax_t
#define __DEFINED_intptr_t
#define __DEFINED_key_t
#define __DEFINED_locale_t
#define __DEFINED_mbstate_t
#define __DEFINED_mode_t
#define __DEFINED_mtx_t
#define __DEFINED_nlink_t
#define __DEFINED_off_t
#define __DEFINED_pid_t
#define __DEFINED_pthread_attr_t
#define __DEFINED_pthread_barrier_t
#define __DEFINED_pthread_barrierattr_t
#define __DEFINED_pthread_cond_t
#define __DEFINED_pthread_condattr_t
#define __DEFINED_pthread_key_t
#define __DEFINED_pthread_mutex_t
#define __DEFINED_pthread_mutexattr_t
#define __DEFINED_pthread_once_t
#define __DEFINED_pthread_rwlock_t
#define __DEFINED_pthread_rwlockattr_t
#define __DEFINED_pthread_spinlock_t
#define __DEFINED_pthread_t
#define __DEFINED_register_t
#define __DEFINED_regoff_t
#define __DEFINED_sa_family_t
#define __DEFINED_sigset_t
#define __DEFINED_size_t
#define __DEFINED_socklen_t
#define __DEFINED_ssize_t
#define __DEFINED_suseconds_t
#define __DEFINED_time_t
#define __DEFINED_timer_t
#define __DEFINED_u_int64_t
#define __DEFINED_uid_t
#define __DEFINED_uint16_t
#define __DEFINED_uint32_t
#define __DEFINED_uint64_t
#define __DEFINED_uint8_t
#define __DEFINED_uintmax_t
#define __DEFINED_uintptr_t
#define __DEFINED_useconds_t
#define __DEFINED_va_list
#define __DEFINED_wchar_t
#define __DEFINED_wctype_t
#define __DEFINED_wint_t
#define __FINITE_MATH_ONLY__ 0
#define __FLT(x) (__IS_REAL(x) && sizeof(x) == sizeof(float))
#define __FLTCX(x) (__IS_CX(x) && sizeof(x) == sizeof(float complex))
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_DIG__ 6
#define __FLT_EPSILON__ 1.19209290e-7F
#define __FLT_EVAL_METHOD__ 0
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MANT_DIG__ 24
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN__ 1.17549435e-38F
#define __FLT_RADIX__ 2
#define __compiler_ATOMIC_BOOL_LOCK_FREE 2
#define __compiler_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __compiler_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __compiler_ATOMIC_CHAR_LOCK_FREE 2
#define __compiler_ATOMIC_INT_LOCK_FREE 2
#define __compiler_ATOMIC_LLONG_LOCK_FREE 2
#define __compiler_ATOMIC_LONG_LOCK_FREE 2
#define __compiler_ATOMIC_POINTER_LOCK_FREE 2
#define __compiler_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __compiler_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GNUC_STDC_INLINE__ 1
#define __GNUC_VA_LIST 1
#define __GXX_ABI_VERSION 1002
#define __ILP32__ 1
#define __INT16_C_SUFFIX__
#define __INT16_FMTd__ "hd"
#define __INT16_FMTi__ "hi"
#define __INT16_MAX__ 32767
#define __INT16_TYPE__ short
#define __INT32_C_SUFFIX__
#define __INT32_FMTd__ "d"
#define __INT32_FMTi__ "i"
#define __INT32_MAX__ 2147483647
#define __INT32_TYPE__ int
#define __INT64_C_SUFFIX__ LL
#define __INT64_FMTd__ "lld"
#define __INT64_FMTi__ "lli"
#define __INT64_MAX__ 9223372036854775807LL
#define __INT64_TYPE__ long long int
#define __INT8_C_SUFFIX__
#define __INT8_FMTd__ "hhd"
#define __INT8_FMTi__ "hhi"
#define __INT8_MAX__ 127
#define __INT8_TYPE__ signed char
#define __INTMAX_C_SUFFIX__ LL
#define __INTMAX_FMTd__ "lld"
#define __INTMAX_FMTi__ "lli"
#define __INTMAX_MAX__ 9223372036854775807LL
#define __INTMAX_TYPE__ long long int
#define __INTMAX_WIDTH__ 64
#define __INTPTR_FMTd__ "ld"
#define __INTPTR_FMTi__ "li"
#define __INTPTR_MAX__ 2147483647L
#define __INTPTR_TYPE__ long int
#define __INTPTR_WIDTH__ 32
#define __INT_FAST16_FMTd__ "hd"
#define __INT_FAST16_FMTi__ "hi"
#define __INT_FAST16_MAX__ 32767
#define __INT_FAST16_TYPE__ short
#define __INT_FAST32_FMTd__ "d"
#define __INT_FAST32_FMTi__ "i"
#define __INT_FAST32_MAX__ 2147483647
#define __INT_FAST32_TYPE__ int
#define __INT_FAST64_FMTd__ "lld"
#define __INT_FAST64_FMTi__ "lli"
#define __INT_FAST64_MAX__ 9223372036854775807LL
#define __INT_FAST64_TYPE__ long long int
#define __INT_FAST8_FMTd__ "hhd"
#define __INT_FAST8_FMTi__ "hhi"
#define __INT_FAST8_MAX__ 127
#define __INT_FAST8_TYPE__ signed char
#define __INT_LEAST16_FMTd__ "hd"
#define __INT_LEAST16_FMTi__ "hi"
#define __INT_LEAST16_MAX__ 32767
#define __INT_LEAST16_TYPE__ short
#define __INT_LEAST32_FMTd__ "d"
#define __INT_LEAST32_FMTi__ "i"
#define __INT_LEAST32_MAX__ 2147483647
#define __INT_LEAST32_TYPE__ int
#define __INT_LEAST64_FMTd__ "lld"
#define __INT_LEAST64_FMTi__ "lli"
#define __INT_LEAST64_MAX__ 9223372036854775807LL
#define __INT_LEAST64_TYPE__ long long int
#define __INT_LEAST8_FMTd__ "hhd"
#define __INT_LEAST8_FMTi__ "hhi"
#define __INT_LEAST8_MAX__ 127
#define __INT_LEAST8_TYPE__ signed char
#define __INT_MAX__ 2147483647
#define __IS_CX(x) (__IS_FP(x) && sizeof(x) == sizeof((x)+I))
#define __IS_FP(x) (sizeof((x)+1ULL) == sizeof((x)+1.0f))
#define __IS_REAL(x) (__IS_FP(x) && 2*sizeof(x) == sizeof((x)+I))
#define __LDBL(x) (__IS_REAL(x) && sizeof(x) == sizeof(long double) && sizeof(long double) != sizeof(double))
#define __LDBLCX(x) (__IS_CX(x) && sizeof(x) == sizeof(long double complex) && sizeof(long double) != sizeof(double))
#define __LDBL_DECIMAL_DIG__ 36
#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
#define __LDBL_DIG__ 33
#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 113
#define __LDBL_MAX_10_EXP__ 4932
#define __LDBL_MAX_EXP__ 16384
#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
#define __LITTLE_ENDIAN 1234
#define __LITTLE_ENDIAN__ 1
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __LONG_MAX __LONG_MAX__
#define __LONG_MAX__ 2147483647L
#define __NAMESER 19991006
#define __NEED_FILE
#define __NEED___isoc_va_list
#define __NEED_blkcnt_t
#define __NEED_blksize_t
#define __NEED_clock_t
#define __NEED_clockid_t
#define __NEED_cnd_t
#define __NEED_dev_t
#define __NEED_double_t
#define __NEED_float_t
#define __NEED_fsblkcnt_t
#define __NEED_fsfilcnt_t
#define __NEED_gid_t
#define __NEED_id_t
#define __NEED_ino_t
#define __NEED_int16_t
#define __NEED_int32_t
#define __NEED_int64_t
#define __NEED_int8_t
#define __NEED_intmax_t
#define __NEED_intptr_t
#define __NEED_key_t
#define __NEED_locale_t
#define __NEED_mbstate_t
#define __NEED_mode_t
#define __NEED_mtx_t
#define __NEED_nlink_t
#define __NEED_off_t
#define __NEED_pid_t
#define __NEED_pthread_attr_t
#define __NEED_pthread_barrier_t
#define __NEED_pthread_barrierattr_t
#define __NEED_pthread_cond_t
#define __NEED_pthread_condattr_t
#define __NEED_pthread_key_t
#define __NEED_pthread_mutex_t
#define __NEED_pthread_mutexattr_t
#define __NEED_pthread_once_t
#define __NEED_pthread_rwlock_t
#define __NEED_pthread_rwlockattr_t
#define __NEED_pthread_spinlock_t
#define __NEED_pthread_t
#define __NEED_register_t
#define __NEED_regoff_t
#define __NEED_sa_family_t
#define __NEED_sigset_t
#define __NEED_size_t
#define __NEED_socklen_t
#define __NEED_ssize_t
#define __NEED_struct_iovec
#define __NEED_struct_timespec
#define __NEED_struct_timeval
#define __NEED_suseconds_t
#define __NEED_time_t
#define __NEED_timer_t
#define __NEED_u_int64_t
#define __NEED_uid_t
#define __NEED_uint16_t
#define __NEED_uint32_t
#define __NEED_uint64_t
#define __NEED_uint8_t
#define __NEED_uintmax_t
#define __NEED_uintptr_t
#define __NEED_useconds_t
#define __NEED_va_list
#define __NEED_wchar_t
#define __NEED_wctype_t
#define __NEED_wint_t
#define __OBJC_BOOL_IS_BOOL 0
#define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
#define __OPENCL_MEMORY_SCOPE_DEVICE 2
#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
#define __OPTIMIZE__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412
#define __PDP_ENDIAN 3412
#define __POINTER_WIDTH__ 32
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __PTRDIFF_FMTd__ "ld"
#define __PTRDIFF_FMTi__ "li"
#define __PTRDIFF_MAX__ 2147483647L
#define __PTRDIFF_TYPE__ long int
#define __PTRDIFF_WIDTH__ 32
#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
#define __RETCAST(x)
#define __RETCAST_2(x,y)
#define __RETCAST_3(x,y,z)
#define __RETCAST_CX(x)
#define __RETCAST_REAL(x)
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __SID ('S' << 8)
#define __SIG_ATOMIC_MAX__ 2147483647L
#define __SIG_ATOMIC_WIDTH__ 32
#define __SIZEOF_DOUBLE__ 8
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_INT128__ 16
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG_DOUBLE__ 16
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_LONG__ 4
#define __SIZEOF_POINTER__ 4
#define __SIZEOF_PTRDIFF_T__ 4
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_SIZE_T__ 4
#define __SIZEOF_WCHAR_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __SIZE_FMTX__ "lX"
#define __SIZE_FMTo__ "lo"
#define __SIZE_FMTu__ "lu"
#define __SIZE_FMTx__ "lx"
#define __SIZE_MAX__ 4294967295UL
#define __SIZE_TYPE__ long unsigned int
#define __SIZE_WIDTH__ 32
#define __STDARG_H
#define __STDC_HOSTED__ 1
#define __STDC_IEC_559__ 1
#define __STDC_ISO_10646__ 201206L
#define __STDC_UTF_16__ 1
#define __STDC_UTF_32__ 1
#define __STDC_VERSION__ 201710L
#define __STDC__ 1
#define __STDDEF_H
#define __UAPI_DEF_IN6_ADDR 0
#define __UAPI_DEF_IN6_ADDR_ALT 0
#define __UAPI_DEF_IN6_PKTINFO 0
#define __UAPI_DEF_IN_ADDR 0
#define __UAPI_DEF_IN_CLASS 0
#define __UAPI_DEF_IN_IPPROTO 0
#define __UAPI_DEF_IN_PKTINFO 0
#define __UAPI_DEF_IP6_MTUINFO 0
#define __UAPI_DEF_IPHDR 0
#define __UAPI_DEF_IPPROTO_V6 0
#define __UAPI_DEF_IPV6_MREQ 0
#define __UAPI_DEF_IPV6_OPTIONS 0
#define __UAPI_DEF_IP_MREQ 0
#define __UAPI_DEF_SOCKADDR_IN 0
#define __UAPI_DEF_SOCKADDR_IN6 0
#define __UINT16_C_SUFFIX__
#define __UINT16_FMTX__ "hX"
#define __UINT16_FMTo__ "ho"
#define __UINT16_FMTu__ "hu"
#define __UINT16_FMTx__ "hx"
#define __UINT16_MAX__ 65535
#define __UINT16_TYPE__ unsigned short
#define __UINT32_C_SUFFIX__ U
#define __UINT32_FMTX__ "X"
#define __UINT32_FMTo__ "o"
#define __UINT32_FMTu__ "u"
#define __UINT32_FMTx__ "x"
#define __UINT32_MAX__ 4294967295U
#define __UINT32_TYPE__ unsigned int
#define __UINT64_C_SUFFIX__ ULL
#define __UINT64_FMTX__ "llX"
#define __UINT64_FMTo__ "llo"
#define __UINT64_FMTu__ "llu"
#define __UINT64_FMTx__ "llx"
#define __UINT64_MAX__ 18446744073709551615ULL
#define __UINT64_TYPE__ long long unsigned int
#define __UINT8_C_SUFFIX__
#define __UINT8_FMTX__ "hhX"
#define __UINT8_FMTo__ "hho"
#define __UINT8_FMTu__ "hhu"
#define __UINT8_FMTx__ "hhx"
#define __UINT8_MAX__ 255
#define __UINT8_TYPE__ unsigned char
#define __UINTMAX_C_SUFFIX__ ULL
#define __UINTMAX_FMTX__ "llX"
#define __UINTMAX_FMTo__ "llo"
#define __UINTMAX_FMTu__ "llu"
#define __UINTMAX_FMTx__ "llx"
#define __UINTMAX_MAX__ 18446744073709551615ULL
#define __UINTMAX_TYPE__ long long unsigned int
#define __UINTMAX_WIDTH__ 64
#define __UINTPTR_FMTX__ "lX"
#define __UINTPTR_FMTo__ "lo"
#define __UINTPTR_FMTu__ "lu"
#define __UINTPTR_FMTx__ "lx"
#define __UINTPTR_MAX__ 4294967295UL
#define __UINTPTR_TYPE__ long unsigned int
#define __UINTPTR_WIDTH__ 32
#define __UINT_FAST16_FMTX__ "hX"
#define __UINT_FAST16_FMTo__ "ho"
#define __UINT_FAST16_FMTu__ "hu"
#define __UINT_FAST16_FMTx__ "hx"
#define __UINT_FAST16_MAX__ 65535
#define __UINT_FAST16_TYPE__ unsigned short
#define __UINT_FAST32_FMTX__ "X"
#define __UINT_FAST32_FMTo__ "o"
#define __UINT_FAST32_FMTu__ "u"
#define __UINT_FAST32_FMTx__ "x"
#define __UINT_FAST32_MAX__ 4294967295U
#define __UINT_FAST32_TYPE__ unsigned int
#define __UINT_FAST64_FMTX__ "llX"
#define __UINT_FAST64_FMTo__ "llo"
#define __UINT_FAST64_FMTu__ "llu"
#define __UINT_FAST64_FMTx__ "llx"
#define __UINT_FAST64_MAX__ 18446744073709551615ULL
#define __UINT_FAST64_TYPE__ long long unsigned int
#define __UINT_FAST8_FMTX__ "hhX"
#define __UINT_FAST8_FMTo__ "hho"
#define __UINT_FAST8_FMTu__ "hhu"
#define __UINT_FAST8_FMTx__ "hhx"
#define __UINT_FAST8_MAX__ 255
#define __UINT_FAST8_TYPE__ unsigned char
#define __UINT_LEAST16_FMTX__ "hX"
#define __UINT_LEAST16_FMTo__ "ho"
#define __UINT_LEAST16_FMTu__ "hu"
#define __UINT_LEAST16_FMTx__ "hx"
#define __UINT_LEAST16_MAX__ 65535
#define __UINT_LEAST16_TYPE__ unsigned short
#define __UINT_LEAST32_FMTX__ "X"
#define __UINT_LEAST32_FMTo__ "o"
#define __UINT_LEAST32_FMTu__ "u"
#define __UINT_LEAST32_FMTx__ "x"
#define __UINT_LEAST32_MAX__ 4294967295U
#define __UINT_LEAST32_TYPE__ unsigned int
#define __UINT_LEAST64_FMTX__ "llX"
#define __UINT_LEAST64_FMTo__ "llo"
#define __UINT_LEAST64_FMTu__ "llu"
#define __UINT_LEAST64_FMTx__ "llx"
#define __UINT_LEAST64_MAX__ 18446744073709551615ULL
#define __UINT_LEAST64_TYPE__ long long unsigned int
#define __UINT_LEAST8_FMTX__ "hhX"
#define __UINT_LEAST8_FMTo__ "hho"
#define __UINT_LEAST8_FMTu__ "hhu"
#define __UINT_LEAST8_FMTx__ "hhx"
#define __UINT_LEAST8_MAX__ 255
#define __UINT_LEAST8_TYPE__ unsigned char
#define __USER_LABEL_PREFIX__
#define __USE_TIME_BITS64 1
#define __WASI_ADVICE_DONTNEED (UINT8_C(4))
#define __WASI_ADVICE_NOREUSE (UINT8_C(5))
#define __WASI_ADVICE_NORMAL (UINT8_C(0))
#define __WASI_ADVICE_RANDOM (UINT8_C(2))
#define __WASI_ADVICE_SEQUENTIAL (UINT8_C(1))
#define __WASI_ADVICE_WILLNEED (UINT8_C(3))
#define __WASI_CLOCKID_MONOTONIC (UINT32_C(1))
#define __WASI_CLOCKID_PROCESS_CPUTIME_ID (UINT32_C(2))
#define __WASI_CLOCKID_REALTIME (UINT32_C(0))
#define __WASI_CLOCKID_THREAD_CPUTIME_ID (UINT32_C(3))
#define __WASI_DIRCOOKIE_START (UINT64_C(0))
#define __WASI_ERRNO_2BIG (UINT16_C(1))
#define __WASI_ERRNO_ACCES (UINT16_C(2))
#define __WASI_ERRNO_ADDRINUSE (UINT16_C(3))
#define __WASI_ERRNO_ADDRNOTAVAIL (UINT16_C(4))
#define __WASI_ERRNO_AFNOSUPPORT (UINT16_C(5))
#define __WASI_ERRNO_AGAIN (UINT16_C(6))
#define __WASI_ERRNO_ALREADY (UINT16_C(7))
#define __WASI_ERRNO_BADF (UINT16_C(8))
#define __WASI_ERRNO_BADMSG (UINT16_C(9))
#define __WASI_ERRNO_BUSY (UINT16_C(10))
#define __WASI_ERRNO_CANCELED (UINT16_C(11))
#define __WASI_ERRNO_CHILD (UINT16_C(12))
#define __WASI_ERRNO_CONNABORTED (UINT16_C(13))
#define __WASI_ERRNO_CONNREFUSED (UINT16_C(14))
#define __WASI_ERRNO_CONNRESET (UINT16_C(15))
#define __WASI_ERRNO_DEADLK (UINT16_C(16))
#define __WASI_ERRNO_DESTADDRREQ (UINT16_C(17))
#define __WASI_ERRNO_DOM (UINT16_C(18))
#define __WASI_ERRNO_DQUOT (UINT16_C(19))
#define __WASI_ERRNO_EXIST (UINT16_C(20))
#define __WASI_ERRNO_FAULT (UINT16_C(21))
#define __WASI_ERRNO_FBIG (UINT16_C(22))
#define __WASI_ERRNO_HOSTUNREACH (UINT16_C(23))
#define __WASI_ERRNO_IDRM (UINT16_C(24))
#define __WASI_ERRNO_ILSEQ (UINT16_C(25))
#define __WASI_ERRNO_INPROGRESS (UINT16_C(26))
#define __WASI_ERRNO_INTR (UINT16_C(27))
#define __WASI_ERRNO_INVAL (UINT16_C(28))
#define __WASI_ERRNO_IO (UINT16_C(29))
#define __WASI_ERRNO_ISCONN (UINT16_C(30))
#define __WASI_ERRNO_ISDIR (UINT16_C(31))
#define __WASI_ERRNO_LOOP (UINT16_C(32))
#define __WASI_ERRNO_MFILE (UINT16_C(33))
#define __WASI_ERRNO_MLINK (UINT16_C(34))
#define __WASI_ERRNO_MSGSIZE (UINT16_C(35))
#define __WASI_ERRNO_MULTIHOP (UINT16_C(36))
#define __WASI_ERRNO_NAMETOOLONG (UINT16_C(37))
#define __WASI_ERRNO_NETDOWN (UINT16_C(38))
#define __WASI_ERRNO_NETRESET (UINT16_C(39))
#define __WASI_ERRNO_NETUNREACH (UINT16_C(40))
#define __WASI_ERRNO_NFILE (UINT16_C(41))
#define __WASI_ERRNO_NOBUFS (UINT16_C(42))
#define __WASI_ERRNO_NODEV (UINT16_C(43))
#define __WASI_ERRNO_NOENT (UINT16_C(44))
#define __WASI_ERRNO_NOEXEC (UINT16_C(45))
#define __WASI_ERRNO_NOLCK (UINT16_C(46))
#define __WASI_ERRNO_NOLINK (UINT16_C(47))
#define __WASI_ERRNO_NOMEM (UINT16_C(48))
#define __WASI_ERRNO_NOMSG (UINT16_C(49))
#define __WASI_ERRNO_NOPROTOOPT (UINT16_C(50))
#define __WASI_ERRNO_NOSPC (UINT16_C(51))
#define __WASI_ERRNO_NOSYS (UINT16_C(52))
#define __WASI_ERRNO_NOTCAPABLE (UINT16_C(76))
#define __WASI_ERRNO_NOTCONN (UINT16_C(53))
#define __WASI_ERRNO_NOTDIR (UINT16_C(54))
#define __WASI_ERRNO_NOTEMPTY (UINT16_C(55))
#define __WASI_ERRNO_NOTRECOVERABLE (UINT16_C(56))
#define __WASI_ERRNO_NOTSOCK (UINT16_C(57))
#define __WASI_ERRNO_NOTSUP (UINT16_C(58))
#define __WASI_ERRNO_NOTTY (UINT16_C(59))
#define __WASI_ERRNO_NXIO (UINT16_C(60))
#define __WASI_ERRNO_OVERFLOW (UINT16_C(61))
#define __WASI_ERRNO_OWNERDEAD (UINT16_C(62))
#define __WASI_ERRNO_PERM (UINT16_C(63))
#define __WASI_ERRNO_PIPE (UINT16_C(64))
#define __WASI_ERRNO_PROTO (UINT16_C(65))
#define __WASI_ERRNO_PROTONOSUPPORT (UINT16_C(66))
#define __WASI_ERRNO_PROTOTYPE (UINT16_C(67))
#define __WASI_ERRNO_RANGE (UINT16_C(68))
#define __WASI_ERRNO_ROFS (UINT16_C(69))
#define __WASI_ERRNO_SPIPE (UINT16_C(70))
#define __WASI_ERRNO_SRCH (UINT16_C(71))
#define __WASI_ERRNO_STALE (UINT16_C(72))
#define __WASI_ERRNO_SUCCESS (UINT16_C(0))
#define __WASI_ERRNO_TIMEDOUT (UINT16_C(73))
#define __WASI_ERRNO_TXTBSY (UINT16_C(74))
#define __WASI_ERRNO_XDEV (UINT16_C(75))
#define __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP ((__wasi_eventrwflags_t)(1 << 0))
#define __WASI_EVENTTYPE_CLOCK (UINT8_C(0))
#define __WASI_EVENTTYPE_FD_READ (UINT8_C(1))
#define __WASI_EVENTTYPE_FD_WRITE (UINT8_C(2))
#define __WASI_FDFLAGS_APPEND ((__wasi_fdflags_t)(1 << 0))
#define __WASI_FDFLAGS_DSYNC ((__wasi_fdflags_t)(1 << 1))
#define __WASI_FDFLAGS_NONBLOCK ((__wasi_fdflags_t)(1 << 2))
#define __WASI_FDFLAGS_RSYNC ((__wasi_fdflags_t)(1 << 3))
#define __WASI_FDFLAGS_SYNC ((__wasi_fdflags_t)(1 << 4))
#define __WASI_FILETYPE_BLOCK_DEVICE (UINT8_C(1))
#define __WASI_FILETYPE_CHARACTER_DEVICE (UINT8_C(2))
#define __WASI_FILETYPE_DIRECTORY (UINT8_C(3))
#define __WASI_FILETYPE_REGULAR_FILE (UINT8_C(4))
#define __WASI_FILETYPE_SOCKET_DGRAM (UINT8_C(5))
#define __WASI_FILETYPE_SOCKET_STREAM (UINT8_C(6))
#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
#define __WASI_FILETYPE_UNKNOWN (UINT8_C(0))
#define __WASI_FSTFLAGS_ATIM ((__wasi_fstflags_t)(1 << 0))
#define __WASI_FSTFLAGS_ATIM_NOW ((__wasi_fstflags_t)(1 << 1))
#define __WASI_FSTFLAGS_MTIM ((__wasi_fstflags_t)(1 << 2))
#define __WASI_FSTFLAGS_MTIM_NOW ((__wasi_fstflags_t)(1 << 3))
#define __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW ((__wasi_lookupflags_t)(1 << 0))
#define __WASI_OFLAGS_CREAT ((__wasi_oflags_t)(1 << 0))
#define __WASI_OFLAGS_DIRECTORY ((__wasi_oflags_t)(1 << 1))
#define __WASI_OFLAGS_EXCL ((__wasi_oflags_t)(1 << 2))
#define __WASI_OFLAGS_TRUNC ((__wasi_oflags_t)(1 << 3))
#define __WASI_PREOPENTYPE_DIR (UINT8_C(0))
#define __WASI_RIFLAGS_RECV_PEEK ((__wasi_riflags_t)(1 << 0))
#define __WASI_RIFLAGS_RECV_WAITALL ((__wasi_riflags_t)(1 << 1))
#define __WASI_RIGHTS_FD_ADVISE ((__wasi_rights_t)(1 << 7))
#define __WASI_RIGHTS_FD_ALLOCATE ((__wasi_rights_t)(1 << 8))
#define __WASI_RIGHTS_FD_DATASYNC ((__wasi_rights_t)(1 << 0))
#define __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS ((__wasi_rights_t)(1 << 3))
#define __WASI_RIGHTS_FD_FILESTAT_GET ((__wasi_rights_t)(1 << 21))
#define __WASI_RIGHTS_FD_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 22))
#define __WASI_RIGHTS_FD_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 23))
#define __WASI_RIGHTS_FD_READ ((__wasi_rights_t)(1 << 1))
#define __WASI_RIGHTS_FD_READDIR ((__wasi_rights_t)(1 << 14))
#define __WASI_RIGHTS_FD_SEEK ((__wasi_rights_t)(1 << 2))
#define __WASI_RIGHTS_FD_SYNC ((__wasi_rights_t)(1 << 4))
#define __WASI_RIGHTS_FD_TELL ((__wasi_rights_t)(1 << 5))
#define __WASI_RIGHTS_FD_WRITE ((__wasi_rights_t)(1 << 6))
#define __WASI_RIGHTS_PATH_CREATE_DIRECTORY ((__wasi_rights_t)(1 << 9))
#define __WASI_RIGHTS_PATH_CREATE_FILE ((__wasi_rights_t)(1 << 10))
#define __WASI_RIGHTS_PATH_FILESTAT_GET ((__wasi_rights_t)(1 << 18))
#define __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 19))
#define __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 20))
#define __WASI_RIGHTS_PATH_LINK_SOURCE ((__wasi_rights_t)(1 << 11))
#define __WASI_RIGHTS_PATH_LINK_TARGET ((__wasi_rights_t)(1 << 12))
#define __WASI_RIGHTS_PATH_OPEN ((__wasi_rights_t)(1 << 13))
#define __WASI_RIGHTS_PATH_READLINK ((__wasi_rights_t)(1 << 15))
#define __WASI_RIGHTS_PATH_REMOVE_DIRECTORY ((__wasi_rights_t)(1 << 25))
#define __WASI_RIGHTS_PATH_RENAME_SOURCE ((__wasi_rights_t)(1 << 16))
#define __WASI_RIGHTS_PATH_RENAME_TARGET ((__wasi_rights_t)(1 << 17))
#define __WASI_RIGHTS_PATH_SYMLINK ((__wasi_rights_t)(1 << 24))
#define __WASI_RIGHTS_PATH_UNLINK_FILE ((__wasi_rights_t)(1 << 26))
#define __WASI_RIGHTS_POLL_FD_READWRITE ((__wasi_rights_t)(1 << 27))
#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
#define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
#define __WASI_SIGNAL_ABRT (UINT8_C(6))
#define __WASI_SIGNAL_ALRM (UINT8_C(14))
#define __WASI_SIGNAL_BUS (UINT8_C(7))
#define __WASI_SIGNAL_CHLD (UINT8_C(16))
#define __WASI_SIGNAL_CONT (UINT8_C(17))
#define __WASI_SIGNAL_FPE (UINT8_C(8))
#define __WASI_SIGNAL_HUP (UINT8_C(1))
#define __WASI_SIGNAL_ILL (UINT8_C(4))
#define __WASI_SIGNAL_INT (UINT8_C(2))
#define __WASI_SIGNAL_KILL (UINT8_C(9))
#define __WASI_SIGNAL_NONE (UINT8_C(0))
#define __WASI_SIGNAL_PIPE (UINT8_C(13))
#define __WASI_SIGNAL_POLL (UINT8_C(28))
#define __WASI_SIGNAL_PROF (UINT8_C(26))
#define __WASI_SIGNAL_PWR (UINT8_C(29))
#define __WASI_SIGNAL_QUIT (UINT8_C(3))
#define __WASI_SIGNAL_SEGV (UINT8_C(11))
#define __WASI_SIGNAL_STOP (UINT8_C(18))
#define __WASI_SIGNAL_SYS (UINT8_C(30))
#define __WASI_SIGNAL_TERM (UINT8_C(15))
#define __WASI_SIGNAL_TRAP (UINT8_C(5))
#define __WASI_SIGNAL_TSTP (UINT8_C(19))
#define __WASI_SIGNAL_TTIN (UINT8_C(20))
#define __WASI_SIGNAL_TTOU (UINT8_C(21))
#define __WASI_SIGNAL_URG (UINT8_C(22))
#define __WASI_SIGNAL_USR1 (UINT8_C(10))
#define __WASI_SIGNAL_USR2 (UINT8_C(12))
#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
#define __WASI_SIGNAL_WINCH (UINT8_C(27))
#define __WASI_SIGNAL_XCPU (UINT8_C(23))
#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
#define __WASI_WHENCE_CUR (UINT8_C(1))
#define __WASI_WHENCE_END (UINT8_C(2))
#define __WASI_WHENCE_SET (UINT8_C(0))
#define __WCHAR_MAX__ 2147483647
#define __WCHAR_TYPE__ int
#define __WCHAR_WIDTH__ 32
#define __WINT_MAX__ 2147483647
#define __WINT_TYPE__ int
#define __WINT_WIDTH__ 32
#define __WORDSIZE 64
#define __alignas_is_defined 1
#define __alignof_is_defined 1
#define __bitop(x,i,o) ((x)[(i)/8] o (1<<(i)%8))
#define __bool_true_false_are_defined 1
#define __inline inline
#define __restrict restrict
#define __tg_complex(fun,x) (__RETCAST_CX(x)( __FLTCX((x)+I) && __IS_FP(x) ? fun ## f (x) : __LDBLCX((x)+I) ? fun ## l (x) : fun(x) ))
#define __tg_complex_retreal(fun,x) (__RETCAST_REAL(x)( __FLTCX((x)+I) && __IS_FP(x) ? fun ## f (x) : __LDBLCX((x)+I) ? fun ## l (x) : fun(x) ))
#define __tg_real(fun,x) (__RETCAST(x)__tg_real_nocast(fun, x))
#define __tg_real_2(fun,x,y) (__RETCAST_2(x, y)( __FLT(x) && __FLT(y) ? fun ## f (x, y) : __LDBL((x)+(y)) ? fun ## l (x, y) : fun(x, y) ))
#define __tg_real_2_1(fun,x,y) (__RETCAST(x)( __FLT(x) ? fun ## f (x, y) : __LDBL(x) ? fun ## l (x, y) : fun(x, y) ))
#define __tg_real_complex(fun,x) (__RETCAST(x)( __FLTCX(x) ? c ## fun ## f (x) : __DBLCX(x) ? c ## fun (x) : __LDBLCX(x) ? c ## fun ## l (x) : __FLT(x) ? fun ## f (x) : __LDBL(x) ? fun ## l (x) : fun(x) ))
#define __tg_real_complex_fabs(x) (__RETCAST_REAL(x)( __FLTCX(x) ? cabsf(x) : __DBLCX(x) ? cabs(x) : __LDBLCX(x) ? cabsl(x) : __FLT(x) ? fabsf(x) : __LDBL(x) ? fabsl(x) : fabs(x) ))
#define __tg_real_complex_pow(x,y) (__RETCAST_2(x, y)( __FLTCX((x)+(y)) && __IS_FP(x) && __IS_FP(y) ? cpowf(x, y) : __FLTCX((x)+(y)) ? cpow(x, y) : __DBLCX((x)+(y)) ? cpow(x, y) : __LDBLCX((x)+(y)) ? cpowl(x, y) : __FLT(x) && __FLT(y) ? powf(x, y) : __LDBL((x)+(y)) ? powl(x, y) : pow(x, y) ))
#define __tg_real_fma(x,y,z) (__RETCAST_3(x, y, z)( __FLT(x) && __FLT(y) && __FLT(z) ? fmaf(x, y, z) : __LDBL((x)+(y)+(z)) ? fmal(x, y, z) : fma(x, y, z) ))
#define __tg_real_nocast(fun,x) ( __FLT(x) ? fun ## f (x) : __LDBL(x) ? fun ## l (x) : fun(x) )
#define __tg_real_remquo(x,y,z) (__RETCAST_2(x, y)( __FLT(x) && __FLT(y) ? remquof(x, y, z) : __LDBL((x)+(y)) ? remquol(x, y, z) : remquo(x, y, z) ))
#define __tm_gmtoff tm_gmtoff
#define __tm_zone tm_zone
#define __va_copy(d,s) __builtin_va_copy(d,s)
#define __wasi__ 1
#define __wasi_api_h
#define __wasi_libc_environ_h
#define __wasi_libc_find_relpath_h
#define __wasi_libc_h
#define __wasi_libc_nocwd_h
#define __wasilibc___errno_h
#define __wasilibc___errno_values_h
#define __wasilibc___fd_set_h
#define __wasilibc___function___isatty_h
#define __wasilibc___functions_malloc_h
#define __wasilibc___functions_memcpy_h
#define __wasilibc___header_dirent_h
#define __wasilibc___header_fcntl_h
#define __wasilibc___header_netinet_in_h
#define __wasilibc___header_poll_h
#define __wasilibc___header_stdlib_h
#define __wasilibc___header_string_h
#define __wasilibc___header_sys_ioctl_h
#define __wasilibc___header_sys_resource_h
#define __wasilibc___header_sys_socket_h
#define __wasilibc___header_sys_stat_h
#define __wasilibc___header_time_h
#define __wasilibc___header_unistd_h
#define __wasilibc___include_inttypes_h
#define __wasilibc___macro_FD_SETSIZE_h
#define __wasilibc___macro_PAGESIZE_h
#define __wasilibc___mode_t_h
#define __wasilibc___seek_h
#define __wasilibc___struct_dirent_h
#define __wasilibc___struct_in6_addr_h
#define __wasilibc___struct_in_addr_h
#define __wasilibc___struct_iovec_h
#define __wasilibc___struct_msghdr_h
#define __wasilibc___struct_pollfd_h
#define __wasilibc___struct_rusage_h
#define __wasilibc___struct_sockaddr_h
#define __wasilibc___struct_sockaddr_in6_h
#define __wasilibc___struct_sockaddr_in_h
#define __wasilibc___struct_sockaddr_storage_h
#define __wasilibc___struct_sockaddr_un_h
#define __wasilibc___struct_stat_h
#define __wasilibc___struct_timespec_h
#define __wasilibc___struct_timeval_h
#define __wasilibc___struct_tm_h
#define __wasilibc___struct_tms_h
#define __wasilibc___typedef_DIR_h
#define __wasilibc___typedef_blkcnt_t_h
#define __wasilibc___typedef_blksize_t_h
#define __wasilibc___typedef_clock_t_h
#define __wasilibc___typedef_clockid_t_h
#define __wasilibc___typedef_dev_t_h
#define __wasilibc___typedef_fd_set_h
#define __wasilibc___typedef_gid_t_h
#define __wasilibc___typedef_in_addr_t_h
#define __wasilibc___typedef_in_port_t_h
#define __wasilibc___typedef_ino_t_h
#define __wasilibc___typedef_mode_t_h
#define __wasilibc___typedef_nfds_t_h
#define __wasilibc___typedef_nlink_t_h
#define __wasilibc___typedef_off_t_h
#define __wasilibc___typedef_sa_family_t_h
#define __wasilibc___typedef_sigset_t_h
#define __wasilibc___typedef_socklen_t_h
#define __wasilibc___typedef_ssize_t_h
#define __wasilibc___typedef_suseconds_t_h
#define __wasilibc___typedef_time_t_h
#define __wasilibc___typedef_uid_t_h
#define __wasm 1
#define __wasm32 1
#define __wasm32__ 1
#define __wasm__ 1
#define _tolower(a) ((a)|0x20)
#define _toupper(a) ((a)&0x5f)
#define acos(x) __tg_real_complex(acos, (x))
#define acosh(x) __tg_real_complex(acosh, (x))
#define alignas _Alignas
#define alignof _Alignof
#define alloca __builtin_alloca
#define alphasort64 alphasort
#define and &&
#define and_eq &=
#define asin(x) __tg_real_complex(asin, (x))
#define asinh(x) __tg_real_complex(asinh, (x))
#define assert(x) (void)0
#define atan(x) __tg_real_complex(atan, (x))
#define atan2(x,y) __tg_real_2(atan2, (x), (y))
#define atanh(x) __tg_real_complex(atanh, (x))
#define be16toh(x) __bswap16(x)
#define be32toh(x) __bswap32(x)
#define be64toh(x) __bswap64(x)
#define betoh16(x) __bswap16(x)
#define betoh32(x) __bswap32(x)
#define betoh64(x) __bswap64(x)
#define bitand &
#define bitor |
#define blkcnt64_t blkcnt_t
#define bool _Bool
#define bswap_16(x) __bswap_16(x)
#define bswap_32(x) __bswap_32(x)
#define bswap_64(x) __bswap_64(x)
#define carg(x) __tg_complex_retreal(carg, (x))
#define cbrt(x) __tg_real(cbrt, (x))
#define ceil(x) __tg_real(ceil, (x))
#define cimag(x) __tg_complex_retreal(cimag, (x))
#define cimagf(x) (__builtin_cimagf(x))
#define cimagl(x) (__builtin_cimagl(x))
#define clrbit(x,i) __bitop(x,i,&=~)
#define compl ~
#define complex _Complex
#define conj(x) __tg_complex(conj, (x))
#define copysign(x,y) __tg_real_2(copysign, (x), (y))
#define cos(x) __tg_real_complex(cos, (x))
#define cosh(x) __tg_real_complex(cosh, (x))
#define cproj(x) __tg_complex(cproj, (x))
#define creal(x) __tg_complex_retreal(creal, (x))
#define crealf(x) (__builtin_crealf(x))
#define creall(x) (__builtin_creall(x))
#define creat64 creat
#define d_fileno d_ino
#define direct dirent
#define dirent64 dirent
#define erf(x) __tg_real(erf, (x))
#define erfc(x) __tg_real(erfc, (x))
#define errno errno
#define exp(x) __tg_real_complex(exp, (x))
#define exp2(x) __tg_real(exp2, (x))
#define expm1(x) __tg_real(expm1, (x))
#define fabs(x) __tg_real_complex_fabs(x)
#define false 0
#define fdim(x,y) __tg_real_2(fdim, (x), (y))
#define fgetpos64 fgetpos
#define floor(x) __tg_real(floor, (x))
#define fma(x,y,z) __tg_real_fma((x), (y), (z))
#define fmax(x,y) __tg_real_2(fmax, (x), (y))
#define fmin(x,y) __tg_real_2(fmin, (x), (y))
#define fmod(x,y) __tg_real_2(fmod, (x), (y))
#define fopen64 fopen
#define fpclassify(x) (__builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x))
#define fpos64_t fpos_t
#define freopen64 freopen
#define frexp(x,y) __tg_real_2_1(frexp, (x), (y))
#define fsblkcnt64_t fsblkcnt_t
#define fseeko64 fseeko
#define fsetpos64 fsetpos
#define fsfilcnt64_t fsfilcnt_t
#define fstat64 fstat
#define fstatat64 fstatat
#define ftello64 ftello
#define ftruncate64 ftruncate
#define getdents64 getdents
#define glob64 glob
#define glob64_t glob_t
#define globfree64 globfree
#define howmany(n,d) (((n)+((d)-1))/(d))
#define htobe16(x) __bswap16(x)
#define htobe32(x) __bswap32(x)
#define htobe64(x) __bswap64(x)
#define htole16(x) (uint16_t)(x)
#define htole32(x) (uint32_t)(x)
#define htole64(x) (uint64_t)(x)
#define hypot(x,y) __tg_real_2(hypot, (x), (y))
#define icmp6_data16 icmp6_dataun.icmp6_un_data16
#define icmp6_data32 icmp6_dataun.icmp6_un_data32
#define icmp6_data8 icmp6_dataun.icmp6_un_data8
#define icmp6_id icmp6_data16[0]
#define icmp6_maxdelay icmp6_data16[0]
#define icmp6_mtu icmp6_data32[0]
#define icmp6_pptr icmp6_data32[0]
#define icmp6_seq icmp6_data16[1]
#define icmp_data icmp_dun.id_data
#define icmp_gwaddr icmp_hun.ih_gwaddr
#define icmp_id icmp_hun.ih_idseq.icd_id
#define icmp_ip icmp_dun.id_ip.idi_ip
#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
#define icmp_mask icmp_dun.id_mask
#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
#define icmp_otime icmp_dun.id_ts.its_otime
#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
#define icmp_pptr icmp_hun.ih_pptr
#define icmp_radv icmp_dun.id_radv
#define icmp_rtime icmp_dun.id_ts.its_rtime
#define icmp_seq icmp_hun.ih_idseq.icd_seq
#define icmp_ttime icmp_dun.id_ts.its_ttime
#define icmp_void icmp_hun.ih_void
#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
#define ilogb(x) __tg_real_nocast(ilogb, (x))
#define ino64_t ino_t
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
#define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26)
#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
#define isclr(x,i) !isset(x,i)
#define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10)
#define isfinite(x) (__builtin_isfinite(x))
#define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e)
#define isgreater(x,y) (__builtin_isgreater(x, y))
#define isgreaterequal(x,y) (__builtin_isgreaterequal(x, y))
#define isinf(x) (__builtin_isinf(x))
#define isless(x,y) (__builtin_isless(x, y))
#define islessequal(x,y) (__builtin_islessequal(x, y))
#define islessgreater(x,y) (__builtin_islessgreater(x, y))
#define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26)
#define isnan(x) (__builtin_isnan(x))
#define isnormal(x) (__builtin_isnormal(x))
#define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f)
#define isset(x,i) __bitop(x,i,&)
#define isspace(a) __isspace(a)
#define isunordered(x,y) (__builtin_isunordered(x, y))
#define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26)
#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
#define ldexp(x,y) __tg_real_2_1(ldexp, (x), (y))
#define le16toh(x) (uint16_t)(x)
#define le32toh(x) (uint32_t)(x)
#define le64toh(x) (uint64_t)(x)
#define letoh16(x) (uint16_t)(x)
#define letoh32(x) (uint32_t)(x)
#define letoh64(x) (uint64_t)(x)
#define lgamma(x) __tg_real(lgamma, (x))
#define llrint(x) __tg_real_nocast(llrint, (x))
#define llround(x) __tg_real_nocast(llround, (x))
#define loff_t off_t
#define log(x) __tg_real_complex(log, (x))
#define log10(x) __tg_real(log10, (x))
#define log1p(x) __tg_real(log1p, (x))
#define log2(x) __tg_real(log2, (x))
#define logb(x) __tg_real(logb, (x))
#define lrint(x) __tg_real_nocast(lrint, (x))
#define lround(x) __tg_real_nocast(lround, (x))
#define lseek(fd,offset,whence) ({ off_t __f = (fd); off_t __o = (offset); off_t __w = (whence); __builtin_constant_p((offset)) && __builtin_constant_p((whence)) && __o == 0 && __w == SEEK_CUR ? __wasilibc_tell(__f) : lseek(__f, __o, __w); })
#define lseek64 lseek
#define lstat64 lstat
#define math_errhandling 2
#define mld_cksum mld_icmp6_hdr.icmp6_cksum
#define mld_code mld_icmp6_hdr.icmp6_code
#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
#define mld_type mld_icmp6_hdr.icmp6_type
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
#define nd_na_type nd_na_hdr.icmp6_type
#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
#define nd_ns_code nd_ns_hdr.icmp6_code
#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
#define nd_ns_type nd_ns_hdr.icmp6_type
#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
#define nd_ra_code nd_ra_hdr.icmp6_code
#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
#define nd_ra_type nd_ra_hdr.icmp6_type
#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
#define nd_rd_code nd_rd_hdr.icmp6_code
#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
#define nd_rd_type nd_rd_hdr.icmp6_type
#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
#define nd_rs_code nd_rs_hdr.icmp6_code
#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
#define nd_rs_type nd_rs_hdr.icmp6_type
#define nearbyint(x) __tg_real(nearbyint, (x))
#define nextafter(x,y) __tg_real_2(nextafter, (x), (y))
#define nexttoward(x,y) __tg_real_2(nexttoward, (x), (y))
#define nftw64 nftw
#define no_argument 0
#define noreturn _Noreturn
#define not !
#define not_eq !=
#define ns_msg_base(handle) ((handle)._msg + 0)
#define ns_msg_count(handle,section) ((handle)._counts[section] + 0)
#define ns_msg_end(handle) ((handle)._eom + 0)
#define ns_msg_getflag(handle,flag) (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
#define ns_msg_id(handle) ((handle)._id + 0)
#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
#define ns_rr_rdata(rr) ((rr).rdata + 0)
#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
#define ns_rr_ttl(rr) ((rr).ttl + 0)
#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || (t) == ns_t_mailb || (t) == ns_t_maila)
#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || (t) == ns_t_zxfr)
#define off64_t off_t
#define offsetof(t,d) __builtin_offsetof(t, d)
#define open64 open
#define openat64 openat
#define optional_argument 2
#define or ||
#define or_eq |=
#define posix_fadvise64 posix_fadvise
#define posix_fallocate64 posix_fallocate
#define pow(x,y) __tg_real_complex_pow((x), (y))
#define powerof2(n) !(((n)-1) & (n))
#define pread64 pread
#define preadv64 preadv
#define pwrite64 pwrite
#define pwritev64 pwritev
#define readdir64 readdir
#define remainder(x,y) __tg_real_2(remainder, (x), (y))
#define remquo(x,y,z) __tg_real_remquo((x), (y), (z))
#define required_argument 1
#define rint(x) __tg_real(rint, (x))
#define round(x) __tg_real(round, (x))
#define roundup(n,d) (howmany(n,d)*(d))
#define rr_cksum rr_hdr.icmp6_cksum
#define rr_code rr_hdr.icmp6_code
#define rr_seqnum rr_hdr.icmp6_data32[0]
#define rr_type rr_hdr.icmp6_type
#define scalbln(x,y) __tg_real_2_1(scalbln, (x), (y))
#define scalbn(x,y) __tg_real_2_1(scalbn, (x), (y))
#define scandir64 scandir
#define setbit(x,i) __bitop(x,i,|=)
#define signbit(x) (__builtin_signbit(x))
#define sin(x) __tg_real_complex(sin, (x))
#define sinh(x) __tg_real_complex(sinh, (x))
#define sqrt(x) __tg_real_complex(sqrt, (x))
#define st_atime st_atim.tv_sec
#define st_ctime st_ctim.tv_sec
#define st_mtime st_mtim.tv_sec
#define stat64 stat
#define static_assert _Static_assert
#define stderr (stderr)
#define stdin (stdin)
#define stdout (stdout)
#define strdupa(x) strcpy(alloca(strlen(x)+1),x)
#define tan(x) __tg_real_complex(tan, (x))
#define tanh(x) __tg_real_complex(tanh, (x))
#define telcmds ((char [][6]){ "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0 })
#define tgamma(x) __tg_real(tgamma, (x))
#define th_block th_u.tu_block
#define th_code th_u.tu_code
#define th_msg th_data
#define th_stuff th_u.tu_stuff
#define thrd_equal(A,B) ((A) == (B))
#define thread_local _Thread_local
#define timeradd(s,t,a) (void) ( (a)->tv_sec = (s)->tv_sec + (t)->tv_sec, ((a)->tv_usec = (s)->tv_usec + (t)->tv_usec) >= 1000000 && ((a)->tv_usec -= 1000000, (a)->tv_sec++) )
#define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0)
#define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? (s)->tv_usec op (t)->tv_usec : (s)->tv_sec op (t)->tv_sec)
#define timerisset(t) ((t)->tv_sec || (t)->tv_usec)
#define timersub(s,t,a) (void) ( (a)->tv_sec = (s)->tv_sec - (t)->tv_sec, ((a)->tv_usec = (s)->tv_usec - (t)->tv_usec) < 0 && ((a)->tv_usec += 1000000, (a)->tv_sec--) )
#define true 1
#define trunc(x) __tg_real(trunc, (x))
#define uh_dport dest
#define uh_sport source
#define uh_sum check
#define uh_ulen len
#define va_arg(ap,type) __builtin_va_arg(ap, type)
#define va_copy(dest,src) __builtin_va_copy(dest, src)
#define va_end(ap) __builtin_va_end(ap)
#define va_start(ap,param) __builtin_va_start(ap, param)
#define versionsort64 versionsort
#define xEOF 236
#define xor ^
#define xor_eq ^=
@@ -1,68 +0,0 @@
__addtf3
__divtf3
__eqtf2
__extenddftf2
__extendsftf2
__fixtfdi
__fixtfsi
__fixunstfsi
__floatsitf
__floatunsitf
__getf2
__gttf2
__heap_base
__imported_wasi_snapshot_preview1_args_get
__imported_wasi_snapshot_preview1_args_sizes_get
__imported_wasi_snapshot_preview1_clock_res_get
__imported_wasi_snapshot_preview1_clock_time_get
__imported_wasi_snapshot_preview1_environ_get
__imported_wasi_snapshot_preview1_environ_sizes_get
__imported_wasi_snapshot_preview1_fd_advise
__imported_wasi_snapshot_preview1_fd_allocate
__imported_wasi_snapshot_preview1_fd_close
__imported_wasi_snapshot_preview1_fd_datasync
__imported_wasi_snapshot_preview1_fd_fdstat_get
__imported_wasi_snapshot_preview1_fd_fdstat_set_flags
__imported_wasi_snapshot_preview1_fd_fdstat_set_rights
__imported_wasi_snapshot_preview1_fd_filestat_get
__imported_wasi_snapshot_preview1_fd_filestat_set_size
__imported_wasi_snapshot_preview1_fd_filestat_set_times
__imported_wasi_snapshot_preview1_fd_pread
__imported_wasi_snapshot_preview1_fd_prestat_dir_name
__imported_wasi_snapshot_preview1_fd_prestat_get
__imported_wasi_snapshot_preview1_fd_pwrite
__imported_wasi_snapshot_preview1_fd_read
__imported_wasi_snapshot_preview1_fd_readdir
__imported_wasi_snapshot_preview1_fd_renumber
__imported_wasi_snapshot_preview1_fd_seek
__imported_wasi_snapshot_preview1_fd_sync
__imported_wasi_snapshot_preview1_fd_tell
__imported_wasi_snapshot_preview1_fd_write
__imported_wasi_snapshot_preview1_path_create_directory
__imported_wasi_snapshot_preview1_path_filestat_get
__imported_wasi_snapshot_preview1_path_filestat_set_times
__imported_wasi_snapshot_preview1_path_link
__imported_wasi_snapshot_preview1_path_open
__imported_wasi_snapshot_preview1_path_readlink
__imported_wasi_snapshot_preview1_path_remove_directory
__imported_wasi_snapshot_preview1_path_rename
__imported_wasi_snapshot_preview1_path_symlink
__imported_wasi_snapshot_preview1_path_unlink_file
__imported_wasi_snapshot_preview1_poll_oneoff
__imported_wasi_snapshot_preview1_proc_exit
__imported_wasi_snapshot_preview1_proc_raise
__imported_wasi_snapshot_preview1_random_get
__imported_wasi_snapshot_preview1_sched_yield
__imported_wasi_snapshot_preview1_sock_recv
__imported_wasi_snapshot_preview1_sock_send
__imported_wasi_snapshot_preview1_sock_shutdown
__letf2
__lttf2
__netf2
__stack_pointer
__subtf3
__trunctfdf2
__trunctfsf2
__unordtf2
__wasm_call_ctors
main
-20
View File
@@ -1,20 +0,0 @@
#ifndef __wasilibc___errno_h
#define __wasilibc___errno_h
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern thread_local int errno;
#else
extern _Thread_local int errno;
#endif
#define errno errno
#ifdef __cplusplus
}
#endif
#endif
@@ -1,86 +0,0 @@
#ifndef __wasilibc___errno_values_h
#define __wasilibc___errno_values_h
#include <wasi/api.h>
#define E2BIG __WASI_ERRNO_2BIG
#define EACCES __WASI_ERRNO_ACCES
#define EADDRINUSE __WASI_ERRNO_ADDRINUSE
#define EADDRNOTAVAIL __WASI_ERRNO_ADDRNOTAVAIL
#define EAFNOSUPPORT __WASI_ERRNO_AFNOSUPPORT
#define EAGAIN __WASI_ERRNO_AGAIN
#define EALREADY __WASI_ERRNO_ALREADY
#define EBADF __WASI_ERRNO_BADF
#define EBADMSG __WASI_ERRNO_BADMSG
#define EBUSY __WASI_ERRNO_BUSY
#define ECANCELED __WASI_ERRNO_CANCELED
#define ECHILD __WASI_ERRNO_CHILD
#define ECONNABORTED __WASI_ERRNO_CONNABORTED
#define ECONNREFUSED __WASI_ERRNO_CONNREFUSED
#define ECONNRESET __WASI_ERRNO_CONNRESET
#define EDEADLK __WASI_ERRNO_DEADLK
#define EDESTADDRREQ __WASI_ERRNO_DESTADDRREQ
#define EDOM __WASI_ERRNO_DOM
#define EDQUOT __WASI_ERRNO_DQUOT
#define EEXIST __WASI_ERRNO_EXIST
#define EFAULT __WASI_ERRNO_FAULT
#define EFBIG __WASI_ERRNO_FBIG
#define EHOSTUNREACH __WASI_ERRNO_HOSTUNREACH
#define EIDRM __WASI_ERRNO_IDRM
#define EILSEQ __WASI_ERRNO_ILSEQ
#define EINPROGRESS __WASI_ERRNO_INPROGRESS
#define EINTR __WASI_ERRNO_INTR
#define EINVAL __WASI_ERRNO_INVAL
#define EIO __WASI_ERRNO_IO
#define EISCONN __WASI_ERRNO_ISCONN
#define EISDIR __WASI_ERRNO_ISDIR
#define ELOOP __WASI_ERRNO_LOOP
#define EMFILE __WASI_ERRNO_MFILE
#define EMLINK __WASI_ERRNO_MLINK
#define EMSGSIZE __WASI_ERRNO_MSGSIZE
#define EMULTIHOP __WASI_ERRNO_MULTIHOP
#define ENAMETOOLONG __WASI_ERRNO_NAMETOOLONG
#define ENETDOWN __WASI_ERRNO_NETDOWN
#define ENETRESET __WASI_ERRNO_NETRESET
#define ENETUNREACH __WASI_ERRNO_NETUNREACH
#define ENFILE __WASI_ERRNO_NFILE
#define ENOBUFS __WASI_ERRNO_NOBUFS
#define ENODEV __WASI_ERRNO_NODEV
#define ENOENT __WASI_ERRNO_NOENT
#define ENOEXEC __WASI_ERRNO_NOEXEC
#define ENOLCK __WASI_ERRNO_NOLCK
#define ENOLINK __WASI_ERRNO_NOLINK
#define ENOMEM __WASI_ERRNO_NOMEM
#define ENOMSG __WASI_ERRNO_NOMSG
#define ENOPROTOOPT __WASI_ERRNO_NOPROTOOPT
#define ENOSPC __WASI_ERRNO_NOSPC
#define ENOSYS __WASI_ERRNO_NOSYS
#define ENOTCONN __WASI_ERRNO_NOTCONN
#define ENOTDIR __WASI_ERRNO_NOTDIR
#define ENOTEMPTY __WASI_ERRNO_NOTEMPTY
#define ENOTRECOVERABLE __WASI_ERRNO_NOTRECOVERABLE
#define ENOTSOCK __WASI_ERRNO_NOTSOCK
#define ENOTSUP __WASI_ERRNO_NOTSUP
#define ENOTTY __WASI_ERRNO_NOTTY
#define ENXIO __WASI_ERRNO_NXIO
#define EOVERFLOW __WASI_ERRNO_OVERFLOW
#define EOWNERDEAD __WASI_ERRNO_OWNERDEAD
#define EPERM __WASI_ERRNO_PERM
#define EPIPE __WASI_ERRNO_PIPE
#define EPROTO __WASI_ERRNO_PROTO
#define EPROTONOSUPPORT __WASI_ERRNO_PROTONOSUPPORT
#define EPROTOTYPE __WASI_ERRNO_PROTOTYPE
#define ERANGE __WASI_ERRNO_RANGE
#define EROFS __WASI_ERRNO_ROFS
#define ESPIPE __WASI_ERRNO_SPIPE
#define ESRCH __WASI_ERRNO_SRCH
#define ESTALE __WASI_ERRNO_STALE
#define ETIMEDOUT __WASI_ERRNO_TIMEDOUT
#define ETXTBSY __WASI_ERRNO_TXTBSY
#define EXDEV __WASI_ERRNO_XDEV
#define ENOTCAPABLE __WASI_ERRNO_NOTCAPABLE
#define EOPNOTSUPP ENOTSUP
#define EWOULDBLOCK EAGAIN
#endif
@@ -1,76 +0,0 @@
#ifndef __wasilibc___fd_set_h
#define __wasilibc___fd_set_h
#include <__typedef_fd_set.h>
#ifdef __cplusplus
extern "C" {
#endif
static __inline void FD_CLR(int __fd, fd_set *__set) {
size_t __n = __set->__nfds;
for (int *__p = __set->__fds, *__e = __p + __n;
__p < __e; ++__p)
{
if (*__p == __fd) {
*__p = __e[-1];
__set->__nfds = __n - 1;
return;
}
}
}
static __inline
#ifdef __cplusplus
bool
#else
_Bool
#endif
FD_ISSET(int __fd, const fd_set *__set)
{
size_t __n = __set->__nfds;
for (const int *__p = __set->__fds, *__e = __p + __n;
__p < __e; ++__p)
{
if (*__p == __fd) {
return 1;
}
}
return 0;
}
static __inline void FD_SET(int __fd, fd_set *__set) {
size_t __n = __set->__nfds;
for (const int *__p = __set->__fds, *__e = __p + __n;
__p < __e; ++__p)
{
if (*__p == __fd) {
return;
}
}
__set->__nfds = __n + 1;
__set->__fds[__n] = __fd;
}
static __inline void FD_ZERO(fd_set *__set) {
__set->__nfds = 0;
}
static __inline void FD_COPY(const fd_set *__restrict __from,
fd_set *__restrict __to) {
size_t __n = __from->__nfds;
__to->__nfds = __n;
__builtin_memcpy(__to->__fds, __from->__fds, __n * sizeof(int));
}
#define FD_CLR(fd, set) (FD_CLR((fd), (set)))
#define FD_ISSET(fd, set) (FD_ISSET((fd), (set)))
#define FD_SET(fd, set) (FD_SET((fd), (set)))
#define FD_ZERO(set) (FD_ZERO((set)))
#define FD_COPY(from, to) (FD_COPY((from), (to)))
#ifdef __cplusplus
}
#endif
#endif
@@ -1,14 +0,0 @@
#ifndef __wasilibc___function___isatty_h
#define __wasilibc___function___isatty_h
#ifdef __cplusplus
extern "C" {
#endif
int __isatty(int fd);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,26 +0,0 @@
#ifndef __wasilibc___functions_malloc_h
#define __wasilibc___functions_malloc_h
#define __need_size_t
#define __need_wchar_t
#define __need_NULL
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
void *malloc(size_t __size) __attribute__((__malloc__, __warn_unused_result__));
void free(void *__ptr);
void *calloc(size_t __nmemb, size_t __size) __attribute__((__malloc__, __warn_unused_result__));
void *realloc(void *__ptr, size_t __size) __attribute__((__warn_unused_result__));
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
void *reallocarray(void *__ptr, size_t __nmemb, size_t __size) __attribute__((__warn_unused_result__));
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -1,20 +0,0 @@
#ifndef __wasilibc___functions_memcpy_h
#define __wasilibc___functions_memcpy_h
#define __need_size_t
#define __need_NULL
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
void *memcpy(void *__restrict__ __dst, const void *__restrict__ __src, size_t __n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2)));
void *memmove(void *__dst, const void *__src, size_t __n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2)));
void *memset(void *__dst, int __c, size_t __n) __attribute__((__nothrow__, __leaf__, __nonnull__(1)));
#ifdef __cplusplus
}
#endif
#endif
@@ -1,39 +0,0 @@
#ifndef __wasilibc___header_dirent_h
#define __wasilibc___header_dirent_h
#include <wasi/api.h>
#define DT_BLK __WASI_FILETYPE_BLOCK_DEVICE
#define DT_CHR __WASI_FILETYPE_CHARACTER_DEVICE
#define DT_DIR __WASI_FILETYPE_DIRECTORY
#define DT_FIFO __WASI_FILETYPE_SOCKET_STREAM
#define DT_LNK __WASI_FILETYPE_SYMBOLIC_LINK
#define DT_REG __WASI_FILETYPE_REGULAR_FILE
#define DT_UNKNOWN __WASI_FILETYPE_UNKNOWN
#include <__struct_dirent.h>
#include <__typedef_DIR.h>
#ifdef __cplusplus
extern "C" {
#endif
int closedir(DIR *);
DIR *opendir(const char *);
DIR *fdopendir(int);
int fdclosedir(DIR *);
struct dirent *readdir(DIR *);
void rewinddir(DIR *);
void seekdir(DIR *, long);
long telldir(DIR *);
DIR *opendirat(int, const char *);
void rewinddir(DIR *);
int scandirat(int, const char *, struct dirent ***,
int (*)(const struct dirent *),
int (*)(const struct dirent **, const struct dirent **));
#ifdef __cplusplus
}
#endif
#endif
@@ -1,61 +0,0 @@
#ifndef __wasilibc___header_fcntl_h
#define __wasilibc___header_fcntl_h
#include <wasi/api.h>
#include <__seek.h>
#include <__mode_t.h>
#define O_APPEND __WASI_FDFLAGS_APPEND
#define O_DSYNC __WASI_FDFLAGS_DSYNC
#define O_NONBLOCK __WASI_FDFLAGS_NONBLOCK
#define O_RSYNC __WASI_FDFLAGS_RSYNC
#define O_SYNC __WASI_FDFLAGS_SYNC
#define O_CREAT (__WASI_OFLAGS_CREAT << 12)
#define O_DIRECTORY (__WASI_OFLAGS_DIRECTORY << 12)
#define O_EXCL (__WASI_OFLAGS_EXCL << 12)
#define O_TRUNC (__WASI_OFLAGS_TRUNC << 12)
#define O_NOFOLLOW (0x01000000)
#define O_EXEC (0x02000000)
#define O_RDONLY (0x04000000)
#define O_SEARCH (0x08000000)
#define O_WRONLY (0x10000000)
/*
* O_CLOEXEC is defined to be zero, as WASI has no exec-style functions.
*/
#define O_CLOEXEC (0)
/*
* O_TTY_INIT is defined to be zero, meaning that WASI implementations are
* expected to always initialize a terminal the first time it's opened.
*/
#define O_TTY_INIT (0)
#define O_NOCTTY (0)
#define O_RDWR (O_RDONLY | O_WRONLY)
#define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH)
#define POSIX_FADV_DONTNEED __WASI_ADVICE_DONTNEED
#define POSIX_FADV_NOREUSE __WASI_ADVICE_NOREUSE
#define POSIX_FADV_NORMAL __WASI_ADVICE_NORMAL
#define POSIX_FADV_RANDOM __WASI_ADVICE_RANDOM
#define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL
#define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED
#define F_GETFD (1)
#define F_SETFD (2)
#define F_GETFL (3)
#define F_SETFL (4)
#define FD_CLOEXEC (1)
#define AT_EACCESS (0x0)
#define AT_SYMLINK_NOFOLLOW (0x1)
#define AT_SYMLINK_FOLLOW (0x2)
#define AT_REMOVEDIR (0x4)
#define AT_FDCWD (-2)
#endif
@@ -1,182 +0,0 @@
#ifndef __wasilibc___include_inttypes_h
#define __wasilibc___include_inttypes_h
#include <stdint.h>
#define __need_wchar_t
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { intmax_t quot, rem; } imaxdiv_t;
intmax_t imaxabs(intmax_t);
imaxdiv_t imaxdiv(intmax_t, intmax_t);
intmax_t strtoimax(const char *__restrict, char **__restrict, int);
uintmax_t strtoumax(const char *__restrict, char **__restrict, int);
intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int);
uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
#define PRId16 __INT16_FMTd__
#define PRIi16 __INT16_FMTi__
#define PRId32 __INT32_FMTd__
#define PRIi32 __INT32_FMTi__
#define PRId64 __INT64_FMTd__
#define PRIi64 __INT64_FMTi__
#define PRId8 __INT8_FMTd__
#define PRIi8 __INT8_FMTi__
#define PRIdMAX __INTMAX_FMTd__
#define PRIiMAX __INTMAX_FMTi__
#define PRIdPTR __INTPTR_FMTd__
#define PRIiPTR __INTPTR_FMTi__
#define PRIdFAST16 __INT_FAST16_FMTd__
#define PRIiFAST16 __INT_FAST16_FMTi__
#define PRIdFAST32 __INT_FAST32_FMTd__
#define PRIiFAST32 __INT_FAST32_FMTi__
#define PRIdFAST64 __INT_FAST64_FMTd__
#define PRIiFAST64 __INT_FAST64_FMTi__
#define PRIdFAST8 __INT_FAST8_FMTd__
#define PRIiFAST8 __INT_FAST8_FMTi__
#define PRIdLEAST16 __INT_LEAST16_FMTd__
#define PRIiLEAST16 __INT_LEAST16_FMTi__
#define PRIdLEAST32 __INT_LEAST32_FMTd__
#define PRIiLEAST32 __INT_LEAST32_FMTi__
#define PRIdLEAST64 __INT_LEAST64_FMTd__
#define PRIiLEAST64 __INT_LEAST64_FMTi__
#define PRIdLEAST8 __INT_LEAST8_FMTd__
#define PRIiLEAST8 __INT_LEAST8_FMTi__
#define PRIX16 __UINT16_FMTX__
#define PRIo16 __UINT16_FMTo__
#define PRIu16 __UINT16_FMTu__
#define PRIx16 __UINT16_FMTx__
#define PRIX32 __UINT32_FMTX__
#define PRIo32 __UINT32_FMTo__
#define PRIu32 __UINT32_FMTu__
#define PRIx32 __UINT32_FMTx__
#define PRIX64 __UINT64_FMTX__
#define PRIo64 __UINT64_FMTo__
#define PRIu64 __UINT64_FMTu__
#define PRIx64 __UINT64_FMTx__
#define PRIX8 __UINT8_FMTX__
#define PRIo8 __UINT8_FMTo__
#define PRIu8 __UINT8_FMTu__
#define PRIx8 __UINT8_FMTx__
#define PRIXMAX __UINTMAX_FMTX__
#define PRIoMAX __UINTMAX_FMTo__
#define PRIuMAX __UINTMAX_FMTu__
#define PRIxMAX __UINTMAX_FMTx__
#define PRIXPTR __UINTPTR_FMTX__
#define PRIoPTR __UINTPTR_FMTo__
#define PRIuPTR __UINTPTR_FMTu__
#define PRIxPTR __UINTPTR_FMTx__
#define PRIXFAST16 __UINT_FAST16_FMTX__
#define PRIoFAST16 __UINT_FAST16_FMTo__
#define PRIuFAST16 __UINT_FAST16_FMTu__
#define PRIxFAST16 __UINT_FAST16_FMTx__
#define PRIXFAST32 __UINT_FAST32_FMTX__
#define PRIoFAST32 __UINT_FAST32_FMTo__
#define PRIuFAST32 __UINT_FAST32_FMTu__
#define PRIxFAST32 __UINT_FAST32_FMTx__
#define PRIXFAST64 __UINT_FAST64_FMTX__
#define PRIoFAST64 __UINT_FAST64_FMTo__
#define PRIuFAST64 __UINT_FAST64_FMTu__
#define PRIxFAST64 __UINT_FAST64_FMTx__
#define PRIXFAST8 __UINT_FAST8_FMTX__
#define PRIoFAST8 __UINT_FAST8_FMTo__
#define PRIuFAST8 __UINT_FAST8_FMTu__
#define PRIxFAST8 __UINT_FAST8_FMTx__
#define PRIXLEAST16 __UINT_LEAST16_FMTX__
#define PRIoLEAST16 __UINT_LEAST16_FMTo__
#define PRIuLEAST16 __UINT_LEAST16_FMTu__
#define PRIxLEAST16 __UINT_LEAST16_FMTx__
#define PRIXLEAST32 __UINT_LEAST32_FMTX__
#define PRIoLEAST32 __UINT_LEAST32_FMTo__
#define PRIuLEAST32 __UINT_LEAST32_FMTu__
#define PRIxLEAST32 __UINT_LEAST32_FMTx__
#define PRIXLEAST64 __UINT_LEAST64_FMTX__
#define PRIoLEAST64 __UINT_LEAST64_FMTo__
#define PRIuLEAST64 __UINT_LEAST64_FMTu__
#define PRIxLEAST64 __UINT_LEAST64_FMTx__
#define PRIXLEAST8 __UINT_LEAST8_FMTX__
#define PRIoLEAST8 __UINT_LEAST8_FMTo__
#define PRIuLEAST8 __UINT_LEAST8_FMTu__
#define PRIxLEAST8 __UINT_LEAST8_FMTx__
#define SCNd16 __INT16_FMTd__
#define SCNi16 __INT16_FMTi__
#define SCNd32 __INT32_FMTd__
#define SCNi32 __INT32_FMTi__
#define SCNd64 __INT64_FMTd__
#define SCNi64 __INT64_FMTi__
#define SCNd8 __INT8_FMTd__
#define SCNi8 __INT8_FMTi__
#define SCNdMAX __INTMAX_FMTd__
#define SCNiMAX __INTMAX_FMTi__
#define SCNdPTR __INTPTR_FMTd__
#define SCNiPTR __INTPTR_FMTi__
#define SCNdFAST16 __INT_FAST16_FMTd__
#define SCNiFAST16 __INT_FAST16_FMTi__
#define SCNdFAST32 __INT_FAST32_FMTd__
#define SCNiFAST32 __INT_FAST32_FMTi__
#define SCNdFAST64 __INT_FAST64_FMTd__
#define SCNiFAST64 __INT_FAST64_FMTi__
#define SCNdFAST8 __INT_FAST8_FMTd__
#define SCNiFAST8 __INT_FAST8_FMTi__
#define SCNdLEAST16 __INT_LEAST16_FMTd__
#define SCNiLEAST16 __INT_LEAST16_FMTi__
#define SCNdLEAST32 __INT_LEAST32_FMTd__
#define SCNiLEAST32 __INT_LEAST32_FMTi__
#define SCNdLEAST64 __INT_LEAST64_FMTd__
#define SCNiLEAST64 __INT_LEAST64_FMTi__
#define SCNdLEAST8 __INT_LEAST8_FMTd__
#define SCNiLEAST8 __INT_LEAST8_FMTi__
#define SCNo16 __UINT16_FMTo__
#define SCNu16 __UINT16_FMTu__
#define SCNx16 __UINT16_FMTx__
#define SCNo32 __UINT32_FMTo__
#define SCNu32 __UINT32_FMTu__
#define SCNx32 __UINT32_FMTx__
#define SCNo64 __UINT64_FMTo__
#define SCNu64 __UINT64_FMTu__
#define SCNx64 __UINT64_FMTx__
#define SCNo8 __UINT8_FMTo__
#define SCNu8 __UINT8_FMTu__
#define SCNx8 __UINT8_FMTx__
#define SCNoMAX __UINTMAX_FMTo__
#define SCNuMAX __UINTMAX_FMTu__
#define SCNxMAX __UINTMAX_FMTx__
#define SCNoPTR __UINTPTR_FMTo__
#define SCNuPTR __UINTPTR_FMTu__
#define SCNxPTR __UINTPTR_FMTx__
#define SCNoFAST16 __UINT_FAST16_FMTo__
#define SCNuFAST16 __UINT_FAST16_FMTu__
#define SCNxFAST16 __UINT_FAST16_FMTx__
#define SCNoFAST32 __UINT_FAST32_FMTo__
#define SCNuFAST32 __UINT_FAST32_FMTu__
#define SCNxFAST32 __UINT_FAST32_FMTx__
#define SCNoFAST64 __UINT_FAST64_FMTo__
#define SCNuFAST64 __UINT_FAST64_FMTu__
#define SCNxFAST64 __UINT_FAST64_FMTx__
#define SCNoFAST8 __UINT_FAST8_FMTo__
#define SCNuFAST8 __UINT_FAST8_FMTu__
#define SCNxFAST8 __UINT_FAST8_FMTx__
#define SCNoLEAST16 __UINT_LEAST16_FMTo__
#define SCNuLEAST16 __UINT_LEAST16_FMTu__
#define SCNxLEAST16 __UINT_LEAST16_FMTx__
#define SCNoLEAST32 __UINT_LEAST32_FMTo__
#define SCNuLEAST32 __UINT_LEAST32_FMTu__
#define SCNxLEAST32 __UINT_LEAST32_FMTx__
#define SCNoLEAST64 __UINT_LEAST64_FMTo__
#define SCNuLEAST64 __UINT_LEAST64_FMTu__
#define SCNxLEAST64 __UINT_LEAST64_FMTx__
#define SCNoLEAST8 __UINT_LEAST8_FMTo__
#define SCNuLEAST8 __UINT_LEAST8_FMTu__
#define SCNxLEAST8 __UINT_LEAST8_FMTx__
#ifdef __cplusplus
}
#endif
#endif
@@ -1,30 +0,0 @@
#ifndef __wasilibc___header_netinet_in_h
#define __wasilibc___header_netinet_in_h
#include <__struct_in_addr.h>
#include <__struct_in6_addr.h>
#include <__struct_sockaddr_in.h>
#include <__struct_sockaddr_in6.h>
#define IPPROTO_IP 0
#define IPPROTO_ICMP 1
#define IPPROTO_TCP 6
#define IPPROTO_UDP 17
#define IPPROTO_IPV6 41
#define IPPROTO_RAW 255
#define IN6ADDR_ANY_INIT { { \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00 \
} }
#define IN6ADDR_LOOPBACK_INIT { { \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x01 \
} }
#endif
@@ -1,27 +0,0 @@
#ifndef __wasilibc___header_poll_h
#define __wasilibc___header_poll_h
#include <__struct_pollfd.h>
#include <__typedef_nfds_t.h>
#define POLLRDNORM 0x1
#define POLLWRNORM 0x2
#define POLLIN POLLRDNORM
#define POLLOUT POLLWRNORM
#define POLLERR 0x1000
#define POLLHUP 0x2000
#define POLLNVAL 0x4000
#ifdef __cplusplus
extern "C" {
#endif
int poll(struct pollfd[], nfds_t, int);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,21 +0,0 @@
#ifndef __wasilibc___header_stdlib_h
#define __wasilibc___header_stdlib_h
#define __need_size_t
#include <stddef.h>
#include <__functions_malloc.h>
#ifdef __cplusplus
extern "C" {
#endif
void abort(void) __attribute__((__noreturn__));
void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
void _Exit(int) __attribute__((__noreturn__));
#ifdef __cplusplus
}
#endif
#endif
@@ -1,23 +0,0 @@
#ifndef __wasilibc___header_string_h
#define __wasilibc___header_string_h
#define __need_size_t
#define __need_NULL
#include <stddef.h>
#include <__functions_memcpy.h>
#ifdef __cplusplus
extern "C" {
#endif
size_t strlen(const char *) __attribute__((__nothrow__, __leaf__, __pure__, __nonnull__(1)));
char *strdup(const char *) __attribute__((__nothrow__, __nonnull__(1)));
int strcmp(const char *, const char *) __attribute__((__nothrow__, __pure__, __nonnull__(1, 2)));
void *memchr(const void *, int, size_t) __attribute__((__nothrow__, __pure__, __nonnull__(1)));
#ifdef __cplusplus
}
#endif
#endif
@@ -1,17 +0,0 @@
#ifndef __wasilibc___header_sys_ioctl_h
#define __wasilibc___header_sys_ioctl_h
#define FIONREAD 1
#define FIONBIO 2
#ifdef __cplusplus
extern "C" {
#endif
int ioctl(int, int, ...);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,19 +0,0 @@
#ifndef __wasilibc___header_sys_resource_h
#define __wasilibc___header_sys_resource_h
#include <__struct_rusage.h>
#define RUSAGE_SELF 1
#define RUSAGE_CHILDREN 2
#ifdef __cplusplus
extern "C" {
#endif
int getrusage(int who, struct rusage *usage);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,41 +0,0 @@
#ifndef __wasilibc___header_sys_socket_h
#define __wasilibc___header_sys_socket_h
#include <__struct_msghdr.h>
#include <__struct_sockaddr.h>
#include <__struct_sockaddr_storage.h>
#include <wasi/api.h>
#define SHUT_RD __WASI_SDFLAGS_RD
#define SHUT_WR __WASI_SDFLAGS_WR
#define SHUT_RDWR (SHUT_RD | SHUT_WR)
#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
#define MSG_TRUNC __WASI_RIFLAGS_RECV_DATA_TRUNCATED
#define SOCK_DGRAM __WASI_FILETYPE_SOCKET_DGRAM
#define SOCK_STREAM __WASI_FILETYPE_SOCKET_STREAM
#define SOCK_NONBLOCK (0x00004000)
#define SOCK_CLOEXEC (0x00002000)
#define SOL_SOCKET 0x7fffffff
#define SO_TYPE 3
#define AF_UNSPEC 0
#define AF_INET 1
#define AF_INET6 2
#define AF_UNIX 3
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -1,15 +0,0 @@
#ifndef __wasilibc___header_sys_stat_h
#define __wasilibc___header_sys_stat_h
#include <__struct_stat.h>
#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec
#include <__mode_t.h>
#define UTIME_NOW (-1)
#define UTIME_OMIT (-2)
#endif
@@ -1,37 +0,0 @@
#ifndef __wasilibc___header_time_h
#define __wasilibc___header_time_h
#define __need_size_t
#define __need_NULL
#include <stddef.h>
#include <__typedef_time_t.h>
#include <__struct_timespec.h>
#include <__struct_tm.h>
#include <__typedef_clockid_t.h>
#include <wasi/api.h>
#define TIMER_ABSTIME __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME
extern const struct __clockid _CLOCK_MONOTONIC;
#define CLOCK_MONOTONIC (&_CLOCK_MONOTONIC)
extern const struct __clockid _CLOCK_PROCESS_CPUTIME_ID;
#define CLOCK_PROCESS_CPUTIME_ID (&_CLOCK_PROCESS_CPUTIME_ID)
extern const struct __clockid _CLOCK_REALTIME;
#define CLOCK_REALTIME (&_CLOCK_REALTIME)
extern const struct __clockid _CLOCK_THREAD_CPUTIME_ID;
#define CLOCK_THREAD_CPUTIME_ID (&_CLOCK_THREAD_CPUTIME_ID)
/*
* TIME_UTC is the only standardized time base value.
*/
#define TIME_UTC 1
/*
* Note that XSI specifies CLOCKS_PER_SEC to be 1000000, rather than
* 1000000000; the clock API is providing more precision than XSI specifies.
*/
#define CLOCKS_PER_SEC ((clock_t)1000000000)
#endif
@@ -1,28 +0,0 @@
#ifndef __wasilibc___header_unistd_h
#define __wasilibc___header_unistd_h
struct stat;
#include <__seek.h>
#define F_OK (0)
#define X_OK (1)
#define W_OK (2)
#define R_OK (4)
#ifdef __cplusplus
extern "C" {
#endif
int close(int fd);
int faccessat(int, const char *, int, int);
int fstatat(int, const char *__restrict, struct stat *__restrict, int);
int renameat(int, const char *, int, const char *);
int openat(int, const char *, int, ...);
void *sbrk(intptr_t increment);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___macro_FD_SETSIZE_h
#define __wasilibc___macro_FD_SETSIZE_h
#define FD_SETSIZE 1024
#endif
@@ -1,11 +0,0 @@
#ifndef __wasilibc___macro_PAGESIZE_h
#define __wasilibc___macro_PAGESIZE_h
/*
* The page size in WebAssembly is fixed at 64 KiB. If this ever changes,
* it's expected that applications will need to opt in, so we can change
* this.
*/
#define PAGESIZE (0x10000)
#endif
@@ -1,38 +0,0 @@
#ifndef __wasilibc___mode_t_h
#define __wasilibc___mode_t_h
#define S_IFMT \
(S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK)
#define S_IFBLK (0x6000)
#define S_IFCHR (0x2000)
#define S_IFDIR (0x4000)
#define S_IFLNK (0xa000)
#define S_IFREG (0x8000)
#define S_IFSOCK (0xc000)
#define S_IFIFO (0xc000)
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
#define S_IXOTH (0x1)
#define S_IWOTH (0x2)
#define S_IROTH (0x4)
#define S_IRWXO (S_IXOTH | S_IWOTH | S_IROTH)
#define S_IXGRP (0x8)
#define S_IWGRP (0x10)
#define S_IRGRP (0x20)
#define S_IRWXG (S_IXGRP | S_IWGRP | S_IRGRP)
#define S_IXUSR (0x40)
#define S_IWUSR (0x80)
#define S_IRUSR (0x100)
#define S_IRWXU (S_IXUSR | S_IWUSR | S_IRUSR)
#define S_ISVTX (0x200)
#define S_ISGID (0x400)
#define S_ISUID (0x800)
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc___seek_h
#define __wasilibc___seek_h
#include <wasi/api.h>
#define SEEK_CUR __WASI_WHENCE_CUR
#define SEEK_END __WASI_WHENCE_END
#define SEEK_SET __WASI_WHENCE_SET
#endif
@@ -1,14 +0,0 @@
#ifndef __wasilibc___struct_dirent_h
#define __wasilibc___struct_dirent_h
#include <__typedef_ino_t.h>
#define _DIRENT_HAVE_D_TYPE
struct dirent {
ino_t d_ino;
unsigned char d_type;
char d_name[];
};
#endif
@@ -1,8 +0,0 @@
#ifndef __wasilibc___struct_in6_addr_h
#define __wasilibc___struct_in6_addr_h
struct in6_addr {
_Alignas(int32_t) unsigned char s6_addr[16];
};
#endif
@@ -1,10 +0,0 @@
#ifndef __wasilibc___struct_in_addr_h
#define __wasilibc___struct_in_addr_h
#include <__typedef_in_addr_t.h>
struct in_addr {
in_addr_t s_addr;
};
#endif
@@ -1,12 +0,0 @@
#ifndef __wasilibc___struct_iovec_h
#define __wasilibc___struct_iovec_h
#define __need_size_t
#include <stddef.h>
struct iovec {
void *iov_base;
size_t iov_len;
};
#endif
@@ -1,16 +0,0 @@
#ifndef __wasilibc___struct_msghdr_h
#define __wasilibc___struct_msghdr_h
#include <__typedef_socklen_t.h>
struct msghdr {
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
int msg_iovlen;
void *msg_control;
socklen_t msg_controllen;
int msg_flags;
};
#endif
@@ -1,10 +0,0 @@
#ifndef __wasilibc___struct_pollfd_h
#define __wasilibc___struct_pollfd_h
struct pollfd {
int fd;
short events;
short revents;
};
#endif
@@ -1,12 +0,0 @@
#ifndef __wasilibc___struct_rusage_h
#define __wasilibc___struct_rusage_h
#include <__struct_timeval.h>
/* TODO: Add more features here. */
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
};
#endif
@@ -1,14 +0,0 @@
#ifndef __wasilibc___struct_sockaddr_h
#define __wasilibc___struct_sockaddr_h
#define __need_STDDEF_H_misc
#include <stddef.h>
#include <__typedef_sa_family_t.h>
struct sockaddr {
_Alignas(max_align_t) sa_family_t sa_family;
char sa_data[0];
};
#endif
@@ -1,17 +0,0 @@
#ifndef __wasilibc___struct_sockaddr_in_h
#define __wasilibc___struct_sockaddr_in_h
#define __need_STDDEF_H_misc
#include <stddef.h>
#include <__typedef_sa_family_t.h>
#include <__typedef_in_port_t.h>
#include <__struct_in_addr.h>
struct sockaddr_in {
_Alignas(max_align_t) sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
};
#endif
@@ -1,19 +0,0 @@
#ifndef __wasilibc___struct_sockaddr_in6_h
#define __wasilibc___struct_sockaddr_in6_h
#define __need_STDDEF_H_misc
#include <stddef.h>
#include <__typedef_sa_family_t.h>
#include <__typedef_in_port_t.h>
#include <__struct_in6_addr.h>
struct sockaddr_in6 {
_Alignas(max_align_t) sa_family_t sin6_family;
in_port_t sin6_port;
unsigned sin6_flowinfo;
struct in6_addr sin6_addr;
unsigned sin6_scope_id;
};
#endif
@@ -1,14 +0,0 @@
#ifndef __wasilibc___struct_sockaddr_storage_h
#define __wasilibc___struct_sockaddr_storage_h
#define __need_STDDEF_H_misc
#include <stddef.h>
#include <__typedef_sa_family_t.h>
struct sockaddr_storage {
_Alignas(max_align_t) sa_family_t ss_family;
char __ss_data[32];
};
#endif
@@ -1,13 +0,0 @@
#ifndef __wasilibc___struct_sockaddr_un_h
#define __wasilibc___struct_sockaddr_un_h
#define __need_STDDEF_H_misc
#include <stddef.h>
#include <__typedef_sa_family_t.h>
struct sockaddr_un {
_Alignas(max_align_t) sa_family_t sun_family;
};
#endif
@@ -1,35 +0,0 @@
#ifndef __wasilibc___struct_stat_h
#define __wasilibc___struct_stat_h
#include <__typedef_dev_t.h>
#include <__typedef_ino_t.h>
#include <__typedef_nlink_t.h>
#include <__typedef_mode_t.h>
#include <__typedef_uid_t.h>
#include <__typedef_gid_t.h>
#include <__typedef_off_t.h>
#include <__typedef_blksize_t.h>
#include <__typedef_blkcnt_t.h>
#include <__struct_timespec.h>
struct stat {
dev_t st_dev;
ino_t st_ino;
nlink_t st_nlink;
mode_t st_mode;
uid_t st_uid;
gid_t st_gid;
unsigned int __pad0;
dev_t st_rdev;
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
long long __reserved[3];
};
#endif
@@ -1,12 +0,0 @@
#ifndef __wasilibc___struct_timespec_h
#define __wasilibc___struct_timespec_h
#include <__typedef_time_t.h>
/* As specified in POSIX. */
struct timespec {
time_t tv_sec;
long tv_nsec;
};
#endif
@@ -1,13 +0,0 @@
#ifndef __wasilibc___struct_timeval_h
#define __wasilibc___struct_timeval_h
#include <__typedef_time_t.h>
#include <__typedef_suseconds_t.h>
/* As specified in POSIX. */
struct timeval {
time_t tv_sec;
suseconds_t tv_usec;
};
#endif
@@ -1,19 +0,0 @@
#ifndef __wasilibc___struct_tm_h
#define __wasilibc___struct_tm_h
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
int __tm_gmtoff;
const char *__tm_zone;
int __tm_nsec;
};
#endif
@@ -1,13 +0,0 @@
#ifndef __wasilibc___struct_tms_h
#define __wasilibc___struct_tms_h
#include <__typedef_clock_t.h>
struct tms {
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
};
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_DIR_h
#define __wasilibc___typedef_DIR_h
typedef struct _DIR DIR;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_blkcnt_t_h
#define __wasilibc___typedef_blkcnt_t_h
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */
typedef long long blkcnt_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_blksize_t_h
#define __wasilibc___typedef_blksize_t_h
typedef long blksize_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_clock_t_h
#define __wasilibc___typedef_clock_t_h
/* Define this as a 64-bit signed integer to avoid wraparounds. */
typedef long long clock_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_clockid_t_h
#define __wasilibc___typedef_clockid_t_h
typedef const struct __clockid *clockid_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_dev_t_h
#define __wasilibc___typedef_dev_t_h
/* Define these as 64-bit integers to support billions of devices. */
typedef unsigned long long dev_t;
#endif
@@ -1,14 +0,0 @@
#ifndef __wasilibc___typedef_fd_set_h
#define __wasilibc___typedef_fd_set_h
#define __need_size_t
#include <stddef.h>
#include <__macro_FD_SETSIZE.h>
typedef struct {
size_t __nfds;
int __fds[FD_SETSIZE];
} fd_set;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_gid_t_h
#define __wasilibc___typedef_gid_t_h
typedef unsigned gid_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_in_addr_t_h
#define __wasilibc___typedef_in_addr_t_h
typedef unsigned in_addr_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_in_port_t_h
#define __wasilibc___typedef_in_port_t_h
typedef unsigned short in_port_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_ino_t_h
#define __wasilibc___typedef_ino_t_h
/* Define these as 64-bit integers to support billions of inodes. */
typedef unsigned long long ino_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_mode_t_h
#define __wasilibc___typedef_mode_t_h
typedef unsigned mode_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_nfds_t_h
#define __wasilibc___typedef_nfds_t_h
typedef unsigned long nfds_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_nlink_t_h
#define __wasilibc___typedef_nlink_t_h
/* Define these as 64-bit unsigned integers to support billions of links. */
typedef unsigned long long nlink_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_off_t_h
#define __wasilibc___typedef_off_t_h
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */
typedef long long off_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_sa_family_t_h
#define __wasilibc___typedef_sa_family_t_h
typedef unsigned short sa_family_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_sigset_t_h
#define __wasilibc___typedef_sigset_t_h
/* TODO: This is just a placeholder for now. Keep this in sync with musl. */
typedef unsigned char sigset_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_socklen_t_h
#define __wasilibc___typedef_socklen_t_h
typedef unsigned socklen_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_ssize_t_h
#define __wasilibc___typedef_ssize_t_h
/* This is defined to be the same size as size_t. */
typedef long ssize_t;
#endif
@@ -1,8 +0,0 @@
#ifndef __wasilibc___typedef_suseconds_t_h
#define __wasilibc___typedef_suseconds_t_h
/* Define this to be 64-bit as its main use is in struct timeval where the
extra space would otherwise be padding. */
typedef long long suseconds_t;
#endif
@@ -1,7 +0,0 @@
#ifndef __wasilibc___typedef_time_t_h
#define __wasilibc___typedef_time_t_h
/* Define this as a 64-bit signed integer to avoid the 2038 bug. */
typedef long long time_t;
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc___typedef_uid_t_h
#define __wasilibc___typedef_uid_t_h
typedef unsigned uid_t;
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_dirent_h
#define __wasilibc_dirent_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc dirent implementations.
*/
#include <__header_dirent.h>
#endif
-7
View File
@@ -1,7 +0,0 @@
#ifndef __wasilibc_errno_h
#define __wasilibc_errno_h
#include <__errno.h>
#include <__errno_values.h>
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_fcntl_h
#define __wasilibc_fcntl_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc fcntl implementations.
*/
#include <__header_fcntl.h>
#endif
@@ -1,10 +0,0 @@
#ifndef __wasilibc_inttypes_h
#define __wasilibc_inttypes_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc stdlib implementations.
*/
#include <__header_inttypes.h>
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc_netinet_in_h
#define __wasilibc_netinet_in_h
#include <__header_netinet_in.h>
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_poll_h
#define __wasilibc_poll_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc poll implementations.
*/
#include <__header_poll.h>
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_stdlib_h
#define __wasilibc_stdlib_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc stdlib implementations.
*/
#include <__functions_malloc.h>
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_string_h
#define __wasilibc_string_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc string implementations.
*/
#include <__header_string.h>
#endif
@@ -1,10 +0,0 @@
#ifndef __wasilibc_sys_ioctl_h
#define __wasilibc_sys_ioctl_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc ioctl implementations.
*/
#include <__header_sys_ioctl.h>
#endif
@@ -1,10 +0,0 @@
#ifndef __wasilibc_sys_resource_h
#define __wasilibc_sys_resource_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc resource implementations.
*/
#include <__header_sys_resource.h>
#endif
@@ -1,18 +0,0 @@
#ifndef __wasilibc_sys_select_h
#define __wasilibc_sys_select_h
#include <__fd_set.h>
#include <__struct_timespec.h>
#include <__struct_timeval.h>
#ifdef __cplusplus
extern "C" {
#endif
int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc_sys_socket_h
#define __wasilibc_sys_socket_h
#include <__header_sys_socket.h>
#endif
@@ -1,10 +0,0 @@
#ifndef __wasilibc_sys_stat_h
#define __wasilibc_sys_stat_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc stat implementations.
*/
#include <__header_sys_stat.h>
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc_sys_time_h
#define __wasilibc_sys_time_h
#include <__struct_timeval.h>
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc_sys_times_h
#define __wasilibc_sys_times_h
#include <__struct_tms.h>
#endif
@@ -1,16 +0,0 @@
#ifndef __wasilibc_sys_types_h
#define __wasilibc_sys_types_h
#define __need_size_t
#include <stddef.h>
#include <__typedef_clock_t.h>
#include <__typedef_time_t.h>
#include <__typedef_blksize_t.h>
#include <__typedef_off_t.h>
#include <__typedef_ssize_t.h>
#include <__typedef_suseconds_t.h>
#include <__typedef_nlink_t.h>
#include <__typedef_clockid_t.h>
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc_sys_uio_h
#define __wasilibc_sys_uio_h
#include <__struct_iovec.h>
#endif
@@ -1,6 +0,0 @@
#ifndef __wasilibc_sys_un_h
#define __wasilibc_sys_un_h
#include <__struct_sockaddr_un.h>
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_time_h
#define __wasilibc_time_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc time implementations.
*/
#include <__header_time.h>
#endif
-10
View File
@@ -1,10 +0,0 @@
#ifndef __wasilibc_unistd_h
#define __wasilibc_unistd_h
/*
* Include the real implementation, which is factored into a separate file so
* that it can be reused by other libc unistd implementations.
*/
#include <__header_unistd.h>
#endif
-2280
View File
@@ -1,2280 +0,0 @@
/**
* THIS FILE IS AUTO-GENERATED from the following files:
* wasi_snapshot_preview1.witx
*
* To regenerate this file execute:
*
* cargo run --manifest-path tools/wasi-headers/Cargo.toml generate-libc
*
* Modifications to this file will cause CI to fail, the code generator tool
* must be modified to change this file.
*
* @file
* This file describes the [WASI] interface, consisting of functions, types,
* and defined values (macros).
*
* The interface described here is greatly inspired by [CloudABI]'s clean,
* thoughtfully-designed, capability-oriented, POSIX-style API.
*
* [CloudABI]: https://github.com/NuxiNL/cloudlibc
* [WASI]: https://github.com/WebAssembly/WASI/
*/
#ifndef __wasi_api_h
#define __wasi_api_h
#ifndef __wasi__
#error <wasi/api.h> is only supported on WASI platforms.
#endif
#ifndef __wasm32__
#error <wasi/api.h> only supports wasm32; doesn't yet support wasm64
#endif
#include <stddef.h>
#include <stdint.h>
_Static_assert(_Alignof(int8_t) == 1, "non-wasi data layout");
_Static_assert(_Alignof(uint8_t) == 1, "non-wasi data layout");
_Static_assert(_Alignof(int16_t) == 2, "non-wasi data layout");
_Static_assert(_Alignof(uint16_t) == 2, "non-wasi data layout");
_Static_assert(_Alignof(int32_t) == 4, "non-wasi data layout");
_Static_assert(_Alignof(uint32_t) == 4, "non-wasi data layout");
_Static_assert(_Alignof(int64_t) == 8, "non-wasi data layout");
_Static_assert(_Alignof(uint64_t) == 8, "non-wasi data layout");
_Static_assert(_Alignof(void*) == 4, "non-wasi data layout");
#ifdef __cplusplus
extern "C" {
#endif
// TODO: Encoding this in witx.
#define __WASI_DIRCOOKIE_START (UINT64_C(0))
typedef __SIZE_TYPE__ __wasi_size_t;
_Static_assert(sizeof(__wasi_size_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_size_t) == 4, "witx calculated align");
/**
* Non-negative file size or length of a region within a file.
*/
typedef uint64_t __wasi_filesize_t;
_Static_assert(sizeof(__wasi_filesize_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_filesize_t) == 8, "witx calculated align");
/**
* Timestamp in nanoseconds.
*/
typedef uint64_t __wasi_timestamp_t;
_Static_assert(sizeof(__wasi_timestamp_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_timestamp_t) == 8, "witx calculated align");
/**
* Identifiers for clocks.
*/
typedef uint32_t __wasi_clockid_t;
/**
* The clock measuring real time. Time value zero corresponds with
* 1970-01-01T00:00:00Z.
*/
#define __WASI_CLOCKID_REALTIME (UINT32_C(0))
/**
* The store-wide monotonic clock, which is defined as a clock measuring
* real time, whose value cannot be adjusted and which cannot have negative
* clock jumps. The epoch of this clock is undefined. The absolute time
* value of this clock therefore has no meaning.
*/
#define __WASI_CLOCKID_MONOTONIC (UINT32_C(1))
/**
* The CPU-time clock associated with the current process.
*/
#define __WASI_CLOCKID_PROCESS_CPUTIME_ID (UINT32_C(2))
/**
* The CPU-time clock associated with the current thread.
*/
#define __WASI_CLOCKID_THREAD_CPUTIME_ID (UINT32_C(3))
_Static_assert(sizeof(__wasi_clockid_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_clockid_t) == 4, "witx calculated align");
/**
* Error codes returned by functions.
* Not all of these error codes are returned by the functions provided by this
* API; some are used in higher-level library layers, and others are provided
* merely for alignment with POSIX.
*/
typedef uint16_t __wasi_errno_t;
/**
* No error occurred. System call completed successfully.
*/
#define __WASI_ERRNO_SUCCESS (UINT16_C(0))
/**
* Argument list too long.
*/
#define __WASI_ERRNO_2BIG (UINT16_C(1))
/**
* Permission denied.
*/
#define __WASI_ERRNO_ACCES (UINT16_C(2))
/**
* Address in use.
*/
#define __WASI_ERRNO_ADDRINUSE (UINT16_C(3))
/**
* Address not available.
*/
#define __WASI_ERRNO_ADDRNOTAVAIL (UINT16_C(4))
/**
* Address family not supported.
*/
#define __WASI_ERRNO_AFNOSUPPORT (UINT16_C(5))
/**
* Resource unavailable, or operation would block.
*/
#define __WASI_ERRNO_AGAIN (UINT16_C(6))
/**
* Connection already in progress.
*/
#define __WASI_ERRNO_ALREADY (UINT16_C(7))
/**
* Bad file descriptor.
*/
#define __WASI_ERRNO_BADF (UINT16_C(8))
/**
* Bad message.
*/
#define __WASI_ERRNO_BADMSG (UINT16_C(9))
/**
* Device or resource busy.
*/
#define __WASI_ERRNO_BUSY (UINT16_C(10))
/**
* Operation canceled.
*/
#define __WASI_ERRNO_CANCELED (UINT16_C(11))
/**
* No child processes.
*/
#define __WASI_ERRNO_CHILD (UINT16_C(12))
/**
* Connection aborted.
*/
#define __WASI_ERRNO_CONNABORTED (UINT16_C(13))
/**
* Connection refused.
*/
#define __WASI_ERRNO_CONNREFUSED (UINT16_C(14))
/**
* Connection reset.
*/
#define __WASI_ERRNO_CONNRESET (UINT16_C(15))
/**
* Resource deadlock would occur.
*/
#define __WASI_ERRNO_DEADLK (UINT16_C(16))
/**
* Destination address required.
*/
#define __WASI_ERRNO_DESTADDRREQ (UINT16_C(17))
/**
* Mathematics argument out of domain of function.
*/
#define __WASI_ERRNO_DOM (UINT16_C(18))
/**
* Reserved.
*/
#define __WASI_ERRNO_DQUOT (UINT16_C(19))
/**
* File exists.
*/
#define __WASI_ERRNO_EXIST (UINT16_C(20))
/**
* Bad address.
*/
#define __WASI_ERRNO_FAULT (UINT16_C(21))
/**
* File too large.
*/
#define __WASI_ERRNO_FBIG (UINT16_C(22))
/**
* Host is unreachable.
*/
#define __WASI_ERRNO_HOSTUNREACH (UINT16_C(23))
/**
* Identifier removed.
*/
#define __WASI_ERRNO_IDRM (UINT16_C(24))
/**
* Illegal byte sequence.
*/
#define __WASI_ERRNO_ILSEQ (UINT16_C(25))
/**
* Operation in progress.
*/
#define __WASI_ERRNO_INPROGRESS (UINT16_C(26))
/**
* Interrupted function.
*/
#define __WASI_ERRNO_INTR (UINT16_C(27))
/**
* Invalid argument.
*/
#define __WASI_ERRNO_INVAL (UINT16_C(28))
/**
* I/O error.
*/
#define __WASI_ERRNO_IO (UINT16_C(29))
/**
* Socket is connected.
*/
#define __WASI_ERRNO_ISCONN (UINT16_C(30))
/**
* Is a directory.
*/
#define __WASI_ERRNO_ISDIR (UINT16_C(31))
/**
* Too many levels of symbolic links.
*/
#define __WASI_ERRNO_LOOP (UINT16_C(32))
/**
* File descriptor value too large.
*/
#define __WASI_ERRNO_MFILE (UINT16_C(33))
/**
* Too many links.
*/
#define __WASI_ERRNO_MLINK (UINT16_C(34))
/**
* Message too large.
*/
#define __WASI_ERRNO_MSGSIZE (UINT16_C(35))
/**
* Reserved.
*/
#define __WASI_ERRNO_MULTIHOP (UINT16_C(36))
/**
* Filename too long.
*/
#define __WASI_ERRNO_NAMETOOLONG (UINT16_C(37))
/**
* Network is down.
*/
#define __WASI_ERRNO_NETDOWN (UINT16_C(38))
/**
* Connection aborted by network.
*/
#define __WASI_ERRNO_NETRESET (UINT16_C(39))
/**
* Network unreachable.
*/
#define __WASI_ERRNO_NETUNREACH (UINT16_C(40))
/**
* Too many files open in system.
*/
#define __WASI_ERRNO_NFILE (UINT16_C(41))
/**
* No buffer space available.
*/
#define __WASI_ERRNO_NOBUFS (UINT16_C(42))
/**
* No such device.
*/
#define __WASI_ERRNO_NODEV (UINT16_C(43))
/**
* No such file or directory.
*/
#define __WASI_ERRNO_NOENT (UINT16_C(44))
/**
* Executable file format error.
*/
#define __WASI_ERRNO_NOEXEC (UINT16_C(45))
/**
* No locks available.
*/
#define __WASI_ERRNO_NOLCK (UINT16_C(46))
/**
* Reserved.
*/
#define __WASI_ERRNO_NOLINK (UINT16_C(47))
/**
* Not enough space.
*/
#define __WASI_ERRNO_NOMEM (UINT16_C(48))
/**
* No message of the desired type.
*/
#define __WASI_ERRNO_NOMSG (UINT16_C(49))
/**
* Protocol not available.
*/
#define __WASI_ERRNO_NOPROTOOPT (UINT16_C(50))
/**
* No space left on device.
*/
#define __WASI_ERRNO_NOSPC (UINT16_C(51))
/**
* Function not supported.
*/
#define __WASI_ERRNO_NOSYS (UINT16_C(52))
/**
* The socket is not connected.
*/
#define __WASI_ERRNO_NOTCONN (UINT16_C(53))
/**
* Not a directory or a symbolic link to a directory.
*/
#define __WASI_ERRNO_NOTDIR (UINT16_C(54))
/**
* Directory not empty.
*/
#define __WASI_ERRNO_NOTEMPTY (UINT16_C(55))
/**
* State not recoverable.
*/
#define __WASI_ERRNO_NOTRECOVERABLE (UINT16_C(56))
/**
* Not a socket.
*/
#define __WASI_ERRNO_NOTSOCK (UINT16_C(57))
/**
* Not supported, or operation not supported on socket.
*/
#define __WASI_ERRNO_NOTSUP (UINT16_C(58))
/**
* Inappropriate I/O control operation.
*/
#define __WASI_ERRNO_NOTTY (UINT16_C(59))
/**
* No such device or address.
*/
#define __WASI_ERRNO_NXIO (UINT16_C(60))
/**
* Value too large to be stored in data type.
*/
#define __WASI_ERRNO_OVERFLOW (UINT16_C(61))
/**
* Previous owner died.
*/
#define __WASI_ERRNO_OWNERDEAD (UINT16_C(62))
/**
* Operation not permitted.
*/
#define __WASI_ERRNO_PERM (UINT16_C(63))
/**
* Broken pipe.
*/
#define __WASI_ERRNO_PIPE (UINT16_C(64))
/**
* Protocol error.
*/
#define __WASI_ERRNO_PROTO (UINT16_C(65))
/**
* Protocol not supported.
*/
#define __WASI_ERRNO_PROTONOSUPPORT (UINT16_C(66))
/**
* Protocol wrong type for socket.
*/
#define __WASI_ERRNO_PROTOTYPE (UINT16_C(67))
/**
* Result too large.
*/
#define __WASI_ERRNO_RANGE (UINT16_C(68))
/**
* Read-only file system.
*/
#define __WASI_ERRNO_ROFS (UINT16_C(69))
/**
* Invalid seek.
*/
#define __WASI_ERRNO_SPIPE (UINT16_C(70))
/**
* No such process.
*/
#define __WASI_ERRNO_SRCH (UINT16_C(71))
/**
* Reserved.
*/
#define __WASI_ERRNO_STALE (UINT16_C(72))
/**
* Connection timed out.
*/
#define __WASI_ERRNO_TIMEDOUT (UINT16_C(73))
/**
* Text file busy.
*/
#define __WASI_ERRNO_TXTBSY (UINT16_C(74))
/**
* Cross-device link.
*/
#define __WASI_ERRNO_XDEV (UINT16_C(75))
/**
* Extension: Capabilities insufficient.
*/
#define __WASI_ERRNO_NOTCAPABLE (UINT16_C(76))
_Static_assert(sizeof(__wasi_errno_t) == 2, "witx calculated size");
_Static_assert(_Alignof(__wasi_errno_t) == 2, "witx calculated align");
/**
* File descriptor rights, determining which actions may be performed.
*/
typedef uint64_t __wasi_rights_t;
/**
* The right to invoke `fd_datasync`.
* If `path_open` is set, includes the right to invoke
* `path_open` with `fdflags::dsync`.
*/
#define __WASI_RIGHTS_FD_DATASYNC ((__wasi_rights_t)(1 << 0))
/**
* The right to invoke `fd_read` and `sock_recv`.
* If `rights::fd_seek` is set, includes the right to invoke `fd_pread`.
*/
#define __WASI_RIGHTS_FD_READ ((__wasi_rights_t)(1 << 1))
/**
* The right to invoke `fd_seek`. This flag implies `rights::fd_tell`.
*/
#define __WASI_RIGHTS_FD_SEEK ((__wasi_rights_t)(1 << 2))
/**
* The right to invoke `fd_fdstat_set_flags`.
*/
#define __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS ((__wasi_rights_t)(1 << 3))
/**
* The right to invoke `fd_sync`.
* If `path_open` is set, includes the right to invoke
* `path_open` with `fdflags::rsync` and `fdflags::dsync`.
*/
#define __WASI_RIGHTS_FD_SYNC ((__wasi_rights_t)(1 << 4))
/**
* The right to invoke `fd_seek` in such a way that the file offset
* remains unaltered (i.e., `whence::cur` with offset zero), or to
* invoke `fd_tell`.
*/
#define __WASI_RIGHTS_FD_TELL ((__wasi_rights_t)(1 << 5))
/**
* The right to invoke `fd_write` and `sock_send`.
* If `rights::fd_seek` is set, includes the right to invoke `fd_pwrite`.
*/
#define __WASI_RIGHTS_FD_WRITE ((__wasi_rights_t)(1 << 6))
/**
* The right to invoke `fd_advise`.
*/
#define __WASI_RIGHTS_FD_ADVISE ((__wasi_rights_t)(1 << 7))
/**
* The right to invoke `fd_allocate`.
*/
#define __WASI_RIGHTS_FD_ALLOCATE ((__wasi_rights_t)(1 << 8))
/**
* The right to invoke `path_create_directory`.
*/
#define __WASI_RIGHTS_PATH_CREATE_DIRECTORY ((__wasi_rights_t)(1 << 9))
/**
* If `path_open` is set, the right to invoke `path_open` with `oflags::creat`.
*/
#define __WASI_RIGHTS_PATH_CREATE_FILE ((__wasi_rights_t)(1 << 10))
/**
* The right to invoke `path_link` with the file descriptor as the
* source directory.
*/
#define __WASI_RIGHTS_PATH_LINK_SOURCE ((__wasi_rights_t)(1 << 11))
/**
* The right to invoke `path_link` with the file descriptor as the
* target directory.
*/
#define __WASI_RIGHTS_PATH_LINK_TARGET ((__wasi_rights_t)(1 << 12))
/**
* The right to invoke `path_open`.
*/
#define __WASI_RIGHTS_PATH_OPEN ((__wasi_rights_t)(1 << 13))
/**
* The right to invoke `fd_readdir`.
*/
#define __WASI_RIGHTS_FD_READDIR ((__wasi_rights_t)(1 << 14))
/**
* The right to invoke `path_readlink`.
*/
#define __WASI_RIGHTS_PATH_READLINK ((__wasi_rights_t)(1 << 15))
/**
* The right to invoke `path_rename` with the file descriptor as the source directory.
*/
#define __WASI_RIGHTS_PATH_RENAME_SOURCE ((__wasi_rights_t)(1 << 16))
/**
* The right to invoke `path_rename` with the file descriptor as the target directory.
*/
#define __WASI_RIGHTS_PATH_RENAME_TARGET ((__wasi_rights_t)(1 << 17))
/**
* The right to invoke `path_filestat_get`.
*/
#define __WASI_RIGHTS_PATH_FILESTAT_GET ((__wasi_rights_t)(1 << 18))
/**
* The right to change a file's size (there is no `path_filestat_set_size`).
* If `path_open` is set, includes the right to invoke `path_open` with `oflags::trunc`.
*/
#define __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 19))
/**
* The right to invoke `path_filestat_set_times`.
*/
#define __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 20))
/**
* The right to invoke `fd_filestat_get`.
*/
#define __WASI_RIGHTS_FD_FILESTAT_GET ((__wasi_rights_t)(1 << 21))
/**
* The right to invoke `fd_filestat_set_size`.
*/
#define __WASI_RIGHTS_FD_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 22))
/**
* The right to invoke `fd_filestat_set_times`.
*/
#define __WASI_RIGHTS_FD_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 23))
/**
* The right to invoke `path_symlink`.
*/
#define __WASI_RIGHTS_PATH_SYMLINK ((__wasi_rights_t)(1 << 24))
/**
* The right to invoke `path_remove_directory`.
*/
#define __WASI_RIGHTS_PATH_REMOVE_DIRECTORY ((__wasi_rights_t)(1 << 25))
/**
* The right to invoke `path_unlink_file`.
*/
#define __WASI_RIGHTS_PATH_UNLINK_FILE ((__wasi_rights_t)(1 << 26))
/**
* If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`.
* If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`.
*/
#define __WASI_RIGHTS_POLL_FD_READWRITE ((__wasi_rights_t)(1 << 27))
/**
* The right to invoke `sock_shutdown`.
*/
#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
/**
* A file descriptor handle.
*/
typedef int __wasi_fd_t;
_Static_assert(sizeof(__wasi_fd_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_fd_t) == 4, "witx calculated align");
/**
* A region of memory for scatter/gather reads.
*/
typedef struct __wasi_iovec_t {
/**
* The address of the buffer to be filled.
*/
uint8_t * buf;
/**
* The length of the buffer to be filled.
*/
__wasi_size_t buf_len;
} __wasi_iovec_t;
_Static_assert(sizeof(__wasi_iovec_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_iovec_t) == 4, "witx calculated align");
_Static_assert(offsetof(__wasi_iovec_t, buf) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_iovec_t, buf_len) == 4, "witx calculated offset");
/**
* A region of memory for scatter/gather writes.
*/
typedef struct __wasi_ciovec_t {
/**
* The address of the buffer to be written.
*/
const uint8_t * buf;
/**
* The length of the buffer to be written.
*/
__wasi_size_t buf_len;
} __wasi_ciovec_t;
_Static_assert(sizeof(__wasi_ciovec_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_ciovec_t) == 4, "witx calculated align");
_Static_assert(offsetof(__wasi_ciovec_t, buf) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_ciovec_t, buf_len) == 4, "witx calculated offset");
/**
* Relative offset within a file.
*/
typedef int64_t __wasi_filedelta_t;
_Static_assert(sizeof(__wasi_filedelta_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_filedelta_t) == 8, "witx calculated align");
/**
* The position relative to which to set the offset of the file descriptor.
*/
typedef uint8_t __wasi_whence_t;
/**
* Seek relative to start-of-file.
*/
#define __WASI_WHENCE_SET (UINT8_C(0))
/**
* Seek relative to current position.
*/
#define __WASI_WHENCE_CUR (UINT8_C(1))
/**
* Seek relative to end-of-file.
*/
#define __WASI_WHENCE_END (UINT8_C(2))
_Static_assert(sizeof(__wasi_whence_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_whence_t) == 1, "witx calculated align");
/**
* A reference to the offset of a directory entry.
*
* The value 0 signifies the start of the directory.
*/
typedef uint64_t __wasi_dircookie_t;
_Static_assert(sizeof(__wasi_dircookie_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_dircookie_t) == 8, "witx calculated align");
/**
* The type for the `dirent::d_namlen` field of `dirent` struct.
*/
typedef uint32_t __wasi_dirnamlen_t;
_Static_assert(sizeof(__wasi_dirnamlen_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_dirnamlen_t) == 4, "witx calculated align");
/**
* File serial number that is unique within its file system.
*/
typedef uint64_t __wasi_inode_t;
_Static_assert(sizeof(__wasi_inode_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_inode_t) == 8, "witx calculated align");
/**
* The type of a file descriptor or file.
*/
typedef uint8_t __wasi_filetype_t;
/**
* The type of the file descriptor or file is unknown or is different from any of the other types specified.
*/
#define __WASI_FILETYPE_UNKNOWN (UINT8_C(0))
/**
* The file descriptor or file refers to a block device inode.
*/
#define __WASI_FILETYPE_BLOCK_DEVICE (UINT8_C(1))
/**
* The file descriptor or file refers to a character device inode.
*/
#define __WASI_FILETYPE_CHARACTER_DEVICE (UINT8_C(2))
/**
* The file descriptor or file refers to a directory inode.
*/
#define __WASI_FILETYPE_DIRECTORY (UINT8_C(3))
/**
* The file descriptor or file refers to a regular file inode.
*/
#define __WASI_FILETYPE_REGULAR_FILE (UINT8_C(4))
/**
* The file descriptor or file refers to a datagram socket.
*/
#define __WASI_FILETYPE_SOCKET_DGRAM (UINT8_C(5))
/**
* The file descriptor or file refers to a byte-stream socket.
*/
#define __WASI_FILETYPE_SOCKET_STREAM (UINT8_C(6))
/**
* The file refers to a symbolic link inode.
*/
#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
_Static_assert(sizeof(__wasi_filetype_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_filetype_t) == 1, "witx calculated align");
/**
* A directory entry.
*/
typedef struct __wasi_dirent_t {
/**
* The offset of the next directory entry stored in this directory.
*/
__wasi_dircookie_t d_next;
/**
* The serial number of the file referred to by this directory entry.
*/
__wasi_inode_t d_ino;
/**
* The length of the name of the directory entry.
*/
__wasi_dirnamlen_t d_namlen;
/**
* The type of the file referred to by this directory entry.
*/
__wasi_filetype_t d_type;
} __wasi_dirent_t;
_Static_assert(sizeof(__wasi_dirent_t) == 24, "witx calculated size");
_Static_assert(_Alignof(__wasi_dirent_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_dirent_t, d_next) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_dirent_t, d_ino) == 8, "witx calculated offset");
_Static_assert(offsetof(__wasi_dirent_t, d_namlen) == 16, "witx calculated offset");
_Static_assert(offsetof(__wasi_dirent_t, d_type) == 20, "witx calculated offset");
/**
* File or memory access pattern advisory information.
*/
typedef uint8_t __wasi_advice_t;
/**
* The application has no advice to give on its behavior with respect to the specified data.
*/
#define __WASI_ADVICE_NORMAL (UINT8_C(0))
/**
* The application expects to access the specified data sequentially from lower offsets to higher offsets.
*/
#define __WASI_ADVICE_SEQUENTIAL (UINT8_C(1))
/**
* The application expects to access the specified data in a random order.
*/
#define __WASI_ADVICE_RANDOM (UINT8_C(2))
/**
* The application expects to access the specified data in the near future.
*/
#define __WASI_ADVICE_WILLNEED (UINT8_C(3))
/**
* The application expects that it will not access the specified data in the near future.
*/
#define __WASI_ADVICE_DONTNEED (UINT8_C(4))
/**
* The application expects to access the specified data once and then not reuse it thereafter.
*/
#define __WASI_ADVICE_NOREUSE (UINT8_C(5))
_Static_assert(sizeof(__wasi_advice_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_advice_t) == 1, "witx calculated align");
/**
* File descriptor flags.
*/
typedef uint16_t __wasi_fdflags_t;
/**
* Append mode: Data written to the file is always appended to the file's end.
*/
#define __WASI_FDFLAGS_APPEND ((__wasi_fdflags_t)(1 << 0))
/**
* Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
*/
#define __WASI_FDFLAGS_DSYNC ((__wasi_fdflags_t)(1 << 1))
/**
* Non-blocking mode.
*/
#define __WASI_FDFLAGS_NONBLOCK ((__wasi_fdflags_t)(1 << 2))
/**
* Synchronized read I/O operations.
*/
#define __WASI_FDFLAGS_RSYNC ((__wasi_fdflags_t)(1 << 3))
/**
* Write according to synchronized I/O file integrity completion. In
* addition to synchronizing the data stored in the file, the implementation
* may also synchronously update the file's metadata.
*/
#define __WASI_FDFLAGS_SYNC ((__wasi_fdflags_t)(1 << 4))
/**
* File descriptor attributes.
*/
typedef struct __wasi_fdstat_t {
/**
* File type.
*/
__wasi_filetype_t fs_filetype;
/**
* File descriptor flags.
*/
__wasi_fdflags_t fs_flags;
/**
* Rights that apply to this file descriptor.
*/
__wasi_rights_t fs_rights_base;
/**
* Maximum set of rights that may be installed on new file descriptors that
* are created through this file descriptor, e.g., through `path_open`.
*/
__wasi_rights_t fs_rights_inheriting;
} __wasi_fdstat_t;
_Static_assert(sizeof(__wasi_fdstat_t) == 24, "witx calculated size");
_Static_assert(_Alignof(__wasi_fdstat_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_fdstat_t, fs_filetype) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_fdstat_t, fs_flags) == 2, "witx calculated offset");
_Static_assert(offsetof(__wasi_fdstat_t, fs_rights_base) == 8, "witx calculated offset");
_Static_assert(offsetof(__wasi_fdstat_t, fs_rights_inheriting) == 16, "witx calculated offset");
/**
* Identifier for a device containing a file system. Can be used in combination
* with `inode` to uniquely identify a file or directory in the filesystem.
*/
typedef uint64_t __wasi_device_t;
_Static_assert(sizeof(__wasi_device_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_device_t) == 8, "witx calculated align");
/**
* Which file time attributes to adjust.
*/
typedef uint16_t __wasi_fstflags_t;
/**
* Adjust the last data access timestamp to the value stored in `filestat::atim`.
*/
#define __WASI_FSTFLAGS_ATIM ((__wasi_fstflags_t)(1 << 0))
/**
* Adjust the last data access timestamp to the time of clock `clockid::realtime`.
*/
#define __WASI_FSTFLAGS_ATIM_NOW ((__wasi_fstflags_t)(1 << 1))
/**
* Adjust the last data modification timestamp to the value stored in `filestat::mtim`.
*/
#define __WASI_FSTFLAGS_MTIM ((__wasi_fstflags_t)(1 << 2))
/**
* Adjust the last data modification timestamp to the time of clock `clockid::realtime`.
*/
#define __WASI_FSTFLAGS_MTIM_NOW ((__wasi_fstflags_t)(1 << 3))
/**
* Flags determining the method of how paths are resolved.
*/
typedef uint32_t __wasi_lookupflags_t;
/**
* As long as the resolved path corresponds to a symbolic link, it is expanded.
*/
#define __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW ((__wasi_lookupflags_t)(1 << 0))
/**
* Open flags used by `path_open`.
*/
typedef uint16_t __wasi_oflags_t;
/**
* Create file if it does not exist.
*/
#define __WASI_OFLAGS_CREAT ((__wasi_oflags_t)(1 << 0))
/**
* Fail if not a directory.
*/
#define __WASI_OFLAGS_DIRECTORY ((__wasi_oflags_t)(1 << 1))
/**
* Fail if file already exists.
*/
#define __WASI_OFLAGS_EXCL ((__wasi_oflags_t)(1 << 2))
/**
* Truncate file to size 0.
*/
#define __WASI_OFLAGS_TRUNC ((__wasi_oflags_t)(1 << 3))
/**
* Number of hard links to an inode.
*/
typedef uint64_t __wasi_linkcount_t;
_Static_assert(sizeof(__wasi_linkcount_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_linkcount_t) == 8, "witx calculated align");
/**
* File attributes.
*/
typedef struct __wasi_filestat_t {
/**
* Device ID of device containing the file.
*/
__wasi_device_t dev;
/**
* File serial number.
*/
__wasi_inode_t ino;
/**
* File type.
*/
__wasi_filetype_t filetype;
/**
* Number of hard links to the file.
*/
__wasi_linkcount_t nlink;
/**
* For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link.
*/
__wasi_filesize_t size;
/**
* Last data access timestamp.
*/
__wasi_timestamp_t atim;
/**
* Last data modification timestamp.
*/
__wasi_timestamp_t mtim;
/**
* Last file status change timestamp.
*/
__wasi_timestamp_t ctim;
} __wasi_filestat_t;
_Static_assert(sizeof(__wasi_filestat_t) == 64, "witx calculated size");
_Static_assert(_Alignof(__wasi_filestat_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_filestat_t, dev) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, ino) == 8, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, filetype) == 16, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, nlink) == 24, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, size) == 32, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, atim) == 40, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, mtim) == 48, "witx calculated offset");
_Static_assert(offsetof(__wasi_filestat_t, ctim) == 56, "witx calculated offset");
/**
* User-provided value that may be attached to objects that is retained when
* extracted from the implementation.
*/
typedef uint64_t __wasi_userdata_t;
_Static_assert(sizeof(__wasi_userdata_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_userdata_t) == 8, "witx calculated align");
/**
* Type of a subscription to an event or its occurrence.
*/
typedef uint8_t __wasi_eventtype_t;
/**
* The time value of clock `subscription_clock::id` has
* reached timestamp `subscription_clock::timeout`.
*/
#define __WASI_EVENTTYPE_CLOCK (UINT8_C(0))
/**
* File descriptor `subscription_fd_readwrite::file_descriptor` has data
* available for reading. This event always triggers for regular files.
*/
#define __WASI_EVENTTYPE_FD_READ (UINT8_C(1))
/**
* File descriptor `subscription_fd_readwrite::file_descriptor` has capacity
* available for writing. This event always triggers for regular files.
*/
#define __WASI_EVENTTYPE_FD_WRITE (UINT8_C(2))
_Static_assert(sizeof(__wasi_eventtype_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_eventtype_t) == 1, "witx calculated align");
/**
* The state of the file descriptor subscribed to with
* `eventtype::fd_read` or `eventtype::fd_write`.
*/
typedef uint16_t __wasi_eventrwflags_t;
/**
* The peer of this socket has closed or disconnected.
*/
#define __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP ((__wasi_eventrwflags_t)(1 << 0))
/**
* The contents of an `event` when type is `eventtype::fd_read` or
* `eventtype::fd_write`.
*/
typedef struct __wasi_event_fd_readwrite_t {
/**
* The number of bytes available for reading or writing.
*/
__wasi_filesize_t nbytes;
/**
* The state of the file descriptor.
*/
__wasi_eventrwflags_t flags;
} __wasi_event_fd_readwrite_t;
_Static_assert(sizeof(__wasi_event_fd_readwrite_t) == 16, "witx calculated size");
_Static_assert(_Alignof(__wasi_event_fd_readwrite_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_event_fd_readwrite_t, nbytes) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_event_fd_readwrite_t, flags) == 8, "witx calculated offset");
/**
* An event that occurred.
*/
typedef struct __wasi_event_t {
/**
* User-provided value that got attached to `subscription::userdata`.
*/
__wasi_userdata_t userdata;
/**
* If non-zero, an error that occurred while processing the subscription request.
*/
__wasi_errno_t error;
/**
* The type of event that occured
*/
__wasi_eventtype_t type;
/**
* The contents of the event, if it is an `eventtype::fd_read` or
* `eventtype::fd_write`. `eventtype::clock` events ignore this field.
*/
__wasi_event_fd_readwrite_t fd_readwrite;
} __wasi_event_t;
_Static_assert(sizeof(__wasi_event_t) == 32, "witx calculated size");
_Static_assert(_Alignof(__wasi_event_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_event_t, userdata) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_event_t, error) == 8, "witx calculated offset");
_Static_assert(offsetof(__wasi_event_t, type) == 10, "witx calculated offset");
_Static_assert(offsetof(__wasi_event_t, fd_readwrite) == 16, "witx calculated offset");
/**
* Flags determining how to interpret the timestamp provided in
* `subscription_clock::timeout`.
*/
typedef uint16_t __wasi_subclockflags_t;
/**
* If set, treat the timestamp provided in
* `subscription_clock::timeout` as an absolute timestamp of clock
* `subscription_clock::id`. If clear, treat the timestamp
* provided in `subscription_clock::timeout` relative to the
* current time value of clock `subscription_clock::id`.
*/
#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
/**
* The contents of a `subscription` when type is `eventtype::clock`.
*/
typedef struct __wasi_subscription_clock_t {
/**
* The clock against which to compare the timestamp.
*/
__wasi_clockid_t id;
/**
* The absolute or relative timestamp.
*/
__wasi_timestamp_t timeout;
/**
* The amount of time that the implementation may wait additionally
* to coalesce with other events.
*/
__wasi_timestamp_t precision;
/**
* Flags specifying whether the timeout is absolute or relative
*/
__wasi_subclockflags_t flags;
} __wasi_subscription_clock_t;
_Static_assert(sizeof(__wasi_subscription_clock_t) == 32, "witx calculated size");
_Static_assert(_Alignof(__wasi_subscription_clock_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_subscription_clock_t, id) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_subscription_clock_t, timeout) == 8, "witx calculated offset");
_Static_assert(offsetof(__wasi_subscription_clock_t, precision) == 16, "witx calculated offset");
_Static_assert(offsetof(__wasi_subscription_clock_t, flags) == 24, "witx calculated offset");
/**
* The contents of a `subscription` when type is type is
* `eventtype::fd_read` or `eventtype::fd_write`.
*/
typedef struct __wasi_subscription_fd_readwrite_t {
/**
* The file descriptor on which to wait for it to become ready for reading or writing.
*/
__wasi_fd_t file_descriptor;
} __wasi_subscription_fd_readwrite_t;
_Static_assert(sizeof(__wasi_subscription_fd_readwrite_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_subscription_fd_readwrite_t) == 4, "witx calculated align");
_Static_assert(offsetof(__wasi_subscription_fd_readwrite_t, file_descriptor) == 0, "witx calculated offset");
/**
* The contents of a `subscription`.
*/
typedef union __wasi_subscription_u_u_t {
__wasi_subscription_clock_t clock;
__wasi_subscription_fd_readwrite_t fd_read;
__wasi_subscription_fd_readwrite_t fd_write;
} __wasi_subscription_u_u_t;
typedef struct __wasi_subscription_u_t {
uint8_t tag;
__wasi_subscription_u_u_t u;
} __wasi_subscription_u_t;
_Static_assert(sizeof(__wasi_subscription_u_t) == 40, "witx calculated size");
_Static_assert(_Alignof(__wasi_subscription_u_t) == 8, "witx calculated align");
/**
* Subscription to an event.
*/
typedef struct __wasi_subscription_t {
/**
* User-provided value that is attached to the subscription in the
* implementation and returned through `event::userdata`.
*/
__wasi_userdata_t userdata;
/**
* The type of the event to which to subscribe, and its contents
*/
__wasi_subscription_u_t u;
} __wasi_subscription_t;
_Static_assert(sizeof(__wasi_subscription_t) == 48, "witx calculated size");
_Static_assert(_Alignof(__wasi_subscription_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_subscription_t, userdata) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_subscription_t, u) == 8, "witx calculated offset");
/**
* Exit code generated by a process when exiting.
*/
typedef uint32_t __wasi_exitcode_t;
_Static_assert(sizeof(__wasi_exitcode_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_exitcode_t) == 4, "witx calculated align");
/**
* Signal condition.
*/
typedef uint8_t __wasi_signal_t;
/**
* No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
* so this value is reserved.
*/
#define __WASI_SIGNAL_NONE (UINT8_C(0))
/**
* Hangup.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_HUP (UINT8_C(1))
/**
* Terminate interrupt signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_INT (UINT8_C(2))
/**
* Terminal quit signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_QUIT (UINT8_C(3))
/**
* Illegal instruction.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_ILL (UINT8_C(4))
/**
* Trace/breakpoint trap.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_TRAP (UINT8_C(5))
/**
* Process abort signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_ABRT (UINT8_C(6))
/**
* Access to an undefined portion of a memory object.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_BUS (UINT8_C(7))
/**
* Erroneous arithmetic operation.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_FPE (UINT8_C(8))
/**
* Kill.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_KILL (UINT8_C(9))
/**
* User-defined signal 1.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_USR1 (UINT8_C(10))
/**
* Invalid memory reference.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_SEGV (UINT8_C(11))
/**
* User-defined signal 2.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_USR2 (UINT8_C(12))
/**
* Write on a pipe with no one to read it.
* Action: Ignored.
*/
#define __WASI_SIGNAL_PIPE (UINT8_C(13))
/**
* Alarm clock.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_ALRM (UINT8_C(14))
/**
* Termination signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_TERM (UINT8_C(15))
/**
* Child process terminated, stopped, or continued.
* Action: Ignored.
*/
#define __WASI_SIGNAL_CHLD (UINT8_C(16))
/**
* Continue executing, if stopped.
* Action: Continues executing, if stopped.
*/
#define __WASI_SIGNAL_CONT (UINT8_C(17))
/**
* Stop executing.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_STOP (UINT8_C(18))
/**
* Terminal stop signal.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_TSTP (UINT8_C(19))
/**
* Background process attempting read.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_TTIN (UINT8_C(20))
/**
* Background process attempting write.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_TTOU (UINT8_C(21))
/**
* High bandwidth data is available at a socket.
* Action: Ignored.
*/
#define __WASI_SIGNAL_URG (UINT8_C(22))
/**
* CPU time limit exceeded.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_XCPU (UINT8_C(23))
/**
* File size limit exceeded.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
/**
* Virtual timer expired.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
/**
* Profiling timer expired.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_PROF (UINT8_C(26))
/**
* Window changed.
* Action: Ignored.
*/
#define __WASI_SIGNAL_WINCH (UINT8_C(27))
/**
* I/O possible.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_POLL (UINT8_C(28))
/**
* Power failure.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_PWR (UINT8_C(29))
/**
* Bad system call.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_SYS (UINT8_C(30))
_Static_assert(sizeof(__wasi_signal_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_signal_t) == 1, "witx calculated align");
/**
* Flags provided to `sock_recv`.
*/
typedef uint16_t __wasi_riflags_t;
/**
* Returns the message without removing it from the socket's receive queue.
*/
#define __WASI_RIFLAGS_RECV_PEEK ((__wasi_riflags_t)(1 << 0))
/**
* On byte-stream sockets, block until the full amount of data can be returned.
*/
#define __WASI_RIFLAGS_RECV_WAITALL ((__wasi_riflags_t)(1 << 1))
/**
* Flags returned by `sock_recv`.
*/
typedef uint16_t __wasi_roflags_t;
/**
* Returned by `sock_recv`: Message data has been truncated.
*/
#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
/**
* Flags provided to `sock_send`. As there are currently no flags
* defined, it must be set to zero.
*/
typedef uint16_t __wasi_siflags_t;
_Static_assert(sizeof(__wasi_siflags_t) == 2, "witx calculated size");
_Static_assert(_Alignof(__wasi_siflags_t) == 2, "witx calculated align");
/**
* Which channels on a socket to shut down.
*/
typedef uint8_t __wasi_sdflags_t;
/**
* Disables further receive operations.
*/
#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
/**
* Disables further send operations.
*/
#define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
/**
* Identifiers for preopened capabilities.
*/
typedef uint8_t __wasi_preopentype_t;
/**
* A pre-opened directory.
*/
#define __WASI_PREOPENTYPE_DIR (UINT8_C(0))
_Static_assert(sizeof(__wasi_preopentype_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_preopentype_t) == 1, "witx calculated align");
/**
* The contents of a $prestat when type is `preopentype::dir`.
*/
typedef struct __wasi_prestat_dir_t {
/**
* The length of the directory name for use with `fd_prestat_dir_name`.
*/
__wasi_size_t pr_name_len;
} __wasi_prestat_dir_t;
_Static_assert(sizeof(__wasi_prestat_dir_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_prestat_dir_t) == 4, "witx calculated align");
_Static_assert(offsetof(__wasi_prestat_dir_t, pr_name_len) == 0, "witx calculated offset");
/**
* Information about a pre-opened capability.
*/
typedef union __wasi_prestat_u_t {
__wasi_prestat_dir_t dir;
} __wasi_prestat_u_t;
typedef struct __wasi_prestat_t {
uint8_t tag;
__wasi_prestat_u_t u;
} __wasi_prestat_t;
_Static_assert(sizeof(__wasi_prestat_t) == 8, "witx calculated size");
_Static_assert(_Alignof(__wasi_prestat_t) == 4, "witx calculated align");
/**
* @defgroup wasi_snapshot_preview1
* @{
*/
/**
* Read command-line argument data.
* The size of the array should match that returned by `args_sizes_get`
*/
__wasi_errno_t __wasi_args_get(
uint8_t * * argv,
uint8_t * argv_buf
) __attribute__((__warn_unused_result__));
/**
* Return command-line argument data sizes.
* @return
* Returns the number of arguments and the size of the argument string
* data, or an error.
*/
__wasi_errno_t __wasi_args_sizes_get(
__wasi_size_t *retptr0,
__wasi_size_t *retptr1
) __attribute__((__warn_unused_result__));
/**
* Read environment variable data.
* The sizes of the buffers should match that returned by `environ_sizes_get`.
*/
__wasi_errno_t __wasi_environ_get(
uint8_t * * environ,
uint8_t * environ_buf
) __attribute__((__warn_unused_result__));
/**
* Return environment variable data sizes.
* @return
* Returns the number of environment variable arguments and the size of the
* environment variable data.
*/
__wasi_errno_t __wasi_environ_sizes_get(
__wasi_size_t *retptr0,
__wasi_size_t *retptr1
) __attribute__((__warn_unused_result__));
/**
* Return the resolution of a clock.
* Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
* return `errno::inval`.
* Note: This is similar to `clock_getres` in POSIX.
* @return
* The resolution of the clock, or an error if one happened.
*/
__wasi_errno_t __wasi_clock_res_get(
/**
* The clock for which to return the resolution.
*/
__wasi_clockid_t id,
__wasi_timestamp_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Return the time value of a clock.
* Note: This is similar to `clock_gettime` in POSIX.
* @return
* The time value of the clock.
*/
__wasi_errno_t __wasi_clock_time_get(
/**
* The clock for which to return the time.
*/
__wasi_clockid_t id,
/**
* The maximum lag (exclusive) that the returned time value may have, compared to its actual value.
*/
__wasi_timestamp_t precision,
__wasi_timestamp_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Provide file advisory information on a file descriptor.
* Note: This is similar to `posix_fadvise` in POSIX.
*/
__wasi_errno_t __wasi_fd_advise(
__wasi_fd_t fd,
/**
* The offset within the file to which the advisory applies.
*/
__wasi_filesize_t offset,
/**
* The length of the region to which the advisory applies.
*/
__wasi_filesize_t len,
/**
* The advice.
*/
__wasi_advice_t advice
) __attribute__((__warn_unused_result__));
/**
* Force the allocation of space in a file.
* Note: This is similar to `posix_fallocate` in POSIX.
*/
__wasi_errno_t __wasi_fd_allocate(
__wasi_fd_t fd,
/**
* The offset at which to start the allocation.
*/
__wasi_filesize_t offset,
/**
* The length of the area that is allocated.
*/
__wasi_filesize_t len
) __attribute__((__warn_unused_result__));
/**
* Close a file descriptor.
* Note: This is similar to `close` in POSIX.
*/
__wasi_errno_t __wasi_fd_close(
__wasi_fd_t fd
) __attribute__((__warn_unused_result__));
/**
* Synchronize the data of a file to disk.
* Note: This is similar to `fdatasync` in POSIX.
*/
__wasi_errno_t __wasi_fd_datasync(
__wasi_fd_t fd
) __attribute__((__warn_unused_result__));
/**
* Get the attributes of a file descriptor.
* Note: This returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as well as additional fields.
* @return
* The buffer where the file descriptor's attributes are stored.
*/
__wasi_errno_t __wasi_fd_fdstat_get(
__wasi_fd_t fd,
__wasi_fdstat_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Adjust the flags associated with a file descriptor.
* Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
*/
__wasi_errno_t __wasi_fd_fdstat_set_flags(
__wasi_fd_t fd,
/**
* The desired values of the file descriptor flags.
*/
__wasi_fdflags_t flags
) __attribute__((__warn_unused_result__));
/**
* Adjust the rights associated with a file descriptor.
* This can only be used to remove rights, and returns `errno::notcapable` if called in a way that would attempt to add rights
*/
__wasi_errno_t __wasi_fd_fdstat_set_rights(
__wasi_fd_t fd,
/**
* The desired rights of the file descriptor.
*/
__wasi_rights_t fs_rights_base,
__wasi_rights_t fs_rights_inheriting
) __attribute__((__warn_unused_result__));
/**
* Return the attributes of an open file.
* @return
* The buffer where the file's attributes are stored.
*/
__wasi_errno_t __wasi_fd_filestat_get(
__wasi_fd_t fd,
__wasi_filestat_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
* Note: This is similar to `ftruncate` in POSIX.
*/
__wasi_errno_t __wasi_fd_filestat_set_size(
__wasi_fd_t fd,
/**
* The desired file size.
*/
__wasi_filesize_t size
) __attribute__((__warn_unused_result__));
/**
* Adjust the timestamps of an open file or directory.
* Note: This is similar to `futimens` in POSIX.
*/
__wasi_errno_t __wasi_fd_filestat_set_times(
__wasi_fd_t fd,
/**
* The desired values of the data access timestamp.
*/
__wasi_timestamp_t atim,
/**
* The desired values of the data modification timestamp.
*/
__wasi_timestamp_t mtim,
/**
* A bitmask indicating which timestamps to adjust.
*/
__wasi_fstflags_t fst_flags
) __attribute__((__warn_unused_result__));
/**
* Read from a file descriptor, without using and updating the file descriptor's offset.
* Note: This is similar to `preadv` in POSIX.
* @return
* The number of bytes read.
*/
__wasi_errno_t __wasi_fd_pread(
__wasi_fd_t fd,
/**
* List of scatter/gather vectors in which to store data.
*/
const __wasi_iovec_t *iovs,
/**
* The length of the array pointed to by `iovs`.
*/
size_t iovs_len,
/**
* The offset within the file at which to read.
*/
__wasi_filesize_t offset,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Return a description of the given preopened file descriptor.
* @return
* The buffer where the description is stored.
*/
__wasi_errno_t __wasi_fd_prestat_get(
__wasi_fd_t fd,
__wasi_prestat_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Return a description of the given preopened file descriptor.
*/
__wasi_errno_t __wasi_fd_prestat_dir_name(
__wasi_fd_t fd,
/**
* A buffer into which to write the preopened directory name.
*/
uint8_t * path,
__wasi_size_t path_len
) __attribute__((__warn_unused_result__));
/**
* Write to a file descriptor, without using and updating the file descriptor's offset.
* Note: This is similar to `pwritev` in POSIX.
* @return
* The number of bytes written.
*/
__wasi_errno_t __wasi_fd_pwrite(
__wasi_fd_t fd,
/**
* List of scatter/gather vectors from which to retrieve data.
*/
const __wasi_ciovec_t *iovs,
/**
* The length of the array pointed to by `iovs`.
*/
size_t iovs_len,
/**
* The offset within the file at which to write.
*/
__wasi_filesize_t offset,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Read from a file descriptor.
* Note: This is similar to `readv` in POSIX.
* @return
* The number of bytes read.
*/
__wasi_errno_t __wasi_fd_read(
__wasi_fd_t fd,
/**
* List of scatter/gather vectors to which to store data.
*/
const __wasi_iovec_t *iovs,
/**
* The length of the array pointed to by `iovs`.
*/
size_t iovs_len,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Read directory entries from a directory.
* When successful, the contents of the output buffer consist of a sequence of
* directory entries. Each directory entry consists of a `dirent` object,
* followed by `dirent::d_namlen` bytes holding the name of the directory
* entry.
* This function fills the output buffer as much as possible, potentially
* truncating the last directory entry. This allows the caller to grow its
* read buffer size in case it's too small to fit a single large directory
* entry, or skip the oversized directory entry.
* @return
* The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.
*/
__wasi_errno_t __wasi_fd_readdir(
__wasi_fd_t fd,
/**
* The buffer where directory entries are stored
*/
uint8_t * buf,
__wasi_size_t buf_len,
/**
* The location within the directory to start reading
*/
__wasi_dircookie_t cookie,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Atomically replace a file descriptor by renumbering another file descriptor.
* Due to the strong focus on thread safety, this environment does not provide
* a mechanism to duplicate or renumber a file descriptor to an arbitrary
* number, like `dup2()`. This would be prone to race conditions, as an actual
* file descriptor with the same number could be allocated by a different
* thread at the same time.
* This function provides a way to atomically renumber file descriptors, which
* would disappear if `dup2()` were to be removed entirely.
*/
__wasi_errno_t __wasi_fd_renumber(
__wasi_fd_t fd,
/**
* The file descriptor to overwrite.
*/
__wasi_fd_t to
) __attribute__((__warn_unused_result__));
/**
* Move the offset of a file descriptor.
* Note: This is similar to `lseek` in POSIX.
* @return
* The new offset of the file descriptor, relative to the start of the file.
*/
__wasi_errno_t __wasi_fd_seek(
__wasi_fd_t fd,
/**
* The number of bytes to move.
*/
__wasi_filedelta_t offset,
/**
* The base from which the offset is relative.
*/
__wasi_whence_t whence,
__wasi_filesize_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Synchronize the data and metadata of a file to disk.
* Note: This is similar to `fsync` in POSIX.
*/
__wasi_errno_t __wasi_fd_sync(
__wasi_fd_t fd
) __attribute__((__warn_unused_result__));
/**
* Return the current offset of a file descriptor.
* Note: This is similar to `lseek(fd, 0, SEEK_CUR)` in POSIX.
* @return
* The current offset of the file descriptor, relative to the start of the file.
*/
__wasi_errno_t __wasi_fd_tell(
__wasi_fd_t fd,
__wasi_filesize_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Write to a file descriptor.
* Note: This is similar to `writev` in POSIX.
*/
__wasi_errno_t __wasi_fd_write(
__wasi_fd_t fd,
/**
* List of scatter/gather vectors from which to retrieve data.
*/
const __wasi_ciovec_t *iovs,
/**
* The length of the array pointed to by `iovs`.
*/
size_t iovs_len,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Create a directory.
* Note: This is similar to `mkdirat` in POSIX.
*/
__wasi_errno_t __wasi_path_create_directory(
__wasi_fd_t fd,
/**
* The path at which to create the directory.
*/
const char *path
) __attribute__((__warn_unused_result__));
/**
* Return the attributes of a file or directory.
* Note: This is similar to `stat` in POSIX.
* @return
* The buffer where the file's attributes are stored.
*/
__wasi_errno_t __wasi_path_filestat_get(
__wasi_fd_t fd,
/**
* Flags determining the method of how the path is resolved.
*/
__wasi_lookupflags_t flags,
/**
* The path of the file or directory to inspect.
*/
const char *path,
__wasi_filestat_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Adjust the timestamps of a file or directory.
* Note: This is similar to `utimensat` in POSIX.
*/
__wasi_errno_t __wasi_path_filestat_set_times(
__wasi_fd_t fd,
/**
* Flags determining the method of how the path is resolved.
*/
__wasi_lookupflags_t flags,
/**
* The path of the file or directory to operate on.
*/
const char *path,
/**
* The desired values of the data access timestamp.
*/
__wasi_timestamp_t atim,
/**
* The desired values of the data modification timestamp.
*/
__wasi_timestamp_t mtim,
/**
* A bitmask indicating which timestamps to adjust.
*/
__wasi_fstflags_t fst_flags
) __attribute__((__warn_unused_result__));
/**
* Create a hard link.
* Note: This is similar to `linkat` in POSIX.
*/
__wasi_errno_t __wasi_path_link(
__wasi_fd_t old_fd,
/**
* Flags determining the method of how the path is resolved.
*/
__wasi_lookupflags_t old_flags,
/**
* The source path from which to link.
*/
const char *old_path,
/**
* The working directory at which the resolution of the new path starts.
*/
__wasi_fd_t new_fd,
/**
* The destination path at which to create the hard link.
*/
const char *new_path
) __attribute__((__warn_unused_result__));
/**
* Open a file or directory.
* The returned file descriptor is not guaranteed to be the lowest-numbered
* file descriptor not currently open; it is randomized to prevent
* applications from depending on making assumptions about indexes, since this
* is error-prone in multi-threaded contexts. The returned file descriptor is
* guaranteed to be less than 2**31.
* Note: This is similar to `openat` in POSIX.
* @return
* The file descriptor of the file that has been opened.
*/
__wasi_errno_t __wasi_path_open(
__wasi_fd_t fd,
/**
* Flags determining the method of how the path is resolved.
*/
__wasi_lookupflags_t dirflags,
/**
* The relative path of the file or directory to open, relative to the
* `path_open::fd` directory.
*/
const char *path,
/**
* The method by which to open the file.
*/
__wasi_oflags_t oflags,
/**
* The initial rights of the newly created file descriptor. The
* implementation is allowed to return a file descriptor with fewer rights
* than specified, if and only if those rights do not apply to the type of
* file being opened.
* The *base* rights are rights that will apply to operations using the file
* descriptor itself, while the *inheriting* rights are rights that apply to
* file descriptors derived from it.
*/
__wasi_rights_t fs_rights_base,
__wasi_rights_t fs_rights_inheriting,
__wasi_fdflags_t fdflags,
__wasi_fd_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Read the contents of a symbolic link.
* Note: This is similar to `readlinkat` in POSIX.
* @return
* The number of bytes placed in the buffer.
*/
__wasi_errno_t __wasi_path_readlink(
__wasi_fd_t fd,
/**
* The path of the symbolic link from which to read.
*/
const char *path,
/**
* The buffer to which to write the contents of the symbolic link.
*/
uint8_t * buf,
__wasi_size_t buf_len,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Remove a directory.
* Return `errno::notempty` if the directory is not empty.
* Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
*/
__wasi_errno_t __wasi_path_remove_directory(
__wasi_fd_t fd,
/**
* The path to a directory to remove.
*/
const char *path
) __attribute__((__warn_unused_result__));
/**
* Rename a file or directory.
* Note: This is similar to `renameat` in POSIX.
*/
__wasi_errno_t __wasi_path_rename(
__wasi_fd_t fd,
/**
* The source path of the file or directory to rename.
*/
const char *old_path,
/**
* The working directory at which the resolution of the new path starts.
*/
__wasi_fd_t new_fd,
/**
* The destination path to which to rename the file or directory.
*/
const char *new_path
) __attribute__((__warn_unused_result__));
/**
* Create a symbolic link.
* Note: This is similar to `symlinkat` in POSIX.
*/
__wasi_errno_t __wasi_path_symlink(
/**
* The contents of the symbolic link.
*/
const char *old_path,
__wasi_fd_t fd,
/**
* The destination path at which to create the symbolic link.
*/
const char *new_path
) __attribute__((__warn_unused_result__));
/**
* Unlink a file.
* Return `errno::isdir` if the path refers to a directory.
* Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
*/
__wasi_errno_t __wasi_path_unlink_file(
__wasi_fd_t fd,
/**
* The path to a file to unlink.
*/
const char *path
) __attribute__((__warn_unused_result__));
/**
* Concurrently poll for the occurrence of a set of events.
* @return
* The number of events stored.
*/
__wasi_errno_t __wasi_poll_oneoff(
/**
* The events to which to subscribe.
*/
const __wasi_subscription_t * in,
/**
* The events that have occurred.
*/
__wasi_event_t * out,
/**
* Both the number of subscriptions and events.
*/
__wasi_size_t nsubscriptions,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Terminate the process normally. An exit code of 0 indicates successful
* termination of the program. The meanings of other values is dependent on
* the environment.
*/
_Noreturn void __wasi_proc_exit(
/**
* The exit code returned by the process.
*/
__wasi_exitcode_t rval
);
/**
* Send a signal to the process of the calling thread.
* Note: This is similar to `raise` in POSIX.
*/
__wasi_errno_t __wasi_proc_raise(
/**
* The signal condition to trigger.
*/
__wasi_signal_t sig
) __attribute__((__warn_unused_result__));
/**
* Temporarily yield execution of the calling thread.
* Note: This is similar to `sched_yield` in POSIX.
*/
__wasi_errno_t __wasi_sched_yield(
void
) __attribute__((__warn_unused_result__));
/**
* Write high-quality random data into a buffer.
* This function blocks when the implementation is unable to immediately
* provide sufficient high-quality random data.
* This function may execute slowly, so when large mounts of random data are
* required, it's advisable to use this function to seed a pseudo-random
* number generator, rather than to provide the random data directly.
*/
__wasi_errno_t __wasi_random_get(
/**
* The buffer to fill with random data.
*/
uint8_t * buf,
__wasi_size_t buf_len
) __attribute__((__warn_unused_result__));
/**
* Receive a message from a socket.
* Note: This is similar to `recv` in POSIX, though it also supports reading
* the data into multiple buffers in the manner of `readv`.
* @return
* Number of bytes stored in ri_data and message flags.
*/
__wasi_errno_t __wasi_sock_recv(
__wasi_fd_t fd,
/**
* List of scatter/gather vectors to which to store data.
*/
const __wasi_iovec_t *ri_data,
/**
* The length of the array pointed to by `ri_data`.
*/
size_t ri_data_len,
/**
* Message flags.
*/
__wasi_riflags_t ri_flags,
__wasi_size_t *retptr0,
__wasi_roflags_t *retptr1
) __attribute__((__warn_unused_result__));
/**
* Send a message on a socket.
* Note: This is similar to `send` in POSIX, though it also supports writing
* the data from multiple buffers in the manner of `writev`.
* @return
* Number of bytes transmitted.
*/
__wasi_errno_t __wasi_sock_send(
__wasi_fd_t fd,
/**
* List of scatter/gather vectors to which to retrieve data
*/
const __wasi_ciovec_t *si_data,
/**
* The length of the array pointed to by `si_data`.
*/
size_t si_data_len,
/**
* Message flags.
*/
__wasi_siflags_t si_flags,
__wasi_size_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Shut down socket send and receive channels.
* Note: This is similar to `shutdown` in POSIX.
*/
__wasi_errno_t __wasi_sock_shutdown(
__wasi_fd_t fd,
/**
* Which channels on the socket to shut down.
*/
__wasi_sdflags_t how
) __attribute__((__warn_unused_result__));
/** @} */
#ifdef __cplusplus
}
#endif
#endif
@@ -1,19 +0,0 @@
#ifndef __wasi_libc_environ_h
#define __wasi_libc_environ_h
#ifdef __cplusplus
extern "C" {
#endif
/// Initialize the global environment variable state. Only needs to be
/// called once; most users should call `__wasilibc_ensure_environ` instead.
void __wasilibc_initialize_environ(void);
/// If `__wasilibc_initialize_environ` has not yet been called, call it.
void __wasilibc_ensure_environ(void);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,79 +0,0 @@
#ifndef __wasi_libc_find_relpath_h
#define __wasi_libc_find_relpath_h
#ifdef __cplusplus
extern "C" {
#endif
/**
* Look up the given `path`, relative to the cwd, in the preopened directory
* map. If a suitable entry is found, then the file descriptor for that entry
* is returned. Additionally the absolute path of the directory's file
* descriptor is returned in `abs_prefix` and the relative portion that needs
* to be opened is stored in `*relative_path`.
*
* The `relative_path` argument must be a pointer to a buffer valid for
* `relative_path_len` bytes, and this may be used as storage for the relative
* portion of the path being returned through `*relative_path`.
*
* See documentation on `__wasilibc_find_abspath` for more info about what the
* paths look like.
*
* Returns -1 on failure. Errno is set to either:
*
* * ENOMEM - failed to allocate memory for internal routines.
* * ENOENT - the `path` could not be found relative to any preopened dir.
* * ERANGE - the `relative_path` buffer is too small to hold the relative path.
*/
int __wasilibc_find_relpath(const char *path,
const char **__restrict__ abs_prefix,
char **relative_path,
size_t relative_path_len);
/**
* Look up the given `path`, which is interpreted as absolute, in the preopened
* directory map. If a suitable entry is found, then the file descriptor for
* that entry is returned. Additionally the relative portion of the path to
* where the fd is opened is returned through `relative_path`, the absolute
* prefix which was matched is stored to `abs_prefix`, and `relative_path` may
* be an interior pointer to the `abspath` string.
*
* The `abs_prefix` returned string will not contain a leading `/`. Note that
* this may be the empty string. Additionally the returned `relative_path` will
* not contain a leading `/`. The `relative_path` return will not return an
* empty string, it will return `"."` instead if it would otherwise do so.
*
* Returns -1 on failure. Errno is set to either:
*
* * ENOMEM - failed to allocate memory for internal routines.
* * ENOENT - the `path` could not be found relative to any preopened dir.
*/
int __wasilibc_find_abspath(const char *abspath,
const char **__restrict__ abs_prefix,
const char **__restrict__ relative_path);
/**
* Same as `__wasilibc_find_relpath`, except that this function will interpret
* `relative` as a malloc'd buffer that will be `realloc`'d to the appropriate
* size to contain the relative path.
*
* Note that this is a weak symbol and if it's not defined you can use
* `__wasilibc_find_relpath`. The weak-nature of this symbols means that if it's
* not otherwise included in the compilation then `chdir` wasn't used an there's
* no need for this symbol.
*
* See documentation on `__wasilibc_find_relpath` for more information.
*/
int __wasilibc_find_relpath_alloc(
const char *path,
const char **abs,
char **relative,
size_t *relative_len,
int can_realloc
) __attribute__((weak));
#ifdef __cplusplus
}
#endif
#endif
@@ -1,58 +0,0 @@
#ifndef __wasi_libc_nocwd_h
#define __wasi_libc_nocwd_h
/*
* In order to support AT_FDCWD, we need to wrap the *at functions to handle
* it by calling back into the non-at versions which perform libpreopen
* queries. These __wasilibc_nocwd_* forms are the underlying calls which
* assume AT_FDCWD has already been resolved.
*/
#define __need_size_t
#include <stddef.h>
#include <__typedef_ssize_t.h>
#include <__typedef_mode_t.h>
#include <__typedef_DIR.h>
#ifdef __cplusplus
extern "C" {
#endif
struct timespec;
struct stat;
struct dirent;
int __wasilibc_nocwd___wasilibc_unlinkat(int, const char *)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd___wasilibc_rmdirat(int, const char *)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_linkat(int, const char *, int, const char *, int)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_symlinkat(const char *, int, const char *)
__attribute__((__warn_unused_result__));
ssize_t __wasilibc_nocwd_readlinkat(int, const char *__restrict, char *__restrict, size_t)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_faccessat(int, const char *, int, int)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_renameat(int, const char *, int, const char *)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_openat_nomode(int, const char *, int)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_fstatat(int, const char *__restrict, struct stat *__restrict, int)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_mkdirat_nomode(int, const char *)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_utimensat(int, const char *, const struct timespec [2], int)
__attribute__((__warn_unused_result__));
DIR *__wasilibc_nocwd_opendirat(int, const char *)
__attribute__((__warn_unused_result__));
int __wasilibc_nocwd_scandirat(int, const char *, struct dirent ***,
int (*)(const struct dirent *),
int (*)(const struct dirent **, const struct dirent **))
__attribute__((__warn_unused_result__));
#ifdef __cplusplus
}
#endif
#endif
@@ -1,65 +0,0 @@
#ifndef __wasi_libc_h
#define __wasi_libc_h
#include <__typedef_off_t.h>
#include <__struct_timespec.h>
#ifdef __cplusplus
extern "C" {
#endif
struct stat;
struct timespec;
/// Register the given pre-opened file descriptor under the given path.
///
/// This function does not take ownership of `prefix` (it makes its own copy).
int __wasilibc_register_preopened_fd(int fd, const char *prefix);
/// Renumber `fd` to `newfd`; similar to `dup2` but does a move rather than a
/// copy.
int __wasilibc_fd_renumber(int fd, int newfd)
__attribute__((__warn_unused_result__));
/// Like `unlinkat`, but without depending on `__wasi_path_remove_directory`.
int __wasilibc_unlinkat(int fd, const char *path)
__attribute__((__warn_unused_result__));
/// An `*at` version of rmdir.
int __wasilibc_rmdirat(int fd, const char *path)
__attribute__((__warn_unused_result__));
/// Like `open`, but without the varargs in the signature.
int __wasilibc_open_nomode(const char *path, int oflag);
/// Like `openat`, but without the varargs in the signature.
int __wasilibc_openat_nomode(int fd, const char *path, int oflag);
/// Return the current file offset. Like `lseek(fd, 0, SEEK_CUR)`, but without
/// depending on `lseek`.
off_t __wasilibc_tell(int fd)
__attribute__((__warn_unused_result__));
/* Non-`at` forms of various `*at` functions. */
int __wasilibc_access(const char *pathname, int mode, int flags)
__attribute__((__warn_unused_result__));
int __wasilibc_stat(const char *__restrict pathname, struct stat *__restrict statbuf, int flags)
__attribute__((__warn_unused_result__));
int __wasilibc_utimens(const char *pathname, const struct timespec times[2], int flags)
__attribute__((__warn_unused_result__));
int __wasilibc_link(const char *oldpath, const char *newpath, int flags)
__attribute__((__warn_unused_result__));
int __wasilibc_link_oldat(int olddirfd, const char *oldpath, const char *newpath, int flags)
__attribute__((__warn_unused_result__));
int __wasilibc_link_newat(const char *oldpath, int newdirfd, const char *newpath, int flags)
__attribute__((__warn_unused_result__));
int __wasilibc_rename_oldat(int olddirfd, const char *oldpath, const char *newpath)
__attribute__((__warn_unused_result__));
int __wasilibc_rename_newat(const char *oldpath, int newdirfd, const char *newpath)
__attribute__((__warn_unused_result__));
#ifdef __cplusplus
}
#endif
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef __wasilibc_wchar_h
#define __wasilibc_wchar_h
#define __need_size_t
#define __need_wchar_t
#define __need_NULL
#include <stddef.h>
#endif
-25
View File
@@ -1,25 +0,0 @@
# WASI libc "top half".
The WASI libc "top half" is conceptually the upper half of a traditional libc
implementation, consisting of C standard library and other relatively
higher-level functionality.
Code in the musl directory is based on musl revision
040c1d16b468c50c04fc94edff521f1637708328, which is v1.2.0, from
git://git.musl-libc.org/musl.
Whole files which are unused are omitted. Changes to upstream code are wrapped
in preprocessor directives controlled by the macro `__wasilibc_unmodified_upstream`.
Some major known missing areas include:
- threads
- aio
- setjmp
- signals
- ipc
- termios
- nss
- timezones
- non-builtin locales
- TIOCGWINSZ (because cloudabi lacks it; affects isatty, line buffering for stdout)
- O\_CLOEXEC, O\_NOCTTY (because cloudabi lacks them)
-191
View File
@@ -1,191 +0,0 @@
Quick Installation Guide for musl libc
======================================
There are many different ways to install musl depending on your usage
case. This document covers only the build and installation of musl by
itself, which is useful for upgrading an existing musl-based system or
compiler toolchain, or for using the provided musl-gcc wrapper with an
existing non-musl-based compiler.
Building complete native or cross-compiler toolchains is outside the
scope of this INSTALL file. More information can be found on the musl
website and community wiki.
Build Prerequisites
-------------------
The only build-time prerequisites for musl are GNU Make and a
freestanding C99 compiler toolchain targeting the desired instruction
set architecture and ABI, with support for a minimal subset of "GNU C"
extensions consisting mainly of gcc-style inline assembly, weak
aliases, hidden visibility, and stand-alone assembly source files.
GCC, LLVM/clang, Firm/cparser, and PCC have all successfully built
musl, but GCC is the most widely used/tested. Recent compiler (and
binutils) versions should be used if possible since some older
versions have bugs which affect musl.
The system used to build musl does not need to be Linux-based, nor do
the Linux kernel headers need to be available.
Supported Targets
-----------------
musl can be built for the following CPU instruction set architecture
and ABI combinations:
* i386
* Minimum CPU model is actually 80486 unless kernel emulation of
the `cmpxchg` instruction is added
* x86_64
* ILP32 ABI (x32) is available as a separate arch but is still
experimental
* ARM
* EABI, standard or hard-float VFP variant
* Little-endian default; big-endian variants also supported
* Compiler toolchains only support armv4t and later
* AArch64
* Little-endian default; big-endian variants also supported
* MIPS
* ABI is o32, fp32/fpxx (except on r6 which is fp64)
* Big-endian default; little-endian variants also supported
* Default ABI variant uses FPU registers; alternate soft-float ABI
that does not use FPU registers or instructions is available
* MIPS2 or later, or kernel emulation of ll/sc (standard in Linux)
is required
* MIPS32r6, an incompatible ISA, is supported as a variant "mipsr6"
* MIPS64
* ABI is n64 (LP64) or n32 (ILP32)
* Big-endian default; little-endian variants also supported
* Default ABI variant uses FPU registers; alternate soft-float ABI
that does not use FPU registers or instructions is available
* PowerPC
* Compiler toolchain must provide 64-bit long double, not IBM
double-double or IEEE quad
* For dynamic linking, compiler toolchain must be configured for
"secure PLT" variant
* PowerPC64
* Both little and big endian variants are supported
* Compiler toolchain must provide 64-bit long double, not IBM
double-double or IEEE quad
* Compiler toolchain must use the new (ELFv2) ABI regardless of
whether it is for little or big endian
* S390X (64-bit S390)
* SuperH (SH)
* Standard ELF ABI or FDPIC ABI (shared-text without MMU)
* Little-endian by default; big-endian variant also supported
* Full FPU ABI or soft-float ABI is supported, but the
single-precision-only FPU ABI is not
* Microblaze
* Big-endian default; little-endian variants also supported
* Soft-float
* Requires support for lwx/swx instructions
* OpenRISC 1000 (or1k)
* RISC-V 64
* Little endian
* Hard, soft, and hard-single/soft-double floating point ABIs
* Standard ELF; no shared-text NOMMU support
Build and Installation Procedure
--------------------------------
To build and install musl:
1. Run the provided configure script from the top-level source
directory, passing on its command line any desired options.
2. Run "make" to compile.
3. Run "make install" with appropriate privileges to write to the
target locations.
The configure script attempts to determine automatically the correct
target architecture based on the compiler being used. For some
compilers, this may not be possible. If detection fails or selects the
wrong architecture, you can provide an explicit selection on the
configure command line.
By default, configure installs to a prefix of "/usr/local/musl". This
differs from the behavior of most configure scripts, and is chosen
specifically to avoid clashing with libraries already present on the
system. DO NOT set the prefix to "/usr", "/usr/local", or "/" unless
you're upgrading libc on an existing musl-based system. Doing so will
break your existing system when you run "make install" and it may be
difficult to recover.
Notes on Dynamic Linking
------------------------
If dynamic linking is enabled, one file needs to be installed outside
of the installation prefix: /lib/ld-musl-$ARCH.so.1. This is the
dynamic linker. Its pathname is hard-coded into all dynamic-linked
programs, so for the sake of being able to share binaries between
systems, a consistent location should be used everywhere. Note that
the same applies to glibc and its dynamic linker, which is named
/lib/ld-linux.so.2 on i386 systems.
If for some reason it is impossible to install the dynamic linker in
its standard location (for example, if you are installing without root
privileges), the --syslibdir option to configure can be used to
provide a different location
At runtime, the dynamic linker needs to know the paths to search for
shared libraries. You should create a text file named
/etc/ld-musl-$ARCH.path (where $ARCH matches the architecture name
used in the dynamic linker) containing a list of directories where you
want the dynamic linker to search for shared libraries, separated by
colons or newlines. If the dynamic linker has been installed in a
non-default location, the path file also needs to reside at that
location (../etc relative to the chosen syslibdir).
If you do not intend to use dynamic linking, you may disable it by
passing --disable-shared to configure; this also cuts the build time
in half.
Checking for Successful Installation
------------------------------------
After installing, you should be able to use musl via the musl-gcc
wrapper. For example:
cat > hello.c <<EOF
#include <stdio.h>
int main()
{
printf("hello, world!\n");
return 0;
}
EOF
/usr/local/musl/bin/musl-gcc hello.c
./a.out
To configure autoconf-based program to compile and link against musl,
set the CC variable to musl-gcc when running configure, as in:
CC=musl-gcc ./configure ...
You will probably also want to use --prefix when building libraries to
ensure that they are installed under the musl prefix and not in the
main host system library directories.
-237
View File
@@ -1,237 +0,0 @@
#
# Makefile for musl (requires GNU make)
#
# This is how simple every makefile should be...
# No, I take that back - actually most should be less than half this size.
#
# Use config.mak to override any of the following variables.
# Do not make changes here.
#
srcdir = .
exec_prefix = /usr/local
bindir = $(exec_prefix)/bin
prefix = /usr/local/musl
includedir = $(prefix)/include
libdir = $(prefix)/lib
syslibdir = /lib
MALLOC_DIR = mallocng
SRC_DIRS = $(addprefix $(srcdir)/,src/* src/malloc/$(MALLOC_DIR) crt ldso $(COMPAT_SRC_DIRS))
BASE_GLOBS = $(addsuffix /*.c,$(SRC_DIRS))
ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS))
BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS)))
ARCH_SRCS = $(sort $(wildcard $(ARCH_GLOBS)))
BASE_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(BASE_SRCS)))
ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS)))
ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS))))
LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) $(filter obj/compat/%,$(ALL_OBJS))
LDSO_OBJS = $(filter obj/ldso/%,$(ALL_OBJS:%.o=%.lo))
CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS))
AOBJS = $(LIBC_OBJS)
LOBJS = $(LIBC_OBJS:.o=.lo)
GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h
GENH_INT = obj/src/internal/version.h
IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/locale_impl.h src/internal/libc.h)
LDFLAGS =
LDFLAGS_AUTO =
LIBCC = -lgcc
CPPFLAGS =
CFLAGS =
CFLAGS_AUTO = -Os -pipe
CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
CFLAGS_ALL = $(CFLAGS_C99FSE)
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)
LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
INSTALL = $(srcdir)/tools/install.sh
ARCH_INCLUDES = $(wildcard $(srcdir)/arch/$(ARCH)/bits/*.h)
GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h)
INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h)
ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%))
EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS)))
STATIC_LIBS = lib/libc.a
SHARED_LIBS = lib/libc.so
TOOL_LIBS = lib/musl-gcc.specs
ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
ALL_TOOLS = obj/musl-gcc
WRAPCC_GCC = gcc
WRAPCC_CLANG = clang
LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
-include config.mak
-include $(srcdir)/arch/$(ARCH)/arch.mak
ifeq ($(ARCH),)
all:
@echo "Please set ARCH in config.mak before running make."
@exit 1
else
all: $(ALL_LIBS) $(ALL_TOOLS)
OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(GENH) $(GENH_INT))) obj/include)
$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS)
$(OBJ_DIRS):
mkdir -p $@
obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed
sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@
obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in
cp $< $@
sed -n -e s/__NR_/SYS_/p < $< >> $@
obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git)
printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@
obj/src/internal/version.o obj/src/internal/version.lo: obj/src/internal/version.h
obj/crt/rcrt1.o obj/ldso/dlstart.lo obj/ldso/dynlink.lo: $(srcdir)/src/internal/dynlink.h $(srcdir)/arch/$(ARCH)/reloc.h
obj/crt/crt1.o obj/crt/scrt1.o obj/crt/rcrt1.o obj/ldso/dlstart.lo: $(srcdir)/arch/$(ARCH)/crt_arch.h
obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c
obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC
OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%))
$(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3
MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS))
$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \
%/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \
%/__set_thread_area.o %/memset.o %/memcpy.o \
, $(LIBC_OBJS))
$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
$(CRT_OBJS): CFLAGS_ALL += -DCRT
$(LOBJS) $(LDSO_OBJS): CFLAGS_ALL += -fPIC
CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
# Choose invocation of assembler to be used
ifeq ($(ADD_CFI),yes)
AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ -
else
AS_CMD = $(CC_CMD)
endif
obj/%.o: $(srcdir)/%.s
$(AS_CMD)
obj/%.o: $(srcdir)/%.S
$(CC_CMD)
obj/%.o: $(srcdir)/%.c $(GENH) $(IMPH)
$(CC_CMD)
obj/%.lo: $(srcdir)/%.s
$(AS_CMD)
obj/%.lo: $(srcdir)/%.S
$(CC_CMD)
obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH)
$(CC_CMD)
lib/libc.so: $(LOBJS) $(LDSO_OBJS)
$(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \
-Wl,-e,_dlstart -o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC)
lib/libc.a: $(AOBJS)
rm -f $@
$(AR) rc $@ $(AOBJS)
$(RANLIB) $@
$(EMPTY_LIBS):
rm -f $@
$(AR) rc $@
lib/%.o: obj/crt/$(ARCH)/%.o
cp $< $@
lib/%.o: obj/crt/%.o
cp $< $@
lib/musl-gcc.specs: $(srcdir)/tools/musl-gcc.specs.sh config.mak
sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
obj/musl-gcc: config.mak
printf '#!/bin/sh\nexec "$${REALGCC:-$(WRAPCC_GCC)}" "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
chmod +x $@
obj/%-clang: $(srcdir)/tools/%-clang.in config.mak
sed -e 's!@CC@!$(WRAPCC_CLANG)!g' -e 's!@PREFIX@!$(prefix)!g' -e 's!@INCDIR@!$(includedir)!g' -e 's!@LIBDIR@!$(libdir)!g' -e 's!@LDSO@!$(LDSO_PATHNAME)!g' $< > $@
chmod +x $@
$(DESTDIR)$(bindir)/%: obj/%
$(INSTALL) -D $< $@
$(DESTDIR)$(libdir)/%.so: lib/%.so
$(INSTALL) -D -m 755 $< $@
$(DESTDIR)$(libdir)/%: lib/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/$(ARCH)/bits/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/generic/bits/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/bits/%: obj/include/bits/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/%: $(srcdir)/include/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
$(INSTALL) -D -l $(libdir)/libc.so $@ || true
install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)
install-tools: $(ALL_TOOLS:obj/%=$(DESTDIR)$(bindir)/%)
install: install-libs install-headers install-tools
musl-git-%.tar.gz: .git
git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ $(patsubst musl-git-%.tar.gz,%,$@)
musl-%.tar.gz: .git
git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ v$(patsubst musl-%.tar.gz,%,$@)
endif
clean:
rm -rf obj lib
distclean: clean
rm -f config.mak
.PHONY: all clean install install-libs install-headers install-tools
-23
View File
@@ -1,23 +0,0 @@
musl libc
musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
API, suitable for use in a wide range of deployment environments. musl
offers efficient static and dynamic linking support, lightweight code
and low runtime overhead, strong fail-safe guarantees under correct
usage, and correctness in the sense of standards conformance and
safety. musl is built on the principle that these goals are best
achieved through simple code that is easy to understand and maintain.
The 1.1 release series for musl features coverage for all interfaces
defined in ISO C99 and POSIX 2008 base, along with a number of
non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality.
For basic installation instructions, see the included INSTALL file.
Information on full musl-targeted compiler toolchains, system
bootstrapping, and Linux distributions built on musl can be found on
the project website:
https://musl.libc.org/
-1
View File
@@ -1 +0,0 @@
1.2.2
-2289
View File
@@ -1,2289 +0,0 @@
0.5.0 - initial release
0.5.9 - signal ABI bugfix, various cleanup and fixes:
sigset_t was wrongly defined as 1024 bytes instead of 1024 bits,
breaking the intended ABI compatibility with the LSB/glibc sigaction
structure. users should upgrade immediately and rebuild any libraries
or object files that might be using the incorrect definitions.
improved security against DoS with tcb shadow passwords by checking
that the file opened was really an ordinary file.
fixed a bug in the implementation of atomic ops that could have
allowed the compiler to incorrectly reorder them (in practice, gcc
with the default settings on i386 was not reordering them).
greatly improved conformance to the C and POSIX standards regarding
what the standard header files make visible. _POSIX_C_SOURCE is now
needed to get POSIX functions in standard C headers, and _XOPEN_SOURCE
or _GNU_SOURCE are required to get XSI interfaces or GNU extensions,
respectively.
many internal improvements have been made to the syscall-related code
in preparation for porting to x86_64 and other archs.
0.6.0 - x86_64 port, various important bugs fixed
new x86_64 (amd64) architecture port, contributed by Nicholas J. Kain,
along with PORTING guide. source tree layout and build system have
been improved to accommodate further ports.
various bugs that were introduced while making the headers respect C
and POSIX namespace standards have been fixed. conformance to the
standards has been improved.
fixed an inefficiency in qsort that triggered a bug (occasionaly
internal compiler error) in some versions of gcc.
fixed a major bug in the printf %n specifier that prevented it from
working and caused memory corruption.
0.7.0 - major improvements to posix conformance and completeness
implemented posix shared memory and semaphore interfaces.
implemented all remaining required pthread and clock interfaces.
major fixes to signal semantics.
greatly improved temporary file name generation for safety against
denial of service due to intentional name collisions.
added syscall wrappers for the linux inotify interface.
malloc(0) now returns a non-null pointer.
fixed printf %n specifier (again), pthread_once (it was always
hanging), and non-default-type mutex behavior.
added ucontext/sigcontext support in headers to facilitate building
libgcc with dwarf2 unwind support, and possibly other low-level tools.
improved musl-gcc compiler wrapper.
implemented many small missing functions here and there, minor header
fixes, etc.
0.7.1 - improvements to completeness, bug fixes
implemented flockfile, wprintf, and robust mutex functions.
fixed stack corruption bug in times(), minor header bugs, and some
error return value bugs in thread interfaces.
0.7.5 - new features, major optimization, and robustness
implemented POSIX timers.
optimized and simplified many thread-related functions.
eliminated resource leak races in thread cancellation. (almost all
existing implementations, including glibc, have these leaks.)
overhauled stdio implementation to take advantage of readv/writev for
reduced syscall load, and improved stdio's handling of error status.
added syscall header and interface for applications to use and
greatly simplified internal system for making syscalls.
strangthened tmpnam/tempnam/tmpfile filename generation and made the
straight C functions not depend on POSIX symbols.
fixed pthread cancellation ABI on i386 to match the LSB/glibc ABI
better double-free handling in malloc
various minor bug fixes
0.7.6 - major bug fixes
fixed rare but serious under-allocation bug in malloc.
fixed signedness bug in strchr that prevented finding high bytes.
fixed serious parsing bugs in strtold.
fixed statvfs syscall (it was always failing with EINVAL).
fixed race condition in set*id() functions with threads (possible
deadlock). further audit still needed though.
fseek no longer sets the stream error flag on failed seeks (this was
wrong and broke some programs, notably GNU m4).
nl_langinfo is no longer a dummy function. (the functionality was
previously implemented but accidentally left unused).
various small fixes have been made to the implementations and
prototypes for nonstandard and obsolete functions
0.7.7 - more bug fixes and program-compatibility improvements
fixed floating point formatting and rounding bugs in printf.
fixed broken %N$ positional argument specifiers in printf.
fixed misaligned read/overread bug in strchr which could lead to
crashes scanning tiny strings at the end of a page when the next page
is not readable, or on archs (not yet supported) that forbid
misaligned reads.
fixed breakage of statvfs on x86_64
fixed crash in getmntent_r
fixed bug in POSIX timers created with NULL sigevent argument
improved semaphore performance, and sem_wait is now interruptable by
signals, as required by POSIX.
added many compatibility and system-level interfaces, increasing the
proportion of busybox that works with musl.
0.7.8 - more bug fixes and compatibility improvements
fixed problems with ipv6 dns and address printing code that made ipv6
support practically unusable, and some other getaddrinfo bugs.
fixed broken sendmsg/recvmsg functions on x86_64 (caused by incorrect
msghdr structure).
fixed broken sigsetjmp asm on x86_64.
worked around a problem with input buffering on terminals reblocking
after getting a blank line, due to a bug in the linux readv syscall.
various improvements to the "rsyscall" system used to implement
threaded setuid, setgid, etc.
exiting/cancelling the a timer handler thread no longer kills the
timer.
fixed incorrect trailing zeros on some %g conversions in printf.
fixed buggy byte-swapping functions and moved them to inlines in
byteswap.h.
many small improvements to header/application compatibility, support
for nonstandard macros, etc.
0.7.9 release notes
new pthread cancellation implementation:
- safe against resource-leak/side-effect-leak race conditions
- safe against interruption by signal handlers
- reduced bloat in all cancellable functions
- reduced bloat for blocking cancellation
new interfaces implemented:
- realpath (limited functionality)
- wordexp (limited functionality)
- flock (nonstandard)
- forkpty (nonstandard)
- posix_fadvise
- posix_fallocate
general bug fixes:
- syslog function failure to communicate with syslogd
- bug in siginfo_t definition if wait.h was included before signal.h
- incorrect struct definitions for most of sysv ipc
- pthread_exit/cancel on timer handler wrongly destroying the timer
- linux dup2 ebusy workaround
- obscure issues in non-threaded programs using some pthread functions
- getopt_long allowed mismatch in last char of option name
- incorrect parsing of obscure ip address forms
- initgroups not working reliably (uninitialized var)
- shadow pass treating empty expiry field as pass-expired-in-1970
- bogus longjmp if pthread_exit was called from cancellation handlers
x86_64-specific bug fixes:
- fcntl file locking
- thread stack alignment
- broken select timeouts due to incorrect timeval definition
0.7.10 release notes
new features:
- ipv6 numeric string parsing
- eventfd syscall wrappers
optimizations:
- new qsort implementation using the smoothsort algorithm
- much smaller/faster sigset_t handling functions
- lowered spin count before futex wait in synchronization functions
general bug fixes:
- incorrect floating point round-to-even behavior in printf
- major bugs in pthread barrier implementation
- off-by-one error in scanf %n results
- scanf failure to report EOF when scanning for literal text
- minor missing/incorrect prototype issues
- dependency on undefined call order in fclose
compiler issue workarounds:
- incorrect inlining of variadic functions on recent gcc versions
- pcc preprocessor bug with recursive macro expansion
0.7.11 release notes
new features:
- integrated dynamic linker
- dynamic loading (dlopen/dlsym) (for dynamic-linked programs only)
- XSI search.h API
- POSIX message queues
- POSIX spawn interfaces
- BSD pseudo-random number generator API (random/srandom/initstate/etc.)
- floating point environment (limited usefulness due to gcc bugs)
general bug fixes:
- possible crashes with wordexp due to uninitialized variable
- race condition in pthread_kill (also present and unfixed in glibc/nptl)
- pthread exit destructors called too late
- dangerous unbounded vla in glob
- brk/sbrk legacy functions mismatching legacy semantics
- wcsncpy dest buffer overflow
- strncat and wcsncat possible overflows due to double-termination
0.7.12 release notes
new features:
- support for textrels in shared objects
- rpath support in dynamic linker
- stdio_ext.h functions (for better gnu software compatibility)
bug fixes:
- some compilers miscompiling dlopen due to misuse of longjmp
- safe handling of invalid long-double bit patterns (affects printf)
- workaround for bugs in linux mprotect syscall
- thread-safety for random() functions
- various minor issues
0.8.0 release notes
new features:
- chinese and japanese legacy charset support in iconv
- zero-syscall clock_gettime support (dynamic-linked x86_64 only)
- futex-based locking for stdio (previously used spinlocks)
- LD_PRELOAD and RTLD_NEXT support in dynamic linker
- strptime (mostly working but incomplete)
- posix aio (mostly working but not entirely conformant)
- memory streams (fmemopen, open_memstream, ...)
- stub/dummy implementations for various useless legacy functions
- if_nameindex
security hardening:
- setuid, etc. should not longer be able to "partially fail" with threads
- ensure suid programs start with fd 0,1,2 open
- improved openpty/forkpty failure checks
threads/synchronization bug fixes:
- dangerous spurious wakeup in pthread_join lead to early return
- race condition enabling async cancellation (delayed/lost cancellation)
- destruction/unmapping race conditions in semaphores, mutexes, rwlocks
- recursive rwlock_rdlock deadlock when a writer is waiting
- race condition in sigqueue with fork
- timer expiration thread exit wasn't running dtors
- timer threads weren't blocking signals
- close was wrongly cancellable after succeeding on some devices
- robust mutex list was not reset on fork
general bug fixes:
- incorrect logic in fread (spurious blocking; crash on write-only files)
- many corner cases and overflow cases for strtol-family functions
- various printf integer formatting issues with flags/width/precision
- incorrect iconv return value on failure
- broken FD_* macros on 64-bit targets
- clock function returning wrong value (real time not cpu time)
- siglongjmp signal mask clobbering (off-by-one pointer error)
- dynamic linker weak symbol resolution issues
- fdopendir failure to set errno
- various minor header fixes
0.8.1 release notes
bug fixes:
- mismatching prototypes caused build failure on 64-bit
- other minor prototype errors in the headers have been fixed
- various other small omissions fixed
0.8.2 release notes
new features:
- ptrace syscall support
bug fixes:
- const error (only a warning with many compilers) in lio_listio
- minor portability fixes aimed at supporting new arch targets
0.8.3 release notes
new features:
- arm port (experimental)
- better musl-gcc wrapper script for building against musl
- added clone system call
bug fixes:
- numerous header file typos, copy/paste errors, omissions
- statfs and statvfs ABI are now LSB-conformant (and actually work)
0.8.4 release notes
new features:
- arm dynamic linker support
- process-shared pthread barriers now work
- efficient futex-requeue-based cond var broadcast
- more optional cancellation points are now cancellable
- printf accepts null pointers with %s, prints as "(null)"
- recursive mutexes are now fully reentrant
- __cxa_atexit support
- real vfork
- dynamic linker now gold-compatible
- prlimit syscall
- support for large limits with setrlimit/getrlimit (even on 32-bit)
- glob now supports GLOB_PERIOD option (GNU extension)
bug fixes:
- many serious issues in condition variables
- rwlock failure-to-wake deadlock issues
- various small header files bugs/omissions
- wrong failure return for pthread_create
- path handling issues on execvp
- lock count corruption with robust recursive mutexes on owner death
- integer overflows in atoi, etc. reading most-negative value
- spurious mremaps on every realloc of large memory chunks
- pthread cancellation failure in single-threaded programs
security:
- avoid fd_set overflow in dns lookups
0.8.5 release notes
new features:
- stdio operations are now cancellable (only when low-level io happens)
- global ctor/dtor support in main program start code and shared libs
- dynamic linker support for PIE executables (but missing startup code)
- vfork support on x86_64
- complete set of locale_t functions (all ignore the locale argument)
- provide define float_t and double_t in math.h
- lighter/faster cancellation cleanup handler register/unregister
bug fixes:
- gcc wrapper now supports -shared, -nostdlib, -nostartfiles
- removed one wrongly-classified character from iswspace set (zwsp)
- fixed crashes in dns lookup on some errors, e.g. resolv.conf missing
- "make install" no longer tries to build shared libc if disabled
- ptrace argument handling bugs fixed
- work around visibility-hidden bugs in gcc 3.x
- fix thread-pointer-loss issue when it's initialized in signal handlers
- various minor typo/misc fixes in headers
compatibility:
- glob behaves more like traditional implementations w.r.t. GLOB_MARK
- added legacy futimes, lutimes functions
- more compatibility macros in sys/param.h (nonstandard header)
- setfs[ug]id syscall wrappers (linux specific)
- fgetpwent function (nonstandard)
- utmp.h matches traditional version more closely
- caddr_t now matches glibc type (void * instead of long)
- dummy (always-fail) dlopen and dlsym functions for static linked programs
- [efg]cvt functions (previously posix, removed from standard)
- get_current_dir_name function (nonstandard)
0.8.6 release notes
bug fixes:
- fix crash in dns lookups for all static-linked, non-threaded programs
0.8.7 release notes
new features:
- c++ support with g++'s libstdc++
- c99 math library (float, long double, complex, etc.)
- numerous wchar_t functions
- a64l, l64a functions
- getdate function
compatibility:
- c89 compatibility in math.h
- syscall.h alias for sys/syscall.h
- memory.h alias for string.h
- getcwd supports null buffer argument (auto-allocation)
bug fixes:
- major fenv (floating point environment) fixes and optimizations
- strptime mishandling of day/month names
- strtoull wrongly rejecting the highest 16 possible values as overflow
- math.h constant expression fixes for INFINITY/NAN/etc.
- scanf mishandling of "0" with "%x"
0.8.8 release notes
new feature:
- major math correctness and performance improvements
- many math functions implemented in asm for i386
- some math functions (mostly long double) in asm for x86_64
- new floating point parser/converter with correct rounding
- implement wcstod, wcstof, and wcstold
- new scanf implementation - cleaner, faster, more correct
- minimal/incomplete strfmon implementation
compatibility:
- header fixes for c++
- regex code resync with TRE; support common regex extensions
- support for compiling apps with gcc's -funsigned-char
- sysconf now returns dynamic limits for open files, processes
- give dlerror proper error status stickiness
- make alloca work even with -fno-builtin
critical security fixes:
- stack-based buffer overflow in fprintf on unbuffered files
other bug fixes:
- rare gcc register allocation (miscompilation) bug in syscall wrappers
- printf was rejecting the valid (but redundant) %lf format specifier
- fixed big data bloat (missing const) in math functions
- many math fixes related to floating point exceptions and rounding
- corrected DECIMAL_DIG definitions
- tgammal was wrongly setting global signgam
- crash in wordfree with uninitialized we_offs
- fix wordexp not null-initializing the we_offs initial slots
0.8.9 release notes
bug fixes:
- major breakage in strtol and family: failure to accept leading spaces
- incorrect name for MATH_ERREXCEPT in math.h
compatibility:
- prototypes for a few additional nonstandard functions
0.8.10 release notes
new features:
- correct over/underflow detection (ERANGE setting) for strtod
- new musl-gcc wrapper, specfile based, faster and more robust
- meaningful return strings for dlerror
- new iswalpha, iswpunct, and wcwidth; sync'd to Unicode 6.1
- towupper/towlower sync'd with Unicode 6.1
- new futex-based libc-internal locks instead of spinlocks
- experimental stack protector support (minimal; no random canary)
- experimental gdb shared library tracking support
compatibility:
- getusershell family functions
- getresuid and getresgid syscall wrappers
- byte swapping macros in endian.h
- getdtablesize was wrongly declared in unistd.h for _XOPEN_SOURCE
bug fixes:
- iconv_open wrongly rejecting most dest charsets (broken in 0.8.0)
- sysconf failure when correct value is -1 (broken in 0.8.8)
- scanf and strtod family functions overreading past NAN (4 bytes vs 3)
- scanf and strtod wrongly treating "0.00000000001", etc. as 0
- many bugs in towupper/towlower (never seriously tested before)
- int8_t definition was wrong when gcc -funsigned-char was used
0.9.0 release notes
license change: MIT
new features:
- configure script, improved build system
- full stack protector support
- PIE support on x86 and x86_64
- new O(1) space, O(nm) time implementation of fnmatch
- improved support for sse2 floating point mode on x86
compatibility:
- added linux unshare syscall
- exp10/pow10 function
- sqrtl support on arm (previously missing)
- removed minimal linux/*.h headers that could conflict with real ones
- support for _LARGEFILE64_SOURCE (mapped to standard fcns with #define)
- better c89 compatibility in headers
- stub versions of sched_* functions (previously missing)
- pthread stacks no longer executable (compat with hardened kernels)
- new ar.h and lastlog.h (legacy junk)
- various other header improvements
optimization:
- additional x86_64 math asm
- better formula for acos use in i386 asm
bug fixes:
- large (up to a few %) errors in strtod for certain values due to bug
- mbsnrtowcs and wcsnrtombs were completely broken (bad exit logic)
- wide printf %.0s could fail due to uninitialized variable
- missing dlerror strings for dlsym in some cases
0.9.1 release notes
new features:
- dynamic linker can be used as a program to explicitly load/run executables
- ldd command, usable by making a symlink to the dynamic linker named ldd
bug fixes:
- major bugs in POSIX BRE parsing inherited from TRE regex code
- character matching bug in regex on ARM: WCHAR_MAX was assumed to be signed
- various obscure fixes related to signals and pthread cancellation
- remquot subnormal remainder bug
- buggy macros in (nonstandard) sys/param.h
- major bug in pthread barriers on x86_64 (out of bounds write)
- utimes (legacy) function was making wrong syscall (utime instead of utimes)
- avoid using "old" syscalls that don't exist on arm eabi linux
- broken strrchr(str, 0)
- broken mbsinit(0)
- broken wcsncmp
- syntax error in nextafter macro in tgmath.h
- missing support for -pie in musl-gcc wrapper
- abort could wrongly fail to terminate the program in some cases
compatibility:
- increase default thread stack size to 80k
- support _BSD_SOURCE feature test macro
- support _LARGEFILE64_SOURCE feature test macro (merely exposes alt names)
- lots of legacy-compatibility improvements in headers
- various minor GNU extension functions
- sysconf reporting number of available CPUs/cores
- various LSB/glibc ABI interfaces aimed at compatibility with some binaries
- use fistpll asm mnemonic instead of fistpq for compat with clang
0.9.2 release notes
bug fixes:
- pointer overflow in printf (crash on 32bit userspace, 64bit kernel)
- printf %ls over-read bug
- strtod failure to read -0x as negative zero
- flush stdio after dtors, not before
- wrong file position for buffered input streams on exit
- popen was broken when stdin/out were already closed
- broken wcwidth tables (missing many characters)
- fwrite: wrong return value of partial/failed write
- broken utf-16 conversions
- bad buffer length check in getlogin_r
- bad perror("") behavior; did not match perror(0)
- broken sysinfo syscall/structure
- stdint.h const macro signedness bugs
- broken include guards in some headers
- bogus localeconv values
- cancellation-safety for popen and pclose
- fma corner cases wrong on i386
- fcntl F_GETOWN errno missing on failure.
- char signedness bug in dynamic linker broke dlopen on arm
- mprotect failure in dynamic linker caused crash instead of error
build system:
- configure check to work around hacked-up gcc versions
- test for old binutils that can't support musl dynamic linker
compatibility:
- make _GNU_SOURCE imply _LARGEFILE64_SOURCE
- syscall wrapper for lots of nonstandard and/or legacy linux syscalls
- versionsort stub
- timegm function (inverse of gmtime)
- various minor header tweaks
- make __freading/__fwriting semantics match traditional ones
- added gnulib-compatibility stdio interfaces
- added pthread_attr_setstack interface
- make strerror_r return partial string when buffer is too small
- duplocale should accept LC_GLOBAL_LOCALE
- align ptsname_r to upcoming posix requirements
- support invalid ld80 bit patterns as extra nans.
0.9.3 release notes
new features:
- mips (32-bit, o32 abi) port, currently static-linked only
- newly overhauled crypt implementation
- improved library pathname info for debugger from the dynamic linker
- getaddrinfo (and getservbyname) now support /etc/services lookups
- pipe2 syscall wrapper
- splice and vmsplice syscall wrappers
- syscall wrappers for extended attribute interfaces
- ioperm/iopl syscall wrappers on archs that support these operations
bug fixes:
- dlsym RTLD_NEXT library search order was wrong
- multiple dlopen pathname and library name handling errors
- potential race condition in detached thread exit
- broken internal-lock-handling code not updated for futex-based __lock
- sem_trywait spurious EAGAIN errors arising from CAS failures
- workaround kernel bug in cmsghdr size_t vs socklen_t issue (64-bit)
- getservby* crash on null protocol argument
- logic error skipping failed interfaces in if_nameindex
- various minor header/declaration related issues
arm-specific bug fixes:
- broken crti/crtn startup code when gcc crtbegin/end files are linked
- sigsetjmp tail call optimization failure broke the function
- incorrect little-endian assumptions in atomic.h functions
- use of blx instruction in asm (not supported on pre-v5 arm)
build system:
- only use expensive -ffloat-store cflag on archs/compilers that need it
- make musl-gcc wrapper support -lgcc (mainly for self-hosting)
0.9.4 release notes
new features:
- blowfish crypt
- dynamic linking on mips
- arm hard float support
- BSD fgetln function in stdio
- minor header improvements for compatibility
- support for CROSS_COMPILE variable to configure
- legacy significand function
- better support for SUSv3-targeted programs
performance:
- assembly (string ops based) memcpy for i386 and x86_64
- reduce printf overhead
bug fixes:
- failure of strtod, etc. to process extremely long strings correctly
- read overrun in wcsstr for short needles
- various major mips issues that prevented most software from working
- erroneous floating point exception behavior in i386/x86_64 exp asm
- crashes on null arguments to legacy err.h functions
- various header file/type issues
- extremely rare/obscure race condition with robust mutexes
- crypt now never returns null (most programs don't check, then crash)
- missing xattr remove functions
0.9.5 release notes
compatibility and headers:
- POSIX+XSI+BSD features enabled by default with no macros defined
- most programs can now be built without adding -D_GNU_SOURCE
- added C99 restrict keyword where required in all prototypes
- greater C89 compatibility
- cleaner, more-compatible public syscall.h
- many other header fixes
- support for compiling musl with clang/llvm
new features:
- sha 256/512 password hash functions in crypt
- GNU hash support in dynamic linker
- partial C11 coverage
- dladdr function added
- dynamic linker reports all errors instead of exiting on first error
- syscall wrappers added for most remaining linux syscalls
- provide POSIX O_SEARCH open mode using linux O_PATH
bug fixes:
- most atexit functions were being skipped when exiting
- some BSD functions were not being exposed under _BSD_SOURCE
- issues loading ssp-protected DSO into non-ssp program with dlopen
debloating:
- eliminate .eh_frame (10-15% loaded size bloat)
- optimal inline syscall asm for ARM and MIPS
- no longer force -O3 for shared libs
0.9.6 release notes
bug fixes:
- serious breakage in definition of O_ACCMODE mask (missing a bit)
new features:
- O_EXEC open mode
- md5 crypt hash function
0.9.7 release notes
new features:
- thread-local storage (__thread/_Thread_local)
- microblaze port
- getopt option parsing reset support
- vsyscall (sysenter, etc.) support on i386 (faster syscalls)
- memmem function (GNU extension)
- mips fenv support
- accept "nan(n-char-sequence)" in strtod/scanf family functions
- configure now supports compiling with pcc
quality and correctness improvements:
- close-on-exec flag for all library-internal file descriptors
- cancellation-safety and corner-case overhaul in shm_open/sem_open
- close EINTR vs EINPROGRESS issue
- mark binaries as not requiring executable stack
- better gdb compatibility in dynamic linker
- support recursive dlopen (dlopen called from constructors)
- posix_spawn/system/popen no longer momentarily double commit charge
- all stdio functions wait for locks
bug fixes:
- broken sysvipc *ctl functions on 64-bit archs
- broken shmdt on some archs
- getaddrinfo failure with port "0"
- dirname handling of trailing slash
- vfork race in posix_spawn
0.9.8 release notes
new features:
- powerpc port
- dl_iterate_phdr interface
- added mips-specific syscalls
- thread priority scheduling
- C11 CMPLX macro in complex.h
- x86 port io functions in sys/io.h
compatibility:
- improved headers for trace/debugging/machine-access
- stub functions for unsupported thread-related functionality
bug fixes:
- numerous math bugs (mostly exception flags and excess-precision issues)
- register clobber error in i386 vsyscall asm (did not affect most callers)
- various incorrect definitions in mips headers
- broken dlsym asm on mips
- empty prefix handling in configure script (--prefix="")
- ldso search path logic issues
- lock handling for stdio memory streams at exit time
- invalid SO_REUSEPORT definition in socket.h (not supported by Linux)
- broken redirection attempt to /dev/null in configure script
0.9.9 release notes
new features:
- tgamma implementation (no longer lgamma wrapper with low precision)
- various gnu extensions: sigandset, sigorset, etc.
- futimesat function (obsolete)
- various linux syscalls: arch_prctl, personality, etc.
optimizations:
- hyperbolic, inverse hyperbolic, and inverse trig, bessel functions
- is* comparison macros in math.h now expand inline properly
library bugs fixed:
- calling getenv from shared library ctors was broken
- invalid read in mmap-serviced aligned_alloc/memalign (possible crash)
- wrong errno result in fallback path of pipe2
- various math functions raising spurious exceptions
- mmap errno value on invalid offsets
- backwards alignment logic in strlcpy
- integer overflows in bessel functions
- large (up to 60ulp) error in erfcf
- dlsym/dlclose crashing on invalid library handles
- failure to handle arch variations for cloexec/nonblock flags
- lio_listio wrong return value for LIO_WAIT mode
- dladdr failure to resolve PLT addresses
- time_t/struct tm conversion off-by-one-day in december
- malloc corruption on nonstandard kernels with non-page-aligned brk
arch-specific bugs fixed:
- arm ctors/dtors were not working with recent gcc versions
- arm and mips setjmp/longjmp wrongly saved/restored fenv state
- loss of precision in i386/x86_64 expl
header bugs fixed:
- incorrect PRI/SCN macros in inttypes.h for some types
- arm sys/user.h regressions
- failure of offsetof() to be an integer constant expression
- tgmath return value type problems
header compatibility improvements:
- _GNU_SOURCE now enables everything; _ALL_SOURCE also works
- scsi/scsi.h and scsi/sg.h are now provided
- additional MAP_* flags for mmap
- additional F_* commands and flags for fcntl
- additional socket option, IPPROTO_* values, and multicase macros
- thread-related waitpid flags
- EHWPOISON added to errno.h
- additional macros for mount, swap, and reboot operations
- expose additional link.h structures
- always ensure sizeof(NULL)==sizeof(void *), even in c++
- additional flags for poll, epoll, inotify, timerfd, timex, dlfcn
- register names in signal.h/ucontext.h for x86
- ipc.h ipc_perm nonstandard struct field name compatibility improve
0.9.10 release notes
new features:
- getifaddrs
- pthread_getattr_np (widely used by garbage collectors)
- mkostemps, mkostemp, mkstemps functions (mkostemp is future-POSIX)
- strcasestr and strverscmp (previously stubs)
improvements:
- major performance improvements in mbtowc
- avoid filling caller-provided thread stacks with large TLS
- debloat unnecessary static buffers
- robust posix_spawn based on CLONE_VM instead of vfork
- new system() and popen() based on posix_spawn
- better strerror strings
- further emulation of atomic close-on-exec/nonblock options for old kernels
- provide macro constants for new-ish kernel features
compatibility:
- several nonstandard but widely-available pwd/grp/shadow functions
- program_invocation_[short_]name
- re-added useconds_t type used by some programs
- some legacy arpa headers
- dn_skipname function (legacy resolver API)
- additional ABI aliases for supporting glibc-linked libraries/binaries
general bugs fixed:
- stale locks and bogus munmap call when pthread_create fails
- uninitialized argument to munmap when dynlink load_library fails
- incorrect error returns in gethostby*_r
- memory leak in gethostbyname family
- blank ai_canonname in getaddrinfo for non-CNAME records
- undefined HZ macro in scsi/sg.h
- wrong return value for wmemmove on forward-copy
- namespace conformance in strings.h
- various utmp.h bugs
- unnecessary DT_SONAME in libc.so caused problems on some systems
- multiple bugs in syslog, some possibly dangerous
- non-functional setpriority function
- slight mishandling of 0xf5 byte in UTF-8 decoder
- misaligned memory accesses in mbsrtowcs
arch-specific bugs fixed:
- crash in shared library loading on arm
- missing __aeabi_atexit needed by arm eabi
- wrong float_t definition on x86_64
- various low-impact type size/alignment mismatches in some headers
- epoll struct alignment wrong on non-x86[_64] archs
- broken pipe2 fallback code on mips with old kernels
0.9.11 release notes
new features:
- %m allocation modifier for scanf
- week number and ISO week-based-year functionality in strftime
- per-process and per-thread cputime clocks
- ethernet address conversion interfaces
- legacy classful ipv4 network address interfaces
- minimal dlinfo function (nonstandard)
other improvements:
- dynamic linker path file can now use newlines to separate paths
- math optimizations for archs with extended precision (i386)
- musl-gcc wrapper now exposes gcc's intrinsic headers
- quality of rand and rand_r pseudo-random sequences
- support for large device minor numbers (greater than 8 bits)
- various header conformance and compatibility fixes
directly user-visible bugs fixed:
- scanf losing characters on unbuffered streams and fmemopen streams
- failure of mbsrtowcs to record stop position when dest is full
- failure of iconv to convert to legacy codepages
- non-working pthread_[sg]etschedparam functions (wrong syscall arguments)
other potentially-serious bugs fixed:
- resource leaks in sem_open
- various bugs in thread exit synchronization
- invalid access in aio notification after aiocb free/reuse
- synchronization in dynamic linker when new thread dlopens during ctors
- lack of error handling for failure to read dynamic linker path file
- creation by mmap or shmget of objects larger than PTRDIFF_MAX
minor conformance bugs fixed:
- overflow handling for the clock function
- workaround for incorrect exceptions in fma due to compiler bugs
- workaround wrong kernel type for sem_nsems field in struct semid_ds
arch-specific bugs fixed:
- x86_64 sigsetjmp clobbered the signal mask rather than saving it
- misaligned stack when calling ctors/dtors (crashing on x86_64)
0.9.12 release notes
new features:
- zoneinfo time zone support
- PIE support on all supported archs
- named sub-archs for endian and float ABI variants
- improved support for non-root installs of the dynamic linker
- ability to selectively build only performance-critical modules with -O3
- simple buffer overflow detection in free/realloc
- inet_ntop now presents v4-mapped addresses in ::ffff:a.b.c.d form
- ldd now reports libc and the dynamic linker in its output
compatibility:
- support for new init/fini array (needed for ctors/dtors on newer gcc)
- C++ ABI fully matches glibc/LSB, at least on x86
- many added ABI compatibility symbols for using glibc-linked libs
- support for STB_GNU_UNIQUE symbol bindings (found in some C++ libs)
- macros/types for new Linux kernel features in headers
bugs fixed:
- crashes in scanf on literal mismatches (regression from adding %m)
- dl_iterate_phdr was passing invalid phdr pointers to its callback
- getaddrinfo with null host and AF_UNSPEC was failing to report IPv6
- integer overflows in date/time conversion code
- misinterpretation of pre-1930s dates as post-2038 on 32-bit archs
- make install failed to install bits headers if make was not run first
- shm_open was wrongly cancellable
- low- or no-impact heap corruption in memalign
- explicitly running the dynamic linker on PIE programs did not work
- missing macros and sysconf for some supported POSIX option groups
- missing close-on-exec flags for several internal fd uses
arch-specific bugs:
- wrong SIG_ATOMIC_MIN/MAX macros on x86_64
- erfcl was missing on archs where long double is same as double
- broken dynamic-model TLS in static-linked arm/mips/powerpc programs
0.9.13 release notes
new features:
- iconv support for EUC-KR and Big5 (including HKSCS) encodings
- field widths (POSIX 2008 feature) in strftime
- recursive rpath and $ORIGIN support in dynamic linker
- cpu affinity interfaces
- support for armhf (hardfloat) floating point environment (fenv)
- support for SSE fenv on i386 (for apps using -mfpmath=sse -msse2)
- strftime %s format (seconds since the epoch, future POSIX requirement)
- configure script now saves its command line as a comment in config.mak
- legacy functions valloc and euidaccess
performance:
- optimized asm memcpy for arm
- optimized asm memset for i386 and x86_64
- optimized C versions of memcpy and memset for all archs
- eliminated major spurious syscalls from posix_spawn
- some math asm for armhf (hardfloat)
workarounds for:
- qemu-user's rt_sigaction syscall does not allow old to alias new
- qemu-user's madvise always succeeds (broke pthread_getattr_np)
- passing PT_INTERP to dlopen attempted to double-load libc
- gcc 4.8.x generating self-referential (infinite recursion) memcpy/memset
- linux's lack of support for fchdir, fchmod, fchown, fstat on O_PATH fds
bugs fixed:
- failure to honor flags for fchmodat and faccessat (linux syscall api flaws)
- SIGEV_THREAD timer id corruption and race condition issues
- timer thread TLS incorrectly keeping values from previous expiry run
- ecvt/fcvt decimal position off-by-one
- in symbol-versioned libs, symbol resolved to oldest instead of newest
- posix_spawn not correctly reporting errno from exec failure
- "make install" was not atomic (overwrote files rather than replacing)
- integer overflows in strftime
- unset/empty TZ variable was mishandled
- strftime could crash if the struct tm did not have valid tm_zone field
- failure of fenv functions to handle invalid arguments (required by ISO C)
- failure of some math functions (C and i386 asm) to raise underflow flag
- broken dn_expand function (previously not used internally)
- race conditions with signals during fork
- incorrect access check in mktemp (obsolete function)
- unnecessary arbitrary limits on size of program headers in dynamic loader
- text formatting bugs in output of err.h functions
arch-specific bugs:
- fesetenv(FE_DFL_ENV) crashed on i386
- breakage of arm crt code when libc is compiled as thumb
- arm/armhf (hardfloat) misidentified by configure
- ambiguity of wait (exit status) macros on mips with signal number 127
- wrong value of _NSIG and SIGRTMAX on mips
0.9.14 release notes
bugs fixed:
- failure to properly install dynamic linker with DESTDIR set (symlink wrong)
- rare deadlock in libc-internal locking routines
- dynamic linker used fallback paths wrongly on (possibly transient) errors
- popen broken when stdin or stdout was already closed in parent
- deadlock/memory-corruption in multithreaded set*id and setrlimit functions
- realpath failed when file was not readable
- readpath mistakenly had cancellation points in it
- crashes in scanf with invalid %m conversion specifiers
- misclassificiation of some invalid ld80 float representation in fpclassify
- various overflow and underflow flag issues in math functions
- domain handling errors for acoshf and acoshl
- wrong values for some sysconf properties
- lack of proper memory barriers on arm
mips-specific bugs:
- broken sysv ipc structures
- multiple stack-related bugs in clone, leading to crashes in parent or child
- overflow writing sigset_t in multithreaded set*id and setrlimit functions
other improvements:
- size and performance improvements to various math functions
- wait.h as a compatibility alias for sys/wait.h
- various header improvements
- support for runtime-variable page size on archs that need it (mainly mips)
0.9.15 release notes
new features:
- support for mixing IPv4 and v6 nameserver addresses in resolv.conf
- RFC 3678 multicast structures/macros in netinet/in.h
- putspent and fgetspent functions (shadow password API)
- timef function (obsolete, removed in POSIX 2008)
- fanotify syscalls (Linux-specific feature)
- semtimedop syscall (Linux-specific sysvipc extension)
- quotactl syscall and header (filesystem quotas support)
- drem and finite functions (obsolete BSD functions)
- getloadavg function (non-standard)
- herror function (non-standard and obsolete)
- libc.so now stores and prints its version information
- expose constants for new Linux features including O_TMPFILE
- implement FNM_LEADING_DIR option to fnmatch (GNU extension)
- posix_close function (accepted for inclusion in next POSIX issue)
bugs fixed:
- buffer overflow in mbsrtowcs
- clobbering of gr_name in getgrnam_r and getgrgid_r
- execle ignoring the environment argument
- setenv crash on malloc failure
- out-of-bounds access in fnmatch with FNM_PATHNAME and certain patterns
- failure of malloc to set errno when failing to extend heap
- incorrect errno value from getcwd with zero size
- spurious failure in faccessat with AT_EACCESS flag with suid/sgid programs
- several fd leaks due to missing close-on-exec flag
- misspellings/typos in macro names in several headers
- incorrect failure return value in inet_pton
- various numeric ip address parsing and validation fixes
- namespace conformance issues in several headers
- minor header issues
- zombie processes left by faccessat with AT_EACCESS
- timezone file parser failing/crashing on 64-bit archs
- hang in localtime with near-overflowing time_t values on 64-bit archs
- timezone path search was only trying first path
- incorrect handling of excessive-length TZ environment strings
- timezone file loading was wrongly enforcing O_NOFOLLOW/rejecting symlinks
- iswspace was wrongly returning true for the null character
- various bugs in wordexp
- putgrent could write corrupt lines after write failures
- dn_expand misinterpreted in-packet offsets greater than 255
- spurious strftime/wcsftime failure on len+1==bufsize case
- incorrect underflow flag in fma corner cases
- log*(0) wrongly returned +inf in downward-rounding mode
- failure of fchmod, fstat, fchdir, and fchown to produce EBADF
arch-specific bugs fixed:
- i386: failure of fesetround to set sse rounding mode
- i386: floating point limit constants misinterpreted due to excess precision
- powerpc: broken thread pointer access when compiled with clang
- microblaze: dynamic linker entry point code possibly clobbering argv
strict conformance issues:
- NULL definition re-aligned with POSIX (requires (void *) cast)
- alignment of math.h is* comparison functions with C11 annex F requirements
1.0.0 release notes
new features:
- support for mips softfloat ABI variant
- legacy setkey and encrypt API for DES
- support for BSD version of struct tcphdr in addition to GNU version
- added ipv6 and icmpv6 protocol lookups to getprotoent-family functions
new experimental ports:
- sh (SuperH)
- x32 (ILP32 ABI for x86_64)
compatibility:
- improved c89 compiler support in math.h
- eliminate some compiler warnings in public headers
- added some missing things for LFS64 APIs
- added fallback emulation of accept4 for older kernels
bugs fixed:
- buffer overflow in printf when printing smallest denormal exactly
- rounding errors in printf in some just-over-halfway cases
- posix_spawn did not accept null pid pointer (crashed)
- ftello gave incorrect result for unflushed append-mode streams
- mishandling of n=0 case in wcsxfrm (wild buffer overrun)
- possible system breakage during libc upgrade due to install.sh bugs
- nftw FTW_MOUNT flag prevented walking any directories at all
- ptsname/ptsname_r returned negated error codes
- getprotoent function returned junk after listing valid protocols
- wrong error code from readdir when the directory has been deleted
- various prototype/argument-type fixes, mostly to legacy functions
- various header namespace violations
arch-specific bugs fixed:
- fesetenv(FE_DFL_ENV) was broken on i386 and x86_64
- strerror(EDQUOT) did not work on mips
- recvmsg/sendmsg were broken on powerpc
- sysv ipc was broken on powerpc and mips
- statfs/statvfs were broken on mips
- sigaltstack was broken on mips
1.1.0 release notes
new features:
- relro memory protection in dynamic linker
- malloc can now extend heap with mmap if brk fails
- vdso clock_gettime/gettimeofday/time acceleration on x86_64
- thread/library-safe versions of search.h functions (nonstandard)
- getauxval function (nonstandard)
- sysconf extensions to query physical memory size
bugs fixed:
- floating point printf output corruption from carry into uninitialized slot
- possible runaway carry overflow in printf floating point
- printf %g failure to strip trailing zeros in some cases
- search past end of haystack in memmem
- off-by-one error in confstr return value
- crashes in some near-empty static programs that use stack protector
- deadlock race in pthread_once
- non-working clock_gettime fallback for old kernels
arch-specific bugs fixed:
- crash from missing syscall asm register clobbers on real microblaze kernel
- crash in all nontrivial dynamic linker use on microblaze
- incorrect rlimit constants on mips
- broken, possibly dangerous, use of getrlimit syscall on x32 in sysconf
1.1.1 release notes
new features:
- new options --preload and --library-path to dynamic linker
- public execvpe function (nonstandard extension)
- iconv support for cp437 and cp850
bugs fixed:
- false negatives with some periodic needles in strstr, wcsstr, and memmem
- crash on invalid zoneinfo files
- incorrect zero-padding of some outputs for strftime %s specifier
- misreporting of errors in configure script when $CC does not work at all
- treating not-yet-implemented strptime specifiers as errors
compatibility:
- configure now detects serious constant-folding bug in gcc 4.9.0
- removed __yield symbol (unused) that clashed with some compilers
- improvements to sysconf's handling of unsupported/invalid arguments
arch-specific bugs fixed:
- misdetection of superh ABI variant by configure on gcc 3.x
- missing SO_RCVBUFFORCE and SO_SNDBUFFORCE in mips socket.h
- build regression on armv6 and later with -mthumb
1.1.2 release notes
new features:
- multi-protocol matches (tcp and udp) in getaddrinfo
- support for AI_V4MAPPED and AI_ALL flags to getaddrinfo
- reverse name lookups from /etc/hosts
- reverse service lookups from /etc/services
- support for service aliases in /etc/services
- ipsec and tunneling protocols to getprotoent-family functions
- res_send, res_mkquery, res_querydomain, and dn_comp functions
- ipv6 scope id handling for link-local scope addresses
- previously-unimplemented %C and %y in strptime now work
- vdso clock_gettime acceleration on i386 (new kernel feature)
- better O_CLOEXEC/SOCK_CLOEXEC fallbacks for old kernels
bugs fixed:
- buffer overflow in dns response parsing (CVE-2014-3484)
- possible infinite loop in dns response parsing
- sendfile off_t 32/64-bit size mismatch
- incorrect end pointer in some cases when wcsrtombs stops early
- incorrect if_nametoindex return value when interface does not exist
- dummy "ent" function aliases that possibly shadowed real ones
- tmpfile fd leak on memory exhaustion
- getaddrinfo returning EAI_NONAME for some transient failures
arch-specific bugs fixed:
- broken kernel side RLIM_INFINITY on mips
- incorrect syscall argument 6/7 types for pselect on x32
1.1.3 release notes
new features:
- address sorting in getaddrinfo, etc. modeled on rfc 3484/6724
- default timezone taken from /etc/localtime when $TZ is unset
- getopt double-colon extension for optional arguments
- support for TLSDESC-based (gnu2) TLS dialect on i386 and x86_64
- sendmmsg/recvmmsg (linux-specific)
- fmtmsg (last mandatory XSI function that was missing)
compatibility:
- treat dns rcode=2 as temporary failure, not negative result
- working thread-pointer for pre-2.6 kernels on i386
- further ABI-compat symbols: __xmknod[at], __sysv_signal
bugs fixed:
- memmem false positives/false negatives/crashes from invalid logic
- gethostby*_r not setting result pointer to null on failure
- aliasing violations in syscall.h SYSLOG_NAMES feature
- fanotify_mark syscall arguments wrong
arch-specific bugs fixed:
- various subtle relocation bugs in powerpc and sh dynamic linker
1.1.4 release notes
new features:
- experimental locale support for LC_MESSAGES and LC_TIME
- non-stub gettext family functions for message translation
- or1k (OpenRISC 1000) port
- syslog options LOG_CONS and LOG_PERROR
- issetugid function (from OpenBSD)
- improved if_nameindex and getifaddrs functions
compatibility:
- work around bug #61144 in gcc 4.9.0 and 4.9.1
- support getauxval(AT_SECURE) even on kernels without AT_SECURE
bugs fixed:
- empty dynamic linker error messages (regression in 1.1.3)
- if_nameindex omitted unconfigured and ipv6-only interfaces
- incorrect return value for fwide function
- failure of wide printf/scanf functions to set wide orientation
- multiple issues in legacy function getpass
- dynamic linker did not accept colon as a separator for LD_PRELOAD
- errno clobber in syslog caused wrong output for %m specifier
- crash in regexec for nonzero nmatch argument with REG_NOSUB
- minor bugs in rarely-used nl_langinfo item lookups
arch-specific bugs fixed:
- broken relocations in mips dynamic linker (regression in 1.1.3)
- register state corruption in setjmp asm for microblaze
- broken struct stat st_ino field on microblaze
- broken struct stat st_dev field on big endian mips
- broken asm register constraints in atomics on powerpc
- missing barriers in atomics on mips, powerpc, microblaze, and sh
1.1.5 release notes
new features:
- full C11 coverage (threads, UTF-16/32 API, timespec_get, etc.)
- malloc_usable_size function (nonstandard)
- support for new F_OFD_* fcntl operations (linux 3.15, POSIX-future)
- new _DEFAULT_SOURCE feature test macro to request default profile
performance:
- private-futex support
- redesigned cond var implementation with major performance improvement
- tweaked spinning in userspace before performing futex waits
bugs fixed:
- failure of dn_expand to null-terminate name for crafted DNS packets
- corruption of cond var mutex state when switching mutexes
- use of uninitialized memory with application-provided thread stacks
- false ownership of orphaned mutexes due to tid reuse
- possible failure-to-wake for robust mutexes on owner death
- subtle errors in robust mutex unrecoverable status handling
- missing memory/compiler barrier spinning to obtain locks
- wrong behavior in various zero-length stdio operations
- buffer overflow in swab with odd argument
- incorrect sequence generation in the rand48 family of prng functions
- missing cancellation check in non-wait paths of sem_wait, pthread_join
- missing barrier in pthread_once fast path
- memory leak in regexec when input contains illegal sequence
- various parser bugs in regcomp
- wrong return value on overflow in some strtoul-family functions
- broken CPU_EQUAL macro in sched.h
- dlerror not working in static-linked programs
- mishandling of negative non-whole-hour TZ offsets
- incorrect case mappings for U+00DF
- namespace pollution via accidentally-non-static function named "dummy"
- missing __fpclassifyl and __signbitl definitions for ld64 archs
1.1.6 release notes
new features:
- getopt '-' flag for processing non-option arguments
- getopt_long argument permutation extension
- getopt_long abbreviated options
- ns_parserr and related DNS-packet-parsing functions
- fnmatch FNM_CASEFOLD extension
- support for translation of getopt error messages
- login_tty function (legacy)
performance:
- efficient atomics on armv7+ targets
- pthread_once shrink-wrapping of fast path
compatibility:
- baseline arm binaries now work on new cpus/kernels without kuser_helper
- dynamic linker now honors DT_RUNPATH without DT_RPATH (new binutils)
- arm asm is now compatible with clang's internal assembler
- suppress macro implementations of functions when headers are used in C++
- increased message length limit for syslog
bugs fixed:
- open ignored file creation mode argument for O_TMPFILE
- wrong printf formatting for %#.0o with value zero
- missing private state for uchar.h functions (null ps pointer)
- sched_getaffinity left uninitialized data in output bit array
- wrong return values for pthread_getaffinity_np and pthread_setaffinity_np
- buggy handling of multibyte option chars with arguments in getopt
- printf failed to report or stop on write errors
- printf failed to honor '+' modifier when printing NANs
- wcsnrtombs returned the wrong value in one code path
- syslog failed to check for connect error
- multi-threaded set*id() had spurious failures from ugly workaround code
- various minor header conformance bugs (signedness, constant expressions, ...)
arch-specific bugs fixed:
- on or1k, some syscalls with 64-bit arguments were broken (misaligned)
- usage of sahf instruction on x86_64 crashed on some early cpu models
1.1.7 release notes
new features:
- alternate passwd/group backend support via nscd protocol
- masked cancellation mode extension (experimental)
- aio cancellation
- aarch64 port (experimental)
performance:
- significant memset asm optimizations on i386 and x86_64
compatibility:
- suppress EINTR in semaphores for old kernels where futex restart is broken
- always set optarg in getopt_long
- support SOCK_RAW socket type in getaddrinfo
- report success instead of EINPROGRESS when close is interrupted
bugs fixed:
- multithreaded set*id() was not async-signal safe, had various race bugs
- getspnam_r returned results for partial username matches
- wordexp bad character checker mis-counted parentheses
- close on fd with pending aio could lead to file corruption
- old aio implementation had numerous conformance bugs
- malloc init code could deadlock due to race condition
- pthread_exit did not disable cancellation
- pthread_cond_wait could wrongly consume signal on cancellation
- execvp wrongly stopped path search on EACCESS
- fsync, fdatasync, and msync were not honored as cancellation points
- fchmodat was subject to fd leak race (missing O_CLOEXEC)
- fchmodat failed to report EOPNOTSUPP in race path
- passwd/group lookup functions had various minor error-reporting bugs
- isatty had false-positives/device-state-corruption for OSS sound devices
- configure script failed to detect gcc with translated messages
- FLT_ROUNDS macro failed to reflect rounding mode changes in fenv
arch-specific bugs fixed:
- mips fesetenv did not handle FE_DFL_ENV
- mips POLLWRNORM and POLLWRBAND macros had wrong values
- x32 pthread synchronization object type definitions were wrong
- powerpc minimum signal stack size was insufficient
1.1.8 release notes
bugs fixed:
- stack-based buffer overflow in inet_pton (CVE-2015-1817)
- regcomp crash/mem-corruption with illegal bytes after backslash
- regcomp wrongly allowed backrefs in ER
- regcomp miscompiled character class brace-repetitions
- regcomp wrongly processed \0 as an unmatchable backref
- new FLT_ROUNDS definition failed to work in C++ code
arch-specific bugs fixed:
- aarch64 was missing max_align_t definition
1.1.9 release notes
new features:
- ability to protect libc code itself with stack protector
- sigsetjmp now restores signal mask after restoring context, not before
- thread-local dlerror status/messages
- dlerror messages are no longer truncated
- diagnostics for constraint violations with ctype.h macros
optimizations:
- reduce cost of PIC on archs where PLT calls need a fixed GOT register
- spin locks no longer constantly invalidate cache lines while spinning
- code size reduction in static-linked TLS init
bugs fixed:
- failure to process robust mutexes on detached-thread exit
- possible memory corruption due to robust mutex list on detached-thread exit
- crash on memory exhaustion in getgr* internals
- misaligned memory accesses in static binaries with low-alignment TLS blocks
- multiple cases of wrongful path search continuation after transient failure
- small memory leak on failure of dlopen with RPATH $ORIGIN
- several small math bugs related to exception flags with non-finite args
- mmap leak in sem_open failure path for link call
- duplocale clobbered new locale struct with memcpy of old
- futimes crashed with null timeval argument
arch-specific bugs fixed:
- stack protector spuriously aborted after forking on x32
- stack protector spuriously aborted with flockfile on powerpc
- theoretically-possible clobbering of syscall return value on mips
- random thread-pointer setup failure on sh (uninitialized return value)
- possible crash in dlsym on sh due to incorrectly-computed branch target
- broken fesetenv(FE_DFL_ENV) on mips
- dynamic linker name for sh ignored fpu/nofpu and endianness
- various minor aarch64 bugs
- dangling pointers in x32 syscall timespec fixup code
1.1.10 release notes
new features:
- fail-safe (allocation-free) C locale for newlocale to return
- all locale categories track requested locale name
- rcrt1.o start file for static PIE
optimizations:
- inline atomics for sh4a
- removed heavy atomics from locale-related code paths
- removed global data accesses from CURRENT_LOCALE macro & callers
- dynamic linker stage 1 size reduction
compatibility:
- better configure detection of unsupported compiler options
- support for more relocation types in libc.so, not currently used
- iconv_open accepts "" and "CHAR" as aliases for native (UTF-8)
- additional LFS64 macros in sys/resource.h
regressions fixed:
- dynamic linker crash on NONE-type relocations (only mips affected)
- inability to build as thumb2 on arm
- failure to run under qemu-i386 user-level emulation
- inability to access globals from libc on powerpc
- PIE link errors in Scrt1.o under unusual usage on some archs
other bugs fixed:
- failure of ungetc/ungetwc to work on FILE streams in EOF state
- possible null pointer dereference in gettext
- possible initial stack misalignment on mips with PIE
1.1.11 release notes
new features:
- byte-based C locale
- vdso clock_gettime on arm
- musl-clang wrapper
- sh2 nommu target support
performance:
- major speed-up for dynamic linker symbol lookups with GNU hash
compatibility:
- strverscmp now matches GNU behavior in corner cases
- empty TZ environment variable gives GMT rather than system default
- reconnection on syslog server socket loss (syslogd restart)
- mmap fallback in simple_malloc when brk fails
- support for %m and %s with null pointers in wide printf variants
- call frame information in i386 asm for improved debugger support
bugs fixed:
- spurious errors from pwd/grp functions when nscd backend is absent
- possible invalid access on calloc with simple_malloc
- null pointer dereferences after calling uselocale((locale_t)0)
- erroneous support for cancellation in stdio caused data loss
- inconsistent handling of atexit called from atexit handler
- missing locking in error paths for ungetwc
- btowc mishandling of out-of-range non-EOF inputs
- negated return value of ns_skiprr, failure in related functions
- incorrect void return type for syncfs, missing error status
- possible failure of tempnam due to missing null termination
- negated tm_gmtoff field in struct tm
- off-by-one error in getsubopt leaving equals sign in value result
arch-specific bugs fixed:
- soft deadlocks on i386/x86_64 due to missing barrier in internal locks
- regression in arm pre-v7 support for kernels with kuser helper removed
- runaway PC on mips detached thread exit (due to kernel regression)
- mismatched ABI for local-dynamic model TLS on mips and powerpc
- incorrect value of some SO_* constants on mips
- broken 64-bit syscall argument passing on aarch64
1.1.12 release notes
new features:
- fdpic abi on sh2 for shareable text segment without mmu
- general fdpic elf support in dynamic linker
- CFI generation for x86_64 asm source files
- protection against silently building a libc.so with missing symbols
compatibility:
- nl_langinfo(CODESET) now returns "ASCII" in byte-based C locale
- fixed build regression due to buggy .SECONDARY in some GNU make versions
- additional arm eabi functions needed by llvm arm backend
- added format argument attributes to gettext function prototypes
- static PIE no longer requires linking with -E/-rdynamic
- eliminated spurious protected-data warnings linking against libc.so
- avoided spurious fpu asm errors with some armhf toolchains
bugs fixed:
- fclose of stdin/stdout caused deadlock at exit
- missing memory barrier in pthread_join
- open_[w]memstream produced no buffer when no writes took place
- uninitialized scopeid in address lookups from hosts file and ip literals
- ip literals for mismatching family (v4 vs v6) were queried as hostnames
- possible crash on OOM in regcomp
- incorrect contents in localeconv structure (-1 instead of CHAR_MAX)
- strftime mishandling of out-of-range struct tm members
- wrongful attribute((const)) on pthread_self and errno location function
arch-specific bugs fixed:
- arm crt1 entry point failed to align stack pointer in some cases
- mips fesetround failed to actually set rounding mode
- i386 asm source CFI generation had multiple bugs
1.1.13 release notes
new features:
- out-of-tree builds
- search domains in resolv.conf
- sh arch supports j-core (j2) cas.l atomics
- dynamic linker includes arch/abi in output when run as a command
- header support for new kernel features through linux 4.4
- mips vdso clock_gettime support
- regex BRE extensions: \|, \+, \?
performance:
- improved atomics performance on all archs with ll/sc model
- atomic instructions are now inlined on armv6
- use fpu sqrt for arm softfp abi on targets with vfp
compatibility:
- getnameinfo now accepts sockaddr sizes larger than needed
- new default CFLAGS/LDFLAGS avoid entire classes of toolchain bugs
- explicit use of float_t/double_t avoids compiler float spill bugs
- i386 max_align_t definition now works with g++ 4.7's pseudo-c++11
- all known protocols are added to protoent functions
- stub utmpname, utmpxname functions
- linker support for -Bsymbolic-functions is no longer mandatory
- regex parsing size limits increased
- malloc_usable_size now accepts null pointer input
bugs fixed:
- potential single-byte heap overflow in getdelim
- mishandling of transient failure opening hosts, services, resolv.conf
- mremap was sometimes able to allocate objects larger than PTRDIFF_MAX
- nl_langinfo wrongly returned NULL instead of "" for invalid items
- out-of-bounds dynamic tls allocation due to pointer/index scaling error
- getifaddrs misreported point-to-point interface addresses
- tdelete left tsearch trees misbalanced
- tsearch crashed on allocation failure
- tsearch, tfind, and tdelete failed to handle null pointer input
- passing signal number 0 to sigaction resulted in a crash
- getdelim updated caller's size wrongly when realloc failed
- getdelim realloc strategy was wasteful
- if_nametoindex returned wrong value on failure
- missing ssp-suppression for some source files called from early-init
- various minor resolv.conf parsing bugs
- fwrite wrongly reported success on write errors in line-buffered flush
- fwrite and fread wrongly returned nmemb (not 0) when size was 0
nommu-specific bugs fix:
- failure to zero bss in FDPIC shared library loader
- unsafe writes to read-only file mapping in non-FDPIC library loader
arch-specific bugs fixed:
- sh[eb]-nofpu-fdpic was using fpu-dependent setjmp/longjmp variants
- dynamic linker path file name was wrong for arm "softfp" targets
- mips siginfo_t and related macros were defined incorrectly
- possibly misaligned pointer globals on arm (from an asm source file)
- mips dynamic linker failed to provide info needed by debugger
- mips cancellation asm wrongly assumed validity of $gp register value
1.1.14 release notes
regressions fixed:
- treatment of empty string argument as error by puts and fputs
- make clean and distclean failure in unconfigured trees
- sh/fdpic dynamic linker entry point hang due to wrong code
- armhf (and arm softfp model) build failure with clang
other bugs fixed:
- wrongly clamping (rather than failing) excessive rounds in crypt-sha*
1.1.15 release notes
new features:
- mips64 (full 64-bit and n32) port
- mips r6 isa support (subarch for mips, mips64, and mipsn32 archs)
- powerpc64 port
- powerpc (32-bit) soft-float ABI support (subarch)
- pthread_tryjoin_np and pthread_timedjoin_np (nonstandard extensions)
- header-level support for linux 4.5 and 4.6 features
- sched_getcpu (nonstandard extension) support, including vdso version
- __STDC_ISO_10646__, __STDC_IEC_559__ macros predefined via stdc-predef.h
- support for new elf/arch features in elf.h
compatibility:
- configure now correctly chooses cross-prefix based on build/host/target
- abort now successfully terminates pid 1 in a container (or top-level)
bugs fixed:
- memmem read past end of haystack, possible false positives or crashes
- buffer underflow (reverse-overflow) in ungetwc
- double-free under certain usage of putenv
- incorrect treatment by regcomp of * at start of BRE subexpression
- gethostbyname[2][_r] produced ip addresses in misaligned buffers
- looking up some invalid hostnames caused malformed dns queries
- lookups from hosts file were inconsistent with non-matching family
- missing h_length value in gethostbyaddr results
- a64l function produced wrong-signed results on 64-bit archs
- broken padding of string formats to width in wide printf variants
- wrong results for expf(-NAN) and exp2f(-NAN)
- wrong value for RUSAGE_CHILDREN prevented it from working
- abort failed to provide abnormal termination with SIGABRT blocked
arch-specific bugs fixed:
- broken posix_fadvise on arm and powerpc (32-bit)
- thread structure/dtv corruption on powerpc at thread startup
- various wrong mips and powerpc ioctl and termios constant values
1.1.16 release notes
new features:
- s390x (64-bit S/390) port
- pthread_setname_np extension function
- limited pthread_setattr_default_np function to set stack size defaults
- header-level support for linux 4.7, 4.8, and 4.9 features
- confstr _CS_V6_ENV and _CS_V7_ENV items
compatibility:
- public prototypes for abi-compat *_unlocked symbols, etc.
- fflush_unlocked(NULL) now works
- resolv.h __RES version macro now matches supported APIs
- workaround for gdb bugs backtracing across signals on x86_64
- anchors ^ and $ are now accepted in BRE subexpressions
- building for thumb2-only arm isa levels is now possible
bugs fixed:
- integer overflows in regexec buffer allocation (CVE-2016-8859)
- failure of regexec to report matches at offsets past INT_MAX
- static-pie executables with initialized thread-local storage crashed
- printf failed to catch EOVERFLOW in some cases, wrongly produced it in others
- printf produced wrong output, result for float with precision near INT_MAX
- printf produced wrong results with alt-form octal, zero flag, & field width
- printf float rounding was wrong for some midpoint cases
- swprintf printed junk after internal (256-byte) buffer filled up
- strtod family rounded incorrectly in several corner cases
- getmntent failed to handle long records
- getopt_long_only wrongly treated "--" as an option
- asctime output wrongly varied by locale
- strftime %y specifier produced wrong output for negative tm_year
- time zone names quoted with <> were misparsed
- corner case integer overflow in tm_year for some date conversions
- failure to load shared libs whose names were prefixes of standard lib names
- wrong error codes for several failure cases in various functions
- various asymptomatic undefined behavior
- various minor namespace issues in headers
arch-specific bugs fixed:
- tcsetattr regression on mips (completely non-working)
- wrong pread/pwrite syscall calling convention on sh
- wrong preadv2/pwritev2 syscall numbers on x32
- mrand48/jrand48 produced wrong-signedness results on 64-bit archs
1.1.17 release notes
new features:
- RTLD_LAZY deferred symbol binding, functionally equivalent to lazy binding
- safeguard against dlopen of multiple libc versions/instances
- new posix_spawn flag POSIX_SPAWN_SETSID
- posix_spawnattr_setflags now reports unknown flags as error
- ldso option --argv0 to set argv[0]
- added _NL_LOCALE_NAME extension to nl_langinfo
compatibility:
- dlopen local-to-global promotion no longer changes existing symbols
- gettext now searches locale name variants for translation files
- increased locale name length limit from 15 to 23 bytes
- setlocale(LC_ALL, 0) returns single name if all categories are same
- realloc no longer fails when mremap doesn't work
- getservby* no longer treat numeric port strings as service records
- mmap now works around incorrect EPERM error codes from kernel
- impact of REG_* namespace pollution in x86[_64] signal.h is reduced
- arm atomic asm now assembles correctly with new binutils
- PAGE_SIZE on arm is no longer constant (quiet upstream ABI relaxation)
- lsearch/lfind now pass args to compare callback in canonical order
- STB_WEAK and STB_GNU_UNIQUE symbols now behave same as STB_GLOBAL
- better clang CFLAGS checks in configure
- global vis.h hack, which made lld refuse to link to libc.so, is disabled
performance:
- single-instruction optimized math functions for aarch64, s390x, powerpc64
- fast path for ASCII in towupper/towlower
- new mostly-integer-math fma function
semantic bugs fixed:
- POSIX-format TZ dst time transitions were wrong for southern hemisphere
- regex REG_NEWLINE semantics were wrong with negated brackets
- various bugs in strptime %j, %p, %C formats
- iconv mapped some characters to legacy 8bit encodings incorrectly
- glob failed to match "/"
- UTF-8 decoder accepted invalid f4 9x xx xx code sequences
- scanf %% conversion failed to consume whitespace
- glob with GLOB_PERIOD wrongly descended into . and ..
- nftw gave incorrect base name offset when pathname ends in "/"
- functional regression in resolv.conf attempts option
- scalbn could produce wrong result due to double rounding in subnormal range
- strftime %y format wrong with negative years
- mbsnrtowcs and wcsnrtombs mishandled input limits
- minor issues with error codes for various functions
safety/consistency bugs fixed:
- stack-based buffer overflow in dns response processing
- invalid free in regexec on certain error paths
- invalid free in globfree after failed glob
- one-byte buffer overflow in legacy getpass function
- failed dlopen corrupted thread-local storage module list
- race in pthread_create with priority attributes could leave signals masked
- multithreaded set*id() functions could induce spurious EINTRs
- dl_iterate_phdr reported wrong base address in static PIE
- fd leak and wrong cancellation state after dns socket failure
- memory leaks and other issues in environment-modification functions
- read-after-free race in pthread_detach
- memmem performed single-byte over-read in short-needle code paths
- read via uninitialized pointer in gettext core
- bindtextdomain broke bindings for all other domains
- various silent undefined behavior
- getopt clobbered optopt on success
arch-specific bugs fixed:
- x32 dynamic TLS accesses crashed
- s390x was missing dlsym entry point (needed for RTLD_NEXT)
- powerpc64 ldso startup could crash depending on link order
- powerpc64 setjmp/longjmp didn't properly save/restore TOC pointer
- thumb2 setjmp/longjmp silently broke at ld-time with text not aligned
- fchown was broken on archs without SYS_fchown syscall
- fstatat was broken on mips64
- various incorrect constants in powerpc64 and mips headers
1.1.18 release notes
regression fixes:
- glob failed to match literal . and .. path components
- build for armv4t ISA level was broken
other bug fixes:
- stack overflow in posix_spawnp with large PATH variable in environment
1.1.19 release notes
new features:
- iconv framework for processing stateful encodings
- iconv support for iso-2022-jp
- iconv support for converting to legacy JIS-based Japanese encodings
- iconv support for UTF-16/32 with BOM-determined endianness
- iconv ibm1047 (ebcdic latin1-equivalent) support
- iconv cp866 (dos cyrillic) support
- character data tables & case mappings updated to Unicode 10.0
- fopencookie stdio extension
- strftime padding character extensions
- header-level support for new linux features through 4.13
compatibility:
- UTC timezone is now called UTC instead of GMT
- _DIRENT_HAVE_D_* macros in dirent.h
- dladdr dli_fbase definition now matches other implementations
- pthread_getattr_np now reports guard size
- strftime '+' modifier better matches apparent intent of POSIX
- getopt_long handles long option names containing '='
- better compatibility with linux uapi headers
- workaround linux bug where getcwd can return non-absolute pathname
- configure logic for finding compiler_rt with clang
- execvp path search now continues after ENOTDIR components
bugs fixed:
- fgetwc failed when character crossed buffer boundary
- memory corruption after failing to dlopen a second libc
- sysconf reported infinite rlimits incorrectly
- getopt_long --opt=arg did not work with partial matches
- printf was wrong for alt-form octal with value 0, no explicit precision
- endian errors in arpa/nameser.h and netinet/icmp6.h (missing endian.h)
- atfork handler could clobber fork's errno
- iconv could wrongly output surrogate pairs in ucs2
- fmemopen buffer underallocation with extreme size argument
- getaddrinfo AI_NUMERICSERV wrong error code
- data race in at_quick_exit
- ldd failed to honor rpath $ORIGIN for program in . without "./" prefix
arch-specfic bugs fixed:
- x32 unistd.h wrongly reported LP64 instead of ILP32
- aarch64 signal.h had wrong type for ucontext_t uc_link member
1.1.20 release notes
new features:
- m68k port
- replacement of malloc is now allowed/supported
- setvbuf now accepts caller-provided buffers for stdio streams
- getrandom syscall wrapper, getentropy function
- mlock2 syscall wrapper
- memfd_create syscall wrapper
- explicit_bzero function
- header-level support for new linux features through 4.17
- wcsftime now supports padding specifier extensions
- dynamic linker's reclaim_gaps now works on fdpic archs
- getaddrinfo now honors AI_ADDRCONFIG
- pthread_attr_init now honors pthread_setattr_default_np defaults
hardening:
- prevent bypass of guarantee that suids start with fd 0/1/2 open
- dlopen now rejects libraries with initial-exec refs to dynamic TLS
compatibility:
- elf.h: new flags, aux vector entry types, etc.
- minor namespace issues in several headers
- intNN_t types used in bitfields now safe against -funsigned-bitfields
- complex arc trig/hyperbolic functions were badly broken
- nice function returned wrong value
- stdio locks no longer depend on read-after-free not faulting
- avoid excessive stack usage in getcwd
- inet_ntop no longer compresses single zeros in IPv6 (RFC 5952)
- resolver routability probe for sorting results works on no-IPv6 systems
- added missing ST_RELATIME definition to statvfs.h
- uchar.h now works with old C++ profiles
- added missing and arch-specific commands to ptrace.h
- musl-gcc wrapper now works with default-pie host toolchains
bugs fixed:
- getopt wrongly treating colons in optstring as valid option chars
- nl_langinfo_l(CODESET, loc) reported wrong locale's value
- out-of-tree build produced broken crt files with stack protector enabled
- fmaf produced wrong result for some corner cases
- out of bounds write for zero length buffer passed to gethostname
- getopt_long_only wrongly prefix-matched long-options over short ones
- pthread_kill wrongly returned ESRCH for exited by valid pthread_t's
- iconv buffer overflow converting to legacy JIS-based encodings
- iconv conversion to "UTF-32" (no explicit endianness) failed (regression)
- iconv mishandled big5-hkscs characters that map to two unicode chars
- dynamic linker didn't map/clear bss for libraries with single LOAD segment
- resolver wrongly duplicated trailing dot from query into canonical name
- some futex waits omitted timeout arg to syscall, thereby spun on EFAULT
- dladdr mishandled addresses not matching symbols
- alignment of dirent structures from readdir was broken (regression)
- strftime %z output wrong sign for offsets <1 hour west of UTC
- limits.h, pathconf erroneously defined SYMLINK_MAX
- FP_ILOGB0 and FP_ILOGBNAN definitions were not valid for use in #if
- getopt failed to update optarg and optind correctly on missing argument
- EMULTIHOP error lacked strerror text
- mktime malfunctioned with tm_isdst>0 but no-DST POSIX-format time zone
- async thread self-cancellation produced a deadlock condition
- pthread_barrierattr_setpshared failed to produce EINVAL for bad argument
- fileno failed to produce EBADF for non-fd-associated FILEs
- fmemopen's w+ mode failed to truncate buffer at open
- open_[w]memstream did not bind stream orientation at open time
- system wrongly returned 0x7f00 instead of -1 on error
- wide printf functions ignored field width for %c formats
- fprintf failed to set stream orientation for unbuffered stream or no output
- psignal, psiginfo, and perror wrongly set stream orientation for stderr
- psignal, psiginfo potentially clobbered errno on success
arch-specfic bugs fixed:
- on arm/aarch64/sh, local-exec TLS layout mismatched ABI with large align
- on arm/microblaze/sh, struct ipc_perm mismatched (buggy) kernel ABI
- SO_PEERSEC definition was wrong on mips
- on mips, return from start function passed to clone crashed (runaway exec)
- printf %a precision specifier malfunctioned except on ld80 archs
- async thread cancellation crashed on powerpc64 and sh-fdpic
1.1.21 release notes
new features:
- setting default thread stack size via PT_GNU_STACK program header
- arm vfork implementation
- arm tlsdesc/gnu2 tls dialect support
- name_to_handle_at and name_to_handle_at syscall wrappers
- header-level support for new linux features through 4.18
optimizations:
- glob rewrite with much better performance and stack usage properties
- single-threaded and already-locked fast paths for getc/putc variants
- single-instruction fma implementations for arm, s390x, powerpc, & x86_64
- single-instruction fabs and sqrt implementations for powerpc
- size and performance from making all internal-only functions/data hidden
- made &errno and pthread_self results cachable again (attribute((const)))
- significant speedup in strtod with short inputs
- new tsearch AVL tree implementation, smaller and faster
- special-cased nop calls to wmemmove
- fixed erroneously suboptimal skip conditions in strstr and memmem
hardening:
- default thread stack guard size increased from 4k to 8k
compatibility:
- default thread stack size increased from 80k to 128k
- building for arm as thumb2 with clang internal assembler now works
- aio threads could overflow stack on kernels that break MINSIGSTKSZ ABI
- aio threads no longer call malloc (problematic with malloc replacement)
- pthread_sigmask/sigprocmask now ignore an invalid how when not changing mask
bugs fixed:
- soft deadlock regression in stdio FILE locks with >2 threads contending
- deadlock and buffered data loss race in fclose
- race condition leading to possible crash in dcngettext plural forms
- glob failed to see past searchable-but-unreadable path components
- getdelim wrongly realloc'd buffer that was already exactly right size
- getdelim failed to set stream orientation on early error
- ttyname[_r] reported wrong error when given bad fd
- pthread_key_delete left old tsd values exposed if slot was reused
- freeaddrinfo failed to support freeing sublists
- access to optopt was broken by copy relocations
- memccpy returned wrong result if first byte past buffer end matched
- wordexp read past end of input string ending in backslash
- sem_wait and sem_timedwait were wrongly not interruptible by signals
- getspnam[_r] wrongly treated not-found as an error
arch-specfic bugs fixed:
- soft deadlocks (missing futex wake) on powerpc locking
- dlsym returned wrong address for thread-local symbols on ppc/mips/m68k
1.1.22 release notes
new features:
- priority-inheritance mutexes
- membarrier syscall, pre-registration to use it, fallback emulation
- header-level support for new linux features in 4.19, 4.20, 5.0
major internal changes:
- complete, async-safe view of all existent threads as global list
- robust __synccall based on new thread list
- new dynamic TLS is installed synchronously at dlopen
- TLSDESC resolver functions no longer make bad ABI assumptions to call C
- resolved shared library dependencies are now recorded
compatibility & conformance:
- dependency-order shared library constructor execution
- sigaltstack no longer rejects SS_AUTODISARM, future flags
- FILE is now a complete (dummy) type in pre-C11 feature profiles
- setvbuf reports failure on invalid arguments
- TSVTX is exposed unconditionally in tar.h
- multithreaded set*id() no longer depends on /proc
- key slot reuse after pthread_key_delete no longer depends on /proc
bugs fixed:
- failures in multithreaded set*id() with concurrent thread creation/exit
- interposed free was called from invalid/inconsistent contexts
- freeaddrinfo performed invalid free of some partial results lists
- dlsym dependency order search had false negatives and false positives
- dn_skipname gave wrong results for labels with 8-bit content
- dcngettext clobbered errno, often breaking printing of error messages
- sscanf read past end of buffer under certain conditions (1.1.21 regression)
- pthread_key_create spuriously failed under race condition (1.1.21 regression)
- fdopendir wrongly succeeded with O_PATH file descriptors
- gets behaved incorrectly in presence of null bytes
- namespace violations in c11 tsd and mutex function dependencies
- incorrect prototype for makecontext (unimplemented)
arch-specfic bugs fixed:
- s390x had wrong values for POSIX_FADV_DONTNEED/_NOREUSE
1.1.23 release notes
new features:
- riscv64 port
- configure now allows customizing AR and RANLIB vars
- header-level support for new linux features in 5.1
major internal changes:
- removed extern __syscall; syscall header code is now fully self-contained
performance:
- new math library implementation for log/exp/pow
- aarch64 dynamic tlsdesc function is streamlined
compatibility & conformance:
- O_TTY_INIT is now defined
- sys/types.h no longer pollutes namespace with sys/sysmacros.h in any profile
- powerpc asm is now compatible with clang internal assembler
changes for new POSIX interpretations:
- fgetwc now sets stream error indicator on encoding errors
- fmemopen no longer rejects 0 size
bugs fixed:
- static TLS for shared libraries was allocated wrong on "Variant I" archs
- crash in dladdr reading through uninitialized pointer on non-match
- sigaltstack wrongly errored out on invalid ss_size when doing SS_DISABLE
- getdents function misbehaved with buffer length larger than INT_MAX
- set*id could deadlock after fork from multithreaded process
arch-specfic bugs fixed:
- s390x SO_PEERSEC definition was wrong
- passing of 64-bit syscall arguments was broken on microblaze
- posix_fadvise was broken on mips due to missing 7-arg syscall support
- vrregset_t layout and member naming was wrong on powerpc64
1.1.24 release notes
new features:
- GLOB_TILDE extension to glob
- non-stub catgets localization API, using netbsd binary catalog format
- posix_spawn file actions for [f]chdir (extension, pending future standard)
- secure_getenv function (extension)
- copy_file_range syscall wrapper (Linux extension)
- header-level support for new linux features in 5.2
performance:
- new fast path for lrint (generic C version) on 32-bit archs
major internal changes:
- functions involving time are overhauled to be time64-ready in 32-bit archs
- x32 uses the new time64 code paths to replace nasty hacks in syscall glue
compatibility & conformance:
- support for powerpc[64] unaligned relocation types
- powerpc[64] and sh sys/user.h no longer clash with kernel asm/ptrace.h
- select no longer modifies timeout on failure (or at all)
- mips64 stat results are no longer limited to 32-bit time range
- optreset (BSD extension) now has a public declaration
- support for clang inconsistencies in wchar_t type vs some 32-bit archs
- mips r6 syscall asm no longer has invalid lo/hi register clobbers
- vestigial asm declarations of __tls_get_new are removed (broke some tooling)
- riscv64 mcontext_t mismatch glibc's member naming is corrected
bugs fixed:
- glob failed to match broken symlinks consistently
- invalid use of interposed calloc to allocate initial TLS
- various dlsym symbol resolution logic errors
- semctl with SEM_STAT_ANY didn't work
- pthread_create with explicit scheduling was subject to priority inversion
- pthread_create failure path had data race for thread count
- timer_create with SIGEV_THREAD notification had data race getting timer id
- wide printf family failed to support l modifier for float formats
arch-specific bugs fixed:
- x87 floating point stack imbalance in math asm (i386-only CVE-2019-14697)
- x32 clock_adjtime, getrusage, wait3, wait4 produced junk (struct mismatches)
- lseek broken on x32 and mipsn32 with large file offsets
- riscv64 atomics weren't compiler barriers
- riscv64 atomics had broken asm constraints (missing earlyclobber flag)
- arm clone() was broken when compiled as thumb if start function returned
- mipsr6 setjmp/longjmp did not preserve fpu register state correctly
1.2.0 release notes
new features:
- time_t is now 64-bit on all archs (not just 64-bit archs)
- character type & case mapping data updated to Unicode 12.1.0
- header-level support for new linux features in 5.3 and 5.4
performance:
- new O(1) wchar_t case mapping implementation
- i386 now uses C math code for exp, faster than old asm
- mips math asm
compatibility & conformance:
- endian.h now aims to conform to future POSIX definition
- support older compilers that don't accept powerpc math asm constraints
- fdpic code in ldso was incompatible with valid optimizations in gcc 9+
- RLIMIT_RTTIME was missing from sys/resource.h
bugs fixed:
- wcwidth wrongly returned 0 for most of planes 4 and up
- missing case mapping between U+03F3 and U+037F
- wrong cacosh results for arguments with negative imaginary part
- wrong catanf/catanl results for various classes of arguments
- wrong return value for ungetc with argument outside [0,UCHAR_MAX]
- posix_openpt with no ptys available produced wrong errno
arch-specific bugs fixed:
- sigcontext/regset definition mistakes & omissions on m68k, powerpc64
- fesetenv(FE_DFL_ENV) crashed on riscv64
- sh2 dynamic linker was broken since 1.1.21 (crash in stage 2b)
- arm dynamic linker chose wrong tls/atomic variants since 1.1.21
- some math library functions returned excess precision on i386
- unconfirmed regression in fchmodat AT_SYMLINK_NOFOLLOW on mips*
1.2.1 release notes
major changes:
- new malloc implementation (mallocng & overhauled bump allocator)
new features:
- DNS queries via res_* now set AD flag, report zone signedness (DNSSEC)
- PTHREAD_NULL macro (POSIX-future)
performance:
- optimized memcpy and memset for aarch64
- optimized memcpy for arm now supports big endian
- optimized x86_64 remquol
- improved strerror without linear search
bugs fixed:
- lock-skipping for processes that returned to single-threaded was wrong
- AF_UNSPEC dns lookups mishandled single failure in paired A+AAAA
- res_send and res_query returned wrong value on errors from nameserver
- corrupted sysvipc timestamps on 32-bit archs with old kernels
- incorrect parsing of timezone offsets after overly-long zone name
- clock_adjtime was broken on 32-bit archs (time64)
- pthread_kill as not async-signal-safe
- pthread_cancel was not async-cancel-safe
- large-ulp errors in various math functions in non-default rounding modes
arch-specific bugs fixed:
- arm clock_gettime was broken on some hw due to bad time64 vdso
- m68k sqrtl lacked long double precision
- mips* syscall mechanism regressions on older kernels
- mips* had negated error codes for some syscalls (kernel bug)
- mips* SIGEMT was wrongly called SIGSTKFLT
- sh fesetround didn't work correctly on sh
1.2.2 release notes
major changes:
- child restrictions lifted after fork of multithreaded parent
new features:
- _Fork function (POSIX-future)
- reallocarray function (extension from OpenBSD, now widespread)
- gettid function (kernel tid as supported concept)
- SIGEV_THREAD_ID sigevent API (Linux extension)
- tcgetwinsize and tcsetwinsize functions (POSIX-future)
performance:
- faster software sqrt on archs without native sqrt instruction
compatibility:
- realpath no longer depends on procfs availability & accuracy
- time zone parser now always prefers 64-bit tables if present
- crypt_blowfish now supports $2b$ prefix
- res_query now reports errors via h_errno
- set*id and setrlimit are now safe in vforked/cloned child
- setgroups now applies to all threads
- dlopen debugger notification is improved, should work with lldb
- setrlimit no longer needs __synccall broadcast on linux 2.6.36+
- faccessat with AT_EACCESS no longer needs child process on linux 5.8+
bugs fixed:
- buffer overflow and infinite loop errors in wcsnrtombs (CVE-2020-28928)
- sem_close unmapped still-referenced semaphores
- fork of process with active aio could deadlock or crash paren
- pthread_cond_wait was broken with priority-inheritance mutex
- getgrouplist wrongly failed when nscd reported an empty list
- abort could leak modified SIGABRT disposition to fork or posix_spawn child
- regression with mallocng: malloc_usable_size(0) crashed
- readlink wrongly gave EINVAL on zero length dest buffer
- sqrtl was severely inaccurate (not correctly rounded) on ldquad archs
- assert failure wrongly flushed stdio (possible deadlock)
- MUSL_LOCPATH search was broken with multiple components
- missing newline in herror output
- possible deadlock in pthread_exit with pshared mutex or barrier usage
- pthread_mutexattr_getprotocol didn't read back protocol
- v4l2 ioctl translation for pre-time64 kernels didn't work
arch-specific bugs fixed:
- x86_64 longjmp failed to handle 0 argument reliably
- i386 __set_thread_area fallback for pre-2.6 kernels didn't work
- missing O_LARGEFILE macro value on x86_64, x32, mips64
- unpredictable s390x breakage from failure to preserve call-saved registers
@@ -1,82 +0,0 @@
#define a_ll a_ll
static inline int a_ll(volatile int *p)
{
int v;
__asm__ __volatile__ ("ldaxr %w0,%1" : "=r"(v) : "Q"(*p));
return v;
}
#define a_sc a_sc
static inline int a_sc(volatile int *p, int v)
{
int r;
__asm__ __volatile__ ("stlxr %w0,%w2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory");
return !r;
}
#define a_barrier a_barrier
static inline void a_barrier()
{
__asm__ __volatile__ ("dmb ish" : : : "memory");
}
#define a_cas a_cas
static inline int a_cas(volatile int *p, int t, int s)
{
int old;
do {
old = a_ll(p);
if (old != t) {
a_barrier();
break;
}
} while (!a_sc(p, s));
return old;
}
#define a_ll_p a_ll_p
static inline void *a_ll_p(volatile void *p)
{
void *v;
__asm__ __volatile__ ("ldaxr %0, %1" : "=r"(v) : "Q"(*(void *volatile *)p));
return v;
}
#define a_sc_p a_sc_p
static inline int a_sc_p(volatile int *p, void *v)
{
int r;
__asm__ __volatile__ ("stlxr %w0,%2,%1" : "=&r"(r), "=Q"(*(void *volatile *)p) : "r"(v) : "memory");
return !r;
}
#define a_cas_p a_cas_p
static inline void *a_cas_p(volatile void *p, void *t, void *s)
{
void *old;
do {
old = a_ll_p(p);
if (old != t) {
a_barrier();
break;
}
} while (!a_sc_p(p, s));
return old;
}
#define a_ctz_64 a_ctz_64
static inline int a_ctz_64(uint64_t x)
{
__asm__(
" rbit %0, %1\n"
" clz %0, %0\n"
: "=r"(x) : "r"(x));
return x;
}
#define a_clz_64 a_clz_64
static inline int a_clz_64(uint64_t x)
{
__asm__("clz %0, %1" : "=r"(x) : "r"(x));
return x;
}
@@ -1,24 +0,0 @@
#define _Addr long
#define _Int64 long
#define _Reg long
#if __AARCH64EB__
#define __BYTE_ORDER 4321
#else
#define __BYTE_ORDER 1234
#endif
#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF unsigned wchar_t;
#endif
TYPEDEF unsigned wint_t;
TYPEDEF int blksize_t;
TYPEDEF unsigned int nlink_t;
TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;

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