summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/include
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/src/include
parentInitial commit. (diff)
downloadwasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.tar.xz
wasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/src/include')
-rw-r--r--libc-top-half/musl/src/include/arpa/inet.h8
-rw-r--r--libc-top-half/musl/src/include/crypt.h16
-rw-r--r--libc-top-half/musl/src/include/errno.h18
-rw-r--r--libc-top-half/musl/src/include/features.h11
-rw-r--r--libc-top-half/musl/src/include/langinfo.h8
-rw-r--r--libc-top-half/musl/src/include/pthread.h29
-rw-r--r--libc-top-half/musl/src/include/resolv.h12
-rw-r--r--libc-top-half/musl/src/include/signal.h16
-rw-r--r--libc-top-half/musl/src/include/stdio.h22
-rw-r--r--libc-top-half/musl/src/include/stdlib.h19
-rw-r--r--libc-top-half/musl/src/include/string.h11
-rw-r--r--libc-top-half/musl/src/include/sys/auxv.h10
-rw-r--r--libc-top-half/musl/src/include/sys/membarrier.h9
-rw-r--r--libc-top-half/musl/src/include/sys/mman.h20
-rw-r--r--libc-top-half/musl/src/include/sys/sysinfo.h9
-rw-r--r--libc-top-half/musl/src/include/sys/time.h8
-rw-r--r--libc-top-half/musl/src/include/time.h15
-rw-r--r--libc-top-half/musl/src/include/unistd.h20
-rw-r--r--libc-top-half/musl/src/include/wchar.h11
19 files changed, 272 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/include/arpa/inet.h b/libc-top-half/musl/src/include/arpa/inet.h
new file mode 100644
index 0000000..1e6debf
--- /dev/null
+++ b/libc-top-half/musl/src/include/arpa/inet.h
@@ -0,0 +1,8 @@
+#ifndef ARPA_INET_H
+#define ARPA_INET_H
+
+#include "../../../include/arpa/inet.h"
+
+hidden int __inet_aton(const char *, struct in_addr *);
+
+#endif
diff --git a/libc-top-half/musl/src/include/crypt.h b/libc-top-half/musl/src/include/crypt.h
new file mode 100644
index 0000000..f6c6309
--- /dev/null
+++ b/libc-top-half/musl/src/include/crypt.h
@@ -0,0 +1,16 @@
+#ifndef CRYPT_H
+#define CRYPT_H
+
+#include "../../include/crypt.h"
+
+#include <features.h>
+
+hidden char *__crypt_r(const char *, const char *, struct crypt_data *);
+
+hidden char *__crypt_des(const char *, const char *, char *);
+hidden char *__crypt_md5(const char *, const char *, char *);
+hidden char *__crypt_blowfish(const char *, const char *, char *);
+hidden char *__crypt_sha256(const char *, const char *, char *);
+hidden char *__crypt_sha512(const char *, const char *, char *);
+
+#endif
diff --git a/libc-top-half/musl/src/include/errno.h b/libc-top-half/musl/src/include/errno.h
new file mode 100644
index 0000000..70941d8
--- /dev/null
+++ b/libc-top-half/musl/src/include/errno.h
@@ -0,0 +1,18 @@
+#ifndef ERRNO_H
+#define ERRNO_H
+
+#include "../../include/errno.h"
+
+#ifdef __wasilibc_unmodified_upstream // Use alternate WASI libc headers
+#ifdef __GNUC__
+__attribute__((const))
+#endif
+hidden int *___errno_location(void);
+
+#undef errno
+#define errno (*___errno_location())
+#else
+// Use the WASI libc errno.
+#endif
+
+#endif
diff --git a/libc-top-half/musl/src/include/features.h b/libc-top-half/musl/src/include/features.h
new file mode 100644
index 0000000..f17bd15
--- /dev/null
+++ b/libc-top-half/musl/src/include/features.h
@@ -0,0 +1,11 @@
+#ifndef FEATURES_H
+#define FEATURES_H
+
+#include "../../include/features.h"
+
+#define weak __attribute__((__weak__))
+#define hidden __attribute__((__visibility__("hidden")))
+#define weak_alias(old, new) \
+ extern __typeof(old) new __attribute__((__weak__, __alias__(#old)))
+
+#endif
diff --git a/libc-top-half/musl/src/include/langinfo.h b/libc-top-half/musl/src/include/langinfo.h
new file mode 100644
index 0000000..ab32b88
--- /dev/null
+++ b/libc-top-half/musl/src/include/langinfo.h
@@ -0,0 +1,8 @@
+#ifndef LANGINFO_H
+#define LANGINFO_H
+
+#include "../../include/langinfo.h"
+
+char *__nl_langinfo_l(nl_item, locale_t);
+
+#endif
diff --git a/libc-top-half/musl/src/include/pthread.h b/libc-top-half/musl/src/include/pthread.h
new file mode 100644
index 0000000..7167d3e
--- /dev/null
+++ b/libc-top-half/musl/src/include/pthread.h
@@ -0,0 +1,29 @@
+#ifndef PTHREAD_H
+#define PTHREAD_H
+
+#include "../../include/pthread.h"
+
+hidden int __pthread_once(pthread_once_t *, void (*)(void));
+hidden void __pthread_testcancel(void);
+hidden int __pthread_setcancelstate(int, int *);
+hidden int __pthread_create(pthread_t *restrict, const pthread_attr_t *restrict, void *(*)(void *), void *restrict);
+hidden _Noreturn void __pthread_exit(void *);
+hidden int __pthread_join(pthread_t, void **);
+hidden int __pthread_mutex_lock(pthread_mutex_t *);
+hidden int __pthread_mutex_trylock(pthread_mutex_t *);
+hidden int __pthread_mutex_trylock_owner(pthread_mutex_t *);
+hidden int __pthread_mutex_timedlock(pthread_mutex_t *restrict, const struct timespec *restrict);
+hidden int __pthread_mutex_unlock(pthread_mutex_t *);
+hidden int __private_cond_signal(pthread_cond_t *, int);
+hidden int __pthread_cond_timedwait(pthread_cond_t *restrict, pthread_mutex_t *restrict, const struct timespec *restrict);
+hidden int __pthread_key_create(pthread_key_t *, void (*)(void *));
+hidden int __pthread_key_delete(pthread_key_t);
+hidden int __pthread_rwlock_rdlock(pthread_rwlock_t *);
+hidden int __pthread_rwlock_tryrdlock(pthread_rwlock_t *);
+hidden int __pthread_rwlock_timedrdlock(pthread_rwlock_t *__restrict, const struct timespec *__restrict);
+hidden int __pthread_rwlock_wrlock(pthread_rwlock_t *);
+hidden int __pthread_rwlock_trywrlock(pthread_rwlock_t *);
+hidden int __pthread_rwlock_timedwrlock(pthread_rwlock_t *__restrict, const struct timespec *__restrict);
+hidden int __pthread_rwlock_unlock(pthread_rwlock_t *);
+
+#endif
diff --git a/libc-top-half/musl/src/include/resolv.h b/libc-top-half/musl/src/include/resolv.h
new file mode 100644
index 0000000..945e89e
--- /dev/null
+++ b/libc-top-half/musl/src/include/resolv.h
@@ -0,0 +1,12 @@
+#ifndef RESOLV_H
+#define RESOLV_H
+
+#include "../../include/resolv.h"
+
+hidden int __dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int);
+
+hidden int __res_mkquery(int, const char *, int, int, const unsigned char *, int, const unsigned char*, unsigned char *, int);
+hidden int __res_send(const unsigned char *, int, unsigned char *, int);
+hidden int __res_msend(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int);
+
+#endif
diff --git a/libc-top-half/musl/src/include/signal.h b/libc-top-half/musl/src/include/signal.h
new file mode 100644
index 0000000..46de698
--- /dev/null
+++ b/libc-top-half/musl/src/include/signal.h
@@ -0,0 +1,16 @@
+#ifndef SIGNAL_H
+#define SIGNAL_H
+
+#include "../../include/signal.h"
+
+#ifdef __wasilibc_unmodified_upstream // WASI has no sigaction
+hidden int __sigaction(int, const struct sigaction *, struct sigaction *);
+
+hidden void __block_all_sigs(void *);
+hidden void __block_app_sigs(void *);
+hidden void __restore_sigs(void *);
+
+hidden void __get_handler_set(sigset_t *);
+#endif
+
+#endif
diff --git a/libc-top-half/musl/src/include/stdio.h b/libc-top-half/musl/src/include/stdio.h
new file mode 100644
index 0000000..176a73c
--- /dev/null
+++ b/libc-top-half/musl/src/include/stdio.h
@@ -0,0 +1,22 @@
+#ifndef STDIO_H
+#define STDIO_H
+
+#ifdef __wasilibc_unmodified_upstream /* WASI doesn't need to define FILE as a complete type */
+#define __DEFINED_struct__IO_FILE
+#endif
+
+#include "../../include/stdio.h"
+
+#undef stdin
+#undef stdout
+#undef stderr
+
+extern hidden FILE __stdin_FILE;
+extern hidden FILE __stdout_FILE;
+extern hidden FILE __stderr_FILE;
+
+#define stdin (&__stdin_FILE)
+#define stdout (&__stdout_FILE)
+#define stderr (&__stderr_FILE)
+
+#endif
diff --git a/libc-top-half/musl/src/include/stdlib.h b/libc-top-half/musl/src/include/stdlib.h
new file mode 100644
index 0000000..812b04d
--- /dev/null
+++ b/libc-top-half/musl/src/include/stdlib.h
@@ -0,0 +1,19 @@
+#ifndef STDLIB_H
+#define STDLIB_H
+
+#include "../../include/stdlib.h"
+
+hidden int __putenv(char *, size_t, char *);
+hidden void __env_rm_add(char *, char *);
+hidden int __mkostemps(char *, int, int);
+hidden int __ptsname_r(int, char *, size_t);
+hidden char *__randname(char *);
+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
+
+hidden void *__libc_malloc(size_t);
+hidden void *__libc_malloc_impl(size_t);
+hidden void *__libc_calloc(size_t, size_t);
+hidden void *__libc_realloc(void *, size_t);
+hidden void __libc_free(void *);
+
+#endif
diff --git a/libc-top-half/musl/src/include/string.h b/libc-top-half/musl/src/include/string.h
new file mode 100644
index 0000000..2133b5c
--- /dev/null
+++ b/libc-top-half/musl/src/include/string.h
@@ -0,0 +1,11 @@
+#ifndef STRING_H
+#define STRING_H
+
+#include "../../include/string.h"
+
+hidden void *__memrchr(const void *, int, size_t);
+hidden char *__stpcpy(char *, const char *);
+hidden char *__stpncpy(char *, const char *, size_t);
+hidden char *__strchrnul(const char *, int);
+
+#endif
diff --git a/libc-top-half/musl/src/include/sys/auxv.h b/libc-top-half/musl/src/include/sys/auxv.h
new file mode 100644
index 0000000..9358a4a
--- /dev/null
+++ b/libc-top-half/musl/src/include/sys/auxv.h
@@ -0,0 +1,10 @@
+#ifndef SYS_AUXV_H
+#define SYS_AUXV_H
+
+#include "../../../include/sys/auxv.h"
+
+#include <features.h>
+
+hidden unsigned long __getauxval(unsigned long);
+
+#endif
diff --git a/libc-top-half/musl/src/include/sys/membarrier.h b/libc-top-half/musl/src/include/sys/membarrier.h
new file mode 100644
index 0000000..3654491
--- /dev/null
+++ b/libc-top-half/musl/src/include/sys/membarrier.h
@@ -0,0 +1,9 @@
+#ifndef SYS_MEMBARRIER_H
+#define SYS_MEMBARRIER_H
+
+#include "../../../include/sys/membarrier.h"
+#include <features.h>
+
+hidden int __membarrier(int, int);
+
+#endif
diff --git a/libc-top-half/musl/src/include/sys/mman.h b/libc-top-half/musl/src/include/sys/mman.h
new file mode 100644
index 0000000..57c5bd3
--- /dev/null
+++ b/libc-top-half/musl/src/include/sys/mman.h
@@ -0,0 +1,20 @@
+#ifndef SYS_MMAN_H
+#define SYS_MMAN_H
+
+#include "../../../include/sys/mman.h"
+
+hidden void __vm_wait(void);
+hidden void __vm_lock(void);
+hidden void __vm_unlock(void);
+
+hidden void *__mmap(void *, size_t, int, int, int, off_t);
+hidden int __munmap(void *, size_t);
+hidden void *__mremap(void *, size_t, size_t, int, ...);
+hidden int __madvise(void *, size_t, int);
+hidden int __mprotect(void *, size_t, int);
+
+hidden const unsigned char *__map_file(const char *, size_t *);
+
+hidden char *__shm_mapname(const char *, char *);
+
+#endif
diff --git a/libc-top-half/musl/src/include/sys/sysinfo.h b/libc-top-half/musl/src/include/sys/sysinfo.h
new file mode 100644
index 0000000..10be8a4
--- /dev/null
+++ b/libc-top-half/musl/src/include/sys/sysinfo.h
@@ -0,0 +1,9 @@
+#ifndef SYS_SYSINFO_H
+#define SYS_SYSINFO_H
+
+#include "../../../include/sys/sysinfo.h"
+#include <features.h>
+
+hidden int __lsysinfo(struct sysinfo *);
+
+#endif
diff --git a/libc-top-half/musl/src/include/sys/time.h b/libc-top-half/musl/src/include/sys/time.h
new file mode 100644
index 0000000..fb9622e
--- /dev/null
+++ b/libc-top-half/musl/src/include/sys/time.h
@@ -0,0 +1,8 @@
+#ifndef SYS_TIME_H
+#define SYS_TIME_H
+
+#include "../../../include/sys/time.h"
+
+hidden int __futimesat(int, const char *, const struct timeval [2]);
+
+#endif
diff --git a/libc-top-half/musl/src/include/time.h b/libc-top-half/musl/src/include/time.h
new file mode 100644
index 0000000..cbabde4
--- /dev/null
+++ b/libc-top-half/musl/src/include/time.h
@@ -0,0 +1,15 @@
+#ifndef TIME_H
+#define TIME_H
+
+#include "../../include/time.h"
+
+hidden int __clock_gettime(clockid_t, struct timespec *);
+hidden int __clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);
+
+hidden char *__asctime_r(const struct tm *, char *);
+hidden struct tm *__gmtime_r(const time_t *restrict, struct tm *restrict);
+hidden struct tm *__localtime_r(const time_t *restrict, struct tm *restrict);
+
+hidden size_t __strftime_l(char *restrict, size_t, const char *restrict, const struct tm *restrict, locale_t);
+
+#endif
diff --git a/libc-top-half/musl/src/include/unistd.h b/libc-top-half/musl/src/include/unistd.h
new file mode 100644
index 0000000..d02206e
--- /dev/null
+++ b/libc-top-half/musl/src/include/unistd.h
@@ -0,0 +1,20 @@
+#ifndef UNISTD_H
+#define UNISTD_H
+
+#include "../../include/unistd.h"
+
+#ifdef __wasilibc_unmodified_upstream // Lazy environment variable init.
+extern char **__environ;
+#else
+// To support lazy initialization of environment variables, `__environ` is
+// omitted, and a lazy `__wasilibc_environ` is used instead. Use
+// "wasi/libc-environ-compat.h" in functions that use `__environ`.
+#include "wasi/libc-environ.h"
+#endif
+
+hidden int __dup3(int, int, int);
+hidden int __mkostemps(char *, int, int);
+hidden int __execvpe(const char *, char *const *, char *const *);
+hidden off_t __lseek(int, off_t, int);
+
+#endif
diff --git a/libc-top-half/musl/src/include/wchar.h b/libc-top-half/musl/src/include/wchar.h
new file mode 100644
index 0000000..1814bad
--- /dev/null
+++ b/libc-top-half/musl/src/include/wchar.h
@@ -0,0 +1,11 @@
+#ifndef WCHAR_H
+#define WCHAR_H
+
+#ifdef __wasilibc_unmodified_upstream /* WASI doesn't need to define FILE as a complete type */
+#define __DEFINED_struct__IO_FILE
+#endif
+
+#include "../../include/wchar.h"
+
+#endif
+