├── .gitmodules ├── LICENSE.md ├── Makefile ├── README.md ├── dist ├── cimgui.o ├── imgui.o ├── imgui_demo.o ├── imgui_draw.o └── imgui_widgets.o ├── docs ├── index.html └── spasm-imgui.wasm ├── spasm-imgui ├── .gitignore ├── dev-server.js ├── dub.sdl ├── dub.selections.json ├── package-lock.json ├── package.json ├── source │ ├── app.d │ └── imgui │ │ ├── funcs.d │ │ └── types.d ├── spasm │ ├── entry.js │ ├── index.template.html │ └── modules │ │ ├── bindings.js │ │ ├── index.js │ │ ├── spa.js │ │ ├── spasm.js │ │ └── wasi.js └── webpack.config.js └── sysroot ├── include ├── __errno.h ├── __errno_values.h ├── __fd_set.h ├── __function___isatty.h ├── __functions_malloc.h ├── __functions_memcpy.h ├── __header_bits_signal.h ├── __header_dirent.h ├── __header_fcntl.h ├── __header_inttypes.h ├── __header_netinet_in.h ├── __header_poll.h ├── __header_stdlib.h ├── __header_string.h ├── __header_sys_ioctl.h ├── __header_sys_resource.h ├── __header_sys_socket.h ├── __header_sys_stat.h ├── __header_time.h ├── __header_unistd.h ├── __macro_FD_SETSIZE.h ├── __macro_PAGESIZE.h ├── __mode_t.h ├── __seek.h ├── __struct_dirent.h ├── __struct_in6_addr.h ├── __struct_in_addr.h ├── __struct_iovec.h ├── __struct_msghdr.h ├── __struct_pollfd.h ├── __struct_rusage.h ├── __struct_sockaddr.h ├── __struct_sockaddr_in.h ├── __struct_sockaddr_in6.h ├── __struct_sockaddr_storage.h ├── __struct_sockaddr_un.h ├── __struct_stat.h ├── __struct_timespec.h ├── __struct_timeval.h ├── __struct_tm.h ├── __struct_tms.h ├── __typedef_DIR.h ├── __typedef_blkcnt_t.h ├── __typedef_blksize_t.h ├── __typedef_clock_t.h ├── __typedef_clockid_t.h ├── __typedef_dev_t.h ├── __typedef_fd_set.h ├── __typedef_gid_t.h ├── __typedef_in_addr_t.h ├── __typedef_in_port_t.h ├── __typedef_ino_t.h ├── __typedef_mode_t.h ├── __typedef_nfds_t.h ├── __typedef_nlink_t.h ├── __typedef_off_t.h ├── __typedef_sa_family_t.h ├── __typedef_sigset_t.h ├── __typedef_socklen_t.h ├── __typedef_ssize_t.h ├── __typedef_suseconds_t.h ├── __typedef_time_t.h ├── __typedef_uid_t.h ├── alloca.h ├── ar.h ├── arpa │ ├── ftp.h │ ├── inet.h │ ├── nameser.h │ ├── nameser_compat.h │ ├── telnet.h │ └── tftp.h ├── assert.h ├── bits │ ├── alltypes.h │ ├── endian.h │ ├── fcntl.h │ ├── fenv.h │ ├── float.h │ ├── hwcap.h │ ├── io.h │ ├── ioctl.h │ ├── ioctl_fix.h │ ├── limits.h │ ├── mman.h │ ├── poll.h │ ├── posix.h │ ├── reg.h │ ├── resource.h │ ├── signal.h │ ├── socket.h │ ├── stat.h │ └── stdint.h ├── byteswap.h ├── complex.h ├── cpio.h ├── crypt.h ├── ctype.h ├── dirent.h ├── endian.h ├── err.h ├── errno.h ├── fcntl.h ├── features.h ├── fenv.h ├── float.h ├── fmtmsg.h ├── fnmatch.h ├── ftw.h ├── getopt.h ├── glob.h ├── iconv.h ├── ifaddrs.h ├── inttypes.h ├── iso646.h ├── langinfo.h ├── libgen.h ├── libintl.h ├── limits.h ├── locale.h ├── malloc.h ├── math.h ├── memory.h ├── monetary.h ├── mqueue.h ├── netinet │ ├── icmp6.h │ ├── igmp.h │ ├── in.h │ ├── in_systm.h │ ├── ip.h │ ├── ip6.h │ ├── ip_icmp.h │ ├── tcp.h │ └── udp.h ├── netpacket │ └── packet.h ├── nl_types.h ├── poll.h ├── regex.h ├── sched.h ├── search.h ├── semaphore.h ├── signal.h ├── stdalign.h ├── stdarg.h ├── stdbool.h ├── stdc-predef.h ├── stddef.h ├── stdint.h ├── stdio.h ├── stdio_ext.h ├── stdlib.h ├── stdnoreturn.h ├── string.h ├── strings.h ├── stropts.h ├── sys │ ├── dir.h │ ├── errno.h │ ├── eventfd.h │ ├── fcntl.h │ ├── file.h │ ├── ioctl.h │ ├── mman.h │ ├── param.h │ ├── poll.h │ ├── random.h │ ├── reg.h │ ├── resource.h │ ├── select.h │ ├── signal.h │ ├── socket.h │ ├── stat.h │ ├── stropts.h │ ├── syscall.h │ ├── sysinfo.h │ ├── sysmacros.h │ ├── time.h │ ├── timeb.h │ ├── times.h │ ├── timex.h │ ├── ttydefaults.h │ ├── types.h │ ├── uio.h │ ├── un.h │ └── utsname.h ├── syscall.h ├── sysexits.h ├── tar.h ├── tgmath.h ├── threads.h ├── time.h ├── uchar.h ├── unistd.h ├── utime.h ├── values.h ├── wasi │ ├── core.h │ ├── libc-find-relpath.h │ └── libc.h ├── wchar.h └── wctype.h ├── lib └── wasm32-wasi │ ├── crt1.o │ ├── libc-printscan-long-double.a │ ├── libc-printscan-no-floating-point.a │ ├── libc.a │ ├── libc.imports │ ├── libcrypt.a │ ├── libdl.a │ ├── libm.a │ ├── libpthread.a │ ├── libresolv.a │ ├── librt.a │ ├── libutil.a │ ├── libwasi-emulated-mman.a │ └── libxnet.a └── share └── wasm32-wasi ├── defined-symbols.txt ├── include-all.c ├── predefined-macros.txt └── undefined-symbols.txt /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cimgui"] 2 | path = cimgui 3 | url = https://github.com/cimgui/cimgui 4 | [submodule "wasi-libc"] 5 | path = wasi-libc 6 | url = https://github.com/CraneStation/wasi-libc 7 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Sebastiaan Koppe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | OBJS = ./dist/cimgui.o 2 | 3 | CXXFLAGS=-Os -c --target=wasm32-unknown-wasi --sysroot sysroot -I./imgui 4 | 5 | all:$(OBJS) sysroot dub 6 | @echo Build complete for spasm-imgui 7 | 8 | webpack: 9 | cd spasm-imgui && npx webpack 10 | 11 | move-docs: 12 | cd spasm-imgui && mv index.html ../docs && mv spasm-imgui ../docs/spasm-imgui.wasm 13 | 14 | docs: all webpack move-docs 15 | 16 | dub: 17 | cd spasm-imgui && dub build --build=release 18 | 19 | ./dist/cimgui.o: 20 | clang $(CXXFLAGS) ./cimgui/cimgui.cpp ./cimgui/imgui/imgui.cpp ./cimgui/imgui/imgui_draw.cpp ./cimgui/imgui/imgui_widgets.cpp ./cimgui/imgui/imgui_demo.cpp 21 | mv *.o dist/ 22 | 23 | sysroot: 24 | cd wasi-libc && make && mv sysroot ../ 25 | 26 | .PHONY: all dub 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wasm Imgui for D (experimental) 2 | 3 | This repo contains a WebAssembly build of imgui (C++) and cimgui (C bindings), together with a webgl backend written in D. See [live demo](https://skoppe.github.io/spasm-imgui/). 4 | 5 | The WebAssembly build of imgui and cimgui is done with clang and [WASI](https://wasi.dev/) as libc. This is linked with a D program that uses web bindings from [spasm](https://github.com/skoppe/spasm) to create a WebGL backend and render it to a canvas. 6 | 7 | The cimgui D bindings are taken from [derelict dimgui](https://github.com/Extrawurst/DerelictImgui) and are partially upgraded to 1.71 8 | 9 | # Experimental 10 | 11 | I have only implemented the Bare Minimum (tm), some feature in the demo window don't work (e.g. filesystem, keyboard, right-click, etc.) 12 | 13 | # Building yourself 14 | 15 | Although imgui, cimgui and WASI are already precompiled (WebAssembly is portable), you can remove the dist and the sysroot folder and run `make`. Make sure to install the following dependencies first: clang llvm ldc dub lld grep diffutils make. 16 | -------------------------------------------------------------------------------- /dist/cimgui.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/dist/cimgui.o -------------------------------------------------------------------------------- /dist/imgui.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/dist/imgui.o -------------------------------------------------------------------------------- /dist/imgui_demo.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/dist/imgui_demo.o -------------------------------------------------------------------------------- /dist/imgui_draw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/dist/imgui_draw.o -------------------------------------------------------------------------------- /dist/imgui_widgets.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/dist/imgui_widgets.o -------------------------------------------------------------------------------- /docs/spasm-imgui.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/docs/spasm-imgui.wasm -------------------------------------------------------------------------------- /spasm-imgui/.gitignore: -------------------------------------------------------------------------------- 1 | .dub 2 | docs.json 3 | __dummy.html 4 | *.o 5 | *.obj 6 | __test__*__ 7 | *spasm-imgui* 8 | node_modules 9 | index.html 10 | main.js -------------------------------------------------------------------------------- /spasm-imgui/dev-server.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const middleware = require('webpack-dev-middleware'); 3 | const config = require('./webpack.config.js'); 4 | config.mode = 'development' 5 | const compiler = webpack(config); 6 | const express = require('express'); 7 | const app = express(); 8 | const fs = require('fs'); 9 | const WebSocket = require('ws'); 10 | 11 | app.use(middleware(compiler, { 12 | })); 13 | app.use(express.static('.',{setHeaders: function(req, path, stat){ 14 | req.set('Content-Type', "application/wasm"); 15 | }})) 16 | 17 | app.listen(3000, () => console.log('Example app listening on port 3000!')) 18 | 19 | function notifyClients() { 20 | wss.clients.forEach(function each(client) { 21 | if (client.readyState === WebSocket.OPEN) { 22 | client.send('reload'); 23 | } 24 | }); 25 | } 26 | 27 | const wss = new WebSocket.Server({ port: 3001 }); 28 | 29 | (function() { 30 | function exists(filename) { 31 | try { 32 | fs.accessSync(filename); 33 | return true; 34 | } catch (e) { 35 | return false; 36 | } 37 | } 38 | let backoff = 0; 39 | function doWatch() { 40 | try { 41 | let watcher = fs.watch('spasm-imgui', (event, filename)=>{ 42 | if (event == 'change') 43 | notifyClients(); 44 | else if (event == 'rename') { 45 | if (exists('spasm-material')) { 46 | notifyClients(); 47 | } else { 48 | watcher.close(); 49 | backoff = 100; 50 | setTimeout(doWatch, backoff); 51 | } 52 | } 53 | }); 54 | if (backoff != 0) { 55 | notifyClients(); 56 | backoff = 0; 57 | } 58 | } catch (e) { 59 | backoff = Math.min(backoff * 2, 60000); 60 | setTimeout(doWatch, backoff); 61 | } 62 | } 63 | doWatch(); 64 | })(); 65 | -------------------------------------------------------------------------------- /spasm-imgui/dub.sdl: -------------------------------------------------------------------------------- 1 | name "spasm-imgui" 2 | description "A minimal D application." 3 | authors "Sebastiaan Koppe" 4 | copyright "Copyright © 2019, Sebastiaan Koppe" 5 | license "proprietary" 6 | dependency "spasm" version="==0.2.0-beta.5" 7 | dflags "-mtriple=wasm32-unknown-unknown-wasm" "-Oz" "-betterC" "-fvisibility=hidden" 8 | lflags "../dist/cimgui.o" "../dist/imgui.o" "../dist/imgui_demo.o" "../dist/imgui_draw.o" "../dist/imgui_widgets.o" "../sysroot/lib/wasm32-wasi/libc.a" -------------------------------------------------------------------------------- /spasm-imgui/dub.selections.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileVersion": 1, 3 | "versions": { 4 | "bolts": "0.11.1", 5 | "mir-core": "0.2.2", 6 | "optional": "0.16.0", 7 | "silly": "0.8.2", 8 | "spasm": "0.2.0-beta.5", 9 | "stdx-allocator": "3.1.0-beta.2", 10 | "unit-threaded": "0.10.3" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spasm-imgui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "start": "node dev-server.js" 4 | }, 5 | "devDependencies": { 6 | "babel-core": "^6.26.3", 7 | "babel-loader": "^7.1.5", 8 | "babel-plugin-transform-object-rest-spread": "^6.26.0", 9 | "babel-preset-env": "^1.7.0", 10 | "express": "^4.16.3", 11 | "html-webpack-inline-source-plugin": "0.0.10", 12 | "html-webpack-plugin": "^3.2.0", 13 | "script-loader": "^0.7.2", 14 | "string-replace-loader": "^2.1.1", 15 | "webpack": "^4.16.2", 16 | "webpack-cli": "^3.3.2", 17 | "webpack-dev-middleware": "^3.1.3", 18 | "ws": "^7.0.0" 19 | }, 20 | "dependencies": {} 21 | } 22 | -------------------------------------------------------------------------------- /spasm-imgui/spasm/entry.js: -------------------------------------------------------------------------------- 1 | // File is autogenerated with `dub run spasm:bootstrap-webpack` 2 | import {spasm, modules} from './modules'; 3 | 4 | spasm.spasm.init(modules); 5 | -------------------------------------------------------------------------------- /spasm-imgui/spasm/index.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spasm 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /spasm-imgui/spasm/modules/index.js: -------------------------------------------------------------------------------- 1 | // File is autogenerated with `dub spasm:webidl -- --bindgen` 2 | import * as bindings from './bindings.js'; 3 | import * as spa from './spa.js'; 4 | import * as spasm from './spasm.js'; 5 | import * as wasi from './wasi.js'; 6 | const modules = [bindings, spa, spasm, wasi]; 7 | export { spasm, modules } -------------------------------------------------------------------------------- /spasm-imgui/spasm/modules/spasm.js: -------------------------------------------------------------------------------- 1 | // File is autogenerated with `dub run spasm:bootstrap-webpack` 2 | const abort = (what,file,line) => { 3 | throw `ABORT: $what @ $file:$line`; 4 | } 5 | 6 | const utf8Decoder = new TextDecoder('utf-8'); 7 | const utf8Encoder = new TextEncoder(); 8 | 9 | let objects = {1: document, 2: window}; 10 | let freelist = []; 11 | let addObject = (value) => { 12 | if (value === null || value == undefined) return 0; 13 | let idx = freelist.pop() || ++spasm.lastPtr; 14 | objects[idx] = value; 15 | return idx; 16 | }, 17 | getObject = (ptr) => objects[ptr]; 18 | const setupMemory = (memory) => { 19 | spasm.memory = memory; 20 | spasm.buffer = memory.buffer; 21 | } 22 | const spasm = { 23 | lastPtr: 2, 24 | instance: null, 25 | init: (modules) => { 26 | window.spasm = spasm 27 | if (!spasm.exports) { 28 | var tmp = {}; 29 | modules.map(m=>m.jsExports).filter(a=>!!a).map(e=>Object.entries(e).forEach(e=>tmp[e[0]] = Object.assign.apply(null,[tmp[e[0]] || {}, e[1]]))); 30 | spasm.exports = tmp; 31 | } 32 | if ('undefined' === typeof WebAssembly.instantiateStreaming) { 33 | fetch('spasm-imgui') 34 | .then(request => request.arrayBuffer()) 35 | .then(bytes => WebAssembly.compile(bytes)) 36 | .then(module => { 37 | let instance = new WebAssembly.Instance(module, spasm.exports); 38 | spasm.instance = instance 39 | setupMemory(instance.exports.memory); 40 | instance.exports._start(instance.exports.__heap_base); 41 | }); 42 | } else { 43 | WebAssembly.instantiateStreaming(fetch('spasm-imgui'), spasm.exports) 44 | .then(obj => { 45 | let instance = obj.instance; 46 | spasm.instance = instance; 47 | setupMemory(instance.exports.memory); 48 | instance.exports._start(instance.exports.__heap_base); 49 | }); 50 | } 51 | }, 52 | objects, 53 | addObject: addObject, 54 | } 55 | 56 | let encoders = { 57 | string: (ptr, val) => { 58 | const encodedString = utf8Encoder.encode(val); 59 | const wasmPtr = spasm.instance.exports.allocString(encodedString.length); 60 | const asBytes = new Uint8Array(spasm.memory.buffer, wasmPtr, encodedString.length); 61 | const heapi32u = new Uint32Array(spasm.memory.buffer) 62 | heapi32u[ptr / 4] = encodedString.length; 63 | heapi32u[(ptr / 4)+1] = wasmPtr; 64 | asBytes.set(encodedString); 65 | return ptr; 66 | } 67 | } 68 | let decoders = { 69 | string: (len, offset) => { 70 | if (offset == null) { 71 | const heapi32u = new Uint32Array(spasm.memory.buffer) 72 | offset = heapi32u[(len+4)/4]; 73 | len = heapi32u[(len/4)]; 74 | } 75 | return utf8Decoder.decode(new DataView(spasm.memory.buffer,offset,len)); 76 | } 77 | } 78 | let jsExports = { 79 | env: { 80 | onOutOfMemoryError: () => abort("Out of memory exception"), 81 | _d_assert: (file,line) => abort("assert",file,line), 82 | doLog: arg => console.log(arg), 83 | memory: spasm.memory, 84 | __assert: () => {}, 85 | _Unwind_Resume: () => { 86 | console.log(arguments); 87 | }, 88 | _d_dynamic_cast: () => { 89 | console.log(arguments) 90 | }, 91 | spasm_add__bool: (b)=>addObject(!!b), 92 | spasm_add__int: addObject, 93 | spasm_add__uint: addObject, 94 | spasm_add__long: addObject, 95 | spasm_add__ulong: addObject, 96 | spasm_add__short: addObject, 97 | spasm_add__ushort: addObject, 98 | spasm_add__byte: addObject, 99 | spasm_add__ubyte: addObject, 100 | spasm_add__float: addObject, 101 | spasm_add__double: addObject, 102 | spasm_add__object: () => addObject({}), 103 | spasm_add__string: (len, offset) => { 104 | return addObject(decoders.string(len, offset)); 105 | }, 106 | spasm_get__field: (handle, len, offset) => { 107 | return addObject(getObject(handle)[decoders.string(len,offset)]); 108 | }, 109 | spasm_get__int: getObject, 110 | spasm_get__uint: getObject, 111 | spasm_get__long: getObject, 112 | spasm_get__ulong: getObject, 113 | spasm_get__short: getObject, 114 | spasm_get__ushort: getObject, 115 | spasm_get__float: getObject, 116 | spasm_get__double: getObject, 117 | spasm_get__byte: getObject, 118 | spasm_get__ubyte: getObject, 119 | spasm_get__string: (rawResult, ptr) => { 120 | encoders.string(rawResult, getObject(ptr)); 121 | }, 122 | spasm_removeObject: (ctx) => { 123 | freelist.push(ctx) 124 | delete objects[ctx] 125 | }, 126 | DataView_Create: (len, offset) => { 127 | return addObject(new DataView(spasm.memory.buffer, offset, len)); 128 | }, 129 | Float32Array_Create: (len, offset) => { 130 | return addObject(new Float32Array(spasm.memory.buffer, offset, len)); 131 | }, 132 | Uint8Array_Create: (len, offset) => { 133 | return addObject(new Uint8Array(spasm.memory.buffer, offset, len)); 134 | } 135 | } 136 | }; 137 | 138 | export {spasm, encoders, decoders, jsExports}; 139 | -------------------------------------------------------------------------------- /spasm-imgui/spasm/modules/wasi.js: -------------------------------------------------------------------------------- 1 | // File is autogenerated with `dub run spasm:bootstrap-webpack` 2 | import {spasm as spa, decoders as decoder, encoders as encoder} from './spasm.js'; 3 | 4 | let spasm = spa; 5 | const nodes = spasm.objects; 6 | const addPtr = spasm.addObject; 7 | 8 | export let jsExports = { 9 | env: { 10 | __cxa_guard_acquire: () => { 11 | return 1 12 | }, 13 | __cxa_guard_release: () => { 14 | } 15 | }, 16 | wasi_unstable: { 17 | fd_write: (fd,//: wasm32::__wasi_fd_t, 18 | iovs,//: wasm32::uintptr_t, 19 | iovs_len,//: wasm32::size_t, 20 | nwritten//: wasm32::uintptr_t 21 | ) => { 22 | let written = 0; 23 | const heapi32u = new Uint32Array(spasm.memory.buffer) 24 | for(var i = 0; i < iovs_len; i++) { 25 | var buf = heapi32u[(iovs+i*8) / 4]; 26 | var len = heapi32u[(iovs+i*8) / 4 + 1]; 27 | if (len > 0) { 28 | var str = decoder.string(len, buf); 29 | written += len; 30 | } 31 | } 32 | heapi32u[nwritten/4] = written; 33 | return 0; 34 | }, 35 | fd_seek: (fd, //: wasm32::__wasi_fd_t, 36 | offset, //: wasm32::__wasi_filedelta_t, 37 | whence, //: wasm32::__wasi_whence_t, 38 | newoffset //: wasm32::uintptr_t 39 | ) => { 40 | return 0; 41 | }, 42 | fd_close: (fd, //: wasm32::__wasi_fd_t) 43 | ) => { 44 | return 0; 45 | }, 46 | fd_fdstat_get: (fd,//: wasm32::__wasi_fd_t, 47 | buf,//: wasm32::uintptr_t, 48 | ) => { 49 | const heapi8u = new Uint8Array(spasm.memory.buffer) 50 | const heapi16u = new Uint16Array(spasm.memory.buffer) 51 | const heapi32u = new Uint32Array(spasm.memory.buffer) 52 | heapi8u[buf] = 0x60; // filetype 53 | heapi16u[buf / 2] = 0x01 | 0x10; //fdflags 54 | heapi32u[buf+1] = 0x40 | 0x4000; // uint64 rights 55 | heapi32u[buf+1] = 0x40 | 0x4000; // uint64 rights_inheriting 56 | return 0; 57 | }, 58 | path_open: () => { 59 | return 0; 60 | }, 61 | fd_fdstat_set_flags: () => 0, 62 | fd_read: () => 0 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /spasm-imgui/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); 5 | 6 | module.exports = { 7 | entry: './spasm/entry.js', 8 | mode: "production", 9 | plugins: [ 10 | new HtmlWebpackPlugin({ 11 | title: 'Spasm', 12 | inlineSource: '.(js|css)$', 13 | template: './spasm/index.template.html' 14 | }), 15 | new HtmlWebpackInlineSourcePlugin(), 16 | ], 17 | module: { 18 | rules: [ 19 | { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }, 20 | ] 21 | }, 22 | output: { 23 | path: path.resolve(__dirname, '.') 24 | }, 25 | devServer: { 26 | contentBase: path.join(__dirname, '.'), 27 | }, 28 | context: path.resolve(__dirname, '.') 29 | }; 30 | -------------------------------------------------------------------------------- /sysroot/include/__errno.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___errno_h 2 | #define __wasm_basics___errno_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifdef __cplusplus 9 | extern thread_local int errno; 10 | #else 11 | extern _Thread_local int errno; 12 | #endif 13 | 14 | #define errno errno 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sysroot/include/__errno_values.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___errno_values_h 2 | #define __wasilibc___errno_values_h 3 | 4 | #include 5 | 6 | #define E2BIG __WASI_E2BIG 7 | #define EACCES __WASI_EACCES 8 | #define EADDRINUSE __WASI_EADDRINUSE 9 | #define EADDRNOTAVAIL __WASI_EADDRNOTAVAIL 10 | #define EAFNOSUPPORT __WASI_EAFNOSUPPORT 11 | #define EAGAIN __WASI_EAGAIN 12 | #define EALREADY __WASI_EALREADY 13 | #define EBADF __WASI_EBADF 14 | #define EBADMSG __WASI_EBADMSG 15 | #define EBUSY __WASI_EBUSY 16 | #define ECANCELED __WASI_ECANCELED 17 | #define ECHILD __WASI_ECHILD 18 | #define ECONNABORTED __WASI_ECONNABORTED 19 | #define ECONNREFUSED __WASI_ECONNREFUSED 20 | #define ECONNRESET __WASI_ECONNRESET 21 | #define EDEADLK __WASI_EDEADLK 22 | #define EDESTADDRREQ __WASI_EDESTADDRREQ 23 | #define EDOM __WASI_EDOM 24 | #define EDQUOT __WASI_EDQUOT 25 | #define EEXIST __WASI_EEXIST 26 | #define EFAULT __WASI_EFAULT 27 | #define EFBIG __WASI_EFBIG 28 | #define EHOSTUNREACH __WASI_EHOSTUNREACH 29 | #define EIDRM __WASI_EIDRM 30 | #define EILSEQ __WASI_EILSEQ 31 | #define EINPROGRESS __WASI_EINPROGRESS 32 | #define EINTR __WASI_EINTR 33 | #define EINVAL __WASI_EINVAL 34 | #define EIO __WASI_EIO 35 | #define EISCONN __WASI_EISCONN 36 | #define EISDIR __WASI_EISDIR 37 | #define ELOOP __WASI_ELOOP 38 | #define EMFILE __WASI_EMFILE 39 | #define EMLINK __WASI_EMLINK 40 | #define EMSGSIZE __WASI_EMSGSIZE 41 | #define EMULTIHOP __WASI_EMULTIHOP 42 | #define ENAMETOOLONG __WASI_ENAMETOOLONG 43 | #define ENETDOWN __WASI_ENETDOWN 44 | #define ENETRESET __WASI_ENETRESET 45 | #define ENETUNREACH __WASI_ENETUNREACH 46 | #define ENFILE __WASI_ENFILE 47 | #define ENOBUFS __WASI_ENOBUFS 48 | #define ENODEV __WASI_ENODEV 49 | #define ENOENT __WASI_ENOENT 50 | #define ENOEXEC __WASI_ENOEXEC 51 | #define ENOLCK __WASI_ENOLCK 52 | #define ENOLINK __WASI_ENOLINK 53 | #define ENOMEM __WASI_ENOMEM 54 | #define ENOMSG __WASI_ENOMSG 55 | #define ENOPROTOOPT __WASI_ENOPROTOOPT 56 | #define ENOSPC __WASI_ENOSPC 57 | #define ENOSYS __WASI_ENOSYS 58 | #define ENOTCONN __WASI_ENOTCONN 59 | #define ENOTDIR __WASI_ENOTDIR 60 | #define ENOTEMPTY __WASI_ENOTEMPTY 61 | #define ENOTRECOVERABLE __WASI_ENOTRECOVERABLE 62 | #define ENOTSOCK __WASI_ENOTSOCK 63 | #define ENOTSUP __WASI_ENOTSUP 64 | #define ENOTTY __WASI_ENOTTY 65 | #define ENXIO __WASI_ENXIO 66 | #define EOVERFLOW __WASI_EOVERFLOW 67 | #define EOWNERDEAD __WASI_EOWNERDEAD 68 | #define EPERM __WASI_EPERM 69 | #define EPIPE __WASI_EPIPE 70 | #define EPROTO __WASI_EPROTO 71 | #define EPROTONOSUPPORT __WASI_EPROTONOSUPPORT 72 | #define EPROTOTYPE __WASI_EPROTOTYPE 73 | #define ERANGE __WASI_ERANGE 74 | #define EROFS __WASI_EROFS 75 | #define ESPIPE __WASI_ESPIPE 76 | #define ESRCH __WASI_ESRCH 77 | #define ESTALE __WASI_ESTALE 78 | #define ETIMEDOUT __WASI_ETIMEDOUT 79 | #define ETXTBSY __WASI_ETXTBSY 80 | #define EXDEV __WASI_EXDEV 81 | #define ENOTCAPABLE __WASI_ENOTCAPABLE 82 | 83 | #define EOPNOTSUPP ENOTSUP 84 | #define EWOULDBLOCK EAGAIN 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /sysroot/include/__fd_set.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___fd_set_h 2 | #define __wasilibc___fd_set_h 3 | 4 | #include <__typedef_fd_set.h> 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | static __inline void FD_CLR(int __fd, fd_set *__set) { 11 | size_t __n = __set->__nfds; 12 | for (int *__p = __set->__fds, *__e = __p + __n; 13 | __p < __e; ++__p) 14 | { 15 | if (*__p == __fd) { 16 | *__p = __e[-1]; 17 | __set->__nfds = __n - 1; 18 | return; 19 | } 20 | } 21 | } 22 | 23 | static __inline 24 | #ifdef __cplusplus 25 | bool 26 | #else 27 | _Bool 28 | #endif 29 | FD_ISSET(int __fd, const fd_set *__set) 30 | { 31 | size_t __n = __set->__nfds; 32 | for (const int *__p = __set->__fds, *__e = __p + __n; 33 | __p < __e; ++__p) 34 | { 35 | if (*__p == __fd) { 36 | return 1; 37 | } 38 | } 39 | return 0; 40 | } 41 | 42 | static __inline void FD_SET(int __fd, fd_set *__set) { 43 | size_t __n = __set->__nfds; 44 | for (const int *__p = __set->__fds, *__e = __p + __n; 45 | __p < __e; ++__p) 46 | { 47 | if (*__p == __fd) { 48 | return; 49 | } 50 | } 51 | __set->__nfds = __n + 1; 52 | __set->__fds[__n] = __fd; 53 | } 54 | 55 | static __inline void FD_ZERO(fd_set *__set) { 56 | __set->__nfds = 0; 57 | } 58 | 59 | static __inline void FD_COPY(const fd_set *__restrict __from, 60 | fd_set *__restrict __to) { 61 | size_t __n = __from->__nfds; 62 | __to->__nfds = __n; 63 | __builtin_memcpy(__to->__fds, __from->__fds, __n * sizeof(int)); 64 | } 65 | 66 | #define FD_CLR(fd, set) (FD_CLR((fd), (set))) 67 | #define FD_ISSET(fd, set) (FD_ISSET((fd), (set))) 68 | #define FD_SET(fd, set) (FD_SET((fd), (set))) 69 | #define FD_ZERO(set) (FD_ZERO((set))) 70 | #define FD_COPY(from, to) (FD_COPY((from), (to))) 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /sysroot/include/__function___isatty.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___function___isatty_h 2 | #define __wasilibc___function___isatty_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int __isatty(int fd); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sysroot/include/__functions_malloc.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___functions_malloc_h 2 | #define __wasm_basics___functions_malloc_h 3 | 4 | #define __need_size_t 5 | #define __need_wchar_t 6 | #define __need_NULL 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | void *malloc(size_t size) __attribute__((__malloc__, __warn_unused_result__)); 14 | void free(void *ptr); 15 | void *calloc(size_t nmemb, size_t size) __attribute__((__malloc__, __warn_unused_result__)); 16 | void *realloc(void *ptr, size_t size) __attribute__((__warn_unused_result__)); 17 | 18 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 19 | void *reallocarray(void *, size_t, size_t) __attribute__((__warn_unused_result__)); 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sysroot/include/__functions_memcpy.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___functions_memcpy_h 2 | #define __wasm_basics___functions_memcpy_h 3 | 4 | #define __need_size_t 5 | #define __need_NULL 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | void *memcpy(void *__restrict__ dst, const void *__restrict__ src, size_t n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2))); 13 | void *memmove(void *dst, const void *src, size_t n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2))); 14 | void *memset(void *dst, int c, size_t n) __attribute__((__nothrow__, __leaf__, __nonnull__(1))); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sysroot/include/__header_bits_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_bits_signal_h 2 | #define __wasilibc___header_bits_signal_h 3 | 4 | #include 5 | 6 | #define SIGHUP __WASI_SIGHUP 7 | #define SIGINT __WASI_SIGINT 8 | #define SIGQUIT __WASI_SIGQUIT 9 | #define SIGILL __WASI_SIGILL 10 | #define SIGTRAP __WASI_SIGTRAP 11 | #define SIGABRT __WASI_SIGABRT 12 | #define SIGBUS __WASI_SIGBUS 13 | #define SIGFPE __WASI_SIGFPE 14 | #define SIGKILL __WASI_SIGKILL 15 | #define SIGUSR1 __WASI_SIGUSR1 16 | #define SIGSEGV __WASI_SIGSEGV 17 | #define SIGUSR2 __WASI_SIGUSR2 18 | #define SIGPIPE __WASI_SIGPIPE 19 | #define SIGALRM __WASI_SIGALRM 20 | #define SIGTERM __WASI_SIGTERM 21 | #define SIGCHLD __WASI_SIGCHLD 22 | #define SIGCONT __WASI_SIGCONT 23 | #define SIGSTOP __WASI_SIGSTOP 24 | #define SIGTSTP __WASI_SIGTSTP 25 | #define SIGTTIN __WASI_SIGTTIN 26 | #define SIGTTOU __WASI_SIGTTOU 27 | #define SIGURG __WASI_SIGURG 28 | #define SIGXCPU __WASI_SIGXCPU 29 | #define SIGXFSZ __WASI_SIGXFSZ 30 | #define SIGVTALRM __WASI_SIGVTALRM 31 | #define SIGPROF __WASI_SIGPROF 32 | #define SIGWINCH __WASI_SIGWINCH 33 | #define SIGPOLL __WASI_SIGPOLL 34 | #define SIGPWR __WASI_SIGPWR 35 | #define SIGSYS __WASI_SIGSYS 36 | 37 | #define SIGIOT SIGABRT 38 | #define SIGIO SIGPOLL 39 | #define SIGUNUSED SIGSYS 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sysroot/include/__header_dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_dirent_h 2 | #define __wasilibc___header_dirent_h 3 | 4 | #include 5 | 6 | #define DT_BLK __WASI_FILETYPE_BLOCK_DEVICE 7 | #define DT_CHR __WASI_FILETYPE_CHARACTER_DEVICE 8 | #define DT_DIR __WASI_FILETYPE_DIRECTORY 9 | #define DT_FIFO __WASI_FILETYPE_SOCKET_STREAM 10 | #define DT_LNK __WASI_FILETYPE_SYMBOLIC_LINK 11 | #define DT_REG __WASI_FILETYPE_REGULAR_FILE 12 | #define DT_UNKNOWN __WASI_FILETYPE_UNKNOWN 13 | 14 | #include <__struct_dirent.h> 15 | #include <__typedef_DIR.h> 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | int closedir(DIR *); 22 | DIR *opendir(const char *); 23 | DIR *fdopendir(int); 24 | int fdclosedir(DIR *); 25 | struct dirent *readdir(DIR *); 26 | void rewinddir(DIR *); 27 | void seekdir(DIR *, long); 28 | long telldir(DIR *); 29 | DIR *opendirat(int, const char *); 30 | void rewinddir(DIR *); 31 | int scandirat(int, const char *, struct dirent ***, 32 | int (*)(const struct dirent *), 33 | int (*)(const struct dirent **, const struct dirent **)); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sysroot/include/__header_fcntl.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_fcntl_h 2 | #define __wasilibc___header_fcntl_h 3 | 4 | #include 5 | #include <__seek.h> 6 | #include <__mode_t.h> 7 | 8 | #define O_APPEND __WASI_FDFLAG_APPEND 9 | #define O_DSYNC __WASI_FDFLAG_DSYNC 10 | #define O_NONBLOCK __WASI_FDFLAG_NONBLOCK 11 | #define O_RSYNC __WASI_FDFLAG_RSYNC 12 | #define O_SYNC __WASI_FDFLAG_SYNC 13 | #define O_CREAT (__WASI_O_CREAT << 12) 14 | #define O_DIRECTORY (__WASI_O_DIRECTORY << 12) 15 | #define O_EXCL (__WASI_O_EXCL << 12) 16 | #define O_TRUNC (__WASI_O_TRUNC << 12) 17 | 18 | #define O_NOFOLLOW (0x01000000) 19 | #define O_EXEC (0x02000000) 20 | #define O_RDONLY (0x04000000) 21 | #define O_SEARCH (0x08000000) 22 | #define O_WRONLY (0x10000000) 23 | 24 | /* 25 | * O_CLOEXEC is defined to be zero, as WASI has no exec-style functions. 26 | */ 27 | #define O_CLOEXEC (0) 28 | 29 | /* 30 | * O_TTY_INIT is defined to be zero, meaning that WASI implementations are 31 | * expected to always initialize a terminal the first time it's opened. 32 | */ 33 | #define O_TTY_INIT (0) 34 | 35 | #define O_NOCTTY (0) 36 | 37 | #define O_RDWR (O_RDONLY | O_WRONLY) 38 | #define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH) 39 | 40 | #define POSIX_FADV_DONTNEED __WASI_ADVICE_DONTNEED 41 | #define POSIX_FADV_NOREUSE __WASI_ADVICE_NOREUSE 42 | #define POSIX_FADV_NORMAL __WASI_ADVICE_NORMAL 43 | #define POSIX_FADV_RANDOM __WASI_ADVICE_RANDOM 44 | #define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL 45 | #define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED 46 | 47 | #define F_GETFD (1) 48 | #define F_SETFD (2) 49 | #define F_GETFL (3) 50 | #define F_SETFL (4) 51 | 52 | #define FD_CLOEXEC (1) 53 | 54 | #define AT_EACCESS (0x0) 55 | #define AT_SYMLINK_NOFOLLOW (0x1) 56 | #define AT_SYMLINK_FOLLOW (0x2) 57 | #define AT_REMOVEDIR (0x4) 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /sysroot/include/__header_netinet_in.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_netinet_in_h 2 | #define __wasilibc___header_netinet_in_h 3 | 4 | #include <__struct_in_addr.h> 5 | #include <__struct_in6_addr.h> 6 | #include <__struct_sockaddr_in.h> 7 | #include <__struct_sockaddr_in6.h> 8 | 9 | #define IPPROTO_IP 0 10 | #define IPPROTO_ICMP 1 11 | #define IPPROTO_TCP 6 12 | #define IPPROTO_UDP 17 13 | #define IPPROTO_IPV6 41 14 | #define IPPROTO_RAW 255 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /sysroot/include/__header_poll.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_poll_h 2 | #define __wasilibc___header_poll_h 3 | 4 | #include <__struct_pollfd.h> 5 | #include <__typedef_nfds_t.h> 6 | 7 | #define POLLRDNORM 0x1 8 | #define POLLWRNORM 0x2 9 | 10 | #define POLLIN POLLRDNORM 11 | #define POLLOUT POLLWRNORM 12 | 13 | #define POLLERR 0x1000 14 | #define POLLHUP 0x2000 15 | #define POLLNVAL 0x4000 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | int poll(struct pollfd[], nfds_t, int); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sysroot/include/__header_stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___headers_stdlib_h 2 | #define __wasilibc___headers_stdlib_h 3 | 4 | #define __need_size_t 5 | #include 6 | 7 | #include <__functions_malloc.h> 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | void abort(void) __attribute__((__noreturn__)); 14 | void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); 15 | void _Exit(int) __attribute__((__noreturn__)); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sysroot/include/__header_string.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___headers_string_h 2 | #define __wasilibc___headers_string_h 3 | 4 | #define __need_size_t 5 | #define __need_NULL 6 | #include 7 | 8 | #include <__functions_memcpy.h> 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | size_t strlen(const char *) __attribute__((__nothrow__, __leaf__, __pure__, __nonnull__(1))); 15 | char *strdup(const char *) __attribute__((__nothrow__, __nonnull__(1))); 16 | int strcmp(const char *, const char *) __attribute__((__nothrow__, __pure__, __nonnull__(1, 2))); 17 | void *memchr(const void *, int, size_t) __attribute__((__nothrow__, __pure__, __nonnull__(1))); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /sysroot/include/__header_sys_ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_sys_ioctl_h 2 | #define __wasilibc___header_sys_ioctl_h 3 | 4 | #define FIONREAD 1 5 | #define FIONBIO 2 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | int ioctl(int, int, ...); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /sysroot/include/__header_sys_resource.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_sys_resource_h 2 | #define __wasilibc___header_sys_resource_h 3 | 4 | #include <__struct_rusage.h> 5 | 6 | #define RUSAGE_SELF 1 7 | #define RUSAGE_CHILDREN 2 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | int getrusage(int who, struct rusage *usage); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sysroot/include/__header_sys_socket.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_sys_socket_h 2 | #define __wasilibc___header_sys_socket_h 3 | 4 | #include <__struct_msghdr.h> 5 | #include <__struct_sockaddr.h> 6 | #include <__struct_sockaddr_storage.h> 7 | 8 | #include 9 | 10 | #define SHUT_RD __WASI_SHUT_RD 11 | #define SHUT_WR __WASI_SHUT_WR 12 | #define SHUT_RDWR (SHUT_RD | SHUT_WR) 13 | 14 | #define MSG_PEEK __WASI_SOCK_RECV_PEEK 15 | #define MSG_WAITALL __WASI_SOCK_RECV_WAITALL 16 | #define MSG_TRUNC __WASI_SOCK_RECV_DATA_TRUNCATED 17 | 18 | #define SOCK_DGRAM __WASI_FILETYPE_SOCKET_DGRAM 19 | #define SOCK_STREAM __WASI_FILETYPE_SOCKET_STREAM 20 | 21 | #define SOCK_NONBLOCK (0x00004000) 22 | #define SOCK_CLOEXEC (0x00002000) 23 | 24 | #define SOL_SOCKET 0x7fffffff 25 | 26 | #define SO_TYPE 3 27 | 28 | #define AF_UNSPEC 0 29 | #define AF_INET 1 30 | #define AF_INET6 2 31 | #define AF_UNIX 3 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sysroot/include/__header_sys_stat.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_sys_stat_h 2 | #define __wasilibc___header_sys_stat_h 3 | 4 | #include <__struct_stat.h> 5 | 6 | #define st_atime st_atim.tv_sec 7 | #define st_mtime st_mtim.tv_sec 8 | #define st_ctime st_ctim.tv_sec 9 | 10 | #include <__mode_t.h> 11 | 12 | #define UTIME_NOW (-1) 13 | #define UTIME_OMIT (-2) 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /sysroot/include/__header_time.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_time_h 2 | #define __wasilibc___header_time_h 3 | 4 | #define __need_size_t 5 | #define __need_NULL 6 | #include 7 | 8 | #include <__typedef_time_t.h> 9 | #include <__struct_timespec.h> 10 | #include <__struct_tm.h> 11 | #include <__typedef_clockid_t.h> 12 | 13 | #include 14 | 15 | #define TIMER_ABSTIME __WASI_SUBSCRIPTION_CLOCK_ABSTIME 16 | 17 | extern const struct __clockid _CLOCK_MONOTONIC; 18 | #define CLOCK_MONOTONIC (&_CLOCK_MONOTONIC) 19 | extern const struct __clockid _CLOCK_PROCESS_CPUTIME_ID; 20 | #define CLOCK_PROCESS_CPUTIME_ID (&_CLOCK_PROCESS_CPUTIME_ID) 21 | extern const struct __clockid _CLOCK_REALTIME; 22 | #define CLOCK_REALTIME (&_CLOCK_REALTIME) 23 | extern const struct __clockid _CLOCK_THREAD_CPUTIME_ID; 24 | #define CLOCK_THREAD_CPUTIME_ID (&_CLOCK_THREAD_CPUTIME_ID) 25 | 26 | /* 27 | * TIME_UTC is the only standardized time base value. 28 | */ 29 | #define TIME_UTC 1 30 | 31 | /* 32 | * Note that XSI specifies CLOCKS_PER_SEC to be 1000000, rather than 33 | * 1000000000; the clock API is providing more precision than XSI specifies. 34 | */ 35 | #define CLOCKS_PER_SEC ((clock_t)1000000000) 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /sysroot/include/__header_unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___header_unistd_h 2 | #define __wasilibc___header_unistd_h 3 | 4 | struct stat; 5 | 6 | #include <__seek.h> 7 | 8 | #define F_OK 0 9 | #define R_OK 1 10 | #define W_OK 2 11 | #define X_OK 4 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int close(int fd); 18 | int faccessat(int, const char *, int, int); 19 | int fstatat(int, const char *__restrict, struct stat *__restrict, int); 20 | int renameat(int, const char *, int, const char *); 21 | int openat(int, const char *, int, ...); 22 | void *sbrk(intptr_t increment); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /sysroot/include/__macro_FD_SETSIZE.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___macro_FD_SETSIZE_h 2 | #define __wasilibc___macro_FD_SETSIZE_h 3 | 4 | #define FD_SETSIZE 1024 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__macro_PAGESIZE.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___macro_PAGESIZE_h 2 | #define __wasm_basics___macro_PAGESIZE_h 3 | 4 | /* 5 | * The page size in WebAssembly is fixed at 64 KiB. If this ever changes, 6 | * it's expected that applications will need to opt in, so we can change 7 | * this. 8 | */ 9 | #define PAGESIZE (0x10000) 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /sysroot/include/__mode_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___mode_t_h 2 | #define __wasilibc___mode_t_h 3 | 4 | #define S_IFMT \ 5 | (S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK) 6 | #define S_IFBLK (0x6000) 7 | #define S_IFCHR (0x2000) 8 | #define S_IFDIR (0x4000) 9 | #define S_IFLNK (0xa000) 10 | #define S_IFREG (0x8000) 11 | #define S_IFSOCK (0xc000) 12 | #define S_IFIFO (0xc000) 13 | 14 | #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) 15 | #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) 16 | #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) 17 | #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) 18 | #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) 19 | #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) 20 | #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) 21 | 22 | #define S_IXOTH (0x1) 23 | #define S_IWOTH (0x2) 24 | #define S_IROTH (0x4) 25 | #define S_IRWXO (S_IXOTH | S_IWOTH | S_IROTH) 26 | #define S_IXGRP (0x8) 27 | #define S_IWGRP (0x10) 28 | #define S_IRGRP (0x20) 29 | #define S_IRWXG (S_IXGRP | S_IWGRP | S_IRGRP) 30 | #define S_IXUSR (0x40) 31 | #define S_IWUSR (0x80) 32 | #define S_IRUSR (0x100) 33 | #define S_IRWXU (S_IXUSR | S_IWUSR | S_IRUSR) 34 | #define S_ISVTX (0x200) 35 | #define S_ISGID (0x400) 36 | #define S_ISUID (0x800) 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sysroot/include/__seek.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___seek_h 2 | #define __wasilibc___seek_h 3 | 4 | #include 5 | 6 | #define SEEK_CUR __WASI_WHENCE_CUR 7 | #define SEEK_END __WASI_WHENCE_END 8 | #define SEEK_SET __WASI_WHENCE_SET 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sysroot/include/__struct_dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_dirent_h 2 | #define __wasilibc___struct_dirent_h 3 | 4 | #include <__typedef_ino_t.h> 5 | 6 | struct dirent { 7 | ino_t d_ino; 8 | unsigned char d_type; 9 | char d_name[]; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /sysroot/include/__struct_in6_addr.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_in6_addr_h 2 | #define __wasilibc___struct_in6_addr_h 3 | 4 | struct in6_addr { 5 | _Alignas(long) unsigned char s6_addr[16]; 6 | }; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /sysroot/include/__struct_in_addr.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_in_addr_h 2 | #define __wasilibc___struct_in_addr_h 3 | 4 | #include <__typedef_in_addr_t.h> 5 | 6 | struct in_addr { 7 | in_addr_t s_addr; 8 | }; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sysroot/include/__struct_iovec.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_iovec_h 2 | #define __wasilibc___struct_iovec_h 3 | 4 | #define __need_size_t 5 | #include 6 | 7 | struct iovec { 8 | void *iov_base; 9 | size_t iov_len; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /sysroot/include/__struct_msghdr.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_msghdr_h 2 | #define __wasilibc___struct_msghdr_h 3 | 4 | #include <__typedef_socklen_t.h> 5 | 6 | struct msghdr { 7 | void *msg_name; 8 | socklen_t msg_namelen; 9 | struct iovec *msg_iov; 10 | int msg_iovlen; 11 | void *msg_control; 12 | socklen_t msg_controllen; 13 | int msg_flags; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /sysroot/include/__struct_pollfd.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_pollfd_h 2 | #define __wasilibc___struct_pollfd_h 3 | 4 | struct pollfd { 5 | int fd; 6 | short events; 7 | short revents; 8 | }; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sysroot/include/__struct_rusage.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_rusage_h 2 | #define __wasilibc___struct_rusage_h 3 | 4 | #include <__struct_timeval.h> 5 | 6 | /* TODO: Add more features here. */ 7 | struct rusage { 8 | struct timeval ru_utime; 9 | struct timeval ru_stime; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /sysroot/include/__struct_sockaddr.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_sockaddr_h 2 | #define __wasilibc___struct_sockaddr_h 3 | 4 | #define __need_STDDEF_H_misc 5 | #include 6 | 7 | #include <__typedef_sa_family_t.h> 8 | 9 | struct sockaddr { 10 | _Alignas(max_align_t) sa_family_t sa_family; 11 | char sa_data[0]; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sysroot/include/__struct_sockaddr_in.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_sockaddr_in_h 2 | #define __wasilibc___struct_sockaddr_in_h 3 | 4 | #define __need_STDDEF_H_misc 5 | #include 6 | 7 | #include <__typedef_sa_family_t.h> 8 | #include <__typedef_in_port_t.h> 9 | #include <__struct_in_addr.h> 10 | 11 | struct sockaddr_in { 12 | _Alignas(max_align_t) sa_family_t sin_family; 13 | in_port_t sin_port; 14 | struct in_addr sin_addr; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /sysroot/include/__struct_sockaddr_in6.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_sockaddr_in6_h 2 | #define __wasilibc___struct_sockaddr_in6_h 3 | 4 | #define __need_STDDEF_H_misc 5 | #include 6 | 7 | #include <__typedef_sa_family_t.h> 8 | #include <__typedef_in_port_t.h> 9 | #include <__struct_in6_addr.h> 10 | 11 | struct sockaddr_in6 { 12 | _Alignas(max_align_t) sa_family_t sin6_family; 13 | in_port_t sin6_port; 14 | unsigned sin6_flowinfo; 15 | struct in6_addr sin6_addr; 16 | unsigned sin6_scope_id; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sysroot/include/__struct_sockaddr_storage.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_sockaddr_storage_h 2 | #define __wasilibc___struct_sockaddr_storage_h 3 | 4 | #define __need_STDDEF_H_misc 5 | #include 6 | 7 | #include <__typedef_sa_family_t.h> 8 | 9 | struct sockaddr_storage { 10 | _Alignas(max_align_t) sa_family_t ss_family; 11 | char __ss_data[32]; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sysroot/include/__struct_sockaddr_un.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_sockaddr_un_h 2 | #define __wasilibc___struct_sockaddr_un_h 3 | 4 | #define __need_STDDEF_H_misc 5 | #include 6 | 7 | #include <__typedef_sa_family_t.h> 8 | 9 | struct sockaddr_un { 10 | _Alignas(max_align_t) sa_family_t sun_family; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /sysroot/include/__struct_stat.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___struct_stat_h 2 | #define __wasm_basics___struct_stat_h 3 | 4 | #include <__typedef_dev_t.h> 5 | #include <__typedef_ino_t.h> 6 | #include <__typedef_nlink_t.h> 7 | #include <__typedef_mode_t.h> 8 | #include <__typedef_uid_t.h> 9 | #include <__typedef_gid_t.h> 10 | #include <__typedef_off_t.h> 11 | #include <__typedef_blksize_t.h> 12 | #include <__typedef_blkcnt_t.h> 13 | #include <__struct_timespec.h> 14 | 15 | struct stat { 16 | dev_t st_dev; 17 | ino_t st_ino; 18 | nlink_t st_nlink; 19 | 20 | mode_t st_mode; 21 | uid_t st_uid; 22 | gid_t st_gid; 23 | unsigned int __pad0; 24 | dev_t st_rdev; 25 | off_t st_size; 26 | blksize_t st_blksize; 27 | blkcnt_t st_blocks; 28 | 29 | struct timespec st_atim; 30 | struct timespec st_mtim; 31 | struct timespec st_ctim; 32 | long long __reserved[3]; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /sysroot/include/__struct_timespec.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___struct_timespec_h 2 | #define __wasm_basics___struct_timespec_h 3 | 4 | #include <__typedef_time_t.h> 5 | 6 | /* As specified in POSIX. */ 7 | struct timespec { 8 | time_t tv_sec; 9 | long tv_nsec; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /sysroot/include/__struct_timeval.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_timeval_h 2 | #define __wasilibc___struct_timeval_h 3 | 4 | #include <__typedef_time_t.h> 5 | #include <__typedef_suseconds_t.h> 6 | 7 | /* As specified in POSIX. */ 8 | struct timeval { 9 | time_t tv_sec; 10 | suseconds_t tv_usec; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /sysroot/include/__struct_tm.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_tm_h 2 | #define __wasilibc___struct_tm_h 3 | 4 | struct tm { 5 | int tm_sec; 6 | int tm_min; 7 | int tm_hour; 8 | int tm_mday; 9 | int tm_mon; 10 | int tm_year; 11 | int tm_wday; 12 | int tm_yday; 13 | int tm_isdst; 14 | int __tm_gmtoff; 15 | const char *__tm_zone; 16 | int __tm_nsec; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sysroot/include/__struct_tms.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___struct_tms_h 2 | #define __wasilibc___struct_tms_h 3 | 4 | #include <__typedef_clock_t.h> 5 | 6 | struct tms { 7 | clock_t tms_utime; 8 | clock_t tms_stime; 9 | clock_t tms_cutime; 10 | clock_t tms_cstime; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_DIR.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_DIR_h 2 | #define __wasilibc___typedef_DIR_h 3 | 4 | typedef struct _DIR DIR; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_blkcnt_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_blkcnt_t_h 2 | #define __wasm_basics___typedef_blkcnt_t_h 3 | 4 | /* Define these as 64-bit signed integers to support files larger than 2 GiB. */ 5 | typedef long long blkcnt_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_blksize_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_blksize_t_h 2 | #define __wasm_basics___typedef_blksize_t_h 3 | 4 | typedef long blksize_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_clock_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_clock_t_h 2 | #define __wasm_basics___typedef_clock_t_h 3 | 4 | /* Define this as a 64-bit signed integer to avoid wraparounds. */ 5 | typedef long long clock_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_clockid_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_clockid_t_h 2 | #define __wasilibc___typedef_clockid_t_h 3 | 4 | typedef const struct __clockid *clockid_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_dev_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_dev_t_h 2 | #define __wasm_basics___typedef_dev_t_h 3 | 4 | /* Define these as 64-bit integers to support billions of devices. */ 5 | typedef unsigned long long dev_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_fd_set.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_fd_set_h 2 | #define __wasilibc___typedef_fd_set_h 3 | 4 | #define __need_size_t 5 | #include 6 | 7 | #include <__macro_FD_SETSIZE.h> 8 | 9 | typedef struct { 10 | size_t __nfds; 11 | int __fds[FD_SETSIZE]; 12 | } fd_set; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_gid_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_gid_t_h 2 | #define __wasm_basics___typedef_gid_t_h 3 | 4 | typedef unsigned gid_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_in_addr_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_in_addr_t_h 2 | #define __wasilibc___typedef_in_addr_t_h 3 | 4 | typedef unsigned in_addr_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_in_port_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_in_port_t_h 2 | #define __wasilibc___typedef_in_port_t_h 3 | 4 | typedef unsigned short in_port_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_ino_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_ino_t_h 2 | #define __wasm_basics___typedef_ino_t_h 3 | 4 | /* Define these as 64-bit integers to support billions of inodes. */ 5 | typedef unsigned long long ino_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_mode_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_mode_t_h 2 | #define __wasm_basics___typedef_mode_t_h 3 | 4 | typedef unsigned mode_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_nfds_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_nfds_t_h 2 | #define __wasilibc___typedef_nfds_t_h 3 | 4 | typedef unsigned long nfds_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_nlink_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_nlink_t_h 2 | #define __wasm_basics___typedef_nlink_t_h 3 | 4 | /* Define these as 64-bit unsigned integers to support billions of links. */ 5 | typedef unsigned long long nlink_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_off_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_off_t_h 2 | #define __wasm_basics___typedef_off_t_h 3 | 4 | /* Define these as 64-bit signed integers to support files larger than 2 GiB. */ 5 | typedef long long off_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_sa_family_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_sa_family_t_h 2 | #define __wasilibc___typedef_sa_family_t_h 3 | 4 | typedef unsigned short sa_family_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_sigset_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_sigset_t_h 2 | #define __wasilibc___typedef_sigset_t_h 3 | 4 | /* TODO: This is just a placeholder for now. Keep this in sync with musl. */ 5 | typedef unsigned char sigset_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_socklen_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasilibc___typedef_socklen_t_h 2 | #define __wasilibc___typedef_socklen_t_h 3 | 4 | typedef unsigned socklen_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_ssize_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_ssize_t_h 2 | #define __wasm_basics___typedef_ssize_t_h 3 | 4 | /* This is defined to be the same size as size_t. */ 5 | typedef long ssize_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_suseconds_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_suseconds_t_h 2 | #define __wasm_basics___typedef_suseconds_t_h 3 | 4 | /* Define this to be 64-bit as its main use is in struct timeval where the 5 | extra space would otherwise be padding. */ 6 | typedef long long suseconds_t; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_time_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_time_t_h 2 | #define __wasm_basics___typedef_time_t_h 3 | 4 | /* Define this as a 64-bit signed integer to avoid the 2038 bug. */ 5 | typedef long long time_t; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/__typedef_uid_t.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasm_basics___typedef_uid_t_h 2 | #define __wasm_basics___typedef_uid_t_h 3 | 4 | typedef unsigned uid_t; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sysroot/include/alloca.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALLOCA_H 2 | #define _ALLOCA_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __NEED_size_t 9 | #include 10 | 11 | void *alloca(size_t); 12 | 13 | #ifdef __GNUC__ 14 | #define alloca __builtin_alloca 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sysroot/include/ar.h: -------------------------------------------------------------------------------- 1 | #ifndef _AR_H 2 | #define _AR_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define ARMAG "!\n" 9 | #define SARMAG 8 10 | #define ARFMAG "`\n" 11 | 12 | struct ar_hdr { 13 | char ar_name[16]; 14 | char ar_date[12]; 15 | char ar_uid[6], ar_gid[6]; 16 | char ar_mode[8]; 17 | char ar_size[10]; 18 | char ar_fmag[2]; 19 | }; 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sysroot/include/arpa/ftp.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARPA_FTP_H 2 | #define _ARPA_FTP_H 3 | #define PRELIM 1 4 | #define COMPLETE 2 5 | #define CONTINUE 3 6 | #define TRANSIENT 4 7 | #define ERROR 5 8 | #define TYPE_A 1 9 | #define TYPE_E 2 10 | #define TYPE_I 3 11 | #define TYPE_L 4 12 | #define FORM_N 1 13 | #define FORM_T 2 14 | #define FORM_C 3 15 | #define STRU_F 1 16 | #define STRU_R 2 17 | #define STRU_P 3 18 | #define MODE_S 1 19 | #define MODE_B 2 20 | #define MODE_C 3 21 | #define REC_ESC '\377' 22 | #define REC_EOR '\001' 23 | #define REC_EOF '\002' 24 | #define BLK_EOR 0x80 25 | #define BLK_EOF 0x40 26 | #define BLK_ERRORS 0x20 27 | #define BLK_RESTART 0x10 28 | #define BLK_BYTECOUNT 2 29 | #ifdef FTP_NAMES 30 | char *modenames[] = {"0", "Stream", "Block", "Compressed" }; 31 | char *strunames[] = {"0", "File", "Record", "Page" }; 32 | char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" }; 33 | char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" }; 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /sysroot/include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARPA_INET_H 2 | #define _ARPA_INET_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | uint32_t htonl(uint32_t); 12 | uint16_t htons(uint16_t); 13 | uint32_t ntohl(uint32_t); 14 | uint16_t ntohs(uint16_t); 15 | 16 | #ifdef __wasilibc_unmodified_upstream /* WASI has no inet_addr */ 17 | in_addr_t inet_addr (const char *); 18 | in_addr_t inet_network (const char *); 19 | char *inet_ntoa (struct in_addr); 20 | #endif 21 | int inet_pton (int, const char *__restrict, void *__restrict); 22 | const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t); 23 | 24 | int inet_aton (const char *, struct in_addr *); 25 | #ifdef __wasilibc_unmodified_upstream /* WASI has no inet_makeaddr */ 26 | struct in_addr inet_makeaddr(in_addr_t, in_addr_t); 27 | in_addr_t inet_lnaof(struct in_addr); 28 | in_addr_t inet_netof(struct in_addr); 29 | #endif 30 | 31 | #undef INET_ADDRSTRLEN 32 | #undef INET6_ADDRSTRLEN 33 | #define INET_ADDRSTRLEN 16 34 | #define INET6_ADDRSTRLEN 46 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sysroot/include/arpa/nameser_compat.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | -------------------------------------------------------------------------------- /sysroot/include/arpa/tftp.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARPA_TFTP_H 2 | #define _ARPA_TFTP_H 3 | #define SEGSIZE 512 4 | #define RRQ 01 5 | #define WRQ 02 6 | #define DATA 03 7 | #define ACK 04 8 | #define ERROR 05 9 | struct tftphdr { 10 | short th_opcode; 11 | union { 12 | unsigned short tu_block; 13 | short tu_code; 14 | char tu_stuff[1]; 15 | } th_u; 16 | char th_data[1]; 17 | }; 18 | #define th_block th_u.tu_block 19 | #define th_code th_u.tu_code 20 | #define th_stuff th_u.tu_stuff 21 | #define th_msg th_data 22 | #define EUNDEF 0 23 | #define ENOTFOUND 1 24 | #define EACCESS 2 25 | #define ENOSPACE 3 26 | #define EBADOP 4 27 | #define EBADID 5 28 | #define EEXISTS 6 29 | #define ENOUSER 7 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /sysroot/include/assert.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #undef assert 4 | 5 | #ifdef NDEBUG 6 | #define assert(x) (void)0 7 | #else 8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))) 9 | #endif 10 | 11 | #if __STDC_VERSION__ >= 201112L && !defined(__cplusplus) 12 | #define static_assert _Static_assert 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | _Noreturn void __assert_fail (const char *, const char *, int, const char *); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /sysroot/include/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /sysroot/include/bits/fcntl.h: -------------------------------------------------------------------------------- 1 | /* Use the WASI libc fcntl implementation bits. */ 2 | -------------------------------------------------------------------------------- /sysroot/include/bits/fenv.h: -------------------------------------------------------------------------------- 1 | #define FE_ALL_EXCEPT 0 2 | #define FE_TONEAREST 0 3 | 4 | typedef unsigned long fexcept_t; 5 | 6 | typedef struct { 7 | unsigned long __cw; 8 | } fenv_t; 9 | 10 | #define FE_DFL_ENV ((const fenv_t *) -1) 11 | -------------------------------------------------------------------------------- /sysroot/include/bits/float.h: -------------------------------------------------------------------------------- 1 | #define FLT_EVAL_METHOD 0 2 | 3 | #define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L 4 | #define LDBL_MIN 3.36210314311209350626267781732175260e-4932L 5 | #define LDBL_MAX 1.18973149535723176508575932662800702e+4932L 6 | #define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L 7 | 8 | #define LDBL_MANT_DIG 113 9 | #define LDBL_MIN_EXP (-16381) 10 | #define LDBL_MAX_EXP 16384 11 | 12 | #define LDBL_DIG 33 13 | #define LDBL_MIN_10_EXP (-4931) 14 | #define LDBL_MAX_10_EXP 4932 15 | 16 | #define DECIMAL_DIG 36 17 | -------------------------------------------------------------------------------- /sysroot/include/bits/hwcap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/include/bits/hwcap.h -------------------------------------------------------------------------------- /sysroot/include/bits/io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/include/bits/io.h -------------------------------------------------------------------------------- /sysroot/include/bits/ioctl.h: -------------------------------------------------------------------------------- 1 | /* Use the WASI libc ioctl implementation bits. */ 2 | -------------------------------------------------------------------------------- /sysroot/include/bits/ioctl_fix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/include/bits/ioctl_fix.h -------------------------------------------------------------------------------- /sysroot/include/bits/limits.h: -------------------------------------------------------------------------------- 1 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 2 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 3 | #include <__macro_PAGESIZE.h> 4 | #define LONG_BIT (32) 5 | #endif 6 | 7 | #define LONG_MAX (0x7fffffffL) 8 | #define LLONG_MAX (0x7fffffffffffffffLL) 9 | -------------------------------------------------------------------------------- /sysroot/include/bits/mman.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/include/bits/mman.h -------------------------------------------------------------------------------- /sysroot/include/bits/poll.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/include/bits/poll.h -------------------------------------------------------------------------------- /sysroot/include/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG (1) 2 | #define _POSIX_V7_ILP32_OFFBIG (1) 3 | -------------------------------------------------------------------------------- /sysroot/include/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 64 3 | -------------------------------------------------------------------------------- /sysroot/include/bits/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/include/bits/resource.h -------------------------------------------------------------------------------- /sysroot/include/bits/signal.h: -------------------------------------------------------------------------------- 1 | #include <__header_bits_signal.h> 2 | -------------------------------------------------------------------------------- /sysroot/include/bits/socket.h: -------------------------------------------------------------------------------- 1 | #include <__struct_msghdr.h> 2 | -------------------------------------------------------------------------------- /sysroot/include/bits/stat.h: -------------------------------------------------------------------------------- 1 | #include <__struct_stat.h> 2 | -------------------------------------------------------------------------------- /sysroot/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | typedef int16_t int_fast16_t; 2 | typedef int32_t int_fast32_t; 3 | typedef uint16_t uint_fast16_t; 4 | typedef uint32_t uint_fast32_t; 5 | 6 | #define INT_FAST16_MIN INT16_MIN 7 | #define INT_FAST32_MIN INT32_MIN 8 | 9 | #define INT_FAST16_MAX INT16_MAX 10 | #define INT_FAST32_MAX INT32_MAX 11 | 12 | #define UINT_FAST16_MAX UINT16_MAX 13 | #define UINT_FAST32_MAX UINT32_MAX 14 | 15 | #define INTPTR_MIN INT32_MIN 16 | #define INTPTR_MAX INT32_MAX 17 | #define UINTPTR_MAX UINT32_MAX 18 | #define PTRDIFF_MIN INT32_MIN 19 | #define PTRDIFF_MAX INT32_MAX 20 | #define SIZE_MAX UINT32_MAX 21 | -------------------------------------------------------------------------------- /sysroot/include/byteswap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BYTESWAP_H 2 | #define _BYTESWAP_H 3 | 4 | #include 5 | #include 6 | 7 | static __inline uint16_t __bswap_16(uint16_t __x) 8 | { 9 | return __x<<8 | __x>>8; 10 | } 11 | 12 | static __inline uint32_t __bswap_32(uint32_t __x) 13 | { 14 | return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; 15 | } 16 | 17 | static __inline uint64_t __bswap_64(uint64_t __x) 18 | { 19 | return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32); 20 | } 21 | 22 | #define bswap_16(x) __bswap_16(x) 23 | #define bswap_32(x) __bswap_32(x) 24 | #define bswap_64(x) __bswap_64(x) 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sysroot/include/complex.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPLEX_H 2 | #define _COMPLEX_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define complex _Complex 9 | #ifdef __GNUC__ 10 | #define _Complex_I (__extension__ (0.0f+1.0fi)) 11 | #else 12 | #define _Complex_I (0.0f+1.0fi) 13 | #endif 14 | #define I _Complex_I 15 | 16 | double complex cacos(double complex); 17 | float complex cacosf(float complex); 18 | long double complex cacosl(long double complex); 19 | 20 | double complex casin(double complex); 21 | float complex casinf(float complex); 22 | long double complex casinl(long double complex); 23 | 24 | double complex catan(double complex); 25 | float complex catanf(float complex); 26 | long double complex catanl(long double complex); 27 | 28 | double complex ccos(double complex); 29 | float complex ccosf(float complex); 30 | long double complex ccosl(long double complex); 31 | 32 | double complex csin(double complex); 33 | float complex csinf(float complex); 34 | long double complex csinl(long double complex); 35 | 36 | double complex ctan(double complex); 37 | float complex ctanf(float complex); 38 | long double complex ctanl(long double complex); 39 | 40 | double complex cacosh(double complex); 41 | float complex cacoshf(float complex); 42 | long double complex cacoshl(long double complex); 43 | 44 | double complex casinh(double complex); 45 | float complex casinhf(float complex); 46 | long double complex casinhl(long double complex); 47 | 48 | double complex catanh(double complex); 49 | float complex catanhf(float complex); 50 | long double complex catanhl(long double complex); 51 | 52 | double complex ccosh(double complex); 53 | float complex ccoshf(float complex); 54 | long double complex ccoshl(long double complex); 55 | 56 | double complex csinh(double complex); 57 | float complex csinhf(float complex); 58 | long double complex csinhl(long double complex); 59 | 60 | double complex ctanh(double complex); 61 | float complex ctanhf(float complex); 62 | long double complex ctanhl(long double complex); 63 | 64 | double complex cexp(double complex); 65 | float complex cexpf(float complex); 66 | long double complex cexpl(long double complex); 67 | 68 | double complex clog(double complex); 69 | float complex clogf(float complex); 70 | long double complex clogl(long double complex); 71 | 72 | double cabs(double complex); 73 | float cabsf(float complex); 74 | long double cabsl(long double complex); 75 | 76 | double complex cpow(double complex, double complex); 77 | float complex cpowf(float complex, float complex); 78 | long double complex cpowl(long double complex, long double complex); 79 | 80 | double complex csqrt(double complex); 81 | float complex csqrtf(float complex); 82 | long double complex csqrtl(long double complex); 83 | 84 | double carg(double complex); 85 | float cargf(float complex); 86 | long double cargl(long double complex); 87 | 88 | double cimag(double complex); 89 | float cimagf(float complex); 90 | long double cimagl(long double complex); 91 | 92 | double complex conj(double complex); 93 | float complex conjf(float complex); 94 | long double complex conjl(long double complex); 95 | 96 | double complex cproj(double complex); 97 | float complex cprojf(float complex); 98 | long double complex cprojl(long double complex); 99 | 100 | double creal(double complex); 101 | float crealf(float complex); 102 | long double creall(long double complex); 103 | 104 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's real/imag operators rather than union type punning */ 105 | #ifndef __cplusplus 106 | #define __CIMAG(x, t) \ 107 | (+(union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1]) 108 | 109 | #define creal(x) ((double)(x)) 110 | #define crealf(x) ((float)(x)) 111 | #define creall(x) ((long double)(x)) 112 | 113 | #define cimag(x) __CIMAG(x, double) 114 | #define cimagf(x) __CIMAG(x, float) 115 | #define cimagl(x) __CIMAG(x, long double) 116 | #endif 117 | #endif 118 | 119 | #if __STDC_VERSION__ >= 201112L 120 | #if defined(_Imaginary_I) 121 | #define __CMPLX(x, y, t) ((t)(x) + _Imaginary_I*(t)(y)) 122 | #elif defined(__clang__) 123 | #define __CMPLX(x, y, t) (+(_Complex t){ (t)(x), (t)(y) }) 124 | #else 125 | #define __CMPLX(x, y, t) (__builtin_complex((t)(x), (t)(y))) 126 | #endif 127 | #define CMPLX(x, y) __CMPLX(x, y, double) 128 | #define CMPLXF(x, y) __CMPLX(x, y, float) 129 | #define CMPLXL(x, y) __CMPLX(x, y, long double) 130 | #endif 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | #endif 136 | -------------------------------------------------------------------------------- /sysroot/include/cpio.h: -------------------------------------------------------------------------------- 1 | #ifndef _CPIO_H 2 | #define _CPIO_H 3 | 4 | #define MAGIC "070707" 5 | 6 | #define C_IRUSR 000400 7 | #define C_IWUSR 000200 8 | #define C_IXUSR 000100 9 | #define C_IRGRP 000040 10 | #define C_IWGRP 000020 11 | #define C_IXGRP 000010 12 | #define C_IROTH 000004 13 | #define C_IWOTH 000002 14 | #define C_IXOTH 000001 15 | 16 | #define C_ISUID 004000 17 | #define C_ISGID 002000 18 | #define C_ISVTX 001000 19 | 20 | #define C_ISBLK 060000 21 | #define C_ISCHR 020000 22 | #define C_ISDIR 040000 23 | #define C_ISFIFO 010000 24 | #define C_ISSOCK 0140000 25 | #define C_ISLNK 0120000 26 | #define C_ISCTG 0110000 27 | #define C_ISREG 0100000 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sysroot/include/crypt.h: -------------------------------------------------------------------------------- 1 | #ifndef _CRYPT_H 2 | #define _CRYPT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct crypt_data { 9 | int initialized; 10 | char __buf[256]; 11 | }; 12 | 13 | char *crypt(const char *, const char *); 14 | char *crypt_r(const char *, const char *, struct crypt_data *); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sysroot/include/ctype.h: -------------------------------------------------------------------------------- 1 | #ifndef _CTYPE_H 2 | #define _CTYPE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | int isalnum(int); 11 | int isalpha(int); 12 | int isblank(int); 13 | int iscntrl(int); 14 | int isdigit(int); 15 | int isgraph(int); 16 | int islower(int); 17 | int isprint(int); 18 | int ispunct(int); 19 | int isspace(int); 20 | int isupper(int); 21 | int isxdigit(int); 22 | int tolower(int); 23 | int toupper(int); 24 | 25 | #ifndef __cplusplus 26 | static __inline int __isspace(int _c) 27 | { 28 | return _c == ' ' || (unsigned)_c-'\t' < 5; 29 | } 30 | 31 | #define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26) 32 | #define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10) 33 | #define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26) 34 | #define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26) 35 | #define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f) 36 | #define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e) 37 | #define isspace(a) __isspace(a) 38 | #endif 39 | 40 | 41 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 42 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 43 | || defined(_BSD_SOURCE) 44 | 45 | #define __NEED_locale_t 46 | #include 47 | 48 | int isalnum_l(int, locale_t); 49 | int isalpha_l(int, locale_t); 50 | int isblank_l(int, locale_t); 51 | int iscntrl_l(int, locale_t); 52 | int isdigit_l(int, locale_t); 53 | int isgraph_l(int, locale_t); 54 | int islower_l(int, locale_t); 55 | int isprint_l(int, locale_t); 56 | int ispunct_l(int, locale_t); 57 | int isspace_l(int, locale_t); 58 | int isupper_l(int, locale_t); 59 | int isxdigit_l(int, locale_t); 60 | int tolower_l(int, locale_t); 61 | int toupper_l(int, locale_t); 62 | 63 | int isascii(int); 64 | int toascii(int); 65 | #define _tolower(a) ((a)|0x20) 66 | #define _toupper(a) ((a)&0x5f) 67 | #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128) 68 | 69 | #endif 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /sysroot/include/dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef _DIRENT_H 2 | #define _DIRENT_H 3 | 4 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 5 | #else 6 | #include <__header_dirent.h> 7 | #endif 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #include 13 | 14 | #define __NEED_ino_t 15 | #define __NEED_off_t 16 | #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) 17 | #define __NEED_size_t 18 | #endif 19 | 20 | #include 21 | 22 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 23 | typedef struct __dirstream DIR; 24 | #else 25 | #include <__typedef_DIR.h> 26 | #endif 27 | 28 | #define _DIRENT_HAVE_D_RECLEN 29 | #define _DIRENT_HAVE_D_OFF 30 | #define _DIRENT_HAVE_D_TYPE 31 | 32 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 33 | struct dirent { 34 | ino_t d_ino; 35 | off_t d_off; 36 | unsigned short d_reclen; 37 | unsigned char d_type; 38 | char d_name[256]; 39 | }; 40 | #else 41 | #include <__struct_dirent.h> 42 | #endif 43 | 44 | #define d_fileno d_ino 45 | 46 | int closedir(DIR *); 47 | DIR *fdopendir(int); 48 | DIR *opendir(const char *); 49 | struct dirent *readdir(DIR *); 50 | #ifdef __wasilibc_unmodified_upstream /* readdir_r is obsolete */ 51 | int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict); 52 | #endif 53 | void rewinddir(DIR *); 54 | int dirfd(DIR *); 55 | 56 | int alphasort(const struct dirent **, const struct dirent **); 57 | int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); 58 | 59 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 60 | void seekdir(DIR *, long); 61 | long telldir(DIR *); 62 | #endif 63 | 64 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 65 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 66 | #define DT_UNKNOWN 0 67 | #define DT_FIFO 1 68 | #define DT_CHR 2 69 | #define DT_DIR 4 70 | #define DT_BLK 6 71 | #define DT_REG 8 72 | #define DT_LNK 10 73 | #define DT_SOCK 12 74 | #define DT_WHT 14 75 | #define IFTODT(x) ((x)>>12 & 017) 76 | #define DTTOIF(x) ((x)<<12) 77 | #endif 78 | int getdents(int, struct dirent *, size_t); 79 | #endif 80 | 81 | #ifdef _GNU_SOURCE 82 | int versionsort(const struct dirent **, const struct dirent **); 83 | #endif 84 | 85 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 86 | #define dirent64 dirent 87 | #define readdir64 readdir 88 | #define readdir64_r readdir_r 89 | #define scandir64 scandir 90 | #define alphasort64 alphasort 91 | #define versionsort64 versionsort 92 | #define off64_t off_t 93 | #define ino64_t ino_t 94 | #define getdents64 getdents 95 | #endif 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /sysroot/include/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _ENDIAN_H 2 | #define _ENDIAN_H 3 | 4 | #include 5 | 6 | #define __LITTLE_ENDIAN 1234 7 | #define __BIG_ENDIAN 4321 8 | #define __PDP_ENDIAN 3412 9 | 10 | #if defined(__GNUC__) && defined(__BYTE_ORDER__) 11 | #define __BYTE_ORDER __BYTE_ORDER__ 12 | #else 13 | #include 14 | #endif 15 | 16 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 17 | 18 | #define BIG_ENDIAN __BIG_ENDIAN 19 | #define LITTLE_ENDIAN __LITTLE_ENDIAN 20 | #define PDP_ENDIAN __PDP_ENDIAN 21 | #define BYTE_ORDER __BYTE_ORDER 22 | 23 | #include 24 | 25 | static __inline uint16_t __bswap16(uint16_t __x) 26 | { 27 | return __x<<8 | __x>>8; 28 | } 29 | 30 | static __inline uint32_t __bswap32(uint32_t __x) 31 | { 32 | return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; 33 | } 34 | 35 | static __inline uint64_t __bswap64(uint64_t __x) 36 | { 37 | return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32); 38 | } 39 | 40 | #if __BYTE_ORDER == __LITTLE_ENDIAN 41 | #define htobe16(x) __bswap16(x) 42 | #define be16toh(x) __bswap16(x) 43 | #define betoh16(x) __bswap16(x) 44 | #define htobe32(x) __bswap32(x) 45 | #define be32toh(x) __bswap32(x) 46 | #define betoh32(x) __bswap32(x) 47 | #define htobe64(x) __bswap64(x) 48 | #define be64toh(x) __bswap64(x) 49 | #define betoh64(x) __bswap64(x) 50 | #define htole16(x) (uint16_t)(x) 51 | #define le16toh(x) (uint16_t)(x) 52 | #define letoh16(x) (uint16_t)(x) 53 | #define htole32(x) (uint32_t)(x) 54 | #define le32toh(x) (uint32_t)(x) 55 | #define letoh32(x) (uint32_t)(x) 56 | #define htole64(x) (uint64_t)(x) 57 | #define le64toh(x) (uint64_t)(x) 58 | #define letoh64(x) (uint64_t)(x) 59 | #else 60 | #define htobe16(x) (uint16_t)(x) 61 | #define be16toh(x) (uint16_t)(x) 62 | #define betoh16(x) (uint16_t)(x) 63 | #define htobe32(x) (uint32_t)(x) 64 | #define be32toh(x) (uint32_t)(x) 65 | #define betoh32(x) (uint32_t)(x) 66 | #define htobe64(x) (uint64_t)(x) 67 | #define be64toh(x) (uint64_t)(x) 68 | #define betoh64(x) (uint64_t)(x) 69 | #define htole16(x) __bswap16(x) 70 | #define le16toh(x) __bswap16(x) 71 | #define letoh16(x) __bswap16(x) 72 | #define htole32(x) __bswap32(x) 73 | #define le32toh(x) __bswap32(x) 74 | #define letoh32(x) __bswap32(x) 75 | #define htole64(x) __bswap64(x) 76 | #define le64toh(x) __bswap64(x) 77 | #define letoh64(x) __bswap64(x) 78 | #endif 79 | 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /sysroot/include/err.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERR_H 2 | #define _ERR_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | void warn(const char *, ...); 12 | void vwarn(const char *, va_list); 13 | void warnx(const char *, ...); 14 | void vwarnx(const char *, va_list); 15 | 16 | _Noreturn void err(int, const char *, ...); 17 | _Noreturn void verr(int, const char *, va_list); 18 | _Noreturn void errx(int, const char *, ...); 19 | _Noreturn void verrx(int, const char *, va_list); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sysroot/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 11 | #include 12 | 13 | #ifdef __GNUC__ 14 | __attribute__((const)) 15 | #endif 16 | int *__errno_location(void); 17 | #define errno (*__errno_location()) 18 | #else 19 | #include <__errno.h> 20 | #include <__errno_values.h> 21 | #endif 22 | 23 | #ifdef _GNU_SOURCE 24 | extern char *program_invocation_short_name, *program_invocation_name; 25 | #endif 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /sysroot/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef _FEATURES_H 2 | #define _FEATURES_H 3 | 4 | #if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) 5 | #define _GNU_SOURCE 1 6 | #endif 7 | 8 | #if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) 9 | #define _BSD_SOURCE 1 10 | #endif 11 | 12 | #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ 13 | && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ 14 | && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) 15 | #define _BSD_SOURCE 1 16 | #define _XOPEN_SOURCE 700 17 | #endif 18 | 19 | #if __STDC_VERSION__ >= 199901L 20 | #define __restrict restrict 21 | #elif !defined(__GNUC__) 22 | #define __restrict 23 | #endif 24 | 25 | #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) 26 | #define __inline inline 27 | #elif !defined(__GNUC__) 28 | #define __inline 29 | #endif 30 | 31 | #if __STDC_VERSION__ >= 201112L 32 | #elif defined(__GNUC__) 33 | #define _Noreturn __attribute__((__noreturn__)) 34 | #else 35 | #define _Noreturn 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sysroot/include/fenv.h: -------------------------------------------------------------------------------- 1 | #ifndef _FENV_H 2 | #define _FENV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | int feclearexcept(int); 11 | int fegetexceptflag(fexcept_t *, int); 12 | int feraiseexcept(int); 13 | int fesetexceptflag(const fexcept_t *, int); 14 | int fetestexcept(int); 15 | 16 | int fegetround(void); 17 | int fesetround(int); 18 | 19 | int fegetenv(fenv_t *); 20 | int feholdexcept(fenv_t *); 21 | int fesetenv(const fenv_t *); 22 | int feupdateenv(const fenv_t *); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /sysroot/include/float.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLOAT_H 2 | #define _FLOAT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's definition of FLT_ROUNDS */ 9 | int __flt_rounds(void); 10 | #define FLT_ROUNDS (__flt_rounds()) 11 | #else 12 | #define FLT_ROUNDS (__builtin_flt_rounds()) 13 | #endif 14 | 15 | #define FLT_RADIX 2 16 | 17 | #define FLT_TRUE_MIN 1.40129846432481707092e-45F 18 | #define FLT_MIN 1.17549435082228750797e-38F 19 | #define FLT_MAX 3.40282346638528859812e+38F 20 | #define FLT_EPSILON 1.1920928955078125e-07F 21 | 22 | #define FLT_MANT_DIG 24 23 | #define FLT_MIN_EXP (-125) 24 | #define FLT_MAX_EXP 128 25 | #define FLT_HAS_SUBNORM 1 26 | 27 | #define FLT_DIG 6 28 | #define FLT_DECIMAL_DIG 9 29 | #define FLT_MIN_10_EXP (-37) 30 | #define FLT_MAX_10_EXP 38 31 | 32 | #define DBL_TRUE_MIN 4.94065645841246544177e-324 33 | #define DBL_MIN 2.22507385850720138309e-308 34 | #define DBL_MAX 1.79769313486231570815e+308 35 | #define DBL_EPSILON 2.22044604925031308085e-16 36 | 37 | #define DBL_MANT_DIG 53 38 | #define DBL_MIN_EXP (-1021) 39 | #define DBL_MAX_EXP 1024 40 | #define DBL_HAS_SUBNORM 1 41 | 42 | #define DBL_DIG 15 43 | #define DBL_DECIMAL_DIG 17 44 | #define DBL_MIN_10_EXP (-307) 45 | #define DBL_MAX_10_EXP 308 46 | 47 | #define LDBL_HAS_SUBNORM 1 48 | #define LDBL_DECIMAL_DIG DECIMAL_DIG 49 | 50 | #include 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /sysroot/include/fmtmsg.h: -------------------------------------------------------------------------------- 1 | #ifndef _FMTMSG_H 2 | #define _FMTMSG_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define MM_HARD 1 9 | #define MM_SOFT 2 10 | #define MM_FIRM 4 11 | 12 | #define MM_APPL 8 13 | #define MM_UTIL 16 14 | #define MM_OPSYS 32 15 | 16 | #define MM_RECOVER 64 17 | #define MM_NRECOV 128 18 | 19 | #define MM_PRINT 256 20 | #define MM_CONSOLE 512 21 | 22 | #define MM_NULLMC 0L 23 | 24 | #define MM_HALT 1 25 | #define MM_ERROR 2 26 | #define MM_WARNING 3 27 | #define MM_INFO 4 28 | #define MM_NOSEV 0 29 | 30 | #define MM_OK 0 31 | #define MM_NOTOK (-1) 32 | #define MM_NOMSG 1 33 | #define MM_NOCON 4 34 | 35 | #define MM_NULLLBL ((char*)0) 36 | #define MM_NULLTXT ((char*)0) 37 | #define MM_NULLACT ((char*)0) 38 | #define MM_NULLTAG ((char*)0) 39 | #define MM_NULLSEV 0 40 | 41 | int fmtmsg(long, const char *, int, const char *, const char *, const char *); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /sysroot/include/fnmatch.h: -------------------------------------------------------------------------------- 1 | #ifndef _FNMATCH_H 2 | #define _FNMATCH_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define FNM_PATHNAME 0x1 9 | #define FNM_NOESCAPE 0x2 10 | #define FNM_PERIOD 0x4 11 | #define FNM_LEADING_DIR 0x8 12 | #define FNM_CASEFOLD 0x10 13 | #define FNM_FILE_NAME FNM_PATHNAME 14 | 15 | #define FNM_NOMATCH 1 16 | #define FNM_NOSYS (-1) 17 | 18 | int fnmatch(const char *, const char *, int); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /sysroot/include/ftw.h: -------------------------------------------------------------------------------- 1 | #ifndef _FTW_H 2 | #define _FTW_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #define FTW_F 1 12 | #define FTW_D 2 13 | #define FTW_DNR 3 14 | #define FTW_NS 4 15 | #define FTW_SL 5 16 | #define FTW_DP 6 17 | #define FTW_SLN 7 18 | 19 | #define FTW_PHYS 1 20 | #define FTW_MOUNT 2 21 | #define FTW_CHDIR 4 22 | #define FTW_DEPTH 8 23 | 24 | struct FTW { 25 | int base; 26 | int level; 27 | }; 28 | 29 | #ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ 30 | int ftw(const char *, int (*)(const char *, const struct stat *, int), int); 31 | #endif 32 | int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int); 33 | 34 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 35 | #ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ 36 | #define ftw64 ftw 37 | #endif 38 | #define nftw64 nftw 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /sysroot/include/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef _GETOPT_H 2 | #define _GETOPT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int getopt(int, char * const [], const char *); 9 | extern char *optarg; 10 | extern int optind, opterr, optopt, optreset; 11 | 12 | struct option { 13 | const char *name; 14 | int has_arg; 15 | int *flag; 16 | int val; 17 | }; 18 | 19 | int getopt_long(int, char *const *, const char *, const struct option *, int *); 20 | int getopt_long_only(int, char *const *, const char *, const struct option *, int *); 21 | 22 | #define no_argument 0 23 | #define required_argument 1 24 | #define optional_argument 2 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /sysroot/include/glob.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOB_H 2 | #define _GLOB_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_size_t 11 | 12 | #include 13 | 14 | typedef struct { 15 | size_t gl_pathc; 16 | char **gl_pathv; 17 | size_t gl_offs; 18 | int __dummy1; 19 | void *__dummy2[5]; 20 | } glob_t; 21 | 22 | int glob(const char *__restrict, int, int (*)(const char *, int), glob_t *__restrict); 23 | void globfree(glob_t *); 24 | 25 | #define GLOB_ERR 0x01 26 | #define GLOB_MARK 0x02 27 | #define GLOB_NOSORT 0x04 28 | #define GLOB_DOOFFS 0x08 29 | #define GLOB_NOCHECK 0x10 30 | #define GLOB_APPEND 0x20 31 | #define GLOB_NOESCAPE 0x40 32 | #define GLOB_PERIOD 0x80 33 | 34 | #define GLOB_NOSPACE 1 35 | #define GLOB_ABORTED 2 36 | #define GLOB_NOMATCH 3 37 | #define GLOB_NOSYS 4 38 | 39 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 40 | #define glob64 glob 41 | #define globfree64 globfree 42 | #define glob64_t glob_t 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /sysroot/include/iconv.h: -------------------------------------------------------------------------------- 1 | #ifndef _ICONV_H 2 | #define _ICONV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_size_t 11 | 12 | #include 13 | 14 | typedef void *iconv_t; 15 | 16 | iconv_t iconv_open(const char *, const char *); 17 | size_t iconv(iconv_t, char **__restrict, size_t *__restrict, char **__restrict, size_t *__restrict); 18 | int iconv_close(iconv_t); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /sysroot/include/ifaddrs.h: -------------------------------------------------------------------------------- 1 | #ifndef _IFADDRS_H 2 | #define _IFADDRS_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | struct ifaddrs { 13 | struct ifaddrs *ifa_next; 14 | char *ifa_name; 15 | unsigned ifa_flags; 16 | struct sockaddr *ifa_addr; 17 | struct sockaddr *ifa_netmask; 18 | union { 19 | struct sockaddr *ifu_broadaddr; 20 | struct sockaddr *ifu_dstaddr; 21 | } ifa_ifu; 22 | void *ifa_data; 23 | }; 24 | #define ifa_broadaddr ifa_ifu.ifu_broadaddr 25 | #define ifa_dstaddr ifa_ifu.ifu_dstaddr 26 | 27 | void freeifaddrs(struct ifaddrs *); 28 | int getifaddrs(struct ifaddrs **); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /sysroot/include/inttypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _INTTYPES_H 2 | #define _INTTYPES_H 3 | 4 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #include 10 | #include 11 | 12 | #define __NEED_wchar_t 13 | #include 14 | 15 | typedef struct { intmax_t quot, rem; } imaxdiv_t; 16 | 17 | intmax_t imaxabs(intmax_t); 18 | imaxdiv_t imaxdiv(intmax_t, intmax_t); 19 | 20 | intmax_t strtoimax(const char *__restrict, char **__restrict, int); 21 | uintmax_t strtoumax(const char *__restrict, char **__restrict, int); 22 | 23 | intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int); 24 | uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); 25 | 26 | #if UINTPTR_MAX == UINT64_MAX 27 | #define __PRI64 "l" 28 | #define __PRIPTR "l" 29 | #else 30 | #define __PRI64 "ll" 31 | #define __PRIPTR "" 32 | #endif 33 | 34 | #define PRId8 "d" 35 | #define PRId16 "d" 36 | #define PRId32 "d" 37 | #define PRId64 __PRI64 "d" 38 | 39 | #define PRIdLEAST8 "d" 40 | #define PRIdLEAST16 "d" 41 | #define PRIdLEAST32 "d" 42 | #define PRIdLEAST64 __PRI64 "d" 43 | 44 | #define PRIdFAST8 "d" 45 | #define PRIdFAST16 "d" 46 | #define PRIdFAST32 "d" 47 | #define PRIdFAST64 __PRI64 "d" 48 | 49 | #define PRIi8 "i" 50 | #define PRIi16 "i" 51 | #define PRIi32 "i" 52 | #define PRIi64 __PRI64 "i" 53 | 54 | #define PRIiLEAST8 "i" 55 | #define PRIiLEAST16 "i" 56 | #define PRIiLEAST32 "i" 57 | #define PRIiLEAST64 __PRI64 "i" 58 | 59 | #define PRIiFAST8 "i" 60 | #define PRIiFAST16 "i" 61 | #define PRIiFAST32 "i" 62 | #define PRIiFAST64 __PRI64 "i" 63 | 64 | #define PRIo8 "o" 65 | #define PRIo16 "o" 66 | #define PRIo32 "o" 67 | #define PRIo64 __PRI64 "o" 68 | 69 | #define PRIoLEAST8 "o" 70 | #define PRIoLEAST16 "o" 71 | #define PRIoLEAST32 "o" 72 | #define PRIoLEAST64 __PRI64 "o" 73 | 74 | #define PRIoFAST8 "o" 75 | #define PRIoFAST16 "o" 76 | #define PRIoFAST32 "o" 77 | #define PRIoFAST64 __PRI64 "o" 78 | 79 | #define PRIu8 "u" 80 | #define PRIu16 "u" 81 | #define PRIu32 "u" 82 | #define PRIu64 __PRI64 "u" 83 | 84 | #define PRIuLEAST8 "u" 85 | #define PRIuLEAST16 "u" 86 | #define PRIuLEAST32 "u" 87 | #define PRIuLEAST64 __PRI64 "u" 88 | 89 | #define PRIuFAST8 "u" 90 | #define PRIuFAST16 "u" 91 | #define PRIuFAST32 "u" 92 | #define PRIuFAST64 __PRI64 "u" 93 | 94 | #define PRIx8 "x" 95 | #define PRIx16 "x" 96 | #define PRIx32 "x" 97 | #define PRIx64 __PRI64 "x" 98 | 99 | #define PRIxLEAST8 "x" 100 | #define PRIxLEAST16 "x" 101 | #define PRIxLEAST32 "x" 102 | #define PRIxLEAST64 __PRI64 "x" 103 | 104 | #define PRIxFAST8 "x" 105 | #define PRIxFAST16 "x" 106 | #define PRIxFAST32 "x" 107 | #define PRIxFAST64 __PRI64 "x" 108 | 109 | #define PRIX8 "X" 110 | #define PRIX16 "X" 111 | #define PRIX32 "X" 112 | #define PRIX64 __PRI64 "X" 113 | 114 | #define PRIXLEAST8 "X" 115 | #define PRIXLEAST16 "X" 116 | #define PRIXLEAST32 "X" 117 | #define PRIXLEAST64 __PRI64 "X" 118 | 119 | #define PRIXFAST8 "X" 120 | #define PRIXFAST16 "X" 121 | #define PRIXFAST32 "X" 122 | #define PRIXFAST64 __PRI64 "X" 123 | 124 | #define PRIdMAX __PRI64 "d" 125 | #define PRIiMAX __PRI64 "i" 126 | #define PRIoMAX __PRI64 "o" 127 | #define PRIuMAX __PRI64 "u" 128 | #define PRIxMAX __PRI64 "x" 129 | #define PRIXMAX __PRI64 "X" 130 | 131 | #define PRIdPTR __PRIPTR "d" 132 | #define PRIiPTR __PRIPTR "i" 133 | #define PRIoPTR __PRIPTR "o" 134 | #define PRIuPTR __PRIPTR "u" 135 | #define PRIxPTR __PRIPTR "x" 136 | #define PRIXPTR __PRIPTR "X" 137 | 138 | #define SCNd8 "hhd" 139 | #define SCNd16 "hd" 140 | #define SCNd32 "d" 141 | #define SCNd64 __PRI64 "d" 142 | 143 | #define SCNdLEAST8 "hhd" 144 | #define SCNdLEAST16 "hd" 145 | #define SCNdLEAST32 "d" 146 | #define SCNdLEAST64 __PRI64 "d" 147 | 148 | #define SCNdFAST8 "hhd" 149 | #define SCNdFAST16 "d" 150 | #define SCNdFAST32 "d" 151 | #define SCNdFAST64 __PRI64 "d" 152 | 153 | #define SCNi8 "hhi" 154 | #define SCNi16 "hi" 155 | #define SCNi32 "i" 156 | #define SCNi64 __PRI64 "i" 157 | 158 | #define SCNiLEAST8 "hhi" 159 | #define SCNiLEAST16 "hi" 160 | #define SCNiLEAST32 "i" 161 | #define SCNiLEAST64 __PRI64 "i" 162 | 163 | #define SCNiFAST8 "hhi" 164 | #define SCNiFAST16 "i" 165 | #define SCNiFAST32 "i" 166 | #define SCNiFAST64 __PRI64 "i" 167 | 168 | #define SCNu8 "hhu" 169 | #define SCNu16 "hu" 170 | #define SCNu32 "u" 171 | #define SCNu64 __PRI64 "u" 172 | 173 | #define SCNuLEAST8 "hhu" 174 | #define SCNuLEAST16 "hu" 175 | #define SCNuLEAST32 "u" 176 | #define SCNuLEAST64 __PRI64 "u" 177 | 178 | #define SCNuFAST8 "hhu" 179 | #define SCNuFAST16 "u" 180 | #define SCNuFAST32 "u" 181 | #define SCNuFAST64 __PRI64 "u" 182 | 183 | #define SCNo8 "hho" 184 | #define SCNo16 "ho" 185 | #define SCNo32 "o" 186 | #define SCNo64 __PRI64 "o" 187 | 188 | #define SCNoLEAST8 "hho" 189 | #define SCNoLEAST16 "ho" 190 | #define SCNoLEAST32 "o" 191 | #define SCNoLEAST64 __PRI64 "o" 192 | 193 | #define SCNoFAST8 "hho" 194 | #define SCNoFAST16 "o" 195 | #define SCNoFAST32 "o" 196 | #define SCNoFAST64 __PRI64 "o" 197 | 198 | #define SCNx8 "hhx" 199 | #define SCNx16 "hx" 200 | #define SCNx32 "x" 201 | #define SCNx64 __PRI64 "x" 202 | 203 | #define SCNxLEAST8 "hhx" 204 | #define SCNxLEAST16 "hx" 205 | #define SCNxLEAST32 "x" 206 | #define SCNxLEAST64 __PRI64 "x" 207 | 208 | #define SCNxFAST8 "hhx" 209 | #define SCNxFAST16 "x" 210 | #define SCNxFAST32 "x" 211 | #define SCNxFAST64 __PRI64 "x" 212 | 213 | #define SCNdMAX __PRI64 "d" 214 | #define SCNiMAX __PRI64 "i" 215 | #define SCNoMAX __PRI64 "o" 216 | #define SCNuMAX __PRI64 "u" 217 | #define SCNxMAX __PRI64 "x" 218 | 219 | #define SCNdPTR __PRIPTR "d" 220 | #define SCNiPTR __PRIPTR "i" 221 | #define SCNoPTR __PRIPTR "o" 222 | #define SCNuPTR __PRIPTR "u" 223 | #define SCNxPTR __PRIPTR "x" 224 | 225 | #ifdef __cplusplus 226 | } 227 | #endif 228 | #else 229 | #include <__header_inttypes.h> 230 | #endif 231 | 232 | #endif 233 | 234 | -------------------------------------------------------------------------------- /sysroot/include/iso646.h: -------------------------------------------------------------------------------- 1 | #ifndef _ISO646_H 2 | #define _ISO646_H 3 | 4 | #ifndef __cplusplus 5 | 6 | #define and && 7 | #define and_eq &= 8 | #define bitand & 9 | #define bitor | 10 | #define compl ~ 11 | #define not ! 12 | #define not_eq != 13 | #define or || 14 | #define or_eq |= 15 | #define xor ^ 16 | #define xor_eq ^= 17 | 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sysroot/include/langinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _LANGINFO_H 2 | #define _LANGINFO_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #define __NEED_locale_t 12 | 13 | #include 14 | 15 | #define ABDAY_1 0x20000 16 | #define ABDAY_2 0x20001 17 | #define ABDAY_3 0x20002 18 | #define ABDAY_4 0x20003 19 | #define ABDAY_5 0x20004 20 | #define ABDAY_6 0x20005 21 | #define ABDAY_7 0x20006 22 | 23 | #define DAY_1 0x20007 24 | #define DAY_2 0x20008 25 | #define DAY_3 0x20009 26 | #define DAY_4 0x2000A 27 | #define DAY_5 0x2000B 28 | #define DAY_6 0x2000C 29 | #define DAY_7 0x2000D 30 | 31 | #define ABMON_1 0x2000E 32 | #define ABMON_2 0x2000F 33 | #define ABMON_3 0x20010 34 | #define ABMON_4 0x20011 35 | #define ABMON_5 0x20012 36 | #define ABMON_6 0x20013 37 | #define ABMON_7 0x20014 38 | #define ABMON_8 0x20015 39 | #define ABMON_9 0x20016 40 | #define ABMON_10 0x20017 41 | #define ABMON_11 0x20018 42 | #define ABMON_12 0x20019 43 | 44 | #define MON_1 0x2001A 45 | #define MON_2 0x2001B 46 | #define MON_3 0x2001C 47 | #define MON_4 0x2001D 48 | #define MON_5 0x2001E 49 | #define MON_6 0x2001F 50 | #define MON_7 0x20020 51 | #define MON_8 0x20021 52 | #define MON_9 0x20022 53 | #define MON_10 0x20023 54 | #define MON_11 0x20024 55 | #define MON_12 0x20025 56 | 57 | #define AM_STR 0x20026 58 | #define PM_STR 0x20027 59 | 60 | #define D_T_FMT 0x20028 61 | #define D_FMT 0x20029 62 | #define T_FMT 0x2002A 63 | #define T_FMT_AMPM 0x2002B 64 | 65 | #define ERA 0x2002C 66 | #define ERA_D_FMT 0x2002E 67 | #define ALT_DIGITS 0x2002F 68 | #define ERA_D_T_FMT 0x20030 69 | #define ERA_T_FMT 0x20031 70 | 71 | #define CODESET 14 72 | 73 | #define CRNCYSTR 0x4000F 74 | 75 | #define RADIXCHAR 0x10000 76 | #define THOUSEP 0x10001 77 | #define YESEXPR 0x50000 78 | #define NOEXPR 0x50001 79 | 80 | #define _NL_LOCALE_NAME(cat) (((cat)<<16) | 0xffff) 81 | 82 | #if defined(_GNU_SOURCE) 83 | #define NL_LOCALE_NAME(cat) _NL_LOCALE_NAME(cat) 84 | #endif 85 | 86 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 87 | #define YESSTR 0x50002 88 | #define NOSTR 0x50003 89 | #endif 90 | 91 | char *nl_langinfo(nl_item); 92 | char *nl_langinfo_l(nl_item, locale_t); 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /sysroot/include/libgen.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBGEN_H 2 | #define _LIBGEN_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | char *dirname(char *); 9 | char *basename(char *); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /sysroot/include/libintl.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBINTL_H 2 | #define _LIBINTL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __USE_GNU_GETTEXT 1 9 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 1 : -1) 10 | 11 | #if __GNUC__ >= 3 12 | #define __fa(n) __attribute__ ((__format_arg__ (n))) 13 | #else 14 | #define __fa(n) 15 | #endif 16 | 17 | char *gettext(const char *) __fa(1); 18 | char *dgettext(const char *, const char *) __fa(2); 19 | char *dcgettext(const char *, const char *, int) __fa(2); 20 | char *ngettext(const char *, const char *, unsigned long) __fa(1) __fa(2); 21 | char *dngettext(const char *, const char *, const char *, unsigned long) __fa(2) __fa(3); 22 | char *dcngettext(const char *, const char *, const char *, unsigned long, int) __fa(2) __fa(3); 23 | char *textdomain(const char *); 24 | char *bindtextdomain (const char *, const char *); 25 | char *bind_textdomain_codeset(const char *, const char *); 26 | 27 | #undef __fa 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /sysroot/include/limits.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIMITS_H 2 | #define _LIMITS_H 3 | 4 | #include 5 | 6 | /* Most limits are system-specific */ 7 | 8 | #include 9 | 10 | /* Support signed or unsigned plain-char */ 11 | 12 | #if '\xff' > 0 13 | #define CHAR_MIN 0 14 | #define CHAR_MAX 255 15 | #else 16 | #define CHAR_MIN (-128) 17 | #define CHAR_MAX 127 18 | #endif 19 | 20 | /* Some universal constants... */ 21 | 22 | #define CHAR_BIT 8 23 | #define SCHAR_MIN (-128) 24 | #define SCHAR_MAX 127 25 | #define UCHAR_MAX 255 26 | #define SHRT_MIN (-1-0x7fff) 27 | #define SHRT_MAX 0x7fff 28 | #define USHRT_MAX 0xffff 29 | #define INT_MIN (-1-0x7fffffff) 30 | #define INT_MAX 0x7fffffff 31 | #define UINT_MAX 0xffffffffU 32 | #define LONG_MIN (-LONG_MAX-1) 33 | #define ULONG_MAX (2UL*LONG_MAX+1) 34 | #define LLONG_MIN (-LLONG_MAX-1) 35 | #define ULLONG_MAX (2ULL*LLONG_MAX+1) 36 | 37 | #define MB_LEN_MAX 4 38 | 39 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 40 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 41 | 42 | #ifdef __wasilibc_unmodified_upstream /* WASI has no pipes */ 43 | #define PIPE_BUF 4096 44 | #endif 45 | #define FILESIZEBITS 64 46 | #define NAME_MAX 255 47 | #define PATH_MAX 4096 48 | #define NGROUPS_MAX 32 49 | #define ARG_MAX 131072 50 | #define IOV_MAX 1024 51 | #define SYMLOOP_MAX 40 52 | #define WORD_BIT 32 53 | #define SSIZE_MAX LONG_MAX 54 | #define TZNAME_MAX 6 55 | #define TTY_NAME_MAX 32 56 | #define HOST_NAME_MAX 255 57 | 58 | /* Implementation choices... */ 59 | 60 | #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT) 61 | #define PTHREAD_KEYS_MAX 128 62 | #define PTHREAD_STACK_MIN 2048 63 | #define PTHREAD_DESTRUCTOR_ITERATIONS 4 64 | #endif 65 | #ifdef __wasilibc_unmodified_upstream /* WASI has no semaphores */ 66 | #define SEM_VALUE_MAX 0x7fffffff 67 | #define SEM_NSEMS_MAX 256 68 | #endif 69 | #define DELAYTIMER_MAX 0x7fffffff 70 | #ifdef __wasilibc_unmodified_upstream /* WASI has no mq */ 71 | #define MQ_PRIO_MAX 32768 72 | #endif 73 | #ifdef __wasilibc_unmodified_upstream /* WASI has no usernames */ 74 | #define LOGIN_NAME_MAX 256 75 | #endif 76 | 77 | /* Arbitrary numbers... */ 78 | 79 | #ifdef __wasilibc_unmodified_upstream /* WASI has no shell commands */ 80 | #define BC_BASE_MAX 99 81 | #define BC_DIM_MAX 2048 82 | #define BC_SCALE_MAX 99 83 | #define BC_STRING_MAX 1000 84 | #endif 85 | #define CHARCLASS_NAME_MAX 14 86 | #define COLL_WEIGHTS_MAX 2 87 | #ifdef __wasilibc_unmodified_upstream /* WASI has no shell commands */ 88 | #define EXPR_NEST_MAX 32 89 | #define LINE_MAX 4096 90 | #endif 91 | #define RE_DUP_MAX 255 92 | 93 | #define NL_ARGMAX 9 94 | #define NL_MSGMAX 32767 95 | #define NL_SETMAX 255 96 | #define NL_TEXTMAX 2048 97 | 98 | #endif 99 | 100 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE) 101 | 102 | #ifdef PAGESIZE 103 | #define PAGE_SIZE PAGESIZE 104 | #endif 105 | #define NZERO 20 106 | #define NL_LANGMAX 32 107 | 108 | #endif 109 | 110 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \ 111 | || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) 112 | 113 | #define NL_NMAX 16 114 | 115 | #endif 116 | 117 | /* POSIX/SUS requirements follow. These numbers come directly 118 | * from SUS and have nothing to do with the host system. */ 119 | 120 | #define _POSIX_AIO_LISTIO_MAX 2 121 | #define _POSIX_AIO_MAX 1 122 | #define _POSIX_ARG_MAX 4096 123 | #define _POSIX_CHILD_MAX 25 124 | #define _POSIX_CLOCKRES_MIN 20000000 125 | #define _POSIX_DELAYTIMER_MAX 32 126 | #define _POSIX_HOST_NAME_MAX 255 127 | #define _POSIX_LINK_MAX 8 128 | #define _POSIX_LOGIN_NAME_MAX 9 129 | #define _POSIX_MAX_CANON 255 130 | #define _POSIX_MAX_INPUT 255 131 | #define _POSIX_MQ_OPEN_MAX 8 132 | #define _POSIX_MQ_PRIO_MAX 32 133 | #define _POSIX_NAME_MAX 14 134 | #define _POSIX_NGROUPS_MAX 8 135 | #define _POSIX_OPEN_MAX 20 136 | #define _POSIX_PATH_MAX 256 137 | #define _POSIX_PIPE_BUF 512 138 | #define _POSIX_RE_DUP_MAX 255 139 | #define _POSIX_RTSIG_MAX 8 140 | #define _POSIX_SEM_NSEMS_MAX 256 141 | #define _POSIX_SEM_VALUE_MAX 32767 142 | #define _POSIX_SIGQUEUE_MAX 32 143 | #define _POSIX_SSIZE_MAX 32767 144 | #define _POSIX_STREAM_MAX 8 145 | #define _POSIX_SS_REPL_MAX 4 146 | #define _POSIX_SYMLINK_MAX 255 147 | #define _POSIX_SYMLOOP_MAX 8 148 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 149 | #define _POSIX_THREAD_KEYS_MAX 128 150 | #define _POSIX_THREAD_THREADS_MAX 64 151 | #define _POSIX_TIMER_MAX 32 152 | #define _POSIX_TRACE_EVENT_NAME_MAX 30 153 | #define _POSIX_TRACE_NAME_MAX 8 154 | #define _POSIX_TRACE_SYS_MAX 8 155 | #define _POSIX_TRACE_USER_EVENT_MAX 32 156 | #define _POSIX_TTY_NAME_MAX 9 157 | #define _POSIX_TZNAME_MAX 6 158 | #define _POSIX2_BC_BASE_MAX 99 159 | #define _POSIX2_BC_DIM_MAX 2048 160 | #define _POSIX2_BC_SCALE_MAX 99 161 | #define _POSIX2_BC_STRING_MAX 1000 162 | #define _POSIX2_CHARCLASS_NAME_MAX 14 163 | #define _POSIX2_COLL_WEIGHTS_MAX 2 164 | #define _POSIX2_EXPR_NEST_MAX 32 165 | #define _POSIX2_LINE_MAX 2048 166 | #define _POSIX2_RE_DUP_MAX 255 167 | 168 | #define _XOPEN_IOV_MAX 16 169 | #define _XOPEN_NAME_MAX 255 170 | #define _XOPEN_PATH_MAX 1024 171 | 172 | #endif 173 | -------------------------------------------------------------------------------- /sysroot/include/locale.h: -------------------------------------------------------------------------------- 1 | #ifndef _LOCALE_H 2 | #define _LOCALE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's definition of NULL */ 11 | #ifdef __cplusplus 12 | #define NULL 0L 13 | #else 14 | #define NULL ((void*)0) 15 | #endif 16 | #else 17 | #define __need_NULL 18 | #include 19 | #endif 20 | 21 | #define LC_CTYPE 0 22 | #define LC_NUMERIC 1 23 | #define LC_TIME 2 24 | #define LC_COLLATE 3 25 | #define LC_MONETARY 4 26 | #define LC_MESSAGES 5 27 | #define LC_ALL 6 28 | 29 | struct lconv { 30 | char *decimal_point; 31 | char *thousands_sep; 32 | char *grouping; 33 | 34 | char *int_curr_symbol; 35 | char *currency_symbol; 36 | char *mon_decimal_point; 37 | char *mon_thousands_sep; 38 | char *mon_grouping; 39 | char *positive_sign; 40 | char *negative_sign; 41 | char int_frac_digits; 42 | char frac_digits; 43 | char p_cs_precedes; 44 | char p_sep_by_space; 45 | char n_cs_precedes; 46 | char n_sep_by_space; 47 | char p_sign_posn; 48 | char n_sign_posn; 49 | char int_p_cs_precedes; 50 | char int_p_sep_by_space; 51 | char int_n_cs_precedes; 52 | char int_n_sep_by_space; 53 | char int_p_sign_posn; 54 | char int_n_sign_posn; 55 | }; 56 | 57 | 58 | char *setlocale (int, const char *); 59 | struct lconv *localeconv(void); 60 | 61 | 62 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 63 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 64 | 65 | #define __NEED_locale_t 66 | 67 | #include 68 | 69 | #define LC_GLOBAL_LOCALE ((locale_t)-1) 70 | 71 | #define LC_CTYPE_MASK (1< 7 | #endif 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define __NEED_size_t 13 | 14 | #include 15 | 16 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 17 | void *malloc (size_t); 18 | void *calloc (size_t, size_t); 19 | void *realloc (void *, size_t); 20 | void free (void *); 21 | #endif 22 | #ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ 23 | void *valloc (size_t); 24 | void *memalign(size_t, size_t); 25 | #endif 26 | 27 | size_t malloc_usable_size(void *); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /sysroot/include/memory.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /sysroot/include/monetary.h: -------------------------------------------------------------------------------- 1 | #ifndef _MONETARY_H 2 | #define _MONETARY_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_ssize_t 11 | #define __NEED_size_t 12 | #define __NEED_locale_t 13 | 14 | #include 15 | 16 | ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...); 17 | ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /sysroot/include/mqueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _MQUEUE_H 2 | #define _MQUEUE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #define __NEED_size_t 10 | #define __NEED_ssize_t 11 | #define __NEED_pthread_attr_t 12 | #define __NEED_time_t 13 | #define __NEED_struct_timespec 14 | #include 15 | 16 | typedef int mqd_t; 17 | struct mq_attr { 18 | long mq_flags, mq_maxmsg, mq_msgsize, mq_curmsgs, __unused[4]; 19 | }; 20 | struct sigevent; 21 | 22 | int mq_close(mqd_t); 23 | int mq_getattr(mqd_t, struct mq_attr *); 24 | int mq_notify(mqd_t, const struct sigevent *); 25 | mqd_t mq_open(const char *, int, ...); 26 | ssize_t mq_receive(mqd_t, char *, size_t, unsigned *); 27 | int mq_send(mqd_t, const char *, size_t, unsigned); 28 | int mq_setattr(mqd_t, const struct mq_attr *__restrict, struct mq_attr *__restrict); 29 | ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, const struct timespec *__restrict); 30 | int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *); 31 | int mq_unlink(const char *); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /sysroot/include/netinet/igmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_IGMP_H 2 | #define _NETINET_IGMP_H 3 | 4 | #include 5 | #include 6 | 7 | struct igmp { 8 | uint8_t igmp_type; 9 | uint8_t igmp_code; 10 | uint16_t igmp_cksum; 11 | struct in_addr igmp_group; 12 | }; 13 | 14 | #define IGMP_MINLEN 8 15 | 16 | #define IGMP_MEMBERSHIP_QUERY 0x11 17 | #define IGMP_V1_MEMBERSHIP_REPORT 0x12 18 | #define IGMP_V2_MEMBERSHIP_REPORT 0x16 19 | #define IGMP_V2_LEAVE_GROUP 0x17 20 | 21 | #define IGMP_DVMRP 0x13 22 | #define IGMP_PIM 0x14 23 | #define IGMP_TRACE 0x15 24 | 25 | #define IGMP_MTRACE_RESP 0x1e 26 | #define IGMP_MTRACE 0x1f 27 | 28 | #define IGMP_MAX_HOST_REPORT_DELAY 10 29 | #define IGMP_TIMER_SCALE 10 30 | 31 | #define IGMP_DELAYING_MEMBER 1 32 | #define IGMP_IDLE_MEMBER 2 33 | #define IGMP_LAZY_MEMBER 3 34 | #define IGMP_SLEEPING_MEMBER 4 35 | #define IGMP_AWAKENING_MEMBER 5 36 | 37 | #define IGMP_v1_ROUTER 1 38 | #define IGMP_v2_ROUTER 2 39 | 40 | #define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY 41 | #define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT 42 | #define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT 43 | #define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /sysroot/include/netinet/in_systm.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_IN_SYSTM_H 2 | #define _NETINET_IN_SYSTM_H 3 | 4 | #include 5 | 6 | typedef uint16_t n_short; 7 | typedef uint32_t n_long, n_time; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /sysroot/include/netinet/ip.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_IP_H 2 | #define _NETINET_IP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | struct timestamp { 13 | uint8_t len; 14 | uint8_t ptr; 15 | #if __BYTE_ORDER == __LITTLE_ENDIAN 16 | unsigned int flags:4; 17 | unsigned int overflow:4; 18 | #else 19 | unsigned int overflow:4; 20 | unsigned int flags:4; 21 | #endif 22 | uint32_t data[9]; 23 | }; 24 | 25 | struct iphdr { 26 | #if __BYTE_ORDER == __LITTLE_ENDIAN 27 | unsigned int ihl:4; 28 | unsigned int version:4; 29 | #else 30 | unsigned int version:4; 31 | unsigned int ihl:4; 32 | #endif 33 | uint8_t tos; 34 | uint16_t tot_len; 35 | uint16_t id; 36 | uint16_t frag_off; 37 | uint8_t ttl; 38 | uint8_t protocol; 39 | uint16_t check; 40 | uint32_t saddr; 41 | uint32_t daddr; 42 | }; 43 | 44 | struct ip { 45 | #if __BYTE_ORDER == __LITTLE_ENDIAN 46 | unsigned int ip_hl:4; 47 | unsigned int ip_v:4; 48 | #else 49 | unsigned int ip_v:4; 50 | unsigned int ip_hl:4; 51 | #endif 52 | uint8_t ip_tos; 53 | uint16_t ip_len; 54 | uint16_t ip_id; 55 | uint16_t ip_off; 56 | uint8_t ip_ttl; 57 | uint8_t ip_p; 58 | uint16_t ip_sum; 59 | struct in_addr ip_src, ip_dst; 60 | }; 61 | 62 | #define IP_RF 0x8000 63 | #define IP_DF 0x4000 64 | #define IP_MF 0x2000 65 | #define IP_OFFMASK 0x1fff 66 | 67 | struct ip_timestamp { 68 | uint8_t ipt_code; 69 | uint8_t ipt_len; 70 | uint8_t ipt_ptr; 71 | #if __BYTE_ORDER == __LITTLE_ENDIAN 72 | unsigned int ipt_flg:4; 73 | unsigned int ipt_oflw:4; 74 | #else 75 | unsigned int ipt_oflw:4; 76 | unsigned int ipt_flg:4; 77 | #endif 78 | uint32_t data[9]; 79 | }; 80 | 81 | #define IPVERSION 4 82 | #define IP_MAXPACKET 65535 83 | 84 | #define IPTOS_ECN_MASK 0x03 85 | #define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK) 86 | #define IPTOS_ECN_NOT_ECT 0x00 87 | #define IPTOS_ECN_ECT1 0x01 88 | #define IPTOS_ECN_ECT0 0x02 89 | #define IPTOS_ECN_CE 0x03 90 | 91 | #define IPTOS_DSCP_MASK 0xfc 92 | #define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK) 93 | #define IPTOS_DSCP_AF11 0x28 94 | #define IPTOS_DSCP_AF12 0x30 95 | #define IPTOS_DSCP_AF13 0x38 96 | #define IPTOS_DSCP_AF21 0x48 97 | #define IPTOS_DSCP_AF22 0x50 98 | #define IPTOS_DSCP_AF23 0x58 99 | #define IPTOS_DSCP_AF31 0x68 100 | #define IPTOS_DSCP_AF32 0x70 101 | #define IPTOS_DSCP_AF33 0x78 102 | #define IPTOS_DSCP_AF41 0x88 103 | #define IPTOS_DSCP_AF42 0x90 104 | #define IPTOS_DSCP_AF43 0x98 105 | #define IPTOS_DSCP_EF 0xb8 106 | 107 | #define IPTOS_CLASS_MASK 0xe0 108 | #define IPTOS_CLASS(x) ((x) & IPTOS_CLASS_MASK) 109 | #define IPTOS_CLASS_CS0 0x00 110 | #define IPTOS_CLASS_CS1 0x20 111 | #define IPTOS_CLASS_CS2 0x40 112 | #define IPTOS_CLASS_CS3 0x60 113 | #define IPTOS_CLASS_CS4 0x80 114 | #define IPTOS_CLASS_CS5 0xa0 115 | #define IPTOS_CLASS_CS6 0xc0 116 | #define IPTOS_CLASS_CS7 0xe0 117 | #define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0 118 | 119 | #define IPTOS_TOS_MASK 0x1E 120 | #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) 121 | #define IPTOS_LOWDELAY 0x10 122 | #define IPTOS_THROUGHPUT 0x08 123 | #define IPTOS_RELIABILITY 0x04 124 | #define IPTOS_LOWCOST 0x02 125 | #define IPTOS_MINCOST IPTOS_LOWCOST 126 | 127 | #define IPTOS_PREC_MASK 0xe0 128 | #define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) 129 | #define IPTOS_PREC_NETCONTROL 0xe0 130 | #define IPTOS_PREC_INTERNETCONTROL 0xc0 131 | #define IPTOS_PREC_CRITIC_ECP 0xa0 132 | #define IPTOS_PREC_FLASHOVERRIDE 0x80 133 | #define IPTOS_PREC_FLASH 0x60 134 | #define IPTOS_PREC_IMMEDIATE 0x40 135 | #define IPTOS_PREC_PRIORITY 0x20 136 | #define IPTOS_PREC_ROUTINE 0x00 137 | 138 | #define IPOPT_COPY 0x80 139 | #define IPOPT_CLASS_MASK 0x60 140 | #define IPOPT_NUMBER_MASK 0x1f 141 | 142 | #define IPOPT_COPIED(o) ((o) & IPOPT_COPY) 143 | #define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK) 144 | #define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK) 145 | 146 | #define IPOPT_CONTROL 0x00 147 | #define IPOPT_RESERVED1 0x20 148 | #define IPOPT_DEBMEAS 0x40 149 | #define IPOPT_MEASUREMENT IPOPT_DEBMEAS 150 | #define IPOPT_RESERVED2 0x60 151 | 152 | #define IPOPT_EOL 0 153 | #define IPOPT_END IPOPT_EOL 154 | #define IPOPT_NOP 1 155 | #define IPOPT_NOOP IPOPT_NOP 156 | 157 | #define IPOPT_RR 7 158 | #define IPOPT_TS 68 159 | #define IPOPT_TIMESTAMP IPOPT_TS 160 | #define IPOPT_SECURITY 130 161 | #define IPOPT_SEC IPOPT_SECURITY 162 | #define IPOPT_LSRR 131 163 | #define IPOPT_SATID 136 164 | #define IPOPT_SID IPOPT_SATID 165 | #define IPOPT_SSRR 137 166 | #define IPOPT_RA 148 167 | 168 | #define IPOPT_OPTVAL 0 169 | #define IPOPT_OLEN 1 170 | #define IPOPT_OFFSET 2 171 | #define IPOPT_MINOFF 4 172 | 173 | #define MAX_IPOPTLEN 40 174 | 175 | #define IPOPT_TS_TSONLY 0 176 | #define IPOPT_TS_TSANDADDR 1 177 | #define IPOPT_TS_PRESPEC 3 178 | 179 | #define IPOPT_SECUR_UNCLASS 0x0000 180 | #define IPOPT_SECUR_CONFID 0xf135 181 | #define IPOPT_SECUR_EFTO 0x789a 182 | #define IPOPT_SECUR_MMMM 0xbc4d 183 | #define IPOPT_SECUR_RESTR 0xaf13 184 | #define IPOPT_SECUR_SECRET 0xd788 185 | #define IPOPT_SECUR_TOPSECRET 0x6bc5 186 | 187 | #define MAXTTL 255 188 | #define IPDEFTTL 64 189 | #define IPFRAGTTL 60 190 | #define IPTTLDEC 1 191 | 192 | #define IP_MSS 576 193 | 194 | #ifdef __cplusplus 195 | } 196 | #endif 197 | 198 | #endif 199 | -------------------------------------------------------------------------------- /sysroot/include/netinet/ip6.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_IP6_H 2 | #define _NETINET_IP6_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | struct ip6_hdr { 13 | union { 14 | struct ip6_hdrctl { 15 | uint32_t ip6_un1_flow; 16 | uint16_t ip6_un1_plen; 17 | uint8_t ip6_un1_nxt; 18 | uint8_t ip6_un1_hlim; 19 | } ip6_un1; 20 | uint8_t ip6_un2_vfc; 21 | } ip6_ctlun; 22 | struct in6_addr ip6_src; 23 | struct in6_addr ip6_dst; 24 | }; 25 | 26 | #define ip6_vfc ip6_ctlun.ip6_un2_vfc 27 | #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow 28 | #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen 29 | #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt 30 | #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim 31 | #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim 32 | 33 | struct ip6_ext { 34 | uint8_t ip6e_nxt; 35 | uint8_t ip6e_len; 36 | }; 37 | 38 | struct ip6_hbh { 39 | uint8_t ip6h_nxt; 40 | uint8_t ip6h_len; 41 | }; 42 | 43 | struct ip6_dest { 44 | uint8_t ip6d_nxt; 45 | uint8_t ip6d_len; 46 | }; 47 | 48 | struct ip6_rthdr { 49 | uint8_t ip6r_nxt; 50 | uint8_t ip6r_len; 51 | uint8_t ip6r_type; 52 | uint8_t ip6r_segleft; 53 | }; 54 | 55 | struct ip6_rthdr0 { 56 | uint8_t ip6r0_nxt; 57 | uint8_t ip6r0_len; 58 | uint8_t ip6r0_type; 59 | uint8_t ip6r0_segleft; 60 | uint8_t ip6r0_reserved; 61 | uint8_t ip6r0_slmap[3]; 62 | struct in6_addr ip6r0_addr[]; 63 | }; 64 | 65 | struct ip6_frag { 66 | uint8_t ip6f_nxt; 67 | uint8_t ip6f_reserved; 68 | uint16_t ip6f_offlg; 69 | uint32_t ip6f_ident; 70 | }; 71 | 72 | #if __BYTE_ORDER == __BIG_ENDIAN 73 | #define IP6F_OFF_MASK 0xfff8 74 | #define IP6F_RESERVED_MASK 0x0006 75 | #define IP6F_MORE_FRAG 0x0001 76 | #else 77 | #define IP6F_OFF_MASK 0xf8ff 78 | #define IP6F_RESERVED_MASK 0x0600 79 | #define IP6F_MORE_FRAG 0x0100 80 | #endif 81 | 82 | struct ip6_opt { 83 | uint8_t ip6o_type; 84 | uint8_t ip6o_len; 85 | }; 86 | 87 | #define IP6OPT_TYPE(o) ((o) & 0xc0) 88 | #define IP6OPT_TYPE_SKIP 0x00 89 | #define IP6OPT_TYPE_DISCARD 0x40 90 | #define IP6OPT_TYPE_FORCEICMP 0x80 91 | #define IP6OPT_TYPE_ICMP 0xc0 92 | #define IP6OPT_TYPE_MUTABLE 0x20 93 | 94 | #define IP6OPT_PAD1 0 95 | #define IP6OPT_PADN 1 96 | 97 | #define IP6OPT_JUMBO 0xc2 98 | #define IP6OPT_NSAP_ADDR 0xc3 99 | #define IP6OPT_TUNNEL_LIMIT 0x04 100 | #define IP6OPT_ROUTER_ALERT 0x05 101 | 102 | struct ip6_opt_jumbo { 103 | uint8_t ip6oj_type; 104 | uint8_t ip6oj_len; 105 | uint8_t ip6oj_jumbo_len[4]; 106 | }; 107 | #define IP6OPT_JUMBO_LEN 6 108 | 109 | struct ip6_opt_nsap { 110 | uint8_t ip6on_type; 111 | uint8_t ip6on_len; 112 | uint8_t ip6on_src_nsap_len; 113 | uint8_t ip6on_dst_nsap_len; 114 | }; 115 | 116 | struct ip6_opt_tunnel { 117 | uint8_t ip6ot_type; 118 | uint8_t ip6ot_len; 119 | uint8_t ip6ot_encap_limit; 120 | }; 121 | 122 | struct ip6_opt_router { 123 | uint8_t ip6or_type; 124 | uint8_t ip6or_len; 125 | uint8_t ip6or_value[2]; 126 | }; 127 | 128 | #if __BYTE_ORDER == __BIG_ENDIAN 129 | #define IP6_ALERT_MLD 0x0000 130 | #define IP6_ALERT_RSVP 0x0001 131 | #define IP6_ALERT_AN 0x0002 132 | #else 133 | #define IP6_ALERT_MLD 0x0000 134 | #define IP6_ALERT_RSVP 0x0100 135 | #define IP6_ALERT_AN 0x0200 136 | #endif 137 | 138 | #ifdef __cplusplus 139 | } 140 | #endif 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /sysroot/include/netinet/ip_icmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_IP_ICMP_H 2 | #define _NETINET_IP_ICMP_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct icmphdr { 13 | uint8_t type; 14 | uint8_t code; 15 | uint16_t checksum; 16 | union { 17 | struct { 18 | uint16_t id; 19 | uint16_t sequence; 20 | } echo; 21 | uint32_t gateway; 22 | struct { 23 | uint16_t __unused; 24 | uint16_t mtu; 25 | } frag; 26 | uint8_t reserved[4]; 27 | } un; 28 | }; 29 | 30 | #define ICMP_ECHOREPLY 0 31 | #define ICMP_DEST_UNREACH 3 32 | #define ICMP_SOURCE_QUENCH 4 33 | #define ICMP_REDIRECT 5 34 | #define ICMP_ECHO 8 35 | #define ICMP_TIME_EXCEEDED 11 36 | #define ICMP_PARAMETERPROB 12 37 | #define ICMP_TIMESTAMP 13 38 | #define ICMP_TIMESTAMPREPLY 14 39 | #define ICMP_INFO_REQUEST 15 40 | #define ICMP_INFO_REPLY 16 41 | #define ICMP_ADDRESS 17 42 | #define ICMP_ADDRESSREPLY 18 43 | #define NR_ICMP_TYPES 18 44 | 45 | 46 | #define ICMP_NET_UNREACH 0 47 | #define ICMP_HOST_UNREACH 1 48 | #define ICMP_PROT_UNREACH 2 49 | #define ICMP_PORT_UNREACH 3 50 | #define ICMP_FRAG_NEEDED 4 51 | #define ICMP_SR_FAILED 5 52 | #define ICMP_NET_UNKNOWN 6 53 | #define ICMP_HOST_UNKNOWN 7 54 | #define ICMP_HOST_ISOLATED 8 55 | #define ICMP_NET_ANO 9 56 | #define ICMP_HOST_ANO 10 57 | #define ICMP_NET_UNR_TOS 11 58 | #define ICMP_HOST_UNR_TOS 12 59 | #define ICMP_PKT_FILTERED 13 60 | #define ICMP_PREC_VIOLATION 14 61 | #define ICMP_PREC_CUTOFF 15 62 | #define NR_ICMP_UNREACH 15 63 | 64 | #define ICMP_REDIR_NET 0 65 | #define ICMP_REDIR_HOST 1 66 | #define ICMP_REDIR_NETTOS 2 67 | #define ICMP_REDIR_HOSTTOS 3 68 | 69 | #define ICMP_EXC_TTL 0 70 | #define ICMP_EXC_FRAGTIME 1 71 | 72 | 73 | struct icmp_ra_addr { 74 | uint32_t ira_addr; 75 | uint32_t ira_preference; 76 | }; 77 | 78 | struct icmp { 79 | uint8_t icmp_type; 80 | uint8_t icmp_code; 81 | uint16_t icmp_cksum; 82 | union { 83 | uint8_t ih_pptr; 84 | struct in_addr ih_gwaddr; 85 | struct ih_idseq { 86 | uint16_t icd_id; 87 | uint16_t icd_seq; 88 | } ih_idseq; 89 | uint32_t ih_void; 90 | 91 | struct ih_pmtu { 92 | uint16_t ipm_void; 93 | uint16_t ipm_nextmtu; 94 | } ih_pmtu; 95 | 96 | struct ih_rtradv { 97 | uint8_t irt_num_addrs; 98 | uint8_t irt_wpa; 99 | uint16_t irt_lifetime; 100 | } ih_rtradv; 101 | } icmp_hun; 102 | union { 103 | struct { 104 | uint32_t its_otime; 105 | uint32_t its_rtime; 106 | uint32_t its_ttime; 107 | } id_ts; 108 | struct { 109 | struct ip idi_ip; 110 | } id_ip; 111 | struct icmp_ra_addr id_radv; 112 | uint32_t id_mask; 113 | uint8_t id_data[1]; 114 | } icmp_dun; 115 | }; 116 | 117 | #define icmp_pptr icmp_hun.ih_pptr 118 | #define icmp_gwaddr icmp_hun.ih_gwaddr 119 | #define icmp_id icmp_hun.ih_idseq.icd_id 120 | #define icmp_seq icmp_hun.ih_idseq.icd_seq 121 | #define icmp_void icmp_hun.ih_void 122 | #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void 123 | #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu 124 | #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs 125 | #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa 126 | #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime 127 | #define icmp_otime icmp_dun.id_ts.its_otime 128 | #define icmp_rtime icmp_dun.id_ts.its_rtime 129 | #define icmp_ttime icmp_dun.id_ts.its_ttime 130 | #define icmp_ip icmp_dun.id_ip.idi_ip 131 | #define icmp_radv icmp_dun.id_radv 132 | #define icmp_mask icmp_dun.id_mask 133 | #define icmp_data icmp_dun.id_data 134 | 135 | #define ICMP_MINLEN 8 136 | #define ICMP_TSLEN (8 + 3 * sizeof (n_time)) 137 | #define ICMP_MASKLEN 12 138 | #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) 139 | #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) 140 | 141 | #define ICMP_UNREACH 3 142 | #define ICMP_SOURCEQUENCH 4 143 | #define ICMP_ROUTERADVERT 9 144 | #define ICMP_ROUTERSOLICIT 10 145 | #define ICMP_TIMXCEED 11 146 | #define ICMP_PARAMPROB 12 147 | #define ICMP_TSTAMP 13 148 | #define ICMP_TSTAMPREPLY 14 149 | #define ICMP_IREQ 15 150 | #define ICMP_IREQREPLY 16 151 | #define ICMP_MASKREQ 17 152 | #define ICMP_MASKREPLY 18 153 | #define ICMP_MAXTYPE 18 154 | 155 | #define ICMP_UNREACH_NET 0 156 | #define ICMP_UNREACH_HOST 1 157 | #define ICMP_UNREACH_PROTOCOL 2 158 | #define ICMP_UNREACH_PORT 3 159 | #define ICMP_UNREACH_NEEDFRAG 4 160 | #define ICMP_UNREACH_SRCFAIL 5 161 | #define ICMP_UNREACH_NET_UNKNOWN 6 162 | #define ICMP_UNREACH_HOST_UNKNOWN 7 163 | #define ICMP_UNREACH_ISOLATED 8 164 | #define ICMP_UNREACH_NET_PROHIB 9 165 | #define ICMP_UNREACH_HOST_PROHIB 10 166 | #define ICMP_UNREACH_TOSNET 11 167 | #define ICMP_UNREACH_TOSHOST 12 168 | #define ICMP_UNREACH_FILTER_PROHIB 13 169 | #define ICMP_UNREACH_HOST_PRECEDENCE 14 170 | #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 171 | 172 | #define ICMP_REDIRECT_NET 0 173 | #define ICMP_REDIRECT_HOST 1 174 | #define ICMP_REDIRECT_TOSNET 2 175 | #define ICMP_REDIRECT_TOSHOST 3 176 | 177 | #define ICMP_TIMXCEED_INTRANS 0 178 | #define ICMP_TIMXCEED_REASS 1 179 | 180 | #define ICMP_PARAMPROB_OPTABSENT 1 181 | 182 | #define ICMP_INFOTYPE(type) \ 183 | ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ 184 | (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ 185 | (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ 186 | (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ 187 | (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) 188 | 189 | #ifdef __cplusplus 190 | } 191 | #endif 192 | 193 | #endif 194 | -------------------------------------------------------------------------------- /sysroot/include/netinet/udp.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_UDP_H 2 | #define _NETINET_UDP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #ifdef _GNU_SOURCE 12 | #define uh_sport source 13 | #define uh_dport dest 14 | #define uh_ulen len 15 | #define uh_sum check 16 | #endif 17 | 18 | struct udphdr { 19 | uint16_t uh_sport; 20 | uint16_t uh_dport; 21 | uint16_t uh_ulen; 22 | uint16_t uh_sum; 23 | }; 24 | 25 | #define UDP_CORK 1 26 | #define UDP_ENCAP 100 27 | #define UDP_NO_CHECK6_TX 101 28 | #define UDP_NO_CHECK6_RX 102 29 | #define UDP_SEGMENT 103 30 | #define UDP_GRO 104 31 | 32 | #define UDP_ENCAP_ESPINUDP_NON_IKE 1 33 | #define UDP_ENCAP_ESPINUDP 2 34 | #define UDP_ENCAP_L2TPINUDP 3 35 | #define UDP_ENCAP_GTP0 4 36 | #define UDP_ENCAP_GTP1U 5 37 | #define UDP_ENCAP_RXRPC 6 38 | 39 | #define SOL_UDP 17 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /sysroot/include/netpacket/packet.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETPACKET_PACKET_H 2 | #define _NETPACKET_PACKET_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct sockaddr_ll { 9 | unsigned short sll_family, sll_protocol; 10 | int sll_ifindex; 11 | unsigned short sll_hatype; 12 | unsigned char sll_pkttype, sll_halen; 13 | unsigned char sll_addr[8]; 14 | }; 15 | 16 | struct packet_mreq { 17 | int mr_ifindex; 18 | unsigned short int mr_type, mr_alen; 19 | unsigned char mr_address[8]; 20 | }; 21 | 22 | #define PACKET_HOST 0 23 | #define PACKET_BROADCAST 1 24 | #define PACKET_MULTICAST 2 25 | #define PACKET_OTHERHOST 3 26 | #define PACKET_OUTGOING 4 27 | #define PACKET_LOOPBACK 5 28 | #define PACKET_FASTROUTE 6 29 | 30 | #define PACKET_ADD_MEMBERSHIP 1 31 | #define PACKET_DROP_MEMBERSHIP 2 32 | #define PACKET_RECV_OUTPUT 3 33 | #define PACKET_RX_RING 5 34 | #define PACKET_STATISTICS 6 35 | #define PACKET_COPY_THRESH 7 36 | #define PACKET_AUXDATA 8 37 | #define PACKET_ORIGDEV 9 38 | #define PACKET_VERSION 10 39 | #define PACKET_HDRLEN 11 40 | #define PACKET_RESERVE 12 41 | #define PACKET_TX_RING 13 42 | #define PACKET_LOSS 14 43 | #define PACKET_VNET_HDR 15 44 | #define PACKET_TX_TIMESTAMP 16 45 | #define PACKET_TIMESTAMP 17 46 | #define PACKET_FANOUT 18 47 | #define PACKET_TX_HAS_OFF 19 48 | #define PACKET_QDISC_BYPASS 20 49 | #define PACKET_ROLLOVER_STATS 21 50 | #define PACKET_FANOUT_DATA 22 51 | #define PACKET_IGNORE_OUTGOING 23 52 | 53 | #define PACKET_MR_MULTICAST 0 54 | #define PACKET_MR_PROMISC 1 55 | #define PACKET_MR_ALLMULTI 2 56 | #define PACKET_MR_UNICAST 3 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /sysroot/include/nl_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _NL_TYPES_H 2 | #define _NL_TYPES_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define NL_SETD 1 9 | #define NL_CAT_LOCALE 1 10 | 11 | typedef int nl_item; 12 | typedef void *nl_catd; 13 | 14 | nl_catd catopen (const char *, int); 15 | char *catgets (nl_catd, int, int, const char *); 16 | int catclose (nl_catd); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sysroot/include/poll.h: -------------------------------------------------------------------------------- 1 | #ifndef _POLL_H 2 | #define _POLL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #include 11 | 12 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 13 | #define POLLIN 0x001 14 | #define POLLPRI 0x002 15 | #define POLLOUT 0x004 16 | #define POLLERR 0x008 17 | #define POLLHUP 0x010 18 | #define POLLNVAL 0x020 19 | #define POLLRDNORM 0x040 20 | #define POLLRDBAND 0x080 21 | #ifndef POLLWRNORM 22 | #define POLLWRNORM 0x100 23 | #define POLLWRBAND 0x200 24 | #endif 25 | #ifndef POLLMSG 26 | #define POLLMSG 0x400 27 | #define POLLRDHUP 0x2000 28 | #endif 29 | #else 30 | #include <__header_poll.h> 31 | #endif 32 | 33 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 34 | typedef unsigned long nfds_t; 35 | #else 36 | #include <__typedef_nfds_t.h> 37 | #endif 38 | 39 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 40 | struct pollfd { 41 | int fd; 42 | short events; 43 | short revents; 44 | }; 45 | #else 46 | #include <__struct_pollfd.h> 47 | #endif 48 | 49 | int poll (struct pollfd *, nfds_t, int); 50 | 51 | #ifdef _GNU_SOURCE 52 | #define __NEED_time_t 53 | #define __NEED_struct_timespec 54 | #define __NEED_sigset_t 55 | #include 56 | int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); 57 | #endif 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /sysroot/include/regex.h: -------------------------------------------------------------------------------- 1 | #ifndef _REGEX_H 2 | #define _REGEX_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_regoff_t 11 | #define __NEED_size_t 12 | 13 | #include 14 | 15 | typedef struct re_pattern_buffer { 16 | size_t re_nsub; 17 | void *__opaque, *__padding[4]; 18 | size_t __nsub2; 19 | char __padding2; 20 | } regex_t; 21 | 22 | typedef struct { 23 | regoff_t rm_so; 24 | regoff_t rm_eo; 25 | } regmatch_t; 26 | 27 | #define REG_EXTENDED 1 28 | #define REG_ICASE 2 29 | #define REG_NEWLINE 4 30 | #define REG_NOSUB 8 31 | 32 | #define REG_NOTBOL 1 33 | #define REG_NOTEOL 2 34 | 35 | #define REG_OK 0 36 | #define REG_NOMATCH 1 37 | #define REG_BADPAT 2 38 | #define REG_ECOLLATE 3 39 | #define REG_ECTYPE 4 40 | #define REG_EESCAPE 5 41 | #define REG_ESUBREG 6 42 | #define REG_EBRACK 7 43 | #define REG_EPAREN 8 44 | #define REG_EBRACE 9 45 | #define REG_BADBR 10 46 | #define REG_ERANGE 11 47 | #define REG_ESPACE 12 48 | #define REG_BADRPT 13 49 | 50 | #define REG_ENOSYS -1 51 | 52 | int regcomp(regex_t *__restrict, const char *__restrict, int); 53 | int regexec(const regex_t *__restrict, const char *__restrict, size_t, regmatch_t *__restrict, int); 54 | void regfree(regex_t *); 55 | 56 | size_t regerror(int, const regex_t *__restrict, char *__restrict, size_t); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /sysroot/include/sched.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCHED_H 2 | #define _SCHED_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #define __NEED_struct_timespec 10 | #define __NEED_pid_t 11 | #define __NEED_time_t 12 | 13 | #ifdef _GNU_SOURCE 14 | #define __NEED_size_t 15 | #endif 16 | 17 | #include 18 | 19 | #ifdef __wasilibc_unmodified_upstream /* WASI has no CPU scheduling support. */ 20 | struct sched_param { 21 | int sched_priority; 22 | int sched_ss_low_priority; 23 | struct timespec sched_ss_repl_period; 24 | struct timespec sched_ss_init_budget; 25 | int sched_ss_max_repl; 26 | }; 27 | 28 | int sched_get_priority_max(int); 29 | int sched_get_priority_min(int); 30 | int sched_getparam(pid_t, struct sched_param *); 31 | int sched_getscheduler(pid_t); 32 | int sched_rr_get_interval(pid_t, struct timespec *); 33 | int sched_setparam(pid_t, const struct sched_param *); 34 | int sched_setscheduler(pid_t, int, const struct sched_param *); 35 | #endif 36 | int sched_yield(void); 37 | 38 | #ifdef __wasilibc_unmodified_upstream /* WASI has no CPU scheduling support. */ 39 | #define SCHED_OTHER 0 40 | #define SCHED_FIFO 1 41 | #define SCHED_RR 2 42 | #define SCHED_BATCH 3 43 | #define SCHED_IDLE 5 44 | #define SCHED_DEADLINE 6 45 | #define SCHED_RESET_ON_FORK 0x40000000 46 | 47 | #ifdef _GNU_SOURCE 48 | #define CSIGNAL 0x000000ff 49 | #define CLONE_VM 0x00000100 50 | #define CLONE_FS 0x00000200 51 | #define CLONE_FILES 0x00000400 52 | #define CLONE_SIGHAND 0x00000800 53 | #define CLONE_PTRACE 0x00002000 54 | #define CLONE_VFORK 0x00004000 55 | #define CLONE_PARENT 0x00008000 56 | #define CLONE_THREAD 0x00010000 57 | #define CLONE_NEWNS 0x00020000 58 | #define CLONE_SYSVSEM 0x00040000 59 | #define CLONE_SETTLS 0x00080000 60 | #define CLONE_PARENT_SETTID 0x00100000 61 | #define CLONE_CHILD_CLEARTID 0x00200000 62 | #define CLONE_DETACHED 0x00400000 63 | #define CLONE_UNTRACED 0x00800000 64 | #define CLONE_CHILD_SETTID 0x01000000 65 | #define CLONE_NEWCGROUP 0x02000000 66 | #define CLONE_NEWUTS 0x04000000 67 | #define CLONE_NEWIPC 0x08000000 68 | #define CLONE_NEWUSER 0x10000000 69 | #define CLONE_NEWPID 0x20000000 70 | #define CLONE_NEWNET 0x40000000 71 | #define CLONE_IO 0x80000000 72 | int clone (int (*)(void *), void *, int, void *, ...); 73 | int unshare(int); 74 | int setns(int, int); 75 | 76 | void *memcpy(void *__restrict, const void *__restrict, size_t); 77 | int memcmp(const void *, const void *, size_t); 78 | void *memset (void *, int, size_t); 79 | void *calloc(size_t, size_t); 80 | void free(void *); 81 | 82 | typedef struct cpu_set_t { unsigned long __bits[128/sizeof(long)]; } cpu_set_t; 83 | int __sched_cpucount(size_t, const cpu_set_t *); 84 | int sched_getcpu(void); 85 | int sched_getaffinity(pid_t, size_t, cpu_set_t *); 86 | int sched_setaffinity(pid_t, size_t, const cpu_set_t *); 87 | 88 | #define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \ 89 | (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) ) 90 | 91 | #define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=) 92 | #define CPU_CLR_S(i, size, set) __CPU_op_S(i, size, set, &=~) 93 | #define CPU_ISSET_S(i, size, set) __CPU_op_S(i, size, set, &) 94 | 95 | #define __CPU_op_func_S(func, op) \ 96 | static __inline void __CPU_##func##_S(size_t __size, cpu_set_t *__dest, \ 97 | const cpu_set_t *__src1, const cpu_set_t *__src2) \ 98 | { \ 99 | size_t __i; \ 100 | for (__i=0; __i<__size/sizeof(long); __i++) \ 101 | ((unsigned long *)__dest)[__i] = ((unsigned long *)__src1)[__i] \ 102 | op ((unsigned long *)__src2)[__i] ; \ 103 | } 104 | 105 | __CPU_op_func_S(AND, &) 106 | __CPU_op_func_S(OR, |) 107 | __CPU_op_func_S(XOR, ^) 108 | 109 | #define CPU_AND_S(a,b,c,d) __CPU_AND_S(a,b,c,d) 110 | #define CPU_OR_S(a,b,c,d) __CPU_OR_S(a,b,c,d) 111 | #define CPU_XOR_S(a,b,c,d) __CPU_XOR_S(a,b,c,d) 112 | 113 | #define CPU_COUNT_S(size,set) __sched_cpucount(size,set) 114 | #define CPU_ZERO_S(size,set) memset(set,0,size) 115 | #define CPU_EQUAL_S(size,set1,set2) (!memcmp(set1,set2,size)) 116 | 117 | #define CPU_ALLOC_SIZE(n) (sizeof(long) * ( (n)/(8*sizeof(long)) \ 118 | + ((n)%(8*sizeof(long)) + 8*sizeof(long)-1)/(8*sizeof(long)) ) ) 119 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) 120 | #define CPU_FREE(set) free(set) 121 | 122 | #define CPU_SETSIZE 128 123 | 124 | #define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set) 125 | #define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set) 126 | #define CPU_ISSET(i, set) CPU_ISSET_S(i,sizeof(cpu_set_t),set) 127 | #define CPU_AND(d,s1,s2) CPU_AND_S(sizeof(cpu_set_t),d,s1,s2) 128 | #define CPU_OR(d,s1,s2) CPU_OR_S(sizeof(cpu_set_t),d,s1,s2) 129 | #define CPU_XOR(d,s1,s2) CPU_XOR_S(sizeof(cpu_set_t),d,s1,s2) 130 | #define CPU_COUNT(set) CPU_COUNT_S(sizeof(cpu_set_t),set) 131 | #define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t),set) 132 | #define CPU_EQUAL(s1,s2) CPU_EQUAL_S(sizeof(cpu_set_t),s1,s2) 133 | 134 | #endif 135 | #endif 136 | 137 | #ifdef __cplusplus 138 | } 139 | #endif 140 | #endif 141 | -------------------------------------------------------------------------------- /sysroot/include/search.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEARCH_H 2 | #define _SEARCH_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_size_t 11 | #include 12 | 13 | typedef enum { FIND, ENTER } ACTION; 14 | typedef enum { preorder, postorder, endorder, leaf } VISIT; 15 | 16 | typedef struct entry { 17 | char *key; 18 | void *data; 19 | } ENTRY; 20 | 21 | int hcreate(size_t); 22 | void hdestroy(void); 23 | ENTRY *hsearch(ENTRY, ACTION); 24 | 25 | #ifdef _GNU_SOURCE 26 | struct hsearch_data { 27 | struct __tab *__tab; 28 | unsigned int __unused1; 29 | unsigned int __unused2; 30 | }; 31 | 32 | int hcreate_r(size_t, struct hsearch_data *); 33 | void hdestroy_r(struct hsearch_data *); 34 | int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *); 35 | #endif 36 | 37 | void insque(void *, void *); 38 | void remque(void *); 39 | 40 | void *lsearch(const void *, void *, size_t *, size_t, 41 | int (*)(const void *, const void *)); 42 | void *lfind(const void *, const void *, size_t *, size_t, 43 | int (*)(const void *, const void *)); 44 | 45 | void *tdelete(const void *__restrict, void **__restrict, int(*)(const void *, const void *)); 46 | void *tfind(const void *, void *const *, int(*)(const void *, const void *)); 47 | void *tsearch(const void *, void **, int (*)(const void *, const void *)); 48 | void twalk(const void *, void (*)(const void *, VISIT, int)); 49 | 50 | #ifdef _GNU_SOURCE 51 | struct qelem { 52 | struct qelem *q_forw, *q_back; 53 | char q_data[1]; 54 | }; 55 | 56 | void tdestroy(void *, void (*)(void *)); 57 | #endif 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /sysroot/include/semaphore.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEMAPHORE_H 2 | #define _SEMAPHORE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #define __NEED_time_t 10 | #define __NEED_struct_timespec 11 | #include 12 | 13 | #include 14 | 15 | #define SEM_FAILED ((sem_t *)0) 16 | 17 | typedef struct { 18 | volatile int __val[4*sizeof(long)/sizeof(int)]; 19 | } sem_t; 20 | 21 | int sem_close(sem_t *); 22 | int sem_destroy(sem_t *); 23 | int sem_getvalue(sem_t *__restrict, int *__restrict); 24 | int sem_init(sem_t *, int, unsigned); 25 | sem_t *sem_open(const char *, int, ...); 26 | int sem_post(sem_t *); 27 | int sem_timedwait(sem_t *__restrict, const struct timespec *__restrict); 28 | int sem_trywait(sem_t *); 29 | int sem_unlink(const char *); 30 | int sem_wait(sem_t *); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /sysroot/include/stdalign.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDALIGN_H 2 | #define _STDALIGN_H 3 | 4 | #ifndef __cplusplus 5 | 6 | /* this whole header only works in C11 or with compiler extensions */ 7 | #if __STDC_VERSION__ < 201112L && defined( __GNUC__) 8 | #define _Alignas(t) __attribute__((__aligned__(t))) 9 | #define _Alignof(t) __alignof__(t) 10 | #endif 11 | 12 | #define alignas _Alignas 13 | #define alignof _Alignof 14 | 15 | #endif 16 | 17 | #define __alignas_is_defined 1 18 | #define __alignof_is_defined 1 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sysroot/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's stdarg.h */ 2 | #ifndef _STDARG_H 3 | #define _STDARG_H 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #define __NEED_va_list 10 | 11 | #include 12 | 13 | #define va_start(v,l) __builtin_va_start(v,l) 14 | #define va_end(v) __builtin_va_end(v) 15 | #define va_arg(v,l) __builtin_va_arg(v,l) 16 | #define va_copy(d,s) __builtin_va_copy(d,s) 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | #else 24 | /* Just use the compiler's stdarg.h. */ 25 | #include_next 26 | #endif 27 | -------------------------------------------------------------------------------- /sysroot/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | #ifndef __cplusplus 5 | 6 | #define true 1 7 | #define false 0 8 | #define bool _Bool 9 | 10 | #endif 11 | 12 | #define __bool_true_false_are_defined 1 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sysroot/include/stdc-predef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDC_PREDEF_H 2 | #define _STDC_PREDEF_H 3 | 4 | #define __STDC_ISO_10646__ 201206L 5 | 6 | #if !defined(__GCC_IEC_559) || __GCC_IEC_559 > 0 7 | #define __STDC_IEC_559__ 1 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sysroot/include/stddef.h: -------------------------------------------------------------------------------- 1 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's stddef.h */ 2 | #ifndef _STDDEF_H 3 | #define _STDDEF_H 4 | 5 | #ifdef __cplusplus 6 | #define NULL 0L 7 | #else 8 | #define NULL ((void*)0) 9 | #endif 10 | 11 | #define __NEED_ptrdiff_t 12 | #define __NEED_size_t 13 | #define __NEED_wchar_t 14 | #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L 15 | #define __NEED_max_align_t 16 | #endif 17 | 18 | #include 19 | 20 | #if __GNUC__ > 3 21 | #define offsetof(type, member) __builtin_offsetof(type, member) 22 | #else 23 | #define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 )) 24 | #endif 25 | 26 | #endif 27 | #else 28 | 29 | /* Just use the compiler's stddef.h. */ 30 | #include_next 31 | 32 | /* Define musl's include guard, in case any code depends on that. */ 33 | #if defined(__STDDEF_H) && !defined(_STDDEF_H) 34 | #define _STDDEF_H 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /sysroot/include/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDINT_H 2 | #define _STDINT_H 3 | 4 | #define __NEED_int8_t 5 | #define __NEED_int16_t 6 | #define __NEED_int32_t 7 | #define __NEED_int64_t 8 | 9 | #define __NEED_uint8_t 10 | #define __NEED_uint16_t 11 | #define __NEED_uint32_t 12 | #define __NEED_uint64_t 13 | 14 | #define __NEED_intptr_t 15 | #define __NEED_uintptr_t 16 | 17 | #define __NEED_intmax_t 18 | #define __NEED_uintmax_t 19 | 20 | #include 21 | 22 | typedef int8_t int_fast8_t; 23 | typedef int64_t int_fast64_t; 24 | 25 | typedef int8_t int_least8_t; 26 | typedef int16_t int_least16_t; 27 | typedef int32_t int_least32_t; 28 | typedef int64_t int_least64_t; 29 | 30 | typedef uint8_t uint_fast8_t; 31 | typedef uint64_t uint_fast64_t; 32 | 33 | typedef uint8_t uint_least8_t; 34 | typedef uint16_t uint_least16_t; 35 | typedef uint32_t uint_least32_t; 36 | typedef uint64_t uint_least64_t; 37 | 38 | #define INT8_MIN (-1-0x7f) 39 | #define INT16_MIN (-1-0x7fff) 40 | #define INT32_MIN (-1-0x7fffffff) 41 | #define INT64_MIN (-1-0x7fffffffffffffff) 42 | 43 | #define INT8_MAX (0x7f) 44 | #define INT16_MAX (0x7fff) 45 | #define INT32_MAX (0x7fffffff) 46 | #define INT64_MAX (0x7fffffffffffffff) 47 | 48 | #define UINT8_MAX (0xff) 49 | #define UINT16_MAX (0xffff) 50 | #define UINT32_MAX (0xffffffffu) 51 | #define UINT64_MAX (0xffffffffffffffffu) 52 | 53 | #define INT_FAST8_MIN INT8_MIN 54 | #define INT_FAST64_MIN INT64_MIN 55 | 56 | #define INT_LEAST8_MIN INT8_MIN 57 | #define INT_LEAST16_MIN INT16_MIN 58 | #define INT_LEAST32_MIN INT32_MIN 59 | #define INT_LEAST64_MIN INT64_MIN 60 | 61 | #define INT_FAST8_MAX INT8_MAX 62 | #define INT_FAST64_MAX INT64_MAX 63 | 64 | #define INT_LEAST8_MAX INT8_MAX 65 | #define INT_LEAST16_MAX INT16_MAX 66 | #define INT_LEAST32_MAX INT32_MAX 67 | #define INT_LEAST64_MAX INT64_MAX 68 | 69 | #define UINT_FAST8_MAX UINT8_MAX 70 | #define UINT_FAST64_MAX UINT64_MAX 71 | 72 | #define UINT_LEAST8_MAX UINT8_MAX 73 | #define UINT_LEAST16_MAX UINT16_MAX 74 | #define UINT_LEAST32_MAX UINT32_MAX 75 | #define UINT_LEAST64_MAX UINT64_MAX 76 | 77 | #define INTMAX_MIN INT64_MIN 78 | #define INTMAX_MAX INT64_MAX 79 | #define UINTMAX_MAX UINT64_MAX 80 | 81 | #define WINT_MIN 0U 82 | #define WINT_MAX UINT32_MAX 83 | 84 | #if L'\0'-1 > 0 85 | #define WCHAR_MAX (0xffffffffu+L'\0') 86 | #define WCHAR_MIN (0+L'\0') 87 | #else 88 | #define WCHAR_MAX (0x7fffffff+L'\0') 89 | #define WCHAR_MIN (-1-0x7fffffff+L'\0') 90 | #endif 91 | 92 | #define SIG_ATOMIC_MIN INT32_MIN 93 | #define SIG_ATOMIC_MAX INT32_MAX 94 | 95 | #include 96 | 97 | #define INT8_C(c) c 98 | #define INT16_C(c) c 99 | #define INT32_C(c) c 100 | 101 | #define UINT8_C(c) c 102 | #define UINT16_C(c) c 103 | #define UINT32_C(c) c ## U 104 | 105 | #if UINTPTR_MAX == UINT64_MAX 106 | #define INT64_C(c) c ## L 107 | #define UINT64_C(c) c ## UL 108 | #define INTMAX_C(c) c ## L 109 | #define UINTMAX_C(c) c ## UL 110 | #else 111 | #define INT64_C(c) c ## LL 112 | #define UINT64_C(c) c ## ULL 113 | #define INTMAX_C(c) c ## LL 114 | #define UINTMAX_C(c) c ## ULL 115 | #endif 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /sysroot/include/stdio_ext.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDIO_EXT_H 2 | #define _STDIO_EXT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define FSETLOCKING_QUERY 0 11 | #define FSETLOCKING_INTERNAL 1 12 | #define FSETLOCKING_BYCALLER 2 13 | 14 | void _flushlbf(void); 15 | int __fsetlocking(FILE *, int); 16 | int __fwriting(FILE *); 17 | int __freading(FILE *); 18 | int __freadable(FILE *); 19 | int __fwritable(FILE *); 20 | int __flbf(FILE *); 21 | size_t __fbufsize(FILE *); 22 | size_t __fpending(FILE *); 23 | int __fpurge(FILE *); 24 | 25 | size_t __freadahead(FILE *); 26 | const char *__freadptr(FILE *, size_t *); 27 | void __freadptrinc(FILE *, size_t); 28 | void __fseterr(FILE *); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /sysroot/include/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDNORETURN_H 2 | #define _STDNORETURN_H 3 | #ifndef __cplusplus 4 | #include 5 | #define noreturn _Noreturn 6 | #endif 7 | #endif 8 | -------------------------------------------------------------------------------- /sysroot/include/string.h: -------------------------------------------------------------------------------- 1 | #ifndef _STRING_H 2 | #define _STRING_H 3 | 4 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 5 | #else 6 | #include <__header_string.h> 7 | #endif 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #include 13 | 14 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's definition of NULL */ 15 | #ifdef __cplusplus 16 | #define NULL 0L 17 | #else 18 | #define NULL ((void*)0) 19 | #endif 20 | #else 21 | #define __need_NULL 22 | #include 23 | #endif 24 | 25 | #define __NEED_size_t 26 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 27 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 28 | || defined(_BSD_SOURCE) 29 | #define __NEED_locale_t 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 35 | void *memcpy (void *__restrict, const void *__restrict, size_t); 36 | void *memmove (void *, const void *, size_t); 37 | void *memset (void *, int, size_t); 38 | #endif 39 | int memcmp (const void *, const void *, size_t); 40 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 41 | void *memchr (const void *, int, size_t); 42 | #endif 43 | 44 | char *strcpy (char *__restrict, const char *__restrict); 45 | char *strncpy (char *__restrict, const char *__restrict, size_t); 46 | 47 | char *strcat (char *__restrict, const char *__restrict); 48 | char *strncat (char *__restrict, const char *__restrict, size_t); 49 | 50 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 51 | int strcmp (const char *, const char *); 52 | #endif 53 | int strncmp (const char *, const char *, size_t); 54 | 55 | int strcoll (const char *, const char *); 56 | size_t strxfrm (char *__restrict, const char *__restrict, size_t); 57 | 58 | char *strchr (const char *, int); 59 | char *strrchr (const char *, int); 60 | 61 | size_t strcspn (const char *, const char *); 62 | size_t strspn (const char *, const char *); 63 | char *strpbrk (const char *, const char *); 64 | char *strstr (const char *, const char *); 65 | char *strtok (char *__restrict, const char *__restrict); 66 | 67 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 68 | size_t strlen (const char *); 69 | #endif 70 | 71 | char *strerror (int); 72 | 73 | #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) 74 | #include 75 | #endif 76 | 77 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 78 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 79 | || defined(_BSD_SOURCE) 80 | char *strtok_r (char *__restrict, const char *__restrict, char **__restrict); 81 | int strerror_r (int, char *, size_t); 82 | char *stpcpy(char *__restrict, const char *__restrict); 83 | char *stpncpy(char *__restrict, const char *__restrict, size_t); 84 | size_t strnlen (const char *, size_t); 85 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 86 | char *strdup (const char *); 87 | #endif 88 | char *strndup (const char *, size_t); 89 | char *strsignal(int); 90 | char *strerror_l (int, locale_t); 91 | int strcoll_l (const char *, const char *, locale_t); 92 | size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); 93 | #endif 94 | 95 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 96 | || defined(_BSD_SOURCE) 97 | void *memccpy (void *__restrict, const void *__restrict, int, size_t); 98 | #endif 99 | 100 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 101 | char *strsep(char **, const char *); 102 | size_t strlcat (char *, const char *, size_t); 103 | size_t strlcpy (char *, const char *, size_t); 104 | void explicit_bzero (void *, size_t); 105 | #endif 106 | 107 | #ifdef _GNU_SOURCE 108 | #define strdupa(x) strcpy(alloca(strlen(x)+1),x) 109 | int strverscmp (const char *, const char *); 110 | char *strchrnul(const char *, int); 111 | char *strcasestr(const char *, const char *); 112 | void *memmem(const void *, size_t, const void *, size_t); 113 | void *memrchr(const void *, int, size_t); 114 | void *mempcpy(void *, const void *, size_t); 115 | #ifdef __wasilibc_unmodified_upstream /* avoid unprototyped decls; use */ 116 | #ifndef __cplusplus 117 | char *basename(); 118 | #endif 119 | #endif 120 | #endif 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /sysroot/include/strings.h: -------------------------------------------------------------------------------- 1 | #ifndef _STRINGS_H 2 | #define _STRINGS_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | #define __NEED_size_t 10 | #define __NEED_locale_t 11 | #include 12 | 13 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \ 14 | || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \ 15 | || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) 16 | int bcmp (const void *, const void *, size_t); 17 | void bcopy (const void *, void *, size_t); 18 | void bzero (void *, size_t); 19 | char *index (const char *, int); 20 | char *rindex (const char *, int); 21 | #endif 22 | 23 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 24 | int ffs (int); 25 | int ffsl (long); 26 | int ffsll (long long); 27 | #endif 28 | 29 | int strcasecmp (const char *, const char *); 30 | int strncasecmp (const char *, const char *, size_t); 31 | 32 | int strcasecmp_l (const char *, const char *, locale_t); 33 | int strncasecmp_l (const char *, const char *, size_t, locale_t); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sysroot/include/stropts.h: -------------------------------------------------------------------------------- 1 | #ifndef _STROPTS_H 2 | #define _STROPTS_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __SID ('S' << 8) 9 | 10 | #define I_NREAD (__SID | 1) 11 | #define I_PUSH (__SID | 2) 12 | #define I_POP (__SID | 3) 13 | #define I_LOOK (__SID | 4) 14 | #define I_FLUSH (__SID | 5) 15 | #define I_SRDOPT (__SID | 6) 16 | #define I_GRDOPT (__SID | 7) 17 | #define I_STR (__SID | 8) 18 | #define I_SETSIG (__SID | 9) 19 | #define I_GETSIG (__SID |10) 20 | #define I_FIND (__SID |11) 21 | #define I_LINK (__SID |12) 22 | #define I_UNLINK (__SID |13) 23 | #define I_PEEK (__SID |15) 24 | #define I_FDINSERT (__SID |16) 25 | #define I_SENDFD (__SID |17) 26 | #define I_RECVFD (__SID |14) 27 | #define I_SWROPT (__SID |19) 28 | #define I_GWROPT (__SID |20) 29 | #define I_LIST (__SID |21) 30 | #define I_PLINK (__SID |22) 31 | #define I_PUNLINK (__SID |23) 32 | #define I_FLUSHBAND (__SID |28) 33 | #define I_CKBAND (__SID |29) 34 | #define I_GETBAND (__SID |30) 35 | #define I_ATMARK (__SID |31) 36 | #define I_SETCLTIME (__SID |32) 37 | #define I_GETCLTIME (__SID |33) 38 | #define I_CANPUT (__SID |34) 39 | 40 | #define FMNAMESZ 8 41 | 42 | #define FLUSHR 0x01 43 | #define FLUSHW 0x02 44 | #define FLUSHRW 0x03 45 | #define FLUSHBAND 0x04 46 | 47 | #define S_INPUT 0x0001 48 | #define S_HIPRI 0x0002 49 | #define S_OUTPUT 0x0004 50 | #define S_MSG 0x0008 51 | #define S_ERROR 0x0010 52 | #define S_HANGUP 0x0020 53 | #define S_RDNORM 0x0040 54 | #define S_WRNORM S_OUTPUT 55 | #define S_RDBAND 0x0080 56 | #define S_WRBAND 0x0100 57 | #define S_BANDURG 0x0200 58 | 59 | #define RS_HIPRI 0x01 60 | 61 | #define RNORM 0x0000 62 | #define RMSGD 0x0001 63 | #define RMSGN 0x0002 64 | #define RPROTDAT 0x0004 65 | #define RPROTDIS 0x0008 66 | #define RPROTNORM 0x0010 67 | #define RPROTMASK 0x001C 68 | 69 | #define SNDZERO 0x001 70 | #define SNDPIPE 0x002 71 | 72 | #define ANYMARK 0x01 73 | #define LASTMARK 0x02 74 | 75 | #define MUXID_ALL (-1) 76 | 77 | #define MSG_HIPRI 0x01 78 | #define MSG_ANY 0x02 79 | #define MSG_BAND 0x04 80 | 81 | #define MORECTL 1 82 | #define MOREDATA 2 83 | 84 | struct bandinfo { 85 | unsigned char bi_pri; 86 | int bi_flag; 87 | }; 88 | 89 | struct strbuf { 90 | int maxlen; 91 | int len; 92 | char *buf; 93 | }; 94 | 95 | struct strpeek { 96 | struct strbuf ctlbuf; 97 | struct strbuf databuf; 98 | unsigned flags; 99 | }; 100 | 101 | struct strfdinsert { 102 | struct strbuf ctlbuf; 103 | struct strbuf databuf; 104 | unsigned flags; 105 | int fildes; 106 | int offset; 107 | }; 108 | 109 | struct strioctl { 110 | int ic_cmd; 111 | int ic_timout; 112 | int ic_len; 113 | char *ic_dp; 114 | }; 115 | 116 | struct strrecvfd { 117 | int fd; 118 | int uid; 119 | int gid; 120 | char __fill[8]; 121 | }; 122 | 123 | struct str_mlist { 124 | char l_name[FMNAMESZ + 1]; 125 | }; 126 | 127 | struct str_list { 128 | int sl_nmods; 129 | struct str_mlist *sl_modlist; 130 | }; 131 | 132 | int isastream(int); 133 | int ioctl(int, int, ...); 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | 139 | #endif 140 | -------------------------------------------------------------------------------- /sysroot/include/sys/dir.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define direct dirent 3 | -------------------------------------------------------------------------------- /sysroot/include/sys/errno.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /sysroot/include/sys/eventfd.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_EVENTFD_H 2 | #define _SYS_EVENTFD_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | typedef uint64_t eventfd_t; 12 | 13 | #define EFD_SEMAPHORE 1 14 | #define EFD_CLOEXEC O_CLOEXEC 15 | #define EFD_NONBLOCK O_NONBLOCK 16 | 17 | int eventfd(unsigned int, int); 18 | int eventfd_read(int, eventfd_t *); 19 | int eventfd_write(int, eventfd_t); 20 | 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif /* sys/eventfd.h */ 27 | -------------------------------------------------------------------------------- /sysroot/include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /sysroot/include/sys/file.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_FILE_H 2 | #define _SYS_FILE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #define LOCK_SH 1 8 | #define LOCK_EX 2 9 | #define LOCK_NB 4 10 | #define LOCK_UN 8 11 | 12 | #define L_SET 0 13 | #define L_INCR 1 14 | #define L_XTND 2 15 | 16 | int flock(int, int); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /sysroot/include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_IOCTL_H 2 | #define _SYS_IOCTL_H 3 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define N_TTY 0 11 | #define N_SLIP 1 12 | #define N_MOUSE 2 13 | #define N_PPP 3 14 | #define N_STRIP 4 15 | #define N_AX25 5 16 | #define N_X25 6 17 | #define N_6PACK 7 18 | #define N_MASC 8 19 | #define N_R3964 9 20 | #define N_PROFIBUS_FDL 10 21 | #define N_IRDA 11 22 | #define N_SMSBLOCK 12 23 | #define N_HDLC 13 24 | #define N_SYNC_PPP 14 25 | #define N_HCI 15 26 | #define N_GIGASET_M101 16 27 | #define N_SLCAN 17 28 | #define N_PPS 18 29 | #define N_V253 19 30 | #define N_CAIF 20 31 | #define N_GSM0710 21 32 | #define N_TI_WL 22 33 | #define N_TRACESINK 23 34 | #define N_TRACEROUTER 24 35 | #define N_NCI 25 36 | #define N_SPEAKUP 26 37 | #define N_NULL 27 38 | 39 | #define TIOCPKT_DATA 0 40 | #define TIOCPKT_FLUSHREAD 1 41 | #define TIOCPKT_FLUSHWRITE 2 42 | #define TIOCPKT_STOP 4 43 | #define TIOCPKT_START 8 44 | #define TIOCPKT_NOSTOP 16 45 | #define TIOCPKT_DOSTOP 32 46 | #define TIOCPKT_IOCTL 64 47 | 48 | #define TIOCSER_TEMT 1 49 | 50 | struct winsize { 51 | unsigned short ws_row; 52 | unsigned short ws_col; 53 | unsigned short ws_xpixel; 54 | unsigned short ws_ypixel; 55 | }; 56 | 57 | #define SIOCADDRT 0x890B 58 | #define SIOCDELRT 0x890C 59 | #define SIOCRTMSG 0x890D 60 | 61 | #define SIOCGIFNAME 0x8910 62 | #define SIOCSIFLINK 0x8911 63 | #define SIOCGIFCONF 0x8912 64 | #define SIOCGIFFLAGS 0x8913 65 | #define SIOCSIFFLAGS 0x8914 66 | #define SIOCGIFADDR 0x8915 67 | #define SIOCSIFADDR 0x8916 68 | #define SIOCGIFDSTADDR 0x8917 69 | #define SIOCSIFDSTADDR 0x8918 70 | #define SIOCGIFBRDADDR 0x8919 71 | #define SIOCSIFBRDADDR 0x891a 72 | #define SIOCGIFNETMASK 0x891b 73 | #define SIOCSIFNETMASK 0x891c 74 | #define SIOCGIFMETRIC 0x891d 75 | #define SIOCSIFMETRIC 0x891e 76 | #define SIOCGIFMEM 0x891f 77 | #define SIOCSIFMEM 0x8920 78 | #define SIOCGIFMTU 0x8921 79 | #define SIOCSIFMTU 0x8922 80 | #define SIOCSIFNAME 0x8923 81 | #define SIOCSIFHWADDR 0x8924 82 | #define SIOCGIFENCAP 0x8925 83 | #define SIOCSIFENCAP 0x8926 84 | #define SIOCGIFHWADDR 0x8927 85 | #define SIOCGIFSLAVE 0x8929 86 | #define SIOCSIFSLAVE 0x8930 87 | #define SIOCADDMULTI 0x8931 88 | #define SIOCDELMULTI 0x8932 89 | #define SIOCGIFINDEX 0x8933 90 | #define SIOGIFINDEX SIOCGIFINDEX 91 | #define SIOCSIFPFLAGS 0x8934 92 | #define SIOCGIFPFLAGS 0x8935 93 | #define SIOCDIFADDR 0x8936 94 | #define SIOCSIFHWBROADCAST 0x8937 95 | #define SIOCGIFCOUNT 0x8938 96 | 97 | #define SIOCGIFBR 0x8940 98 | #define SIOCSIFBR 0x8941 99 | 100 | #define SIOCGIFTXQLEN 0x8942 101 | #define SIOCSIFTXQLEN 0x8943 102 | 103 | #define SIOCDARP 0x8953 104 | #define SIOCGARP 0x8954 105 | #define SIOCSARP 0x8955 106 | 107 | #define SIOCDRARP 0x8960 108 | #define SIOCGRARP 0x8961 109 | #define SIOCSRARP 0x8962 110 | 111 | #define SIOCGIFMAP 0x8970 112 | #define SIOCSIFMAP 0x8971 113 | 114 | #define SIOCADDDLCI 0x8980 115 | #define SIOCDELDLCI 0x8981 116 | 117 | #define SIOCDEVPRIVATE 0x89F0 118 | #define SIOCPROTOPRIVATE 0x89E0 119 | 120 | int ioctl (int, int, ...); 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | #else 126 | #include <__header_sys_ioctl.h> 127 | #endif 128 | #endif 129 | -------------------------------------------------------------------------------- /sysroot/include/sys/mman.h: -------------------------------------------------------------------------------- 1 | #ifndef _WASI_EMULATED_MMAN 2 | #error "WASI lacks a true mmap; to enable minimal mmap emulation, \ 3 | compile with -D_WASI_EMULATED_MMAN and link with -lwasi-emulated-mman" 4 | #else 5 | #ifndef _SYS_MMAN_H 6 | #define _SYS_MMAN_H 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #include 12 | 13 | #define __NEED_mode_t 14 | #define __NEED_size_t 15 | #define __NEED_off_t 16 | 17 | #if defined(_GNU_SOURCE) 18 | #define __NEED_ssize_t 19 | #endif 20 | 21 | #include 22 | 23 | #define MAP_FAILED ((void *) -1) 24 | 25 | #define MAP_SHARED 0x01 26 | #define MAP_PRIVATE 0x02 27 | #define MAP_SHARED_VALIDATE 0x03 28 | #define MAP_TYPE 0x0f 29 | #define MAP_FIXED 0x10 30 | #define MAP_ANON 0x20 31 | #define MAP_ANONYMOUS MAP_ANON 32 | #define MAP_NORESERVE 0x4000 33 | #define MAP_GROWSDOWN 0x0100 34 | #define MAP_DENYWRITE 0x0800 35 | #define MAP_EXECUTABLE 0x1000 36 | #define MAP_LOCKED 0x2000 37 | #define MAP_POPULATE 0x8000 38 | #define MAP_NONBLOCK 0x10000 39 | #define MAP_STACK 0x20000 40 | #define MAP_HUGETLB 0x40000 41 | #define MAP_SYNC 0x80000 42 | #define MAP_FIXED_NOREPLACE 0x100000 43 | #define MAP_FILE 0 44 | 45 | #define MAP_HUGE_SHIFT 26 46 | #define MAP_HUGE_MASK 0x3f 47 | #define MAP_HUGE_64KB (16 << 26) 48 | #define MAP_HUGE_512KB (19 << 26) 49 | #define MAP_HUGE_1MB (20 << 26) 50 | #define MAP_HUGE_2MB (21 << 26) 51 | #define MAP_HUGE_8MB (23 << 26) 52 | #define MAP_HUGE_16MB (24 << 26) 53 | #define MAP_HUGE_32MB (25 << 26) 54 | #define MAP_HUGE_256MB (28 << 26) 55 | #define MAP_HUGE_512MB (29 << 26) 56 | #define MAP_HUGE_1GB (30 << 26) 57 | #define MAP_HUGE_2GB (31 << 26) 58 | #define MAP_HUGE_16GB (34U << 26) 59 | 60 | #define PROT_NONE 0 61 | #define PROT_READ 1 62 | #define PROT_WRITE 2 63 | #define PROT_EXEC 4 64 | #define PROT_GROWSDOWN 0x01000000 65 | #define PROT_GROWSUP 0x02000000 66 | 67 | #define MS_ASYNC 1 68 | #define MS_INVALIDATE 2 69 | #define MS_SYNC 4 70 | 71 | #define MCL_CURRENT 1 72 | #define MCL_FUTURE 2 73 | #define MCL_ONFAULT 4 74 | 75 | #define POSIX_MADV_NORMAL 0 76 | #define POSIX_MADV_RANDOM 1 77 | #define POSIX_MADV_SEQUENTIAL 2 78 | #define POSIX_MADV_WILLNEED 3 79 | #define POSIX_MADV_DONTNEED 4 80 | 81 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 82 | #define MADV_NORMAL 0 83 | #define MADV_RANDOM 1 84 | #define MADV_SEQUENTIAL 2 85 | #define MADV_WILLNEED 3 86 | #define MADV_DONTNEED 4 87 | #define MADV_FREE 8 88 | #define MADV_REMOVE 9 89 | #define MADV_DONTFORK 10 90 | #define MADV_DOFORK 11 91 | #define MADV_MERGEABLE 12 92 | #define MADV_UNMERGEABLE 13 93 | #define MADV_HUGEPAGE 14 94 | #define MADV_NOHUGEPAGE 15 95 | #define MADV_DONTDUMP 16 96 | #define MADV_DODUMP 17 97 | #define MADV_WIPEONFORK 18 98 | #define MADV_KEEPONFORK 19 99 | #define MADV_HWPOISON 100 100 | #define MADV_SOFT_OFFLINE 101 101 | #endif 102 | 103 | #ifdef _GNU_SOURCE 104 | #define MREMAP_MAYMOVE 1 105 | #define MREMAP_FIXED 2 106 | 107 | #define MLOCK_ONFAULT 0x01 108 | 109 | #define MFD_CLOEXEC 0x0001U 110 | #define MFD_ALLOW_SEALING 0x0002U 111 | #define MFD_HUGETLB 0x0004U 112 | #endif 113 | 114 | #include 115 | 116 | void *mmap (void *, size_t, int, int, int, off_t); 117 | int munmap (void *, size_t); 118 | 119 | int mprotect (void *, size_t, int); 120 | int msync (void *, size_t, int); 121 | 122 | int posix_madvise (void *, size_t, int); 123 | 124 | int mlock (const void *, size_t); 125 | int munlock (const void *, size_t); 126 | int mlockall (int); 127 | int munlockall (void); 128 | 129 | #ifdef _GNU_SOURCE 130 | void *mremap (void *, size_t, size_t, int, ...); 131 | int remap_file_pages (void *, size_t, int, size_t, int); 132 | int memfd_create (const char *, unsigned); 133 | int mlock2 (const void *, size_t, unsigned); 134 | #endif 135 | 136 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 137 | int madvise (void *, size_t, int); 138 | int mincore (void *, size_t, unsigned char *); 139 | #endif 140 | 141 | int shm_open (const char *, int, mode_t); 142 | int shm_unlink (const char *); 143 | 144 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 145 | #define mmap64 mmap 146 | #define off64_t off_t 147 | #endif 148 | 149 | #ifdef __cplusplus 150 | } 151 | #endif 152 | #endif 153 | #endif 154 | -------------------------------------------------------------------------------- /sysroot/include/sys/param.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_PARAM_H 2 | #define _SYS_PARAM_H 3 | 4 | #define MAXSYMLINKS 20 5 | #define MAXHOSTNAMELEN 64 6 | #define MAXNAMLEN 255 7 | #define MAXPATHLEN 4096 8 | #define NBBY 8 9 | #define NGROUPS 32 10 | #define CANBSIZ 255 11 | #define NOFILE 256 12 | #define NCARGS 131072 13 | #define DEV_BSIZE 512 14 | #define NOGROUP (-1) 15 | 16 | #undef MIN 17 | #undef MAX 18 | #define MIN(a,b) (((a)<(b))?(a):(b)) 19 | #define MAX(a,b) (((a)>(b))?(a):(b)) 20 | 21 | #define __bitop(x,i,o) ((x)[(i)/8] o (1<<(i)%8)) 22 | #define setbit(x,i) __bitop(x,i,|=) 23 | #define clrbit(x,i) __bitop(x,i,&=~) 24 | #define isset(x,i) __bitop(x,i,&) 25 | #define isclr(x,i) !isset(x,i) 26 | 27 | #define howmany(n,d) (((n)+((d)-1))/(d)) 28 | #define roundup(n,d) (howmany(n,d)*(d)) 29 | #define powerof2(n) !(((n)-1) & (n)) 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /sysroot/include/sys/poll.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /sysroot/include/sys/random.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RANDOM_H 2 | #define _SYS_RANDOM_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #ifdef __wasilibc_unmodified_upstream /* WASI has no getrandom, but it does have getentropy */ 8 | #define __NEED_size_t 9 | #define __NEED_ssize_t 10 | #include 11 | 12 | #define GRND_NONBLOCK 0x0001 13 | #define GRND_RANDOM 0x0002 14 | 15 | ssize_t getrandom(void *, size_t, unsigned); 16 | #else 17 | #define __NEED_size_t 18 | #include 19 | 20 | int getentropy(void *, size_t); 21 | #endif 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /sysroot/include/sys/reg.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_REG_H 2 | #define _SYS_REG_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /sysroot/include/sys/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RESOURCE_H 2 | #define _SYS_RESOURCE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #define __NEED_id_t 12 | 13 | #ifdef _GNU_SOURCE 14 | #define __NEED_pid_t 15 | #endif 16 | 17 | #include 18 | #include 19 | 20 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 21 | typedef unsigned long long rlim_t; 22 | 23 | struct rlimit { 24 | rlim_t rlim_cur; 25 | rlim_t rlim_max; 26 | }; 27 | 28 | struct rusage { 29 | struct timeval ru_utime; 30 | struct timeval ru_stime; 31 | /* linux extentions, but useful */ 32 | long ru_maxrss; 33 | long ru_ixrss; 34 | long ru_idrss; 35 | long ru_isrss; 36 | long ru_minflt; 37 | long ru_majflt; 38 | long ru_nswap; 39 | long ru_inblock; 40 | long ru_oublock; 41 | long ru_msgsnd; 42 | long ru_msgrcv; 43 | long ru_nsignals; 44 | long ru_nvcsw; 45 | long ru_nivcsw; 46 | /* room for more... */ 47 | long __reserved[16]; 48 | }; 49 | 50 | int getrlimit (int, struct rlimit *); 51 | int setrlimit (int, const struct rlimit *); 52 | int getrusage (int, struct rusage *); 53 | 54 | int getpriority (int, id_t); 55 | int setpriority (int, id_t, int); 56 | 57 | #ifdef _GNU_SOURCE 58 | int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); 59 | #define prlimit64 prlimit 60 | #endif 61 | 62 | #define PRIO_MIN (-20) 63 | #define PRIO_MAX 20 64 | 65 | #define PRIO_PROCESS 0 66 | #define PRIO_PGRP 1 67 | #define PRIO_USER 2 68 | 69 | #define RUSAGE_SELF 0 70 | #define RUSAGE_CHILDREN (-1) 71 | #define RUSAGE_THREAD 1 72 | 73 | #define RLIM_INFINITY (~0ULL) 74 | #define RLIM_SAVED_CUR RLIM_INFINITY 75 | #define RLIM_SAVED_MAX RLIM_INFINITY 76 | 77 | #define RLIMIT_CPU 0 78 | #define RLIMIT_FSIZE 1 79 | #define RLIMIT_DATA 2 80 | #define RLIMIT_STACK 3 81 | #define RLIMIT_CORE 4 82 | #ifndef RLIMIT_RSS 83 | #define RLIMIT_RSS 5 84 | #define RLIMIT_NPROC 6 85 | #define RLIMIT_NOFILE 7 86 | #define RLIMIT_MEMLOCK 8 87 | #define RLIMIT_AS 9 88 | #endif 89 | #define RLIMIT_LOCKS 10 90 | #define RLIMIT_SIGPENDING 11 91 | #define RLIMIT_MSGQUEUE 12 92 | #define RLIMIT_NICE 13 93 | #define RLIMIT_RTPRIO 14 94 | #define RLIMIT_NLIMITS 15 95 | 96 | #define RLIM_NLIMITS RLIMIT_NLIMITS 97 | 98 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 99 | #define RLIM64_INFINITY RLIM_INFINITY 100 | #define RLIM64_SAVED_CUR RLIM_SAVED_CUR 101 | #define RLIM64_SAVED_MAX RLIM_SAVED_MAX 102 | #define getrlimit64 getrlimit 103 | #define setrlimit64 setrlimit 104 | #define rlimit64 rlimit 105 | #define rlim64_t rlim_t 106 | #endif 107 | #else 108 | #include <__header_sys_resource.h> 109 | #endif 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /sysroot/include/sys/select.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SELECT_H 2 | #define _SYS_SELECT_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #define __NEED_size_t 10 | #define __NEED_time_t 11 | #define __NEED_suseconds_t 12 | #define __NEED_struct_timeval 13 | #define __NEED_struct_timespec 14 | #define __NEED_sigset_t 15 | 16 | #include 17 | 18 | #define FD_SETSIZE 1024 19 | 20 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 21 | typedef unsigned long fd_mask; 22 | #endif 23 | 24 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 25 | typedef struct { 26 | unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)]; 27 | } fd_set; 28 | 29 | #define FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0) 30 | #define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long))))) 31 | #define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long))))) 32 | #define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long))))) 33 | #else 34 | #include <__fd_set.h> 35 | #endif 36 | 37 | int select (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict); 38 | int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict, const sigset_t *__restrict); 39 | 40 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 41 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 42 | #define NFDBITS (8*(int)sizeof(long)) 43 | #endif 44 | #endif 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | #endif 50 | -------------------------------------------------------------------------------- /sysroot/include/sys/signal.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /sysroot/include/sys/stat.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_STAT_H 2 | #define _SYS_STAT_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #define __NEED_dev_t 10 | #define __NEED_ino_t 11 | #define __NEED_mode_t 12 | #define __NEED_nlink_t 13 | #define __NEED_uid_t 14 | #define __NEED_gid_t 15 | #define __NEED_off_t 16 | #define __NEED_time_t 17 | #define __NEED_blksize_t 18 | #define __NEED_blkcnt_t 19 | #define __NEED_struct_timespec 20 | 21 | #include 22 | 23 | #include 24 | 25 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 26 | #define st_atime st_atim.tv_sec 27 | #define st_mtime st_mtim.tv_sec 28 | #define st_ctime st_ctim.tv_sec 29 | 30 | #define S_IFMT 0170000 31 | 32 | #define S_IFDIR 0040000 33 | #define S_IFCHR 0020000 34 | #define S_IFBLK 0060000 35 | #define S_IFREG 0100000 36 | #define S_IFIFO 0010000 37 | #define S_IFLNK 0120000 38 | #define S_IFSOCK 0140000 39 | 40 | #define S_TYPEISMQ(buf) 0 41 | #define S_TYPEISSEM(buf) 0 42 | #define S_TYPEISSHM(buf) 0 43 | #define S_TYPEISTMO(buf) 0 44 | 45 | #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) 46 | #define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR) 47 | #define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) 48 | #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 49 | #define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) 50 | #define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) 51 | #define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) 52 | 53 | #ifndef S_IRUSR 54 | #define S_ISUID 04000 55 | #define S_ISGID 02000 56 | #define S_ISVTX 01000 57 | #define S_IRUSR 0400 58 | #define S_IWUSR 0200 59 | #define S_IXUSR 0100 60 | #define S_IRWXU 0700 61 | #define S_IRGRP 0040 62 | #define S_IWGRP 0020 63 | #define S_IXGRP 0010 64 | #define S_IRWXG 0070 65 | #define S_IROTH 0004 66 | #define S_IWOTH 0002 67 | #define S_IXOTH 0001 68 | #define S_IRWXO 0007 69 | #endif 70 | 71 | #define UTIME_NOW 0x3fffffff 72 | #define UTIME_OMIT 0x3ffffffe 73 | #else 74 | #include <__header_sys_stat.h> 75 | #endif 76 | 77 | int stat(const char *__restrict, struct stat *__restrict); 78 | int fstat(int, struct stat *); 79 | int lstat(const char *__restrict, struct stat *__restrict); 80 | int fstatat(int, const char *__restrict, struct stat *__restrict, int); 81 | #ifdef __wasilibc_unmodified_upstream /* WASI has no chmod */ 82 | int chmod(const char *, mode_t); 83 | int fchmod(int, mode_t); 84 | int fchmodat(int, const char *, mode_t, int); 85 | #endif 86 | #ifdef __wasilibc_unmodified_upstream /* WASI has no umask */ 87 | mode_t umask(mode_t); 88 | #endif 89 | int mkdir(const char *, mode_t); 90 | #ifdef __wasilibc_unmodified_upstream /* WASI has no fifo */ 91 | int mkfifo(const char *, mode_t); 92 | #endif 93 | int mkdirat(int, const char *, mode_t); 94 | #ifdef __wasilibc_unmodified_upstream /* WASI has no fifo */ 95 | int mkfifoat(int, const char *, mode_t); 96 | #endif 97 | 98 | #ifdef __wasilibc_unmodified_upstream /* WASI has no mknod */ 99 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 100 | int mknod(const char *, mode_t, dev_t); 101 | int mknodat(int, const char *, mode_t, dev_t); 102 | #endif 103 | #endif 104 | 105 | int futimens(int, const struct timespec [2]); 106 | int utimensat(int, const char *, const struct timespec [2], int); 107 | 108 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 109 | #ifdef __wasilibc_unmodified_upstream /* WASI has no chmod */ 110 | int lchmod(const char *, mode_t); 111 | #endif 112 | #define S_IREAD S_IRUSR 113 | #define S_IWRITE S_IWUSR 114 | #define S_IEXEC S_IXUSR 115 | #endif 116 | 117 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 118 | #define stat64 stat 119 | #define fstat64 fstat 120 | #define lstat64 lstat 121 | #define fstatat64 fstatat 122 | #define blkcnt64_t blkcnt_t 123 | #define fsblkcnt64_t fsblkcnt_t 124 | #define fsfilcnt64_t fsfilcnt_t 125 | #define ino64_t ino_t 126 | #define off64_t off_t 127 | #endif 128 | 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | #endif 133 | 134 | 135 | -------------------------------------------------------------------------------- /sysroot/include/sys/stropts.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /sysroot/include/sys/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSCALL_H 2 | #define _SYS_SYSCALL_H 3 | 4 | #ifdef __wasilibc_unmodified_upstream /* WASI has no syscall */ 5 | #include 6 | #else 7 | /* The generic syscall funtion is not yet implemented. */ 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sysroot/include/sys/sysinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSINFO_H 2 | #define _SYS_SYSINFO_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define SI_LOAD_SHIFT 16 9 | 10 | struct sysinfo { 11 | unsigned long uptime; 12 | unsigned long loads[3]; 13 | unsigned long totalram; 14 | unsigned long freeram; 15 | unsigned long sharedram; 16 | unsigned long bufferram; 17 | unsigned long totalswap; 18 | unsigned long freeswap; 19 | unsigned short procs, pad; 20 | unsigned long totalhigh; 21 | unsigned long freehigh; 22 | unsigned mem_unit; 23 | char __reserved[256]; 24 | }; 25 | 26 | int sysinfo (struct sysinfo *); 27 | int get_nprocs_conf (void); 28 | int get_nprocs (void); 29 | long get_phys_pages (void); 30 | long get_avphys_pages (void); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /sysroot/include/sys/sysmacros.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSMACROS_H 2 | #define _SYS_SYSMACROS_H 3 | 4 | #define major(x) \ 5 | ((unsigned)( (((x)>>31>>1) & 0xfffff000) | (((x)>>8) & 0x00000fff) )) 6 | #define minor(x) \ 7 | ((unsigned)( (((x)>>12) & 0xffffff00) | ((x) & 0x000000ff) )) 8 | 9 | #define makedev(x,y) ( \ 10 | (((x)&0xfffff000ULL) << 32) | \ 11 | (((x)&0x00000fffULL) << 8) | \ 12 | (((y)&0xffffff00ULL) << 12) | \ 13 | (((y)&0x000000ffULL)) ) 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /sysroot/include/sys/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIME_H 2 | #define _SYS_TIME_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #include 10 | 11 | int gettimeofday (struct timeval *__restrict, void *__restrict); 12 | 13 | #ifdef __wasilibc_unmodified_upstream /* WASI has no getitimer */ 14 | #define ITIMER_REAL 0 15 | #define ITIMER_VIRTUAL 1 16 | #define ITIMER_PROF 2 17 | 18 | struct itimerval { 19 | struct timeval it_interval; 20 | struct timeval it_value; 21 | }; 22 | 23 | int getitimer (int, struct itimerval *); 24 | int setitimer (int, const struct itimerval *__restrict, struct itimerval *__restrict); 25 | #endif 26 | #ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ 27 | int utimes (const char *, const struct timeval [2]); 28 | #endif 29 | 30 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 31 | struct timezone { 32 | int tz_minuteswest; 33 | int tz_dsttime; 34 | }; 35 | #ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ 36 | int futimes(int, const struct timeval [2]); 37 | int futimesat(int, const char *, const struct timeval [2]); 38 | int lutimes(const char *, const struct timeval [2]); 39 | #endif 40 | #ifdef __wasilibc_unmodified_upstream /* WASI has no way to set the time */ 41 | int settimeofday(const struct timeval *, const struct timezone *); 42 | int adjtime (const struct timeval *, struct timeval *); 43 | #endif 44 | #define timerisset(t) ((t)->tv_sec || (t)->tv_usec) 45 | #define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0) 46 | #define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? \ 47 | (s)->tv_usec op (t)->tv_usec : (s)->tv_sec op (t)->tv_sec) 48 | #define timeradd(s,t,a) (void) ( (a)->tv_sec = (s)->tv_sec + (t)->tv_sec, \ 49 | ((a)->tv_usec = (s)->tv_usec + (t)->tv_usec) >= 1000000 && \ 50 | ((a)->tv_usec -= 1000000, (a)->tv_sec++) ) 51 | #define timersub(s,t,a) (void) ( (a)->tv_sec = (s)->tv_sec - (t)->tv_sec, \ 52 | ((a)->tv_usec = (s)->tv_usec - (t)->tv_usec) < 0 && \ 53 | ((a)->tv_usec += 1000000, (a)->tv_sec--) ) 54 | #endif 55 | 56 | #if defined(_GNU_SOURCE) 57 | #define TIMEVAL_TO_TIMESPEC(tv, ts) ( \ 58 | (ts)->tv_sec = (tv)->tv_sec, \ 59 | (ts)->tv_nsec = (tv)->tv_usec * 1000, \ 60 | (void)0 ) 61 | #define TIMESPEC_TO_TIMEVAL(tv, ts) ( \ 62 | (tv)->tv_sec = (ts)->tv_sec, \ 63 | (tv)->tv_usec = (ts)->tv_nsec / 1000, \ 64 | (void)0 ) 65 | #endif 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | #endif 71 | -------------------------------------------------------------------------------- /sysroot/include/sys/timeb.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIMEB_H 2 | #define _SYS_TIMEB_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #define __NEED_time_t 8 | 9 | #include 10 | 11 | struct timeb { 12 | time_t time; 13 | unsigned short millitm; 14 | short timezone, dstflag; 15 | }; 16 | 17 | int ftime(struct timeb *); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif 23 | -------------------------------------------------------------------------------- /sysroot/include/sys/times.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIMES_H 2 | #define _SYS_TIMES_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __NEED_clock_t 9 | #include 10 | 11 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 12 | struct tms { 13 | clock_t tms_utime; 14 | clock_t tms_stime; 15 | clock_t tms_cutime; 16 | clock_t tms_cstime; 17 | }; 18 | #else 19 | #include <__struct_tms.h> 20 | #endif 21 | 22 | clock_t times (struct tms *); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /sysroot/include/sys/timex.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIMEX_H 2 | #define _SYS_TIMEX_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __NEED_clockid_t 9 | 10 | #include 11 | 12 | #include 13 | 14 | struct ntptimeval { 15 | struct timeval time; 16 | long maxerror, esterror; 17 | }; 18 | 19 | struct timex { 20 | unsigned modes; 21 | long offset, freq, maxerror, esterror; 22 | int status; 23 | long constant, precision, tolerance; 24 | struct timeval time; 25 | long tick, ppsfreq, jitter; 26 | int shift; 27 | long stabil, jitcnt, calcnt, errcnt, stbcnt; 28 | int tai; 29 | int __padding[11]; 30 | }; 31 | 32 | #define ADJ_OFFSET 0x0001 33 | #define ADJ_FREQUENCY 0x0002 34 | #define ADJ_MAXERROR 0x0004 35 | #define ADJ_ESTERROR 0x0008 36 | #define ADJ_STATUS 0x0010 37 | #define ADJ_TIMECONST 0x0020 38 | #define ADJ_TAI 0x0080 39 | #define ADJ_SETOFFSET 0x0100 40 | #define ADJ_MICRO 0x1000 41 | #define ADJ_NANO 0x2000 42 | #define ADJ_TICK 0x4000 43 | #define ADJ_OFFSET_SINGLESHOT 0x8001 44 | #define ADJ_OFFSET_SS_READ 0xa001 45 | 46 | #define MOD_OFFSET ADJ_OFFSET 47 | #define MOD_FREQUENCY ADJ_FREQUENCY 48 | #define MOD_MAXERROR ADJ_MAXERROR 49 | #define MOD_ESTERROR ADJ_ESTERROR 50 | #define MOD_STATUS ADJ_STATUS 51 | #define MOD_TIMECONST ADJ_TIMECONST 52 | #define MOD_CLKB ADJ_TICK 53 | #define MOD_CLKA ADJ_OFFSET_SINGLESHOT 54 | #define MOD_TAI ADJ_TAI 55 | #define MOD_MICRO ADJ_MICRO 56 | #define MOD_NANO ADJ_NANO 57 | 58 | #define STA_PLL 0x0001 59 | #define STA_PPSFREQ 0x0002 60 | #define STA_PPSTIME 0x0004 61 | #define STA_FLL 0x0008 62 | 63 | #define STA_INS 0x0010 64 | #define STA_DEL 0x0020 65 | #define STA_UNSYNC 0x0040 66 | #define STA_FREQHOLD 0x0080 67 | 68 | #define STA_PPSSIGNAL 0x0100 69 | #define STA_PPSJITTER 0x0200 70 | #define STA_PPSWANDER 0x0400 71 | #define STA_PPSERROR 0x0800 72 | 73 | #define STA_CLOCKERR 0x1000 74 | #define STA_NANO 0x2000 75 | #define STA_MODE 0x4000 76 | #define STA_CLK 0x8000 77 | 78 | #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ 79 | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) 80 | 81 | #define TIME_OK 0 82 | #define TIME_INS 1 83 | #define TIME_DEL 2 84 | #define TIME_OOP 3 85 | #define TIME_WAIT 4 86 | #define TIME_ERROR 5 87 | #define TIME_BAD TIME_ERROR 88 | 89 | #define MAXTC 6 90 | 91 | int adjtimex(struct timex *); 92 | int clock_adjtime(clockid_t, struct timex *); 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /sysroot/include/sys/ttydefaults.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TTYDEFAULTS_H 2 | #define _SYS_TTYDEFAULTS_H 3 | 4 | #define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY) 5 | #define TTYDEF_OFLAG (OPOST | ONLCR | XTABS) 6 | #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) 7 | #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) 8 | #define TTYDEF_SPEED (B9600) 9 | #define CTRL(x) (x&037) 10 | #define CEOF CTRL('d') 11 | 12 | #ifdef _POSIX_VDISABLE 13 | #define CEOL _POSIX_VDISABLE 14 | #define CSTATUS _POSIX_VDISABLE 15 | #else 16 | #define CEOL '\0' 17 | #define CSTATUS '\0' 18 | #endif 19 | 20 | #define CERASE 0177 21 | #define CINTR CTRL('c') 22 | #define CKILL CTRL('u') 23 | #define CMIN 1 24 | #define CQUIT 034 25 | #define CSUSP CTRL('z') 26 | #define CTIME 0 27 | #define CDSUSP CTRL('y') 28 | #define CSTART CTRL('q') 29 | #define CSTOP CTRL('s') 30 | #define CLNEXT CTRL('v') 31 | #define CDISCARD CTRL('o') 32 | #define CWERASE CTRL('w') 33 | #define CREPRINT CTRL('r') 34 | #define CEOT CEOF 35 | #define CBRK CEOL 36 | #define CRPRNT CREPRINT 37 | #define CFLUSH CDISCARD 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sysroot/include/sys/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TYPES_H 2 | #define _SYS_TYPES_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | #define __NEED_ino_t 10 | #define __NEED_dev_t 11 | #define __NEED_uid_t 12 | #define __NEED_gid_t 13 | #define __NEED_mode_t 14 | #define __NEED_nlink_t 15 | #define __NEED_off_t 16 | #define __NEED_pid_t 17 | #define __NEED_size_t 18 | #define __NEED_ssize_t 19 | #define __NEED_time_t 20 | #define __NEED_timer_t 21 | #define __NEED_clockid_t 22 | 23 | #define __NEED_blkcnt_t 24 | #define __NEED_fsblkcnt_t 25 | #define __NEED_fsfilcnt_t 26 | 27 | #define __NEED_id_t 28 | #define __NEED_key_t 29 | #define __NEED_clock_t 30 | #define __NEED_suseconds_t 31 | #define __NEED_blksize_t 32 | 33 | #define __NEED_pthread_t 34 | #define __NEED_pthread_attr_t 35 | #define __NEED_pthread_mutexattr_t 36 | #define __NEED_pthread_condattr_t 37 | #define __NEED_pthread_rwlockattr_t 38 | #define __NEED_pthread_barrierattr_t 39 | #define __NEED_pthread_mutex_t 40 | #define __NEED_pthread_cond_t 41 | #define __NEED_pthread_rwlock_t 42 | #define __NEED_pthread_barrier_t 43 | #define __NEED_pthread_spinlock_t 44 | #define __NEED_pthread_key_t 45 | #define __NEED_pthread_once_t 46 | #define __NEED_useconds_t 47 | 48 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 49 | #define __NEED_int8_t 50 | #define __NEED_int16_t 51 | #define __NEED_int32_t 52 | #define __NEED_int64_t 53 | #define __NEED_u_int64_t 54 | #define __NEED_register_t 55 | #endif 56 | 57 | #include 58 | 59 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 60 | typedef unsigned char u_int8_t; 61 | typedef unsigned short u_int16_t; 62 | typedef unsigned u_int32_t; 63 | typedef char *caddr_t; 64 | typedef unsigned char u_char; 65 | typedef unsigned short u_short, ushort; 66 | typedef unsigned u_int, uint; 67 | typedef unsigned long u_long, ulong; 68 | typedef long long quad_t; 69 | typedef unsigned long long u_quad_t; 70 | #include 71 | #include 72 | #include 73 | #endif 74 | 75 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 76 | #define blkcnt64_t blkcnt_t 77 | #define fsblkcnt64_t fsblkcnt_t 78 | #define fsfilcnt64_t fsfilcnt_t 79 | #define ino64_t ino_t 80 | #define off64_t off_t 81 | #endif 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | #endif 87 | -------------------------------------------------------------------------------- /sysroot/include/sys/uio.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UIO_H 2 | #define _SYS_UIO_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_size_t 11 | #define __NEED_ssize_t 12 | #define __NEED_struct_iovec 13 | 14 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 15 | #define __NEED_off_t 16 | #endif 17 | 18 | #ifdef _GNU_SOURCE 19 | #define __NEED_pid_t 20 | #endif 21 | 22 | #include 23 | 24 | #define UIO_MAXIOV 1024 25 | 26 | ssize_t readv (int, const struct iovec *, int); 27 | ssize_t writev (int, const struct iovec *, int); 28 | 29 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 30 | ssize_t preadv (int, const struct iovec *, int, off_t); 31 | ssize_t pwritev (int, const struct iovec *, int, off_t); 32 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 33 | #define preadv64 preadv 34 | #define pwritev64 pwritev 35 | #define off64_t off_t 36 | #endif 37 | #endif 38 | 39 | #ifdef _GNU_SOURCE 40 | ssize_t process_vm_writev(pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long); 41 | ssize_t process_vm_readv(pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long); 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /sysroot/include/sys/un.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UN_H 2 | #define _SYS_UN_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_sa_family_t 11 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 12 | #define __NEED_size_t 13 | #endif 14 | 15 | #include 16 | 17 | #ifdef __wasilibc_unmodified_upstream /* WASI has no UNIX-domain sockets */ 18 | struct sockaddr_un { 19 | sa_family_t sun_family; 20 | char sun_path[108]; 21 | }; 22 | #else 23 | #include <__struct_sockaddr_un.h> 24 | #endif 25 | 26 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 27 | #ifdef __wasilibc_unmodified_upstream /* Declare strlen with the same attributes as uses */ 28 | size_t strlen(const char *); 29 | #else 30 | size_t strlen(const char *) __attribute__((__nothrow__, __leaf__, __pure__, __nonnull__(1))); 31 | #endif 32 | #define SUN_LEN(s) (2+strlen((s)->sun_path)) 33 | #endif 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sysroot/include/sys/utsname.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UTSNAME_H 2 | #define _SYS_UTSNAME_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | struct utsname { 11 | char sysname[65]; 12 | char nodename[65]; 13 | char release[65]; 14 | char version[65]; 15 | char machine[65]; 16 | #ifdef _GNU_SOURCE 17 | char domainname[65]; 18 | #else 19 | char __domainname[65]; 20 | #endif 21 | }; 22 | 23 | int uname (struct utsname *); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sysroot/include/syscall.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /sysroot/include/sysexits.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYSEXITS_H 2 | #define _SYSEXITS_H 3 | #define EX_OK 0 4 | #define EX__BASE 64 5 | #define EX_USAGE 64 6 | #define EX_DATAERR 65 7 | #define EX_NOINPUT 66 8 | #define EX_NOUSER 67 9 | #define EX_NOHOST 68 10 | #define EX_UNAVAILABLE 69 11 | #define EX_SOFTWARE 70 12 | #define EX_OSERR 71 13 | #define EX_OSFILE 72 14 | #define EX_CANTCREAT 73 15 | #define EX_IOERR 74 16 | #define EX_TEMPFAIL 75 17 | #define EX_PROTOCOL 76 18 | #define EX_NOPERM 77 19 | #define EX_CONFIG 78 20 | #define EX__MAX 78 21 | #endif 22 | -------------------------------------------------------------------------------- /sysroot/include/tar.h: -------------------------------------------------------------------------------- 1 | #ifndef _TAR_H 2 | #define _TAR_H 3 | 4 | #define TSUID 04000 5 | #define TSGID 02000 6 | #define TSVTX 01000 7 | #define TUREAD 00400 8 | #define TUWRITE 00200 9 | #define TUEXEC 00100 10 | #define TGREAD 00040 11 | #define TGWRITE 00020 12 | #define TGEXEC 00010 13 | #define TOREAD 00004 14 | #define TOWRITE 00002 15 | #define TOEXEC 00001 16 | 17 | #define REGTYPE '0' 18 | #define AREGTYPE '\0' 19 | #define LNKTYPE '1' 20 | #define SYMTYPE '2' 21 | #define CHRTYPE '3' 22 | #define BLKTYPE '4' 23 | #define DIRTYPE '5' 24 | #define FIFOTYPE '6' 25 | #define CONTTYPE '7' 26 | 27 | #define TMAGIC "ustar" 28 | #define TMAGLEN 6 29 | 30 | #define TVERSION "00" 31 | #define TVERSLEN 2 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /sysroot/include/threads.h: -------------------------------------------------------------------------------- 1 | #ifndef _THREADS_H 2 | #define _THREADS_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | typedef unsigned long thrd_t; 10 | #else 11 | typedef struct __pthread *thrd_t; 12 | #define thread_local _Thread_local 13 | #endif 14 | 15 | typedef int once_flag; 16 | typedef unsigned tss_t; 17 | typedef int (*thrd_start_t)(void *); 18 | typedef void (*tss_dtor_t)(void *); 19 | 20 | #define __NEED_cnd_t 21 | #define __NEED_mtx_t 22 | 23 | #include 24 | 25 | #define TSS_DTOR_ITERATIONS 4 26 | 27 | enum { 28 | thrd_success = 0, 29 | thrd_busy = 1, 30 | thrd_error = 2, 31 | thrd_nomem = 3, 32 | thrd_timedout = 4, 33 | }; 34 | 35 | enum { 36 | mtx_plain = 0, 37 | mtx_recursive = 1, 38 | mtx_timed = 2, 39 | }; 40 | 41 | #define ONCE_FLAG_INIT 0 42 | 43 | int thrd_create(thrd_t *, thrd_start_t, void *); 44 | _Noreturn void thrd_exit(int); 45 | 46 | int thrd_detach(thrd_t); 47 | int thrd_join(thrd_t, int *); 48 | 49 | int thrd_sleep(const struct timespec *, struct timespec *); 50 | void thrd_yield(void); 51 | 52 | thrd_t thrd_current(void); 53 | int thrd_equal(thrd_t, thrd_t); 54 | #ifndef __cplusplus 55 | #define thrd_equal(A, B) ((A) == (B)) 56 | #endif 57 | 58 | void call_once(once_flag *, void (*)(void)); 59 | 60 | int mtx_init(mtx_t *, int); 61 | void mtx_destroy(mtx_t *); 62 | 63 | int mtx_lock(mtx_t *); 64 | int mtx_timedlock(mtx_t *__restrict, const struct timespec *__restrict); 65 | int mtx_trylock(mtx_t *); 66 | int mtx_unlock(mtx_t *); 67 | 68 | int cnd_init(cnd_t *); 69 | void cnd_destroy(cnd_t *); 70 | 71 | int cnd_broadcast(cnd_t *); 72 | int cnd_signal(cnd_t *); 73 | 74 | int cnd_timedwait(cnd_t *__restrict, mtx_t *__restrict, const struct timespec *__restrict); 75 | int cnd_wait(cnd_t *, mtx_t *); 76 | 77 | int tss_create(tss_t *, tss_dtor_t); 78 | void tss_delete(tss_t); 79 | 80 | int tss_set(tss_t, void *); 81 | void *tss_get(tss_t); 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /sysroot/include/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIME_H 2 | #define _TIME_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #ifdef __wasilibc_unmodified_upstream /* Use the compiler's definition of NULL */ 11 | #ifdef __cplusplus 12 | #define NULL 0L 13 | #else 14 | #define NULL ((void*)0) 15 | #endif 16 | #else 17 | #define __need_NULL 18 | #include 19 | #endif 20 | 21 | 22 | #define __NEED_size_t 23 | #define __NEED_time_t 24 | #define __NEED_clock_t 25 | #define __NEED_struct_timespec 26 | 27 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 28 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 29 | || defined(_BSD_SOURCE) 30 | #define __NEED_clockid_t 31 | #define __NEED_timer_t 32 | #define __NEED_pid_t 33 | #define __NEED_locale_t 34 | #endif 35 | 36 | #include 37 | 38 | #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) 39 | #define __tm_gmtoff tm_gmtoff 40 | #define __tm_zone tm_zone 41 | #endif 42 | 43 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 44 | struct tm { 45 | int tm_sec; 46 | int tm_min; 47 | int tm_hour; 48 | int tm_mday; 49 | int tm_mon; 50 | int tm_year; 51 | int tm_wday; 52 | int tm_yday; 53 | int tm_isdst; 54 | long __tm_gmtoff; 55 | const char *__tm_zone; 56 | }; 57 | #else 58 | #include <__header_time.h> 59 | #endif 60 | 61 | clock_t clock (void); 62 | time_t time (time_t *); 63 | double difftime (time_t, time_t); 64 | time_t mktime (struct tm *); 65 | size_t strftime (char *__restrict, size_t, const char *__restrict, const struct tm *__restrict); 66 | struct tm *gmtime (const time_t *); 67 | struct tm *localtime (const time_t *); 68 | char *asctime (const struct tm *); 69 | char *ctime (const time_t *); 70 | int timespec_get(struct timespec *, int); 71 | 72 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 73 | #define CLOCKS_PER_SEC 1000000L 74 | 75 | #define TIME_UTC 1 76 | #endif 77 | 78 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 79 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 80 | || defined(_BSD_SOURCE) 81 | 82 | size_t strftime_l (char * __restrict, size_t, const char * __restrict, const struct tm * __restrict, locale_t); 83 | 84 | struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict); 85 | struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict); 86 | char *asctime_r (const struct tm *__restrict, char *__restrict); 87 | char *ctime_r (const time_t *, char *); 88 | 89 | #ifdef __wasilibc_unmodified_upstream /* WASI has no timezone tables */ 90 | void tzset (void); 91 | #endif 92 | 93 | struct itimerspec { 94 | struct timespec it_interval; 95 | struct timespec it_value; 96 | }; 97 | 98 | #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ 99 | #define CLOCK_REALTIME 0 100 | #define CLOCK_MONOTONIC 1 101 | #define CLOCK_PROCESS_CPUTIME_ID 2 102 | #define CLOCK_THREAD_CPUTIME_ID 3 103 | #define CLOCK_MONOTONIC_RAW 4 104 | #define CLOCK_REALTIME_COARSE 5 105 | #define CLOCK_MONOTONIC_COARSE 6 106 | #define CLOCK_BOOTTIME 7 107 | #define CLOCK_REALTIME_ALARM 8 108 | #define CLOCK_BOOTTIME_ALARM 9 109 | #define CLOCK_SGI_CYCLE 10 110 | #define CLOCK_TAI 11 111 | 112 | #define TIMER_ABSTIME 1 113 | #endif 114 | 115 | int nanosleep (const struct timespec *, struct timespec *); 116 | int clock_getres (clockid_t, struct timespec *); 117 | int clock_gettime (clockid_t, struct timespec *); 118 | #ifdef __wasilibc_unmodified_upstream /* WASI has no clock_settime */ 119 | int clock_settime (clockid_t, const struct timespec *); 120 | #endif 121 | int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *); 122 | #ifdef __wasilibc_unmodified_upstream /* WASI has no clock_getcpuclockid */ 123 | int clock_getcpuclockid (pid_t, clockid_t *); 124 | #endif 125 | 126 | #ifdef __wasilibc_unmodified_upstream /* WASI has no timers */ 127 | struct sigevent; 128 | int timer_create (clockid_t, struct sigevent *__restrict, timer_t *__restrict); 129 | int timer_delete (timer_t); 130 | int timer_settime (timer_t, int, const struct itimerspec *__restrict, struct itimerspec *__restrict); 131 | int timer_gettime (timer_t, struct itimerspec *); 132 | int timer_getoverrun (timer_t); 133 | #endif 134 | 135 | #ifdef __wasilibc_unmodified_upstream /* WASI has no timezone tables */ 136 | extern char *tzname[2]; 137 | #endif 138 | 139 | #endif 140 | 141 | 142 | #if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE) 143 | char *strptime (const char *__restrict, const char *__restrict, struct tm *__restrict); 144 | #ifdef __wasilibc_unmodified_upstream /* WASI has no timezone tables */ 145 | extern int daylight; 146 | extern long timezone; 147 | #endif 148 | extern int getdate_err; 149 | struct tm *getdate (const char *); 150 | #endif 151 | 152 | 153 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 154 | #ifdef __wasilibc_unmodified_upstream /* WASI has no stime */ 155 | int stime(const time_t *); 156 | #endif 157 | time_t timegm(struct tm *); 158 | #endif 159 | 160 | #ifdef __cplusplus 161 | } 162 | #endif 163 | 164 | 165 | #endif 166 | -------------------------------------------------------------------------------- /sysroot/include/uchar.h: -------------------------------------------------------------------------------- 1 | #ifndef _UCHAR_H 2 | #define _UCHAR_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #if __cplusplus < 201103L 9 | typedef unsigned short char16_t; 10 | typedef unsigned char32_t; 11 | #endif 12 | 13 | #define __NEED_mbstate_t 14 | #define __NEED_size_t 15 | 16 | #include 17 | #include 18 | 19 | size_t c16rtomb(char *__restrict, char16_t, mbstate_t *__restrict); 20 | size_t mbrtoc16(char16_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict); 21 | 22 | size_t c32rtomb(char *__restrict, char32_t, mbstate_t *__restrict); 23 | size_t mbrtoc32(char32_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sysroot/include/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTIME_H 2 | #define _UTIME_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __NEED_time_t 9 | 10 | #include 11 | 12 | struct utimbuf { 13 | time_t actime; 14 | time_t modtime; 15 | }; 16 | 17 | int utime (const char *, const struct utimbuf *); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /sysroot/include/values.h: -------------------------------------------------------------------------------- 1 | #ifndef _VALUES_H 2 | #define _VALUES_H 3 | 4 | #include 5 | 6 | #define CHARBITS (sizeof(char) * 8) 7 | #define SHORTBITS (sizeof(short) * 8) 8 | #define INTBITS (sizeof(int) * 8) 9 | #define LONGBITS (sizeof(long) * 8) 10 | #define PTRBITS (sizeof(char *) * 8) 11 | #define DOUBLEBITS (sizeof(double) * 8) 12 | #define FLOATBITS (sizeof(float) * 8) 13 | 14 | #define MINSHORT SHRT_MIN 15 | #define MININT INT_MIN 16 | #define MINLONG LONG_MIN 17 | 18 | #define MAXSHORT SHRT_MAX 19 | #define MAXINT INT_MAX 20 | #define MAXLONG LONG_MAX 21 | 22 | #define HIBITS MINSHORT 23 | #define HIBITL MINLONG 24 | 25 | #include 26 | 27 | #define MAXDOUBLE DBL_MAX 28 | #undef MAXFLOAT 29 | #define MAXFLOAT FLT_MAX 30 | #define MINDOUBLE DBL_MIN 31 | #define MINFLOAT FLT_MIN 32 | #define DMINEXP DBL_MIN_EXP 33 | #define FMINEXP FLT_MIN_EXP 34 | #define DMAXEXP DBL_MAX_EXP 35 | #define FMAXEXP FLT_MAX_EXP 36 | 37 | #define BITSPERBYTE CHAR_BIT 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sysroot/include/wasi/libc-find-relpath.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasi_libc_find_relpath_h 2 | #define __wasi_libc_find_relpath_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /** 9 | * Look up the given path in the preopened directory map. If a suitable 10 | * entry is found, return its directory file descriptor, and store the 11 | * computed relative path in *relative_path. Ignore preopened directories 12 | * which don't provide the specified rights. 13 | * 14 | * Returns -1 if no directories were suitable. 15 | */ 16 | int __wasilibc_find_relpath(const char *path, 17 | __wasi_rights_t rights_base, 18 | __wasi_rights_t rights_inheriting, 19 | const char **relative_path); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sysroot/include/wasi/libc.h: -------------------------------------------------------------------------------- 1 | #ifndef __wasi_libc_h 2 | #define __wasi_libc_h 3 | 4 | #include <__typedef_off_t.h> 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | void __wasilibc_init_preopen(void); 11 | int __wasilibc_register_preopened_fd(int fd, const char *path); 12 | int __wasilibc_fd_renumber(int fd, int newfd); 13 | int __wasilibc_unlinkat(int fd, const char *path); 14 | int __wasilibc_rmdirat(int fd, const char *path); 15 | off_t __wasilibc_tell(int fd); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sysroot/include/wctype.h: -------------------------------------------------------------------------------- 1 | #ifndef _WCTYPE_H 2 | #define _WCTYPE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define __NEED_wint_t 11 | #define __NEED_wctype_t 12 | 13 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 14 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 15 | #define __NEED_locale_t 16 | #endif 17 | 18 | #include 19 | 20 | typedef const int * wctrans_t; 21 | 22 | #undef WEOF 23 | #define WEOF 0xffffffffU 24 | 25 | #undef iswdigit 26 | 27 | int iswalnum(wint_t); 28 | int iswalpha(wint_t); 29 | int iswblank(wint_t); 30 | int iswcntrl(wint_t); 31 | int iswdigit(wint_t); 32 | int iswgraph(wint_t); 33 | int iswlower(wint_t); 34 | int iswprint(wint_t); 35 | int iswpunct(wint_t); 36 | int iswspace(wint_t); 37 | int iswupper(wint_t); 38 | int iswxdigit(wint_t); 39 | int iswctype(wint_t, wctype_t); 40 | wint_t towctrans(wint_t, wctrans_t); 41 | wint_t towlower(wint_t); 42 | wint_t towupper(wint_t); 43 | wctrans_t wctrans(const char *); 44 | wctype_t wctype(const char *); 45 | 46 | #ifndef __cplusplus 47 | #undef iswdigit 48 | #define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10) 49 | #endif 50 | 51 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 52 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 53 | 54 | int iswalnum_l(wint_t, locale_t); 55 | int iswalpha_l(wint_t, locale_t); 56 | int iswblank_l(wint_t, locale_t); 57 | int iswcntrl_l(wint_t, locale_t); 58 | int iswdigit_l(wint_t, locale_t); 59 | int iswgraph_l(wint_t, locale_t); 60 | int iswlower_l(wint_t, locale_t); 61 | int iswprint_l(wint_t, locale_t); 62 | int iswpunct_l(wint_t, locale_t); 63 | int iswspace_l(wint_t, locale_t); 64 | int iswupper_l(wint_t, locale_t); 65 | int iswxdigit_l(wint_t, locale_t); 66 | int iswctype_l(wint_t, wctype_t, locale_t); 67 | wint_t towlower_l(wint_t, locale_t); 68 | wint_t towupper_l(wint_t, locale_t); 69 | wint_t towctrans_l(wint_t, wctrans_t, locale_t); 70 | wctrans_t wctrans_l(const char *, locale_t); 71 | wctype_t wctype_l(const char *, locale_t); 72 | 73 | #endif 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/crt1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/lib/wasm32-wasi/crt1.o -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libc-printscan-long-double.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/lib/wasm32-wasi/libc-printscan-long-double.a -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libc-printscan-no-floating-point.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/lib/wasm32-wasi/libc-printscan-no-floating-point.a -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/lib/wasm32-wasi/libc.a -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libc.imports: -------------------------------------------------------------------------------- 1 | __wasi_args_get 2 | __wasi_args_sizes_get 3 | __wasi_clock_res_get 4 | __wasi_clock_time_get 5 | __wasi_environ_get 6 | __wasi_environ_sizes_get 7 | __wasi_fd_advise 8 | __wasi_fd_allocate 9 | __wasi_fd_close 10 | __wasi_fd_datasync 11 | __wasi_fd_fdstat_get 12 | __wasi_fd_fdstat_set_flags 13 | __wasi_fd_filestat_get 14 | __wasi_fd_filestat_set_size 15 | __wasi_fd_filestat_set_times 16 | __wasi_fd_pread 17 | __wasi_fd_prestat_dir_name 18 | __wasi_fd_prestat_get 19 | __wasi_fd_pwrite 20 | __wasi_fd_read 21 | __wasi_fd_readdir 22 | __wasi_fd_renumber 23 | __wasi_fd_seek 24 | __wasi_fd_sync 25 | __wasi_fd_tell 26 | __wasi_fd_write 27 | __wasi_path_create_directory 28 | __wasi_path_filestat_get 29 | __wasi_path_filestat_set_times 30 | __wasi_path_link 31 | __wasi_path_open 32 | __wasi_path_readlink 33 | __wasi_path_remove_directory 34 | __wasi_path_rename 35 | __wasi_path_symlink 36 | __wasi_path_unlink_file 37 | __wasi_poll_oneoff 38 | __wasi_proc_exit 39 | __wasi_random_get 40 | __wasi_sched_yield 41 | __wasi_sock_recv 42 | __wasi_sock_send 43 | __wasi_sock_shutdown 44 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libcrypt.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libdl.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libm.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libpthread.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libresolv.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/librt.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libutil.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libwasi-emulated-mman.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skoppe/spasm-imgui/733671f42c1af280eb5f72aa23d9925a42ce0924/sysroot/lib/wasm32-wasi/libwasi-emulated-mman.a -------------------------------------------------------------------------------- /sysroot/lib/wasm32-wasi/libxnet.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /sysroot/share/wasm32-wasi/include-all.c: -------------------------------------------------------------------------------- 1 | #include <__errno.h> 2 | #include <__errno_values.h> 3 | #include <__fd_set.h> 4 | #include <__function___isatty.h> 5 | #include <__functions_malloc.h> 6 | #include <__functions_memcpy.h> 7 | #include <__header_bits_signal.h> 8 | #include <__header_dirent.h> 9 | #include <__header_fcntl.h> 10 | #include <__header_inttypes.h> 11 | #include <__header_netinet_in.h> 12 | #include <__header_poll.h> 13 | #include <__header_stdlib.h> 14 | #include <__header_string.h> 15 | #include <__header_sys_ioctl.h> 16 | #include <__header_sys_resource.h> 17 | #include <__header_sys_socket.h> 18 | #include <__header_sys_stat.h> 19 | #include <__header_time.h> 20 | #include <__header_unistd.h> 21 | #include <__macro_FD_SETSIZE.h> 22 | #include <__macro_PAGESIZE.h> 23 | #include <__mode_t.h> 24 | #include <__seek.h> 25 | #include <__struct_dirent.h> 26 | #include <__struct_in6_addr.h> 27 | #include <__struct_in_addr.h> 28 | #include <__struct_iovec.h> 29 | #include <__struct_msghdr.h> 30 | #include <__struct_pollfd.h> 31 | #include <__struct_rusage.h> 32 | #include <__struct_sockaddr.h> 33 | #include <__struct_sockaddr_in.h> 34 | #include <__struct_sockaddr_in6.h> 35 | #include <__struct_sockaddr_storage.h> 36 | #include <__struct_sockaddr_un.h> 37 | #include <__struct_stat.h> 38 | #include <__struct_timespec.h> 39 | #include <__struct_timeval.h> 40 | #include <__struct_tm.h> 41 | #include <__struct_tms.h> 42 | #include <__typedef_DIR.h> 43 | #include <__typedef_blkcnt_t.h> 44 | #include <__typedef_blksize_t.h> 45 | #include <__typedef_clock_t.h> 46 | #include <__typedef_clockid_t.h> 47 | #include <__typedef_dev_t.h> 48 | #include <__typedef_fd_set.h> 49 | #include <__typedef_gid_t.h> 50 | #include <__typedef_in_addr_t.h> 51 | #include <__typedef_in_port_t.h> 52 | #include <__typedef_ino_t.h> 53 | #include <__typedef_mode_t.h> 54 | #include <__typedef_nfds_t.h> 55 | #include <__typedef_nlink_t.h> 56 | #include <__typedef_off_t.h> 57 | #include <__typedef_sa_family_t.h> 58 | #include <__typedef_sigset_t.h> 59 | #include <__typedef_socklen_t.h> 60 | #include <__typedef_ssize_t.h> 61 | #include <__typedef_suseconds_t.h> 62 | #include <__typedef_time_t.h> 63 | #include <__typedef_uid_t.h> 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #include 89 | #include 90 | #include 91 | #include 92 | #include 93 | #include 94 | #include 95 | #include 96 | #include 97 | #include 98 | #include 99 | #include 100 | #include 101 | #include 102 | #include 103 | #include 104 | #include 105 | #include 106 | #include 107 | #include 108 | #include 109 | #include 110 | #include 111 | #include 112 | #include 113 | #include 114 | #include 115 | #include 116 | #include 117 | #include 118 | #include 119 | #include 120 | #include 121 | #include 122 | #include 123 | #include 124 | #include 125 | #include 126 | #include 127 | #include 128 | #include 129 | #include 130 | #include 131 | #include 132 | #include 133 | #include 134 | #include 135 | #include 136 | #include 137 | #include 138 | #include 139 | #include 140 | #include 141 | #include 142 | #include 143 | #include 144 | #include 145 | #include 146 | #include 147 | #include 148 | #include 149 | #include 150 | #include 151 | #include 152 | #include 153 | #include 154 | #include 155 | #include 156 | #include 157 | #include 158 | #include 159 | #include 160 | #include 161 | #include 162 | #include 163 | #include 164 | #include 165 | #include 166 | #include 167 | #include 168 | #include 169 | #include 170 | #include 171 | #include 172 | #include 173 | #include 174 | #include 175 | #include 176 | #include 177 | #include 178 | -------------------------------------------------------------------------------- /sysroot/share/wasm32-wasi/undefined-symbols.txt: -------------------------------------------------------------------------------- 1 | __addtf3 2 | __divtf3 3 | __eqtf2 4 | __extenddftf2 5 | __extendsftf2 6 | __fixtfdi 7 | __fixtfsi 8 | __fixunstfsi 9 | __floatsitf 10 | __floatunsitf 11 | __getf2 12 | __gttf2 13 | __letf2 14 | __lttf2 15 | __muldc3 16 | __muloti4 17 | __mulsc3 18 | __multc3 19 | __multf3 20 | __netf2 21 | __stack_pointer 22 | __subtf3 23 | __trunctfdf2 24 | __trunctfsf2 25 | __unordtf2 26 | __wasi_args_get 27 | __wasi_args_sizes_get 28 | __wasi_clock_res_get 29 | __wasi_clock_time_get 30 | __wasi_environ_get 31 | __wasi_environ_sizes_get 32 | __wasi_fd_advise 33 | __wasi_fd_allocate 34 | __wasi_fd_close 35 | __wasi_fd_datasync 36 | __wasi_fd_fdstat_get 37 | __wasi_fd_fdstat_set_flags 38 | __wasi_fd_filestat_get 39 | __wasi_fd_filestat_set_size 40 | __wasi_fd_filestat_set_times 41 | __wasi_fd_pread 42 | __wasi_fd_prestat_dir_name 43 | __wasi_fd_prestat_get 44 | __wasi_fd_pwrite 45 | __wasi_fd_read 46 | __wasi_fd_readdir 47 | __wasi_fd_renumber 48 | __wasi_fd_seek 49 | __wasi_fd_sync 50 | __wasi_fd_tell 51 | __wasi_fd_write 52 | __wasi_path_create_directory 53 | __wasi_path_filestat_get 54 | __wasi_path_filestat_set_times 55 | __wasi_path_link 56 | __wasi_path_open 57 | __wasi_path_readlink 58 | __wasi_path_remove_directory 59 | __wasi_path_rename 60 | __wasi_path_symlink 61 | __wasi_path_unlink_file 62 | __wasi_poll_oneoff 63 | __wasi_proc_exit 64 | __wasi_random_get 65 | __wasi_sched_yield 66 | __wasi_sock_recv 67 | __wasi_sock_send 68 | __wasi_sock_shutdown 69 | __wasm_call_ctors 70 | main 71 | --------------------------------------------------------------------------------