-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This incoporates pieces from musl-libc, cloudlibc, cloudabi, libpreopen, and dlmalloc, as well as a significant amount of new code.
- Loading branch information
1 parent
0e98504
commit 320054e
Showing
2,691 changed files
with
131,460 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __wasm_basics___errno_h | ||
#define __wasm_basics___errno_h | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern thread_local int errno; | ||
#else | ||
extern _Thread_local int errno; | ||
#endif | ||
|
||
#define errno errno | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef __wasm___functions_malloc_h | ||
#define __wasm___functions_malloc_h | ||
|
||
#define __need_size_t | ||
#define __need_wchar_t | ||
#define __need_NULL | ||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void *malloc(size_t size) __attribute__((__malloc__, __warn_unused_result__)); | ||
void free(void *ptr); | ||
void *calloc(size_t nmemb, size_t size) __attribute__((__malloc__, __warn_unused_result__)); | ||
void *realloc(void *ptr, size_t size) __attribute__((__warn_unused_result__)); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __wasm___functions_memcpy_h | ||
#define __wasm___functions_memcpy_h | ||
|
||
#define __need_size_t | ||
#define __need_NULL | ||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void *memcpy(void *__restrict__ dst, const void *__restrict__ src, size_t n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2))); | ||
void *memmove(void *dst, const void *src, size_t n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2))); | ||
void *memset(void *dst, int c, size_t n) __attribute__((__nothrow__, __leaf__, __nonnull__(1))); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef __wasm_basics___macro_PAGESIZE_h | ||
#define __wasm_basics___macro_PAGESIZE_h | ||
|
||
/* | ||
* The page size in WebAssembly is fixed at 64 KiB. If this ever changes, | ||
* it's expected that applications will need to opt in, so we can change | ||
* this. | ||
*/ | ||
#define PAGESIZE (0x10000) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
#ifndef __wasm_sysroot___typedef_blksize_t_h | ||
#define __wasm_sysroot___typedef_blksize_t_h | ||
#ifndef __wasm_basics___typedef_blksize_t_h | ||
#define __wasm_basics___typedef_blksize_t_h | ||
|
||
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */ | ||
typedef long long blksize_t; | ||
typedef long blksize_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef __wasm_sysroot___typedef_nlink_t_h | ||
#define __wasm_sysroot___typedef_nlink_t_h | ||
#ifndef __wasm_basics___typedef_nlink_t_h | ||
#define __wasm_basics___typedef_nlink_t_h | ||
|
||
/* Define these as 64-bit signed integers to support billions of links. */ | ||
typedef long long nlink_t; | ||
/* Define these as 64-bit unsigned integers to support billions of links. */ | ||
typedef unsigned long long nlink_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
#ifndef __wasm_sysroot_errno_h | ||
#define __wasm_sysroot_errno_h | ||
#ifndef __wasm_basics_errno_h | ||
#define __wasm_basics_errno_h | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef WASM_THREAD_MODEL_SINGLE | ||
extern int errno; | ||
#else | ||
#ifdef __cplusplus | ||
extern thread_local int errno; | ||
#else | ||
extern _Thread_local int errno; | ||
#endif | ||
#endif | ||
|
||
#define errno errno | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#include <__errno.h> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
#ifndef __wasm_sysroot_stdlib_h | ||
#define __wasm_sysroot_stdlib_h | ||
|
||
#define __need_size_t | ||
#define __need_wchar_t | ||
#define __need_NULL | ||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void *malloc(size_t size); | ||
void free(void *ptr); | ||
void *calloc(size_t nmemb, size_t size); | ||
void *realloc(void *ptr, size_t size); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#ifndef __wasm_stdlib_h | ||
#define __wasm_stdlib_h | ||
|
||
/* | ||
* Include the real implementation, which is factored into a separate file so | ||
* that it can be reused by other libc stdlib implementations. | ||
*/ | ||
#include <__functions_malloc.h> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
#ifndef __wasm_sysroot_string_h | ||
#define __wasm_sysroot_string_h | ||
|
||
#define __need_size_t | ||
#define __need_NULL | ||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void *memcpy(void *dst, const void *src, size_t n); | ||
void *memmove(void *dst, const void *src, size_t n); | ||
void *memset(void *dst, int c, size_t n); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#ifndef __wasm_string_h | ||
#define __wasm_string_h | ||
|
||
/* | ||
* Include the real implementation, which is factored into a separate file so | ||
* that it can be reused by other libc string implementations. | ||
*/ | ||
#include <__functions_memcpy.h> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.