mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-10-28 10:45:48 +08:00
remove support for wasi-libc
closes https://github.com/ziglang/zig/issues/9342 closes https://github.com/ziglang/zig/issues/15005 closes https://github.com/ziglang/zig/issues/20747 closes https://github.com/ziglang/zig/issues/22570 closes https://codeberg.org/ziglang/zig/issues/30977
This commit is contained in:
1 parent
56023ff8fe
commit
5e754304de
520 files changed
+475
-42155
No files matched your search
@@ -457,7 +457,6 @@ set(ZIG_STAGE2_SOURCES
|
||||
src/register_manager.zig
|
||||
src/target.zig
|
||||
src/tracy.zig
|
||||
src/libs/wasi_libc.zig
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -775,7 +775,6 @@ pub fn build(b: *std.Build) !void {
|
||||
.optimize_modes = optimize_modes,
|
||||
.test_filters = test_filters,
|
||||
.test_target_filters = test_target_filters,
|
||||
.skip_wasm = skip_wasm,
|
||||
.max_rss = 4_300_000_000,
|
||||
})) |test_libc_nsz_step| test_step.dependOn(test_libc_nsz_step);
|
||||
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ const std = @import("std");
|
||||
const symbol = @import("../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
// Functions specific to musl and wasi-libc.
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
// Functions specific to musl.
|
||||
symbol(&isalnum, "isalnum");
|
||||
symbol(&isalpha, "isalpha");
|
||||
symbol(&isblank, "isblank");
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@ const imaxdiv_t = std.c.imaxdiv_t;
|
||||
const symbol = @import("../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
// Functions specific to musl and wasi-libc.
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
// Functions specific to musl.
|
||||
symbol(&imaxabs, "imaxabs");
|
||||
symbol(&imaxdiv, "imaxdiv");
|
||||
}
|
||||
|
||||
+4
-4
@@ -31,7 +31,7 @@ comptime {
|
||||
symbol(&math.snan(c_longdouble), "__SNANL");
|
||||
}
|
||||
|
||||
if (builtin.target.isMinGW() or builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMinGW() or builtin.target.isMuslLibC()) {
|
||||
symbol(&frexpf, "frexpf");
|
||||
symbol(&frexpl, "frexpl");
|
||||
symbol(&hypotf, "hypotf");
|
||||
@@ -42,14 +42,14 @@ comptime {
|
||||
symbol(&rintl, "rintl");
|
||||
}
|
||||
|
||||
if ((builtin.target.isMinGW() and @sizeOf(f64) != @sizeOf(c_longdouble)) or builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if ((builtin.target.isMinGW() and @sizeOf(f64) != @sizeOf(c_longdouble)) or builtin.target.isMuslLibC()) {
|
||||
symbol(&atanl, "atanl");
|
||||
symbol(©signl, "copysignl");
|
||||
symbol(&fdiml, "fdiml");
|
||||
symbol(&nanl, "nanl");
|
||||
}
|
||||
|
||||
if ((builtin.target.isMinGW() and builtin.cpu.arch == .x86) or builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if ((builtin.target.isMinGW() and builtin.cpu.arch == .x86) or builtin.target.isMuslLibC()) {
|
||||
symbol(&acosf, "acosf");
|
||||
symbol(&atanf, "atanf");
|
||||
symbol(&coshf, "coshf");
|
||||
@@ -57,7 +57,7 @@ comptime {
|
||||
symbol(&tanhf, "tanhf");
|
||||
}
|
||||
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&acos, "acos");
|
||||
symbol(&acoshf, "acoshf");
|
||||
symbol(&asin, "asin");
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ const c = std.c;
|
||||
const symbol = @import("../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC() or builtin.target.isMinGW()) {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isMinGW()) {
|
||||
symbol(&pthread_spin_init, "pthread_spin_init");
|
||||
symbol(&pthread_spin_destroy, "pthread_spin_destroy");
|
||||
symbol(&pthread_spin_trylock, "pthread_spin_trylock");
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ const builtin = @import("builtin");
|
||||
const symbol = @import("../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&insque, "insque");
|
||||
symbol(&remque, "remque");
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ comptime {
|
||||
_ = @import("stdlib/rand.zig");
|
||||
_ = @import("stdlib/drand48.zig");
|
||||
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
// Functions specific to musl and wasi-libc.
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
// Functions specific to musl.
|
||||
symbol(&abs, "abs");
|
||||
symbol(&labs, "labs");
|
||||
symbol(&llabs, "llabs");
|
||||
|
||||
@@ -8,7 +8,7 @@ const Lcg = std.Random.lcg.Wrapping(u48);
|
||||
const symbol = @import("../../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&erand48, "erand48");
|
||||
symbol(&jrand48, "jrand48");
|
||||
symbol(&nrand48, "nrand48");
|
||||
|
||||
@@ -3,7 +3,7 @@ const std = @import("std");
|
||||
const symbol = @import("../../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&rand, "rand");
|
||||
symbol(&srand, "srand");
|
||||
symbol(&rand_r, "rand_r");
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ const c = std.c;
|
||||
comptime {
|
||||
symbol(&strndup, "strndup");
|
||||
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
// memcpy implemented in compiler_rt
|
||||
// memmove implemented in compiler_rt
|
||||
// memset implemented in compiler_rt
|
||||
@@ -53,7 +53,7 @@ comptime {
|
||||
symbol(&__strcoll_l, "strcoll_l");
|
||||
symbol(&__strxfrm_l, "strxfrm_l");
|
||||
|
||||
// These symbols are not in the public ABI of musl/wasi. However they depend on these exports internally.
|
||||
// These symbols are not in the public ABI of musl. However it depends on these exports internally.
|
||||
symbol(&stpcpy, "__stpcpy");
|
||||
symbol(&stpncpy, "__stpncpy");
|
||||
symbol(&strchrnul, "__strchrnul");
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ const std = @import("std");
|
||||
const symbol = @import("../c.zig").symbol;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
// bcmp is implemented in compiler_rt
|
||||
symbol(&bcopy, "bcopy");
|
||||
symbol(&bzero, "bzero");
|
||||
|
||||
@@ -9,27 +9,8 @@ comptime {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&unameLinux, "uname");
|
||||
}
|
||||
|
||||
if (builtin.target.isWasiLibC()) {
|
||||
symbol(&unameWasi, "uname");
|
||||
}
|
||||
}
|
||||
|
||||
fn unameLinux(uts: *std.os.linux.utsname) callconv(.c) c_int {
|
||||
return errno(std.os.linux.uname(uts));
|
||||
}
|
||||
|
||||
fn unameWasi(uts: *std.c.utsname) callconv(.c) c_int {
|
||||
// note the @bitCast's for NUL termination!
|
||||
uts.sysname[0..5].* = @bitCast("wasi".*);
|
||||
uts.nodename[0..7].* = @bitCast("(none)".*);
|
||||
uts.release[0..6].* = @bitCast("0.0.0".*);
|
||||
uts.version[0..6].* = @bitCast("0.0.0".*);
|
||||
uts.machine[0..7].* = @bitCast(switch (builtin.target.cpu.arch) {
|
||||
.wasm32 => "wasm32",
|
||||
.wasm64 => "wasm64",
|
||||
else => comptime unreachable,
|
||||
}.*);
|
||||
uts.domainname[0..7].* = @bitCast("(none)".*);
|
||||
return 0;
|
||||
}
|
||||
+1
-14
@@ -51,12 +51,9 @@ comptime {
|
||||
|
||||
symbol(&execveLinux, "execve");
|
||||
}
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&swab, "swab");
|
||||
}
|
||||
if (builtin.target.isWasiLibC()) {
|
||||
symbol(&closeWasi, "close");
|
||||
}
|
||||
}
|
||||
|
||||
fn _exit(exit_code: c_int) callconv(.c) noreturn {
|
||||
@@ -248,13 +245,3 @@ fn close(fd: std.c.fd_t) callconv(.c) c_int {
|
||||
fn posix_close(fd: std.c.fd_t, _: c_int) callconv(.c) c_int {
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
fn closeWasi(fd: std.c.fd_t) callconv(.c) c_int {
|
||||
switch (std.os.wasi.fd_close(fd)) {
|
||||
.SUCCESS => return 0,
|
||||
else => |e| {
|
||||
std.c._errno().* = @backingInt(e);
|
||||
return -1;
|
||||
},
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ const symbol = @import("../c.zig").symbol;
|
||||
const c = std.c;
|
||||
|
||||
comptime {
|
||||
if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
|
||||
if (builtin.target.isMuslLibC()) {
|
||||
symbol(&wmemchr, "wmemchr");
|
||||
symbol(&wmemcmp, "wmemcmp");
|
||||
symbol(&wmemcpy, "wmemcpy");
|
||||
|
||||
@@ -267,7 +267,6 @@ pub const want_float_exceptions = !builtin.cpu.arch.isWasm();
|
||||
/// arm-linux-musleabihf => true
|
||||
/// arm-linux-gnueabihf => true
|
||||
/// arm-linux-eabihf => false
|
||||
/// wasm32-wasi-musl => false
|
||||
/// wasm32-freestanding-none => false
|
||||
/// x86_64-windows-gnu => true
|
||||
/// x86_64-windows-msvc => true
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
#ifndef __wasilibc___errno_h
|
||||
#define __wasilibc___errno_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern _Thread_local int errno;
|
||||
|
||||
#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
|
||||
-76
@@ -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,52 +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
|
||||
|
||||
// DT_SOCK is not supported in WASI Preview 1 (but will be in Preview 2). We
|
||||
// define it regardless so that libc++'s `<filesystem>` implementation builds.
|
||||
// The exact value is mostly arbitrary, but chosen so it doesn't conflict with
|
||||
// any of the existing `__WASI_FILETYPE_*` flags. We do not expect any new
|
||||
// flags to be added to WASI Preview 1, so that should be sufficient.
|
||||
#define DT_SOCK 20
|
||||
|
||||
#define IFTODT(x) (__wasilibc_iftodt(x))
|
||||
#define DTTOIF(x) (__wasilibc_dttoif(x))
|
||||
|
||||
#include <__struct_dirent.h>
|
||||
#include <__typedef_DIR.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int __wasilibc_iftodt(int x);
|
||||
int __wasilibc_dttoif(int x);
|
||||
|
||||
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
|
||||
-182
@@ -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
|
||||
-27
@@ -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,79 +0,0 @@
|
||||
#ifndef __wasilibc___header_sys_socket_h
|
||||
#define __wasilibc___header_sys_socket_h
|
||||
|
||||
#include <__wasi_snapshot.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)
|
||||
|
||||
#ifdef __wasilibc_use_wasip2
|
||||
#define MSG_DONTWAIT 0x0040
|
||||
#define MSG_NOSIGNAL 0x4000
|
||||
#define MSG_PEEK 0x0002
|
||||
#define MSG_WAITALL 0x0100
|
||||
#define MSG_TRUNC 0x0020
|
||||
|
||||
#define SOL_IP 0
|
||||
#define SOL_TCP 6
|
||||
#define SOL_UDP 17
|
||||
#define SOL_IPV6 41
|
||||
|
||||
#define SOMAXCONN 128
|
||||
|
||||
#define SO_REUSEADDR 2
|
||||
#define SO_ERROR 4
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_ACCEPTCONN 30
|
||||
#define SO_PROTOCOL 38
|
||||
#define SO_DOMAIN 39
|
||||
|
||||
#if __LONG_MAX == 0x7fffffff
|
||||
#define SO_RCVTIMEO 66
|
||||
#define SO_SNDTIMEO 67
|
||||
#else
|
||||
#define SO_RCVTIMEO 20
|
||||
#define SO_SNDTIMEO 21
|
||||
#endif
|
||||
|
||||
#else // __wasilibc_use_wasip2
|
||||
#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
|
||||
#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
|
||||
#define MSG_TRUNC __WASI_ROFLAGS_RECV_DATA_TRUNCATED
|
||||
#endif // __wasilibc_use_wasip2
|
||||
|
||||
#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 PF_UNSPEC 0
|
||||
#define PF_INET 1
|
||||
#define PF_INET6 2
|
||||
|
||||
#define AF_UNSPEC PF_UNSPEC
|
||||
#define AF_INET PF_INET
|
||||
#define AF_INET6 PF_INET6
|
||||
#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
|
||||
-33
@@ -1,33 +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_REALTIME;
|
||||
#define CLOCK_REALTIME (&_CLOCK_REALTIME)
|
||||
|
||||
/*
|
||||
* 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,24 +0,0 @@
|
||||
#ifndef __wasilibc___macro_PAGESIZE_h
|
||||
#define __wasilibc___macro_PAGESIZE_h
|
||||
|
||||
/*
|
||||
* Without custom-page-sizes proposal, the page size in WebAssembly
|
||||
* is fixed at 64 KiB.
|
||||
*
|
||||
* The LLVM versions with a support of custom-page-sizes proposal
|
||||
* provides __wasm_first_page_end global to allow page-size-agnostic
|
||||
* objects.
|
||||
*
|
||||
* If this ever needs to be a value outside the range of an `int`, the
|
||||
* `getpagesize` function which returns this value will need special
|
||||
* consideration. POSIX has deprecated `getpagesize` in favor of
|
||||
* `sysconf(_SC_PAGESIZE)` which does not have this problem.
|
||||
*/
|
||||
#if __clang_major__ >= 22
|
||||
extern char __wasm_first_page_end;
|
||||
#define PAGESIZE ((unsigned long)&__wasm_first_page_end)
|
||||
#else
|
||||
#define PAGESIZE (0x10000)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
-38
@@ -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 (0x1000)
|
||||
|
||||
#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
@@ -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,11 +0,0 @@
|
||||
#ifndef __wasilibc___struct_sockaddr_h
|
||||
#define __wasilibc___struct_sockaddr_h
|
||||
|
||||
#include <__typedef_sa_family_t.h>
|
||||
|
||||
struct sockaddr {
|
||||
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sa_family;
|
||||
char sa_data[0];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,14 +0,0 @@
|
||||
#ifndef __wasilibc___struct_sockaddr_in_h
|
||||
#define __wasilibc___struct_sockaddr_in_h
|
||||
|
||||
#include <__typedef_sa_family_t.h>
|
||||
#include <__typedef_in_port_t.h>
|
||||
#include <__struct_in_addr.h>
|
||||
|
||||
struct sockaddr_in {
|
||||
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sin_family;
|
||||
in_port_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef __wasilibc___struct_sockaddr_in6_h
|
||||
#define __wasilibc___struct_sockaddr_in6_h
|
||||
|
||||
#include <__typedef_sa_family_t.h>
|
||||
#include <__typedef_in_port_t.h>
|
||||
#include <__struct_in6_addr.h>
|
||||
|
||||
struct sockaddr_in6 {
|
||||
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sin6_family;
|
||||
in_port_t sin6_port;
|
||||
unsigned sin6_flowinfo;
|
||||
struct in6_addr sin6_addr;
|
||||
unsigned sin6_scope_id;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef __wasilibc___struct_sockaddr_storage_h
|
||||
#define __wasilibc___struct_sockaddr_storage_h
|
||||
|
||||
#include <__typedef_sa_family_t.h>
|
||||
|
||||
struct sockaddr_storage {
|
||||
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t ss_family;
|
||||
char __ss_data[32];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef __wasilibc___struct_sockaddr_un_h
|
||||
#define __wasilibc___struct_sockaddr_un_h
|
||||
|
||||
#include <__typedef_sa_family_t.h>
|
||||
|
||||
struct sockaddr_un {
|
||||
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sun_family;
|
||||
};
|
||||
|
||||
#endif
|
||||
-35
@@ -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
|
||||
-19
@@ -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
|
||||
-13
@@ -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
|
||||
@@ -1,5 +0,0 @@
|
||||
/* This file is (practically) empty by default. The Makefile will replace it
|
||||
with a non-empty version that defines `__wasilibc_use_wasip2` if targeting
|
||||
`wasm32-wasip2`.
|
||||
*/
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
#ifndef _ARPA_INET_H
|
||||
#define _ARPA_INET_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
uint32_t htonl(uint32_t);
|
||||
uint16_t htons(uint16_t);
|
||||
uint32_t ntohl(uint32_t);
|
||||
uint16_t ntohs(uint16_t);
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no inet_addr */
|
||||
in_addr_t inet_addr (const char *);
|
||||
in_addr_t inet_network (const char *);
|
||||
char *inet_ntoa (struct in_addr);
|
||||
#endif
|
||||
int inet_pton (int, const char *__restrict, void *__restrict);
|
||||
const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
|
||||
|
||||
int inet_aton (const char *, struct in_addr *);
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no inet_makeaddr */
|
||||
struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
|
||||
in_addr_t inet_lnaof(struct in_addr);
|
||||
in_addr_t inet_netof(struct in_addr);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,2 +0,0 @@
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
#ifndef _ARPA_TFTP_H
|
||||
#define _ARPA_TFTP_H
|
||||
#define SEGSIZE 512
|
||||
#define RRQ 01
|
||||
#define WRQ 02
|
||||
#define DATA 03
|
||||
#define ACK 04
|
||||
#define ERROR 05
|
||||
struct tftphdr {
|
||||
short th_opcode;
|
||||
union {
|
||||
unsigned short tu_block;
|
||||
short tu_code;
|
||||
char tu_stuff[1];
|
||||
} th_u;
|
||||
char th_data[1];
|
||||
};
|
||||
#define th_block th_u.tu_block
|
||||
#define th_code th_u.tu_code
|
||||
#define th_stuff th_u.tu_stuff
|
||||
#define th_msg th_data
|
||||
#define EUNDEF 0
|
||||
#define ENOTFOUND 1
|
||||
#define EACCESS 2
|
||||
#define ENOSPACE 3
|
||||
#define EBADOP 4
|
||||
#define EBADID 5
|
||||
#define EEXISTS 6
|
||||
#define ENOUSER 7
|
||||
#endif
|
||||
|
||||
-460
@@ -1,460 +0,0 @@
|
||||
#define _Addr long
|
||||
#define _Int64 long long
|
||||
#define _Reg long long
|
||||
|
||||
#define __BYTE_ORDER __BYTE_ORDER__
|
||||
|
||||
#define __LONG_MAX __LONG_MAX__
|
||||
|
||||
/*
|
||||
* Rather than define everything ourselves here in the musl layer, for
|
||||
* WASI, reference the definitions in the lower layers.
|
||||
*/
|
||||
|
||||
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
|
||||
#define __need_wchar_t
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_wchar_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
|
||||
#define __need_wint_t
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_wint_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
typedef float float_t;
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
typedef double double_t;
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
|
||||
#define __need_max_align_t
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_max_align_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
#include <__typedef_time_t.h>
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
|
||||
#include <__typedef_suseconds_t.h>
|
||||
#define __DEFINED_suseconds_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
|
||||
#include <__typedef_clockid_t.h>
|
||||
#define __DEFINED_clockid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
|
||||
#include <__typedef_sigset_t.h>
|
||||
#define __DEFINED_sigset_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
|
||||
#include <__typedef_clock_t.h>
|
||||
#define __DEFINED_clock_t
|
||||
#endif
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#define __BIG_ENDIAN 4321
|
||||
#define __USE_TIME_BITS64 1
|
||||
|
||||
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
|
||||
typedef unsigned _Addr size_t;
|
||||
#define __DEFINED_size_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
|
||||
typedef unsigned _Addr uintptr_t;
|
||||
#define __DEFINED_uintptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
|
||||
typedef _Addr ptrdiff_t;
|
||||
#define __DEFINED_ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
|
||||
typedef _Addr ssize_t;
|
||||
#define __DEFINED_ssize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
|
||||
typedef _Addr intptr_t;
|
||||
#define __DEFINED_intptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
|
||||
typedef _Addr regoff_t;
|
||||
#define __DEFINED_regoff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
|
||||
typedef _Reg register_t;
|
||||
#define __DEFINED_register_t
|
||||
#endif
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
typedef _Int64 time_t;
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
|
||||
typedef _Int64 suseconds_t;
|
||||
#define __DEFINED_suseconds_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
#include <__typedef_time_t.h>
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
|
||||
#include <__typedef_suseconds_t.h>
|
||||
#define __DEFINED_suseconds_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
|
||||
typedef signed char int8_t;
|
||||
#define __DEFINED_int8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
|
||||
typedef signed short int16_t;
|
||||
#define __DEFINED_int16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
|
||||
typedef signed int int32_t;
|
||||
#define __DEFINED_int32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
|
||||
typedef signed _Int64 int64_t;
|
||||
#define __DEFINED_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
|
||||
typedef signed _Int64 intmax_t;
|
||||
#define __DEFINED_intmax_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
|
||||
typedef unsigned char uint8_t;
|
||||
#define __DEFINED_uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
|
||||
typedef unsigned short uint16_t;
|
||||
#define __DEFINED_uint16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
|
||||
typedef unsigned int uint32_t;
|
||||
#define __DEFINED_uint32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
|
||||
typedef unsigned _Int64 uint64_t;
|
||||
#define __DEFINED_uint64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
|
||||
typedef unsigned _Int64 u_int64_t;
|
||||
#define __DEFINED_u_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
|
||||
typedef unsigned _Int64 uintmax_t;
|
||||
#define __DEFINED_uintmax_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
|
||||
typedef unsigned mode_t;
|
||||
#define __DEFINED_mode_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
|
||||
typedef unsigned _Reg nlink_t;
|
||||
#define __DEFINED_nlink_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
|
||||
typedef _Int64 off_t;
|
||||
#define __DEFINED_off_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
|
||||
typedef unsigned _Int64 ino_t;
|
||||
#define __DEFINED_ino_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
|
||||
typedef unsigned _Int64 dev_t;
|
||||
#define __DEFINED_dev_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
|
||||
typedef long blksize_t;
|
||||
#define __DEFINED_blksize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
|
||||
typedef _Int64 blkcnt_t;
|
||||
#define __DEFINED_blkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
|
||||
typedef unsigned _Int64 fsblkcnt_t;
|
||||
#define __DEFINED_fsblkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
|
||||
typedef unsigned _Int64 fsfilcnt_t;
|
||||
#define __DEFINED_fsfilcnt_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
|
||||
typedef unsigned wint_t;
|
||||
#define __DEFINED_wint_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
|
||||
typedef unsigned long wctype_t;
|
||||
#define __DEFINED_wctype_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
|
||||
typedef void * timer_t;
|
||||
#define __DEFINED_timer_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
|
||||
typedef int clockid_t;
|
||||
#define __DEFINED_clockid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
|
||||
typedef long clock_t;
|
||||
#define __DEFINED_clock_t
|
||||
#endif
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
|
||||
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
|
||||
#define __DEFINED_struct_timeval
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
|
||||
struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
|
||||
#define __DEFINED_struct_timespec
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include <__struct_timeval.h>
|
||||
#include <__struct_timespec.h>
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
|
||||
typedef int pid_t;
|
||||
#define __DEFINED_pid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
|
||||
typedef unsigned id_t;
|
||||
#define __DEFINED_id_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
|
||||
typedef unsigned uid_t;
|
||||
#define __DEFINED_uid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
|
||||
typedef unsigned gid_t;
|
||||
#define __DEFINED_gid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
|
||||
typedef int key_t;
|
||||
#define __DEFINED_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
|
||||
typedef unsigned useconds_t;
|
||||
#define __DEFINED_useconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef unsigned long pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef struct __pthread * pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
|
||||
typedef int pthread_once_t;
|
||||
#define __DEFINED_pthread_once_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
|
||||
typedef unsigned pthread_key_t;
|
||||
#define __DEFINED_pthread_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
|
||||
typedef int pthread_spinlock_t;
|
||||
#define __DEFINED_pthread_spinlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_mutexattr_t;
|
||||
#define __DEFINED_pthread_mutexattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_condattr_t;
|
||||
#define __DEFINED_pthread_condattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_barrierattr_t;
|
||||
#define __DEFINED_pthread_barrierattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
|
||||
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
|
||||
#define __DEFINED_pthread_rwlockattr_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI doesn't need to define FILE as a complete type */
|
||||
#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
|
||||
struct _IO_FILE { char __x; };
|
||||
#define __DEFINED_struct__IO_FILE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
|
||||
typedef struct _IO_FILE FILE;
|
||||
#define __DEFINED_FILE
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
|
||||
typedef __builtin_va_list va_list;
|
||||
#define __DEFINED_va_list
|
||||
#endif
|
||||
|
||||
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
|
||||
typedef __builtin_va_list __isoc_va_list;
|
||||
#define __DEFINED___isoc_va_list
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
|
||||
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
|
||||
#define __DEFINED_mbstate_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
|
||||
typedef struct __locale_struct * locale_t;
|
||||
#define __DEFINED_locale_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
|
||||
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
|
||||
#define __DEFINED_sigset_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
|
||||
struct iovec { void *iov_base; size_t iov_len; };
|
||||
#define __DEFINED_struct_iovec
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include <__struct_iovec.h>
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
|
||||
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
|
||||
#define __DEFINED_struct_winsize
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
|
||||
typedef unsigned socklen_t;
|
||||
#define __DEFINED_socklen_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
|
||||
typedef unsigned short sa_family_t;
|
||||
#define __DEFINED_sa_family_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
|
||||
#define __DEFINED_pthread_attr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
|
||||
#define __DEFINED_pthread_mutex_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
|
||||
#define __DEFINED_mtx_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
|
||||
#define __DEFINED_pthread_cond_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
|
||||
#define __DEFINED_cnd_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
|
||||
#define __DEFINED_pthread_rwlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
|
||||
#define __DEFINED_pthread_barrier_t
|
||||
#endif
|
||||
|
||||
|
||||
#undef _Addr
|
||||
#undef _Int64
|
||||
#undef _Reg
|
||||
@@ -1 +0,0 @@
|
||||
#include <__struct_dirent.h>
|
||||
@@ -1 +0,0 @@
|
||||
/* Use the WASI libc fcntl implementation bits. */
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
#define FE_ALL_EXCEPT 0
|
||||
#define FE_TONEAREST 0
|
||||
|
||||
typedef unsigned long fexcept_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned long __cw;
|
||||
} fenv_t;
|
||||
|
||||
#define FE_DFL_ENV ((const fenv_t *) -1)
|
||||
@@ -1 +0,0 @@
|
||||
/* Use the WASI libc ioctl implementation bits. */
|
||||
@@ -1 +0,0 @@
|
||||
#include <__macro_PAGESIZE.h>
|
||||
@@ -1,2 +0,0 @@
|
||||
#define _POSIX_V6_ILP32_OFFBIG (1)
|
||||
#define _POSIX_V7_ILP32_OFFBIG (1)
|
||||
@@ -1 +0,0 @@
|
||||
typedef unsigned long __jmp_buf[8];
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
#ifdef _WASI_EMULATED_SIGNAL
|
||||
|
||||
#define SIGHUP 1
|
||||
#define SIGINT 2
|
||||
#define SIGQUIT 3
|
||||
#define SIGILL 4
|
||||
#define SIGTRAP 5
|
||||
#define SIGABRT 6
|
||||
#define SIGIOT SIGABRT
|
||||
#define SIGBUS 7
|
||||
#define SIGFPE 8
|
||||
#define SIGKILL 9
|
||||
#define SIGUSR1 10
|
||||
#define SIGSEGV 11
|
||||
#define SIGUSR2 12
|
||||
#define SIGPIPE 13
|
||||
#define SIGALRM 14
|
||||
#define SIGTERM 15
|
||||
#define SIGSTKFLT 16
|
||||
#define SIGCHLD 17
|
||||
#define SIGCONT 18
|
||||
#define SIGSTOP 19
|
||||
#define SIGTSTP 20
|
||||
#define SIGTTIN 21
|
||||
#define SIGTTOU 22
|
||||
#define SIGURG 23
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGVTALRM 26
|
||||
#define SIGPROF 27
|
||||
#define SIGWINCH 28
|
||||
#define SIGIO 29
|
||||
#define SIGPOLL 29
|
||||
#define SIGPWR 30
|
||||
#define SIGSYS 31
|
||||
#define SIGUNUSED SIGSYS
|
||||
|
||||
#define _NSIG 65
|
||||
|
||||
#endif
|
||||
-1
@@ -1 +0,0 @@
|
||||
#include <__struct_stat.h>
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
|
||||
#define INTPTR_MIN INT32_MIN
|
||||
#define INTPTR_MAX INT32_MAX
|
||||
#define UINTPTR_MAX UINT32_MAX
|
||||
#define PTRDIFF_MIN INT32_MIN
|
||||
#define PTRDIFF_MAX INT32_MAX
|
||||
#define SIZE_MAX UINT32_MAX
|
||||
-143
@@ -1,143 +0,0 @@
|
||||
#ifndef _COMPLEX_H
|
||||
#define _COMPLEX_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define complex _Complex
|
||||
#ifdef __GNUC__
|
||||
#define _Complex_I (__extension__ (0.0f+1.0fi))
|
||||
#else
|
||||
#define _Complex_I (0.0f+1.0fi)
|
||||
#endif
|
||||
#define I _Complex_I
|
||||
|
||||
double complex cacos(double complex);
|
||||
float complex cacosf(float complex);
|
||||
long double complex cacosl(long double complex);
|
||||
|
||||
double complex casin(double complex);
|
||||
float complex casinf(float complex);
|
||||
long double complex casinl(long double complex);
|
||||
|
||||
double complex catan(double complex);
|
||||
float complex catanf(float complex);
|
||||
long double complex catanl(long double complex);
|
||||
|
||||
double complex ccos(double complex);
|
||||
float complex ccosf(float complex);
|
||||
long double complex ccosl(long double complex);
|
||||
|
||||
double complex csin(double complex);
|
||||
float complex csinf(float complex);
|
||||
long double complex csinl(long double complex);
|
||||
|
||||
double complex ctan(double complex);
|
||||
float complex ctanf(float complex);
|
||||
long double complex ctanl(long double complex);
|
||||
|
||||
double complex cacosh(double complex);
|
||||
float complex cacoshf(float complex);
|
||||
long double complex cacoshl(long double complex);
|
||||
|
||||
double complex casinh(double complex);
|
||||
float complex casinhf(float complex);
|
||||
long double complex casinhl(long double complex);
|
||||
|
||||
double complex catanh(double complex);
|
||||
float complex catanhf(float complex);
|
||||
long double complex catanhl(long double complex);
|
||||
|
||||
double complex ccosh(double complex);
|
||||
float complex ccoshf(float complex);
|
||||
long double complex ccoshl(long double complex);
|
||||
|
||||
double complex csinh(double complex);
|
||||
float complex csinhf(float complex);
|
||||
long double complex csinhl(long double complex);
|
||||
|
||||
double complex ctanh(double complex);
|
||||
float complex ctanhf(float complex);
|
||||
long double complex ctanhl(long double complex);
|
||||
|
||||
double complex cexp(double complex);
|
||||
float complex cexpf(float complex);
|
||||
long double complex cexpl(long double complex);
|
||||
|
||||
double complex clog(double complex);
|
||||
float complex clogf(float complex);
|
||||
long double complex clogl(long double complex);
|
||||
|
||||
double cabs(double complex);
|
||||
float cabsf(float complex);
|
||||
long double cabsl(long double complex);
|
||||
|
||||
double complex cpow(double complex, double complex);
|
||||
float complex cpowf(float complex, float complex);
|
||||
long double complex cpowl(long double complex, long double complex);
|
||||
|
||||
double complex csqrt(double complex);
|
||||
float complex csqrtf(float complex);
|
||||
long double complex csqrtl(long double complex);
|
||||
|
||||
double carg(double complex);
|
||||
float cargf(float complex);
|
||||
long double cargl(long double complex);
|
||||
|
||||
double cimag(double complex);
|
||||
float cimagf(float complex);
|
||||
long double cimagl(long double complex);
|
||||
|
||||
double complex conj(double complex);
|
||||
float complex conjf(float complex);
|
||||
long double complex conjl(long double complex);
|
||||
|
||||
double complex cproj(double complex);
|
||||
float complex cprojf(float complex);
|
||||
long double complex cprojl(long double complex);
|
||||
|
||||
double creal(double complex);
|
||||
float crealf(float complex);
|
||||
long double creall(long double complex);
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use the compiler's real/imag operators rather than union type punning */
|
||||
#ifndef __cplusplus
|
||||
#define __CIMAG(x, t) \
|
||||
(+(union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1])
|
||||
|
||||
#define creal(x) ((double)(x))
|
||||
#define crealf(x) ((float)(x))
|
||||
#define creall(x) ((long double)(x))
|
||||
|
||||
#define cimag(x) __CIMAG(x, double)
|
||||
#define cimagf(x) __CIMAG(x, float)
|
||||
#define cimagl(x) __CIMAG(x, long double)
|
||||
#endif
|
||||
#else
|
||||
#define creal(x) (__builtin_creal(x))
|
||||
#define crealf(x) (__builtin_crealf(x))
|
||||
#define creall(x) (__builtin_creall(x))
|
||||
|
||||
#define cimag(x) (__builtin_cimag(x))
|
||||
#define cimagf(x) (__builtin_cimagf(x))
|
||||
#define cimagl(x) (__builtin_cimagl(x))
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L
|
||||
#if defined(_Imaginary_I)
|
||||
#define __CMPLX(x, y, t) ((t)(x) + _Imaginary_I*(t)(y))
|
||||
#elif defined(__clang__)
|
||||
#define __CMPLX(x, y, t) (+(_Complex t){ (t)(x), (t)(y) })
|
||||
#else
|
||||
#define __CMPLX(x, y, t) (__builtin_complex((t)(x), (t)(y)))
|
||||
#endif
|
||||
#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)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
#ifndef _DIRENT_H
|
||||
#define _DIRENT_H
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#else
|
||||
#include <__header_dirent.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_ino_t
|
||||
#define __NEED_off_t
|
||||
#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define __NEED_size_t
|
||||
#endif
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#include <bits/dirent.h>
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
typedef struct __dirstream DIR;
|
||||
#else
|
||||
#include <__typedef_DIR.h>
|
||||
#endif
|
||||
|
||||
#define d_fileno d_ino
|
||||
|
||||
int closedir(DIR *);
|
||||
DIR *fdopendir(int);
|
||||
DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
#ifdef __wasilibc_unmodified_upstream /* readdir_r is obsolete */
|
||||
int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
|
||||
#endif
|
||||
void rewinddir(DIR *);
|
||||
int dirfd(DIR *);
|
||||
|
||||
int alphasort(const struct dirent **, const struct dirent **);
|
||||
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
void seekdir(DIR *, long);
|
||||
long telldir(DIR *);
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#define DT_UNKNOWN 0
|
||||
#define DT_FIFO 1
|
||||
#define DT_CHR 2
|
||||
#define DT_DIR 4
|
||||
#define DT_BLK 6
|
||||
#define DT_REG 8
|
||||
#define DT_LNK 10
|
||||
#define DT_SOCK 12
|
||||
#define DT_WHT 14
|
||||
#define IFTODT(x) ((x)>>12 & 017)
|
||||
#define DTTOIF(x) ((x)<<12)
|
||||
#endif
|
||||
int getdents(int, struct dirent *, size_t);
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
int versionsort(const struct dirent **, const struct dirent **);
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define dirent64 dirent
|
||||
#define readdir64 readdir
|
||||
#ifdef __wasilibc_unmodified_upstream /* readdir_r is obsolete */
|
||||
#define readdir64_r readdir_r
|
||||
#endif
|
||||
#define scandir64 scandir
|
||||
#define alphasort64 alphasort
|
||||
#define versionsort64 versionsort
|
||||
#define off64_t off_t
|
||||
#define ino64_t ino_t
|
||||
#define getdents64 getdents
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
#ifndef _DLFCN_H
|
||||
#define _DLFCN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define RTLD_LAZY 1
|
||||
#define RTLD_NOW 2
|
||||
#define RTLD_NOLOAD 4
|
||||
#define RTLD_NODELETE 4096
|
||||
#define RTLD_GLOBAL 256
|
||||
#ifdef __wasilibc_unmodified_upstream
|
||||
#define RTLD_LOCAL 0
|
||||
#else
|
||||
/* For WASI, we give `RTLD_LOCAL` a non-zero value, avoiding ambiguity and
|
||||
* allowing us to defer the decision of whether `RTLD_LOCAL` or `RTLD_GLOBAL`
|
||||
* should be the default when neither is specified.
|
||||
*/
|
||||
#define RTLD_LOCAL 8
|
||||
#endif
|
||||
|
||||
#define RTLD_NEXT ((void *)-1)
|
||||
#define RTLD_DEFAULT ((void *)0)
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream
|
||||
#define RTLD_DI_LINKMAP 2
|
||||
#endif
|
||||
|
||||
int dlclose(void *);
|
||||
char *dlerror(void);
|
||||
void *dlopen(const char *, int);
|
||||
void *dlsym(void *__restrict, const char *__restrict);
|
||||
|
||||
#if defined(__wasilibc_unmodified_upstream) && (defined(_GNU_SOURCE) || defined(_BSD_SOURCE))
|
||||
typedef struct {
|
||||
const char *dli_fname;
|
||||
void *dli_fbase;
|
||||
const char *dli_sname;
|
||||
void *dli_saddr;
|
||||
} Dl_info;
|
||||
int dladdr(const void *, Dl_info *);
|
||||
int dlinfo(void *, int, void *);
|
||||
#endif
|
||||
|
||||
#if _REDIR_TIME64
|
||||
__REDIR(dlsym, __dlsym_time64);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
#ifndef _ERRNO_H
|
||||
#define _ERRNO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#include <bits/errno.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__((const))
|
||||
#endif
|
||||
int *__errno_location(void);
|
||||
#define errno (*__errno_location())
|
||||
#else
|
||||
#include <__errno.h>
|
||||
#include <__errno_values.h>
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
extern char *program_invocation_short_name, *program_invocation_name;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
-250
@@ -1,250 +0,0 @@
|
||||
#ifndef _FCNTL_H
|
||||
#define _FCNTL_H
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#else
|
||||
#include <__header_fcntl.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_off_t
|
||||
#define __NEED_pid_t
|
||||
#define __NEED_mode_t
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#define __NEED_size_t
|
||||
#define __NEED_ssize_t
|
||||
#define __NEED_struct_iovec
|
||||
#endif
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#include <bits/fcntl.h>
|
||||
|
||||
struct flock {
|
||||
short l_type;
|
||||
short l_whence;
|
||||
off_t l_start;
|
||||
off_t l_len;
|
||||
pid_t l_pid;
|
||||
};
|
||||
|
||||
int creat(const char *, mode_t);
|
||||
int fcntl(int, int, ...);
|
||||
int open(const char *, int, ...);
|
||||
int openat(int, const char *, int, ...);
|
||||
int posix_fadvise(int, off_t, off_t, int);
|
||||
int posix_fallocate(int, off_t, off_t);
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
|
||||
#define O_SEARCH O_PATH
|
||||
#define O_EXEC O_PATH
|
||||
#define O_TTY_INIT 0
|
||||
|
||||
#define O_ACCMODE (03|O_SEARCH)
|
||||
#define O_RDONLY 00
|
||||
#define O_WRONLY 01
|
||||
#define O_RDWR 02
|
||||
|
||||
#define F_OFD_GETLK 36
|
||||
#define F_OFD_SETLK 37
|
||||
#define F_OFD_SETLKW 38
|
||||
|
||||
#define F_DUPFD_CLOEXEC 1030
|
||||
|
||||
#define F_RDLCK 0
|
||||
#define F_WRLCK 1
|
||||
#define F_UNLCK 2
|
||||
|
||||
#define FD_CLOEXEC 1
|
||||
|
||||
#define AT_FDCWD (-100)
|
||||
#define AT_SYMLINK_NOFOLLOW 0x100
|
||||
#define AT_REMOVEDIR 0x200
|
||||
#define AT_SYMLINK_FOLLOW 0x400
|
||||
#define AT_EACCESS 0x200
|
||||
|
||||
#define POSIX_FADV_NORMAL 0
|
||||
#define POSIX_FADV_RANDOM 1
|
||||
#define POSIX_FADV_SEQUENTIAL 2
|
||||
#define POSIX_FADV_WILLNEED 3
|
||||
#ifndef POSIX_FADV_DONTNEED
|
||||
#define POSIX_FADV_DONTNEED 4
|
||||
#define POSIX_FADV_NOREUSE 5
|
||||
#endif
|
||||
|
||||
#undef SEEK_SET
|
||||
#undef SEEK_CUR
|
||||
#undef SEEK_END
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
#ifndef S_IRUSR
|
||||
#define S_ISUID 04000
|
||||
#define S_ISGID 02000
|
||||
#define S_ISVTX 01000
|
||||
#define S_IRUSR 0400
|
||||
#define S_IWUSR 0200
|
||||
#define S_IXUSR 0100
|
||||
#define S_IRWXU 0700
|
||||
#define S_IRGRP 0040
|
||||
#define S_IWGRP 0020
|
||||
#define S_IXGRP 0010
|
||||
#define S_IRWXG 0070
|
||||
#define S_IROTH 0004
|
||||
#define S_IWOTH 0002
|
||||
#define S_IXOTH 0001
|
||||
#define S_IRWXO 0007
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define AT_NO_AUTOMOUNT 0x800
|
||||
#define AT_EMPTY_PATH 0x1000
|
||||
#define AT_STATX_SYNC_TYPE 0x6000
|
||||
#define AT_STATX_SYNC_AS_STAT 0x0000
|
||||
#define AT_STATX_FORCE_SYNC 0x2000
|
||||
#define AT_STATX_DONT_SYNC 0x4000
|
||||
#define AT_RECURSIVE 0x8000
|
||||
|
||||
#define FAPPEND O_APPEND
|
||||
#define FFSYNC O_SYNC
|
||||
#define FASYNC O_ASYNC
|
||||
#define FNONBLOCK O_NONBLOCK
|
||||
#define FNDELAY O_NDELAY
|
||||
|
||||
#define F_OK 0
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
#define F_ULOCK 0
|
||||
#define F_LOCK 1
|
||||
#define F_TLOCK 2
|
||||
#define F_TEST 3
|
||||
|
||||
#define F_SETLEASE 1024
|
||||
#define F_GETLEASE 1025
|
||||
#define F_NOTIFY 1026
|
||||
#define F_CANCELLK 1029
|
||||
#define F_SETPIPE_SZ 1031
|
||||
#define F_GETPIPE_SZ 1032
|
||||
#define F_ADD_SEALS 1033
|
||||
#define F_GET_SEALS 1034
|
||||
|
||||
#define F_SEAL_SEAL 0x0001
|
||||
#define F_SEAL_SHRINK 0x0002
|
||||
#define F_SEAL_GROW 0x0004
|
||||
#define F_SEAL_WRITE 0x0008
|
||||
#define F_SEAL_FUTURE_WRITE 0x0010
|
||||
|
||||
#define F_GET_RW_HINT 1035
|
||||
#define F_SET_RW_HINT 1036
|
||||
#define F_GET_FILE_RW_HINT 1037
|
||||
#define F_SET_FILE_RW_HINT 1038
|
||||
|
||||
#define RWF_WRITE_LIFE_NOT_SET 0
|
||||
#define RWH_WRITE_LIFE_NONE 1
|
||||
#define RWH_WRITE_LIFE_SHORT 2
|
||||
#define RWH_WRITE_LIFE_MEDIUM 3
|
||||
#define RWH_WRITE_LIFE_LONG 4
|
||||
#define RWH_WRITE_LIFE_EXTREME 5
|
||||
|
||||
#define DN_ACCESS 0x00000001
|
||||
#define DN_MODIFY 0x00000002
|
||||
#define DN_CREATE 0x00000004
|
||||
#define DN_DELETE 0x00000008
|
||||
#define DN_RENAME 0x00000010
|
||||
#define DN_ATTRIB 0x00000020
|
||||
#define DN_MULTISHOT 0x80000000
|
||||
|
||||
int lockf(int, int, off_t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE)
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no name_to_handle_at */
|
||||
#define F_OWNER_TID 0
|
||||
#define F_OWNER_PID 1
|
||||
#define F_OWNER_PGRP 2
|
||||
#define F_OWNER_GID 2
|
||||
struct file_handle {
|
||||
unsigned handle_bytes;
|
||||
int handle_type;
|
||||
unsigned char f_handle[];
|
||||
};
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no F_GETOWN_EX */
|
||||
struct f_owner_ex {
|
||||
int type;
|
||||
pid_t pid;
|
||||
};
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no fallocate */
|
||||
#define FALLOC_FL_KEEP_SIZE 1
|
||||
#define FALLOC_FL_PUNCH_HOLE 2
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no name_to_handle_at */
|
||||
#define MAX_HANDLE_SZ 128
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no syc_file_range */
|
||||
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
|
||||
#define SYNC_FILE_RANGE_WRITE 2
|
||||
#define SYNC_FILE_RANGE_WAIT_AFTER 4
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no splice */
|
||||
#define SPLICE_F_MOVE 1
|
||||
#define SPLICE_F_NONBLOCK 2
|
||||
#define SPLICE_F_MORE 4
|
||||
#define SPLICE_F_GIFT 8
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no fallocate */
|
||||
int fallocate(int, int, off_t, off_t);
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no name_to_handle_at */
|
||||
int name_to_handle_at(int, const char *, struct file_handle *, int *, int);
|
||||
int open_by_handle_at(int, struct file_handle *, int);
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no readahead */
|
||||
ssize_t readahead(int, off_t, size_t);
|
||||
#endif
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no splice, syc_file_range, or tee */
|
||||
int sync_file_range(int, off_t, off_t, unsigned);
|
||||
ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
|
||||
ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);
|
||||
ssize_t tee(int, int, size_t, unsigned);
|
||||
#endif
|
||||
#define loff_t off_t
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
|
||||
#define F_GETLK64 F_GETLK
|
||||
#define F_SETLK64 F_SETLK
|
||||
#define F_SETLKW64 F_SETLKW
|
||||
#define flock64 flock
|
||||
#endif
|
||||
#define open64 open
|
||||
#define openat64 openat
|
||||
#define creat64 creat
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
|
||||
#define lockf64 lockf
|
||||
#endif
|
||||
#define posix_fadvise64 posix_fadvise
|
||||
#define posix_fallocate64 posix_fallocate
|
||||
#define off64_t off_t
|
||||
#ifdef __wasilibc_unmodified_upstream /* WASI has no fallocate */
|
||||
#if defined(_GNU_SOURCE)
|
||||
#define fallocate64 fallocate
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
#ifndef _FENV_H
|
||||
#define _FENV_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <bits/fenv.h>
|
||||
|
||||
int feclearexcept(int);
|
||||
int fegetexceptflag(fexcept_t *, int);
|
||||
int feraiseexcept(int);
|
||||
int fesetexceptflag(const fexcept_t *, int);
|
||||
int fetestexcept(int);
|
||||
|
||||
int fegetround(void);
|
||||
int fesetround(int);
|
||||
|
||||
int fegetenv(fenv_t *);
|
||||
int feholdexcept(fenv_t *);
|
||||
int fesetenv(const fenv_t *);
|
||||
int feupdateenv(const fenv_t *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
#ifndef _FLOAT_H
|
||||
#define _FLOAT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __wasilibc_unmodified_upstream /* Use the compiler's definition of FLT_ROUNDS */
|
||||
int __flt_rounds(void);
|
||||
#define FLT_ROUNDS (__flt_rounds())
|
||||
#else
|
||||
#define FLT_ROUNDS (__builtin_flt_rounds())
|
||||
#endif
|
||||
|
||||
#define FLT_RADIX 2
|
||||
|
||||
#define FLT_TRUE_MIN 1.40129846432481707092e-45F
|
||||
#define FLT_MIN 1.17549435082228750797e-38F
|
||||
#define FLT_MAX 3.40282346638528859812e+38F
|
||||
#define FLT_EPSILON 1.1920928955078125e-07F
|
||||
|
||||
#define FLT_MANT_DIG 24
|
||||
#define FLT_MIN_EXP (-125)
|
||||
#define FLT_MAX_EXP 128
|
||||
#define FLT_HAS_SUBNORM 1
|
||||
|
||||
#define FLT_DIG 6
|
||||
#define FLT_DECIMAL_DIG 9
|
||||
#define FLT_MIN_10_EXP (-37)
|
||||
#define FLT_MAX_10_EXP 38
|
||||
|
||||
#define DBL_TRUE_MIN 4.94065645841246544177e-324
|
||||
#define DBL_MIN 2.22507385850720138309e-308
|
||||
#define DBL_MAX 1.79769313486231570815e+308
|
||||
#define DBL_EPSILON 2.22044604925031308085e-16
|
||||
|
||||
#define DBL_MANT_DIG 53
|
||||
#define DBL_MIN_EXP (-1021)
|
||||
#define DBL_MAX_EXP 1024
|
||||
#define DBL_HAS_SUBNORM 1
|
||||
|
||||
#define DBL_DIG 15
|
||||
#define DBL_DECIMAL_DIG 17
|
||||
#define DBL_MIN_10_EXP (-307)
|
||||
#define DBL_MAX_10_EXP 308
|
||||
|
||||
#define LDBL_HAS_SUBNORM 1
|
||||
#define LDBL_DECIMAL_DIG DECIMAL_DIG
|
||||
|
||||
#include <bits/float.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loaded 100 of 520 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user