From 4d1ed36eb10e113464368e240285572e143da7b9 Mon Sep 17 00:00:00 2001 From: "Ben L. Titzer" Date: Wed, 27 Dec 2023 16:45:02 -0500 Subject: [PATCH] [wasm] First version of System.v3 for WALI --- aeneas/src/main/Version.v3 | 2 +- aeneas/src/wasm/WasmTarget.v3 | 4 +- bin/dev/v3c-wali | 9 + rt/wali/LinuxConst.v3 | 322 ++++++++++++++++++++++++++++++++++ rt/wali/RiRuntime.v3 | 39 ++++ rt/wali/System.v3 | 175 ++++++++++++++++++ rt/wali/wali.v3 | 280 ++++++++++++++--------------- test/bin/run-wali@iwasm | 17 ++ test/configure | 9 + 9 files changed, 715 insertions(+), 142 deletions(-) create mode 100755 bin/dev/v3c-wali create mode 100644 rt/wali/LinuxConst.v3 create mode 100644 rt/wali/RiRuntime.v3 create mode 100644 rt/wali/System.v3 create mode 100755 test/bin/run-wali@iwasm diff --git a/aeneas/src/main/Version.v3 b/aeneas/src/main/Version.v3 index 4a225d008..7fcb6523b 100644 --- a/aeneas/src/main/Version.v3 +++ b/aeneas/src/main/Version.v3 @@ -3,6 +3,6 @@ // Updated by VCS scripts. DO NOT EDIT. component Version { - def version: string = "III-7.1677"; + def version: string = "III-7.1678"; var buildData: string; } diff --git a/aeneas/src/wasm/WasmTarget.v3 b/aeneas/src/wasm/WasmTarget.v3 index ff25a10fa..d35b718b1 100644 --- a/aeneas/src/wasm/WasmTarget.v3 +++ b/aeneas/src/wasm/WasmTarget.v3 @@ -588,7 +588,9 @@ class WasmProgram(mach: MachProgram, gcTypes: bool, context: SsaContext) { var ri_init = mach.runtime.getRiInit(); var ri_exit = mach.runtime.getRiExit(); if (ri_init != null || ri_exit != null) { - var sig = if(ri_init != null, ri_init.sig, Signature.new(null, [], [Int.TYPE])); + var params: Array = if(ri_init != null, ri_init.sig.paramTypes, TypeUtil.NO_TYPES); + var results: Array = if(ri_exit != null, ri_exit.sig.returnTypes, [Int.TYPE]); + var sig = Signature.new(null, params, results); sigIndex_entryStub = int.!(addSig(Void.TYPE, sig)); entryStubFuncIndex = numFunctions++; } diff --git a/bin/dev/v3c-wali b/bin/dev/v3c-wali new file mode 100755 index 000000000..a40d65962 --- /dev/null +++ b/bin/dev/v3c-wali @@ -0,0 +1,9 @@ +#!/bin/bash +HERE=$(dirname ${BASH_SOURCE[0]}) +BIN=$(cd $HERE/../ && pwd) +RT=$(cd $BIN/../rt/ && pwd) +V3C=${V3C:=$BIN/v3c} +N="$RT/native/" +W="$RT/wali/" +RT_FILES=$(echo $W/*.v3 $N/NativeGlobalsScanner.v3 $N/NativeFileStream.v3 $RT/gc/*.v3) +exec $V3C -entry-export="_start" -heap-size=100m -target=wasm -rt.gc -rt.gctables -rt.files="$RT_FILES" "$@" diff --git a/rt/wali/LinuxConst.v3 b/rt/wali/LinuxConst.v3 new file mode 100644 index 000000000..17de5df67 --- /dev/null +++ b/rt/wali/LinuxConst.v3 @@ -0,0 +1,322 @@ +// Copyright 2021 Ben L. Titzer, Virgil Authors. All rights reserved. +// See LICENSE for details of Apache 2.0 license. + +// Defines constants associated with (x86-64) Linux system calls. +// XXX: some duplication with constants from other platforms. +component LinuxConst { + // Standard file descriptors. + def STDIN = 0; + def STDOUT = 1; + def STDERR = 2; + // Maximum length of a path. + def MAXPATHLEN = 1024; + // Constants associated with open(). + def O_RDONLY = 0; // open read-only + def O_WRONLY = 1; // open write-only + def O_RDWR = 2; // open read-write + def O_NONBLOCK = 0x0800; // no delay + def O_APPEND = 0x0400; // set append mode + def O_SYNC = 0x1000; // synch I/O file integrity + def O_ASYNC = 0x2000; // signal pgrp when data ready + def O_CREAT = 0x0040; // create if nonexistent + def O_TRUNC = 0x0200; // truncate to zero length + def O_EXCL = 0x0080; // error if already exists + def O_NOCTTY = 0x0100; // don't assign controlling terminal + + // Constants for networking + def AF_UNSPEC = 0x0; + def AF_UNIX = 0x1; + def AF_INET = 0x2; + def AF_INET6 = 0xA; + def SOCK_STREAM = 0x1; + def SOCK_DGRAM = 0x2; + def SOCK_NONBLOCK = 0x0800; + def SOCK_CLOEXEC = 0x8000; + def SOCKADDR_V4_SIZE = 16; + def SOCKADDR_V6_SIZE = 28; + def SOCKADDR_UNIX_SIZE = 110; + def SOCKADDR_STORAGE_SIZE = 128; + + // Constants for lseek(). + def SEEK_SET = 0; + def SEEK_CUR = 1; + def SEEK_END = 2; + // Constants for mmap. + def PROT_READ = 0x1; + def PROT_WRITE = 0x2; + def PROT_EXEC = 0x4; + def PROT_NONE = 0x0; + def MAP_SHARED = 0x1; + def MAP_PRIVATE = 0x2; + def MAP_FIXED = 0x10; + def MAP_ANONYMOUS = 0x20; + + // TODO: word offset of st_size in statbuf + def STAT_BUF_SIZE = 144; + def STAT_WOFF_ST_SIZE = 6; + + def error(val: int, description: string) -> int { + // TODO: record the description in a table + return val; + } + + // Linux definitions of errno + // Operation not permitted + def EPERM = 1; + // No such file or directory + def ENOENT = 2; + // No such process + def ESRCH = 3; + // Interrupted system call + def EINTR = 4; + // I/O error + def EIO = 5; + // No such device or address + def ENXIO = 6; + // Argument list too long + def E2BIG = 7; + // Exec format error + def ENOEXEC = 8; + // Bad file number + def EBADF = 9; + // No child processes + def ECHILD = 10; + // Try again + def EAGAIN = 11; + // Out of memory + def ENOMEM = 12; + // Permission denied + def EACCES = 13; + // Bad address + def EFAULT = 14; + // Block device required + def ENOTBLK = 15; + // Device or resource busy + def EBUSY = 16; + // File exists + def EEXIST = 17; + // Cross-device link + def EXDEV = 18; + // No such device + def ENODEV = 19; + // Not a directory + def ENOTDIR = 20; + // Is a directory + def EISDIR = 21; + // Invalid argument + def EINVAL = 22; + // File table overflow + def ENFILE = 23; + // Too many open files + def EMFILE = 24; + // Not a typewriter + def ENOTTY = 25; + // Text file busy + def ETXTBSY = 26; + // File too large + def EFBIG = 27; + // No space left on device + def ENOSPC = 28; + // Illegal seek + def ESPIPE = 29; + // Read-only file system + def EROFS = 30; + // Too many links + def EMLINK = 31; + // Broken pipe + def EPIPE = 32; + // Math argument out of domain of func + def EDOM = 33; + // Math result not representable + def ERANGE = 34; + // Resource deadlock would occur + def EDEADLK = 35; + // File name too long + def ENAMETOOLONG = 36; + // No record locks available + def ENOLCK = 37; + // Function not implemented + def ENOSYS = 38; + // Directory not empty + def ENOTEMPTY = 39; + // Too many symbolic links encountered + def ELOOP = 40; + // No message of desired type + def ENOMSG = 42; + // Identifier removed + def EIDRM = 43; + // Channel number out of range + def ECHRNG = 44; + // Level 2 not synchronized + def EL2NSYNC = 45; + // Level 3 halted + def EL3HLT = 46; + // Level 3 reset + def EL3RST = 47; + // Link number out of range + def ELNRNG = 48; + // Protocol driver not attached + def EUNATCH = 49; + // No CSI structure available + def ENOCSI = 50; + // Level 2 halted + def EL2HLT = 51; + // Invalid exchange + def EBADE = 52; + // Invalid request descriptor + def EBADR = 53; + // Exchange full + def EXFULL = 54; + // No anode + def ENOANO = 55; + // Invalid request code + def EBADRQC = 56; + // Invalid slot + def EBADSLT = 57; + // Bad font file format + def EBFONT = 59; + // Device not a stream + def ENOSTR = 60; + // No data available + def ENODATA = 61; + // Timer expired + def ETIME = 62; + // Out of streams resources + def ENOSR = 63; + // Machine is not on the network + def ENONET = 64; + // Package not installed + def ENOPKG = 65; + // Object is remote + def EREMOTE = 66; + // Link has been severed + def ENOLINK = 67; + // Advertise error + def EADV = 68; + // Srmount error + def ESRMNT = 69; + // Communication error on send + def ECOMM = 70; + // Protocol error + def EPROTO = 71; + // Multihop attempted + def EMULTIHOP = 72; + // RFS specific error + def EDOTDOT = 73; + // Not a data message + def EBADMSG = 74; + // Value too large for defined data type + def EOVERFLOW = 75; + // Name not unique on network + def ENOTUNIQ = 76; + // File descriptor in bad state + def EBADFD = 77; + // Remote address changed + def EREMCHG = 78; + // Can not access a needed shared library + def ELIBACC = 79; + // Accessing a corrupted shared library + def ELIBBAD = 80; + // .lib section in a.out corrupted + def ELIBSCN = 81; + // Attempting to link in too many shared libraries + def ELIBMAX = 82; + // Cannot exec a shared library directly + def ELIBEXEC = 83; + // Illegal byte sequence + def EILSEQ = 84; + // Interrupted system call should be restarted + def ERESTART = 85; + // Streams pipe error + def ESTRPIPE = 86; + // Too many users + def EUSERS = 87; + // Socket operation on non-socket + def ENOTSOCK = 88; + // Destination address required + def EDESTADDRREQ = 89; + // Message too long + def EMSGSIZE = 90; + // Protocol wrong type for socket + def EPROTOTYPE = 91; + // Protocol not available + def ENOPROTOOPT = 92; + // Protocol not supported + def EPROTONOSUPPORT = 93; + // Socket type not supported + def ESOCKTNOSUPPORT = 94; + // Operation not supported on transport endpoint + def EOPNOTSUPP = 95; + // Protocol family not supported + def EPFNOSUPPORT = 96; + // Address family not supported by protocol + def EAFNOSUPPORT = 97; + // Address already in use + def EADDRINUSE = 98; + // Cannot assign requested address + def EADDRNOTAVAIL = 99; + // Network is down + def ENETDOWN = 100; + // Network is unreachable + def ENETUNREACH = 101; + // Network dropped connection because of reset + def ENETRESET = 102; + // Software caused connection abort + def ECONNABORTED = 103; + // Connection reset by peer + def ECONNRESET = 104; + // No buffer space available + def ENOBUFS = 105; + // Transport endpoint is already connected + def EISCONN = 106; + // Transport endpoint is not connected + def ENOTCONN = 107; + // Cannot send after transport endpoint shutdown + def ESHUTDOWN = 108; + // Too many references: cannot splice + def ETOOMANYREFS = 109; + // Connection timed out + def ETIMEDOUT = 110; + // Connection refused + def ECONNREFUSED = 111; + // Host is down + def EHOSTDOWN = 112; + // No route to host + def EHOSTUNREACH = 113; + // Operation already in progress + def EALREADY = 114; + // Operation now in progress + def EINPROGRESS = 115; + // Stale NFS file handle + def ESTALE = 116; + // Structure needs cleaning + def EUCLEAN = 117; + // Not a XENIX named type file + def ENOTNAM = 118; + // No XENIX semaphores available + def ENAVAIL = 119; + // Is a named type file + def EISNAM = 120; + // Remote I/O error + def EREMOTEIO = 121; + // Quota exceeded + def EDQUOT = 122; + // No medium found + def ENOMEDIUM = 123; + // Wrong medium type + def EMEDIUMTYPE = 124; + // Operation Canceled + def ECANCELED = 125; + // Required key not available + def ENOKEY = 126; + // Key has expired + def EKEYEXPIRED = 127; + // Key has been revoked + def EKEYREVOKED = 128; + // Key was rejected by service + def EKEYREJECTED = 129; + // Owner died + def EOWNERDEAD = 130; + // State not recoverable + def ENOTRECOVERABLE = 131; +} diff --git a/rt/wali/RiRuntime.v3 b/rt/wali/RiRuntime.v3 new file mode 100644 index 000000000..3c77a7767 --- /dev/null +++ b/rt/wali/RiRuntime.v3 @@ -0,0 +1,39 @@ +// Copyright 2023 Virgil authors. All rights reserved. +// See LICENSE for details of Apache 2.0 license. + +component RiRuntime { + var gcInit: void -> void; + var gcCollect: (int, Pointer, Pointer) -> Pointer; + // Called from the exported, generated "entry" stub and used to + // construct the arguments to pass to main. + def init() -> Array { + if (gcInit != null) gcInit(); + // Allocate strings for arguments + var argc = wali.cl_get_argc(); + var args = Array.new(int.!(argc - 1u)); + for (i = 1u; i < argc; i++) { + var len = wali.cl_get_argv_len(i); + var str = Array.new(int.!(len)); + wali.cl_copy_argv(Pointer.atContents(str), i); + args[i - 1u] = str; + } + return args; + } + // Called from the generated allocation stub upon allocation failure. + def gc(size: int, ip: Pointer, sp: Pointer) -> Pointer { + var shadowStackStart = Pointer.NULL, shadowStackEnd = Pointer.NULL; // TODO(titzer) + if (gcCollect != null) return gcCollect(size, shadowStackStart, shadowStackEnd); + System.error("HeapOverflow", "no garbage collector installed"); + return Pointer.NULL; // unreachable + } + // Called when main() returns + def exit(code: int) { + wali.SYS_exit(code); + } + def fatalException(ex: string, msg: string, ip: Pointer, sp: Pointer) { + System.err.putc('!').puts(ex); + if (msg != null) System.err.puts(": ").puts(msg).ln(); + else System.err.ln(); + System.error(ex, msg); + } +} diff --git a/rt/wali/System.v3 b/rt/wali/System.v3 new file mode 100644 index 000000000..e032dc50e --- /dev/null +++ b/rt/wali/System.v3 @@ -0,0 +1,175 @@ +// Copyright 2023 Virgil authors. All rights reserved. +// See LICENSE for details of Apache 2.0 license. + +// Implementation of the "System" component on WALI. +component System { + def out = NativeFileStream.new(fs_write, STDOUT); + def err = NativeFileStream.new(fs_write, STDERR); + + // change the permissions of a file + def chmod(path: string, mode: int) { + // TODO wave.fs_chmod(p.0, p.1, mode); + } + // open a file + def fileOpen(path: string, read: bool) -> int { + var mode = if(read, LinuxConst.O_RDONLY, LinuxConst.O_WRONLY | LinuxConst.O_TRUNC | LinuxConst.O_CREAT); + var fd = wali.SYS_open(pathName(path), mode, 420); + return if(fd >= 0, int.view(fd), -1); + } + // close a file + def fileClose(fd: int) { + wali.SYS_close(fd); + } + // read a single byte from a file + def fileRead(fd: int) -> int { + var buf = Pointer.atContents(iobuf); + var result = fs_read(fd, buf, 1); + return if(result == 1, iobuf[0], -1); + } + // write some bytes to the file + def fileWriteK(fd: int, data: Array, offset: int, len: int) { + boundsCheck(data, offset, len); + var buf = Pointer.atContents(data) + offset; + fs_write(fd, buf, len); + } + // read some bytes from the file + def fileReadK(fd: int, data: Array, offset: int, len: int) -> int { + boundsCheck(data, offset, len); + var buf = Pointer.atContents(data) + offset; + var result = fs_read(fd, buf, len); + return result; + } + // calculate bytes remaining to be read from file + def fileLeft(fd: int) -> int { + // XXX: is there a cheaper way to tell the number of available bytes? + var offset = wali.SYS_lseek(fd, 0, LinuxConst.SEEK_CUR); + var end = wali.SYS_lseek(fd, 0, LinuxConst.SEEK_END); + wali.SYS_lseek(fd, offset, LinuxConst.SEEK_SET); + return int.!(end - offset); + } + // load a file into a byte array + def fileLoad(fileName: string) -> Array { + var path = pathName(fileName); + if (wali.SYS_stat(path, Pointer.atContents(statbuf)) < 0) return null; + var r = wali.SYS_open(path, LinuxConst.O_RDONLY, 0); + if (r < 0) return null; + var fd = int.!(r); + var buf = Array.new(int.!(statbuf[LinuxConst.STAT_WOFF_ST_SIZE])); + if (wali.SYS_read(fd, Pointer.atContents(buf), u32.!(buf.length)) < 0) return null; + wali.SYS_close(fd); + return buf; + } + // print a character to standard out + def putc(ch: byte) { + numbuf[0] = ch; + fs_write(STDOUT, Pointer.atContents(numbuf), 1); + } + // print an integer (in decimal) to standard out + def puti(val: int) { + var i = val; + if (i == 0) { + putc('0'); + return; + } + var negative = true; + if (i > 0) { + negative = false; + i = 0 - i; + } + var pos = numbuf.length; + while (i != 0) { // XXX: use pointer loop instead? + var digit = byte.!('0' - i % 10); + numbuf[--pos] = digit; + i = i / 10; + } + if (negative) numbuf[--pos] = '-'; + fs_write(STDOUT, Pointer.atContents(numbuf) + pos, numbuf.length - pos); + } + // print a string (as bytes) to standard out + def puts(str: string) { + fs_write(STDOUT, Pointer.atContents(str), str.length); + } + // prints a newline character to standard out + def ln() { + putc('\n'); + } + // output an error, stacktrace, and exit + def error(ex: string, msg: string) { + def s = Pointer.atContents(ex), s_len = ex.length; + def m = if(msg != null, Pointer.atContents(msg)); + def m_len = if (msg != null, msg.length); + // TODO wave.throw_ex(s, s_len, m, m_len); + } + // get ticks in milliseconds + def ticksMs() -> int { +//TODO wali.SYS_gettimeofday(Pointer.atContents(timeval), Pointer.NULL); + return int.view(timeval[0] * 1000 + timeval[1] / 1000); + } + // get ticks in microseconds + def ticksUs() -> int { +//TODO wali.SYS_gettimeofday(Pointer.atContents(timeval), Pointer.NULL); + return int.view(timeval[0] * 1000000 + timeval[1]); + } + // get ticks in nanoseconds + def ticksNs() -> int { +//TODO wali.SYS_gettimeofday(Pointer.atContents(timeval), Pointer.NULL); + return int.view(timeval[1] * 1000); + } + // write some bytes to the file + def write(fd: int, data: Range) -> int { + var buf = Pointer.atContents(data); + var t = wali.SYS_write(fd, buf, u32.!(data.length)); + return int.!(t); + } + // read some bytes from the file + def read(fd: int, data: Range) -> int { + var buf = Pointer.atContents(data); + var t = wali.SYS_read(fd, buf, u32.!(data.length)); + return int.!(t); + } +} + +// @thread-local @lazy buffer for write integers and chars to System.out +def numbuf = Array.new(16); +// @thread-local @lazy buffer for write integers and chars to System.out +def iobuf = Array.new(16); +// @thread-local @lazy buffer for write integers and chars to System.out +def retbuf = Array.new(16); +// @thread-local @static buffer for gettimeofday +def timeval = Array.new(2); +// @thread-local @static buffer for fstat +def statbuf = Array.new(LinuxConst.STAT_BUF_SIZE / 8); +// @thread-local @lazy buffer for path that don't have space for a null +var pathbuf = Array.new(100); +// the standard output stream +def STDIN = 0; +def STDOUT = 1; +def STDERR = 2; + +def BCE = "BoundsCheckException"; +def EMPTY = ""; +def boundsCheck(array: Array, start: int, len: int) { + if (start < 0) System.error(BCE, EMPTY); + if (start > array.length) System.error(BCE, EMPTY); + var end = u32.!(start) + u32.!(len); + if (end > u32.!(array.length)) System.error(BCE, EMPTY); +} +def fs_write(fd: int, data: Pointer, len: int) -> int { + var r = wali.SYS_write(fd, data, u32.!(len)); + return int.view(r); +} +def fs_read(fd: int, data: Pointer, len: int) -> int { + var r = wali.SYS_read(fd, data, u32.!(len)); + return int.view(r); +} +// get a zero-terminated pathname, allocating if necessary +def pathName(fileName: string) -> Pointer { + if ((fileName.length & 3) == 0) { + // no extra space on the end of the array for the null byte + if (pathbuf.length <= fileName.length) pathbuf = Array.new(fileName.length + 5); + for (i < fileName.length) pathbuf[i] = fileName[i]; + pathbuf[fileName.length] = '\x00'; + return Pointer.atContents(pathbuf); + } + return Pointer.atContents(fileName); +} diff --git a/rt/wali/wali.v3 b/rt/wali/wali.v3 index 8c56616c3..2e2a2303a 100644 --- a/rt/wali/wali.v3 +++ b/rt/wali/wali.v3 @@ -15,285 +15,285 @@ type gid_t(v: i32) #unboxed; import component wali { /// Syscall methods // [0] read(int, void*, u32) - def SYS_read(fd: i32, a2: Pointer/**/, a3: u32) -> u64; + def SYS_read(fd: i32, a2: Pointer/**/, a3: u32) -> i64; // [1] write(int, void*, u32) - def SYS_write(fd: i32, a2: Pointer/**/, a3: u32) -> u64; + def SYS_write(fd: i32, a2: Pointer/**/, a3: u32) -> i64; // [2] open(char*, int, i32) - def SYS_open(path: Pointer/**/, path_len: i32, a3: i32) -> u64; + def SYS_open(path: Pointer/**/, flags: i32, a3: i32) -> i64; // [3] close(int) - def SYS_close(fd: i32) -> u64; + def SYS_close(fd: i32) -> i64; // [4] stat(char*, struct stat*) - def SYS_stat(path: Pointer/**/, buf: Pointer/**/) -> u64; + def SYS_stat(path: Pointer/**/, buf: Pointer/**/) -> i64; // [5] fstat(int, struct stat*) - def SYS_fstat(fd: i32, a2: Pointer/**/) -> u64; + def SYS_fstat(fd: i32, a2: Pointer/**/) -> i64; // [6] lstat(char*, struct stat*) - def SYS_lstat(path: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_lstat(path: Pointer/**/, a2: Pointer/**/) -> i64; // [7] poll(struct pollfd*, nfds_t, int) - def SYS_poll(a1: Pointer/**/, a2: nfds_t, a3: i32) -> u64; + def SYS_poll(a1: Pointer/**/, a2: nfds_t, a3: i32) -> i64; // [8] lseek(int, i64, int) - def SYS_lseek(fd: i32, a2: i64, a3: i32) -> u64; + def SYS_lseek(fd: i32, a2: i64, a3: i32) -> i64; // [9] mmap(void*, u32, int, int, int, i64) - def SYS_mmap(addr: Pointer/**/, a2: u32, a3: i32, a4: i32, a5: i32, a6: i64) -> u64; + def SYS_mmap(addr: Pointer/**/, a2: u32, a3: i32, a4: i32, a5: i32, a6: i64) -> i64; // [10] mprotect(void*, u32, int) - def SYS_mprotect(addr: Pointer/**/, a2: u32, a3: i32) -> u64; + def SYS_mprotect(addr: Pointer/**/, a2: u32, a3: i32) -> i64; // [11] munmap(void*, u32) - def SYS_munmap(addr: Pointer/**/, a2: u32) -> u64; + def SYS_munmap(addr: Pointer/**/, a2: u32) -> i64; // [12] brk(void*) - def SYS_brk(addr: Pointer/**/) -> u64; + def SYS_brk(addr: Pointer/**/) -> i64; // [13] rt_sigaction(int, struct sigaction*, struct sigaction*, u32) - def SYS_rt_sigaction(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: u32) -> u64; + def SYS_rt_sigaction(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: u32) -> i64; // [14] rt_sigprocmask(int, sigset_t*, sigset_t*, u32) - def SYS_rt_sigprocmask(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: u32) -> u64; + def SYS_rt_sigprocmask(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: u32) -> i64; // [15] rt_sigreturn(long) - def SYS_rt_sigreturn(a1: i64) -> u64; + def SYS_rt_sigreturn(a1: i64) -> i64; // [16] ioctl(int, int, char*) - def SYS_ioctl(fd: i32, a2: i32, a3: Pointer/**/) -> u64; + def SYS_ioctl(fd: i32, a2: i32, a3: Pointer/**/) -> i64; // [17] pread64(int, char*, u32, i64) - def SYS_pread64(fd: i32, a2: Pointer/**/, a3: u32, a4: i64) -> u64; + def SYS_pread64(fd: i32, a2: Pointer/**/, a3: u32, a4: i64) -> i64; // [18] pwrite64(int, char*, u32, i64) - def SYS_pwrite64(fd: i32, a2: Pointer/**/, a3: u32, a4: i64) -> u64; + def SYS_pwrite64(fd: i32, a2: Pointer/**/, a3: u32, a4: i64) -> i64; // [19] readv(int, struct iovec*, int) - def SYS_readv(fd: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_readv(fd: i32, a2: Pointer/**/, a3: i32) -> i64; // [20] writev(int, struct iovec*, int) - def SYS_writev(fd: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_writev(fd: i32, a2: Pointer/**/, a3: i32) -> i64; // [21] access(char*, int) - def SYS_access(a1: Pointer/**/, a2: i32) -> u64; + def SYS_access(a1: Pointer/**/, a2: i32) -> i64; // [22] pipe(int*) - def SYS_pipe(a1: Pointer/**/) -> u64; + def SYS_pipe(a1: Pointer/**/) -> i64; // [23] select(int, fd_set*, fd_set*, fd_set*, struct timeval*) - def SYS_select(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: Pointer/**/, a5: Pointer/**/) -> u64; + def SYS_select(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: Pointer/**/, a5: Pointer/**/) -> i64; // [24] sched_yield() - def SYS_sched_yield() -> u64; + def SYS_sched_yield() -> i64; // [25] mremap(void*, u32, u32, int, void*) - def SYS_mremap(a1: Pointer/**/, a2: u32, a3: u32, a4: i32, a5: Pointer/**/) -> u64; + def SYS_mremap(a1: Pointer/**/, a2: u32, a3: u32, a4: i32, a5: Pointer/**/) -> i64; // [26] msync(void*, u32, int) - def SYS_msync(a1: Pointer/**/, a2: u32, a3: i32) -> u64; + def SYS_msync(a1: Pointer/**/, a2: u32, a3: i32) -> i64; // [28] madvise(void*, u32, int) - def SYS_madvise(a1: Pointer/**/, a2: u32, a3: i32) -> u64; + def SYS_madvise(a1: Pointer/**/, a2: u32, a3: i32) -> i64; // [32] dup(int) - def SYS_dup(fd: i32) -> u64; + def SYS_dup(fd: i32) -> i64; // [33] dup2(int, int) - def SYS_dup2(a1: i32, a2: i32) -> u64; + def SYS_dup2(a1: i32, a2: i32) -> i64; // [35] nanosleep(struct timespec*, struct timespec*) - def SYS_nanosleep(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_nanosleep(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [37] alarm(int) - def SYS_alarm(a1: i32) -> u64; + def SYS_alarm(a1: i32) -> i64; // [38] setitimer(int, struct itimerval*, struct itimerval*) - def SYS_setitimer(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> u64; + def SYS_setitimer(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> i64; // [39] getpid() - def SYS_getpid() -> u64; + def SYS_getpid() -> i64; // [41] socket(int, int, int) - def SYS_socket(a1: i32, a2: i32, a3: i32) -> u64; + def SYS_socket(a1: i32, a2: i32, a3: i32) -> i64; // [42] connect(int, struct sockaddr*, socklen_t) - def SYS_connect(a1: i32, a2: Pointer/**/, a3: socklen_t) -> u64; + def SYS_connect(a1: i32, a2: Pointer/**/, a3: socklen_t) -> i64; // [43] accept(int, struct sockaddr*, socklen_t*) - def SYS_accept(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> u64; + def SYS_accept(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> i64; // [44] sendto(int, void*, u32, int, struct sockaddr*, socklen_t) - def SYS_sendto(a1: i32, a2: Pointer/**/, a3: u32, a4: i32, a5: Pointer/**/, a6: socklen_t) -> u64; + def SYS_sendto(a1: i32, a2: Pointer/**/, a3: u32, a4: i32, a5: Pointer/**/, a6: socklen_t) -> i64; // [45] recvfrom(int, void*, u32, int, struct sockaddr*, socklen_t*) - def SYS_recvfrom(a1: i32, a2: Pointer/**/, a3: u32, a4: i32, a5: Pointer/**/, a6: Pointer/**/) -> u64; + def SYS_recvfrom(a1: i32, a2: Pointer/**/, a3: u32, a4: i32, a5: Pointer/**/, a6: Pointer/**/) -> i64; // [46] sendmsg(int, struct msghdr*, int) - def SYS_sendmsg(a1: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_sendmsg(a1: i32, a2: Pointer/**/, a3: i32) -> i64; // [47] recvmsg(int, struct msghdr*, int) - def SYS_recvmsg(a1: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_recvmsg(a1: i32, a2: Pointer/**/, a3: i32) -> i64; // [48] shutdown(int, int) - def SYS_shutdown(a1: i32, a2: i32) -> u64; + def SYS_shutdown(a1: i32, a2: i32) -> i64; // [49] bind(int, struct sockaddr*, socklen_t) - def SYS_bind(a1: i32, a2: Pointer/**/, a3: socklen_t) -> u64; + def SYS_bind(a1: i32, a2: Pointer/**/, a3: socklen_t) -> i64; // [50] listen(int, int) - def SYS_listen(a1: i32, a2: i32) -> u64; + def SYS_listen(a1: i32, a2: i32) -> i64; // [51] getsockname(int, struct sockaddr*, socklen_t*) - def SYS_getsockname(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> u64; + def SYS_getsockname(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> i64; // [52] getpeername(int, struct sockaddr*, socklen_t*) - def SYS_getpeername(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> u64; + def SYS_getpeername(a1: i32, a2: Pointer/**/, a3: Pointer/**/) -> i64; // [53] socketpair(int, int, int, int*) - def SYS_socketpair(a1: i32, a2: i32, a3: i32, a4: Pointer/**/) -> u64; + def SYS_socketpair(a1: i32, a2: i32, a3: i32, a4: Pointer/**/) -> i64; // [54] setsockopt(int, int, int, void*, socklen_t) - def SYS_setsockopt(a1: i32, a2: i32, a3: i32, a4: Pointer/**/, a5: socklen_t) -> u64; + def SYS_setsockopt(a1: i32, a2: i32, a3: i32, a4: Pointer/**/, a5: socklen_t) -> i64; // [55] getsockopt(int, int, int, void*, socklen_t*) - def SYS_getsockopt(a1: i32, a2: i32, a3: i32, a4: Pointer/**/, a5: Pointer/**/) -> u64; + def SYS_getsockopt(a1: i32, a2: i32, a3: i32, a4: Pointer/**/, a5: Pointer/**/) -> i64; // [57] fork() - def SYS_fork() -> u64; + def SYS_fork() -> i64; // [59] execve(char*, char*, char*) - def SYS_execve(a1: Pointer/**/, a2: Pointer/**/, a3: Pointer/**/) -> u64; + def SYS_execve(a1: Pointer/**/, a2: Pointer/**/, a3: Pointer/**/) -> i64; // [60] exit(int) - def SYS_exit(a1: i32) -> u64; + def SYS_exit(a1: i32) -> i64; // [61] wait4(pid_t, int*, int, struct rusage*) - def SYS_wait4(a1: pid_t, a2: Pointer/**/, a3: i32, a4: Pointer/**/) -> u64; + def SYS_wait4(a1: pid_t, a2: Pointer/**/, a3: i32, a4: Pointer/**/) -> i64; // [62] kill(pid_t, int) - def SYS_kill(a1: pid_t, a2: i32) -> u64; + def SYS_kill(a1: pid_t, a2: i32) -> i64; // [63] uname(struct utsname*) - def SYS_uname(a1: Pointer/**/) -> u64; + def SYS_uname(a1: Pointer/**/) -> i64; // [72] fcntl(int, int, int) - def SYS_fcntl(a1: i32, a2: i32, a3: i32) -> u64; + def SYS_fcntl(a1: i32, a2: i32, a3: i32) -> i64; // [73] flock(int, int) - def SYS_flock(a1: i32, a2: i32) -> u64; + def SYS_flock(a1: i32, a2: i32) -> i64; // [74] fsync(int) - def SYS_fsync(a1: i32) -> u64; + def SYS_fsync(a1: i32) -> i64; // [75] fdatasync(int) - def SYS_fdatasync(a1: i32) -> u64; + def SYS_fdatasync(a1: i32) -> i64; // [77] ftruncate(int, i64) - def SYS_ftruncate(a1: i32, a2: i64) -> u64; + def SYS_ftruncate(a1: i32, a2: i64) -> i64; // [78] getdents(int, struct dirent*, int) - def SYS_getdents(a1: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_getdents(a1: i32, a2: Pointer/**/, a3: i32) -> i64; // [79] getcwd(char*, u32) - def SYS_getcwd(a1: Pointer/**/, a2: u32) -> u64; + def SYS_getcwd(a1: Pointer/**/, a2: u32) -> i64; // [80] chdir(char*) - def SYS_chdir(a1: Pointer/**/) -> u64; + def SYS_chdir(a1: Pointer/**/) -> i64; // [81] fchdir(int) - def SYS_fchdir(a1: i32) -> u64; + def SYS_fchdir(a1: i32) -> i64; // [82] rename(char*, char*) - def SYS_rename(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_rename(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [83] mkdir(char*, i32) - def SYS_mkdir(a1: Pointer/**/, a2: i32) -> u64; + def SYS_mkdir(a1: Pointer/**/, a2: i32) -> i64; // [84] rmdir(char*) - def SYS_rmdir(a1: Pointer/**/) -> u64; + def SYS_rmdir(a1: Pointer/**/) -> i64; // [86] link(char*, char*) - def SYS_link(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_link(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [87] unlink(char*) - def SYS_unlink(a1: Pointer/**/) -> u64; + def SYS_unlink(a1: Pointer/**/) -> i64; // [88] symlink(char*, char*) - def SYS_symlink(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_symlink(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [89] readlink(char*, char*, u32) - def SYS_readlink(a1: Pointer/**/, a2: Pointer/**/, a3: u32) -> u64; + def SYS_readlink(a1: Pointer/**/, a2: Pointer/**/, a3: u32) -> i64; // [90] chmod(char*, i32) - def SYS_chmod(a1: Pointer/**/, a2: i32) -> u64; + def SYS_chmod(a1: Pointer/**/, a2: i32) -> i64; // [91] fchmod(int, i32) - def SYS_fchmod(a1: i32, a2: i32) -> u64; + def SYS_fchmod(a1: i32, a2: i32) -> i64; // [92] chown(char*, uid_t, gid_t) - def SYS_chown(a1: Pointer/**/, a2: uid_t, a3: gid_t) -> u64; + def SYS_chown(a1: Pointer/**/, a2: uid_t, a3: gid_t) -> i64; // [93] fchown(int, uid_t, gid_t) - def SYS_fchown(a1: i32, a2: uid_t, a3: gid_t) -> u64; + def SYS_fchown(a1: i32, a2: uid_t, a3: gid_t) -> i64; // [95] umask(i32) - def SYS_umask(a1: i32) -> u64; + def SYS_umask(a1: i32) -> i64; // [97] getrlimit(int, struct rlimit*) - def SYS_getrlimit(a1: i32, a2: Pointer/**/) -> u64; + def SYS_getrlimit(a1: i32, a2: Pointer/**/) -> i64; // [98] getrusage(int, struct rusage*) - def SYS_getrusage(a1: i32, a2: Pointer/**/) -> u64; + def SYS_getrusage(a1: i32, a2: Pointer/**/) -> i64; // [99] sysinfo(struct sysinfo*) - def SYS_sysinfo(a1: Pointer/**/) -> u64; + def SYS_sysinfo(a1: Pointer/**/) -> i64; // [102] getuid() - def SYS_getuid() -> u64; + def SYS_getuid() -> i64; // [104] getgid() - def SYS_getgid() -> u64; + def SYS_getgid() -> i64; // [105] setuid(uid_t) - def SYS_setuid(a1: uid_t) -> u64; + def SYS_setuid(a1: uid_t) -> i64; // [106] setgid(gid_t) - def SYS_setgid(a1: gid_t) -> u64; + def SYS_setgid(a1: gid_t) -> i64; // [107] geteuid() - def SYS_geteuid() -> u64; + def SYS_geteuid() -> i64; // [108] getegid() - def SYS_getegid() -> u64; + def SYS_getegid() -> i64; // [109] setpgid(pid_t, pid_t) - def SYS_setpgid(a1: pid_t, a2: pid_t) -> u64; + def SYS_setpgid(a1: pid_t, a2: pid_t) -> i64; // [110] getppid() - def SYS_getppid() -> u64; + def SYS_getppid() -> i64; // [112] setsid() - def SYS_setsid() -> u64; + def SYS_setsid() -> i64; // [113] setreuid(uid_t, uid_t) - def SYS_setreuid(a1: uid_t, a2: uid_t) -> u64; + def SYS_setreuid(a1: uid_t, a2: uid_t) -> i64; // [114] setregid(gid_t, gid_t) - def SYS_setregid(a1: gid_t, a2: gid_t) -> u64; + def SYS_setregid(a1: gid_t, a2: gid_t) -> i64; // [115] getgroups(u32, gid_t*) - def SYS_getgroups(a1: u32, a2: Pointer/**/) -> u64; + def SYS_getgroups(a1: u32, a2: Pointer/**/) -> i64; // [116] setgroups(u32, gid_t*) - def SYS_setgroups(a1: u32, a2: Pointer/**/) -> u64; + def SYS_setgroups(a1: u32, a2: Pointer/**/) -> i64; // [117] setresuid(uid_t, uid_t, uid_t) - def SYS_setresuid(a1: uid_t, a2: uid_t, a3: uid_t) -> u64; + def SYS_setresuid(a1: uid_t, a2: uid_t, a3: uid_t) -> i64; // [119] setresgid(gid_t, gid_t, gid_t) - def SYS_setresgid(a1: gid_t, a2: gid_t, a3: gid_t) -> u64; + def SYS_setresgid(a1: gid_t, a2: gid_t, a3: gid_t) -> i64; // [121] getpgid(pid_t) - def SYS_getpgid(a1: pid_t) -> u64; + def SYS_getpgid(a1: pid_t) -> i64; // [124] getsid(pid_t) - def SYS_getsid(a1: pid_t) -> u64; + def SYS_getsid(a1: pid_t) -> i64; // [127] rt_sigpending(sigset_t*, u32) - def SYS_rt_sigpending(a1: Pointer/**/, a2: u32) -> u64; + def SYS_rt_sigpending(a1: Pointer/**/, a2: u32) -> i64; // [130] rt_sigsuspend(sigset_t*, u32) - def SYS_rt_sigsuspend(a1: Pointer/**/, a2: u32) -> u64; + def SYS_rt_sigsuspend(a1: Pointer/**/, a2: u32) -> i64; // [131] sigaltstack(stack_t*, stack_t*) - def SYS_sigaltstack(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_sigaltstack(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [132] utime(char*, struct utimbuf*) - def SYS_utime(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_utime(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [137] statfs(char*, struct statfs*) - def SYS_statfs(a1: Pointer/**/, a2: Pointer/**/) -> u64; + def SYS_statfs(a1: Pointer/**/, a2: Pointer/**/) -> i64; // [138] fstatfs(int, struct statfs*) - def SYS_fstatfs(a1: i32, a2: Pointer/**/) -> u64; + def SYS_fstatfs(a1: i32, a2: Pointer/**/) -> i64; // [160] setrlimit(int, struct rlimit*) - def SYS_setrlimit(a1: i32, a2: Pointer/**/) -> u64; + def SYS_setrlimit(a1: i32, a2: Pointer/**/) -> i64; // [161] chroot(char*) - def SYS_chroot(a1: Pointer/**/) -> u64; + def SYS_chroot(a1: Pointer/**/) -> i64; // [186] gettid() - def SYS_gettid() -> u64; + def SYS_gettid() -> i64; // [200] tkill(int, int) - def SYS_tkill(a1: i32, a2: i32) -> u64; + def SYS_tkill(a1: i32, a2: i32) -> i64; // [202] futex(int*, int, int, struct timespec*, int*, int) - def SYS_futex(a1: Pointer/**/, a2: i32, a3: i32, a4: Pointer/**/, a5: Pointer/**/, a6: i32) -> u64; + def SYS_futex(a1: Pointer/**/, a2: i32, a3: i32, a4: Pointer/**/, a5: Pointer/**/, a6: i32) -> i64; // [217] getdents64(int, struct dirent*, int) - def SYS_getdents64(a1: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_getdents64(a1: i32, a2: Pointer/**/, a3: i32) -> i64; // [218] set_tid_address(int*) - def SYS_set_tid_address(a1: Pointer/**/) -> u64; + def SYS_set_tid_address(a1: Pointer/**/) -> i64; // [221] fadvise(int, i64, i64, int) - def SYS_fadvise(a1: i32, a2: i64, a3: i64, a4: i32) -> u64; + def SYS_fadvise(a1: i32, a2: i64, a3: i64, a4: i32) -> i64; // [228] clock_gettime(clockid_t, struct timespec*) - def SYS_clock_gettime(a1: clockid_t, a2: Pointer/**/) -> u64; + def SYS_clock_gettime(a1: clockid_t, a2: Pointer/**/) -> i64; // [229] clock_getres(clockid_t, struct timespec*) - def SYS_clock_getres(a1: clockid_t, a2: Pointer/**/) -> u64; + def SYS_clock_getres(a1: clockid_t, a2: Pointer/**/) -> i64; // [230] clock_nanosleep(clockid_t, int, struct timespec*, struct timespec*) - def SYS_clock_nanosleep(a1: clockid_t, a2: i32, a3: Pointer/**/, a4: Pointer/**/) -> u64; + def SYS_clock_nanosleep(a1: clockid_t, a2: i32, a3: Pointer/**/, a4: Pointer/**/) -> i64; // [231] exit_group(int) - def SYS_exit_group(a1: i32) -> u64; + def SYS_exit_group(a1: i32) -> i64; // [233] epoll_ctl(int, int, int, struct epoll_event*) - def SYS_epoll_ctl(a1: i32, a2: i32, a3: i32, a4: Pointer/**/) -> u64; + def SYS_epoll_ctl(a1: i32, a2: i32, a3: i32, a4: Pointer/**/) -> i64; // [257] openat(int, char*, int, i32) - def SYS_openat(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> u64; + def SYS_openat(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> i64; // [258] mkdirat(int, char*, i32) - def SYS_mkdirat(a1: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_mkdirat(a1: i32, a2: Pointer/**/, a3: i32) -> i64; // [260] fchownat(int, char*, uid_t, gid_t, int) - def SYS_fchownat(a1: i32, a2: Pointer/**/, a3: uid_t, a4: gid_t, a5: i32) -> u64; + def SYS_fchownat(a1: i32, a2: Pointer/**/, a3: uid_t, a4: gid_t, a5: i32) -> i64; // [262] fstatat(int, char*, struct stat*, int) - def SYS_fstatat(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: i32) -> u64; + def SYS_fstatat(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: i32) -> i64; // [263] unlinkat(int, char*, int) - def SYS_unlinkat(a1: i32, a2: Pointer/**/, a3: i32) -> u64; + def SYS_unlinkat(a1: i32, a2: Pointer/**/, a3: i32) -> i64; // [265] linkat(int, char*, int, char*, int) - def SYS_linkat(a1: i32, a2: Pointer/**/, a3: i32, a4: Pointer/**/, a5: i32) -> u64; + def SYS_linkat(a1: i32, a2: Pointer/**/, a3: i32, a4: Pointer/**/, a5: i32) -> i64; // [266] symlinkat(char*, int, char*) - def SYS_symlinkat(a1: Pointer/**/, a2: i32, a3: Pointer/**/) -> u64; + def SYS_symlinkat(a1: Pointer/**/, a2: i32, a3: Pointer/**/) -> i64; // [267] readlinkat(int, char*, char*, u32) - def SYS_readlinkat(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: u32) -> u64; + def SYS_readlinkat(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: u32) -> i64; // [268] fchmodat(int, char*, i32, int) - def SYS_fchmodat(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> u64; + def SYS_fchmodat(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> i64; // [269] faccessat(int, char*, int, int) - def SYS_faccessat(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> u64; + def SYS_faccessat(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> i64; // [270] pselect6(int, fd_set*, fd_set*, fd_set*, struct timespec*, void*) - def SYS_pselect6(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: Pointer/**/, a5: Pointer/**/, a6: Pointer/**/) -> u64; + def SYS_pselect6(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: Pointer/**/, a5: Pointer/**/, a6: Pointer/**/) -> i64; // [271] ppoll(struct pollfd*, nfds_t, struct timespec*, sigset_t*, u32) - def SYS_ppoll(a1: Pointer/**/, a2: nfds_t, a3: Pointer/**/, a4: Pointer/**/, a5: u32) -> u64; + def SYS_ppoll(a1: Pointer/**/, a2: nfds_t, a3: Pointer/**/, a4: Pointer/**/, a5: u32) -> i64; // [280] utimensat(int, char*, struct timespec*, int) - def SYS_utimensat(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: i32) -> u64; + def SYS_utimensat(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: i32) -> i64; // [281] epoll_pwait(int, struct epoll_event*, int, int, sigset_t*, u32) - def SYS_epoll_pwait(a1: i32, a2: Pointer/**/, a3: i32, a4: i32, a5: Pointer/**/, a6: u32) -> u64; + def SYS_epoll_pwait(a1: i32, a2: Pointer/**/, a3: i32, a4: i32, a5: Pointer/**/, a6: u32) -> i64; // [284] eventfd(int) - def SYS_eventfd(a1: i32) -> u64; + def SYS_eventfd(a1: i32) -> i64; // [288] accept4(int, struct sockaddr*, socklen_t*, int) - def SYS_accept4(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: i32) -> u64; + def SYS_accept4(a1: i32, a2: Pointer/**/, a3: Pointer/**/, a4: i32) -> i64; // [290] eventfd2(int, int) - def SYS_eventfd2(a1: i32, a2: i32) -> u64; + def SYS_eventfd2(a1: i32, a2: i32) -> i64; // [291] epoll_create1(int) - def SYS_epoll_create1(a1: i32) -> u64; + def SYS_epoll_create1(a1: i32) -> i64; // [292] dup3(int, int, int) - def SYS_dup3(a1: i32, a2: i32, a3: i32) -> u64; + def SYS_dup3(a1: i32, a2: i32, a3: i32) -> i64; // [293] pipe2(int*, int) - def SYS_pipe2(a1: Pointer/**/, a2: i32) -> u64; + def SYS_pipe2(a1: Pointer/**/, a2: i32) -> i64; // [302] prlimit64(int, int, struct rlimit*, struct rlimit*) - def SYS_prlimit64(a1: i32, a2: i32, a3: Pointer/**/, a4: Pointer/**/) -> u64; + def SYS_prlimit64(a1: i32, a2: i32, a3: Pointer/**/, a4: Pointer/**/) -> i64; // [316] renameat2(int, char*, int, char*, int) - def SYS_renameat2(a1: i32, a2: Pointer/**/, a3: i32, a4: Pointer/**/, a5: i32) -> u64; + def SYS_renameat2(a1: i32, a2: Pointer/**/, a3: i32, a4: Pointer/**/, a5: i32) -> i64; // [318] getrandom(void*, u32, int) - def SYS_getrandom(a1: Pointer/**/, a2: u32, a3: i32) -> u64; + def SYS_getrandom(a1: Pointer/**/, a2: u32, a3: i32) -> i64; // [332] statx(int, char*, int, int, struct statx*) - def SYS_statx(a1: i32, a2: Pointer/**/, a3: i32, a4: i32, a5: Pointer/**/) -> u64; + def SYS_statx(a1: i32, a2: Pointer/**/, a3: i32, a4: i32, a5: Pointer/**/) -> i64; // [439] faccessat2(int, char*, int, int) - def SYS_faccessat2(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> u64; + def SYS_faccessat2(a1: i32, a2: Pointer/**/, a3: i32, a4: i32) -> i64; // Startup "__call_ctors" def call_ctors(); diff --git a/test/bin/run-wali@iwasm b/test/bin/run-wali@iwasm new file mode 100755 index 000000000..07f7ec24f --- /dev/null +++ b/test/bin/run-wali@iwasm @@ -0,0 +1,17 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" +done +DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + +OUT=$1 +shift +TEST=$1 +shift + +BASE=${TEST/%.v3/} +exec $DIR/../config/iwasm -v=0 $OUT/${BASE}.wasm "$@" diff --git a/test/configure b/test/configure index a32413b6c..8fd65fc61 100755 --- a/test/configure +++ b/test/configure @@ -208,3 +208,12 @@ fi if [[ -L $CONFIG/wizeng ]]; then try_link $BIN/run-$T@wizeng run-$T@wizeng fi + +############################################################################# +## target=wali +T="wali" +echo target=$T + +if [[ -L $CONFIG/iwasm || -x $CONFIG/iwasm ]]; then + try_link $BIN/run-$T@iwasm run-$T@iwasm +fi