Squash commits for public release

This commit is contained in:
2025-02-12 09:54:05 -05:00
commit 7118adc514
1108 changed files with 80873 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
#ifndef _LIBC_SYS__STRUCTS_H
#define _LIBC_SYS__STRUCTS_H
#endif

View File

@@ -0,0 +1,10 @@
#ifndef _LIBC_SYS__TYPES__DEVS_H
#define _LIBC_SYS__TYPES__DEVS_H
#define MINORBITS 20
#define MINORMASK ((1U << MINORBITS) - 1)
#define major(dev) ((unsigned int)((dev) >> MINORBITS))
#define minor(dev) ((unsigned int)((dev)&MINORMASK))
#define makedev(ma, mi) (((ma) << MINORBITS) | (mi))
#endif // _LIBC_SYS__TYPES__DEVS_H

View File

@@ -0,0 +1,77 @@
#ifndef _LIBC_SYS__TYPES__INTS_H
#define _LIBC_SYS__TYPES__INTS_H
#include <bits/types.h>
#ifndef __stdints_defined
#define __stdints_defined
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
#endif // __stdints_defined
#ifndef __dev_t_defined
#define __dev_t_defined
typedef __dev_t dev_t;
#endif // __dev_t_defined
#ifndef __uid_t_defined
#define __uid_t_defined
typedef __uid_t uid_t;
#endif // __uid_t_defined
#ifndef __gid_t_defined
#define __gid_t_defined
typedef __gid_t gid_t;
#endif // __gid_t_defined
#ifndef __ino_t_defined
#define __ino_t_defined
typedef __ino_t ino_t;
#endif // __ino_t_defined
#ifndef __ino64_t_defined
#define __ino64_t_defined
typedef __ino64_t ino64_t;
#endif // __ino64_t_defined
#ifndef __mode_t_defined
#define __mode_t_defined
typedef __mode_t mode_t;
#endif // __mode_t_defined
#ifndef __nlink_t_defined
#define __nlink_t_defined
typedef __nlink_t nlink_t;
#endif // __nlink_t_defined
#ifndef __off_t_defined
#define __off_t_defined
typedef __off_t off_t;
#endif // __off_t_defined
#ifndef __off64_t_defined
#define __off64_t_defined
typedef __off64_t off64_t;
#endif // __off64_t_defined
#ifndef __pid_t_defined
#define __pid_t_defined
typedef __pid_t pid_t;
#endif // __pid_t_defined
#ifndef __fsid_t_defined
#define __fsid_t_defined
typedef __fsid_t fsid_t;
#endif // __fsid_t_defined
#ifndef __time_t_defined
#define __time_t_defined
typedef __time_t time_t;
#endif // __time_t_defined
#endif // _LIBC_SYS__TYPES__INTS_H

View File

@@ -0,0 +1,6 @@
#ifndef _LIBC_SYS__TYPES__VA_LIST_H
#define _LIBC_SYS__TYPES__VA_LIST_H
typedef __builtin_va_list va_list;
#endif // _LIBC_SYS__TYPES__VA_LIST_H

View File

@@ -0,0 +1,23 @@
#ifndef _LIBC_SYS_CDEFS_H
#define _LIBC_SYS_CDEFS_H
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
/* Define __use_instead macro for some functions so the user can be warned
about better/faster functions. */
#ifndef __use_instead
#ifdef __clang__
#define __use_instead(F) __attribute__((diagnose_if(1, "use " F " instead", \
"warning")))
#elif defined(__GNUC__)
#define __use_instead(F) __attribute__((warning("use " F " instead")))
#endif
#endif
#endif // _LIBC_SYS_CDEFS_H

View File

@@ -0,0 +1,12 @@
#ifndef _LIBC_SYS_ENVIRON_H
#define _LIBC_SYS_ENVIRON_H
#include <sys/cdefs.h>
__BEGIN_DECLS
extern char** environ;
__END_DECLS
#endif // _LIBC_SYS_ENVIRON_H

View File

@@ -0,0 +1,16 @@
#ifndef _LIBC_SYS_IOCTL_H
#define _LIBC_SYS_IOCTL_H
#include <bits/sys/ioctls.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int ioctl(int fd, uintptr_t cmd, uintptr_t arg);
__END_DECLS
#endif // _LIBC_SYS_IOCTL_H

View File

@@ -0,0 +1,16 @@
#ifndef _LIBC_SYS_MMAN_H
#define _LIBC_SYS_MMAN_H
#include <bits/sys/mman.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
void* mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void* addr, size_t length);
__END_DECLS
#endif // _LIBC_SYS_MMAN_H

View File

@@ -0,0 +1,15 @@
#ifndef _LIBC_SYS_PTRACE_H
#define _LIBC_SYS_PTRACE_H
#include <bits/sys/ptrace.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int ptrace(ptrace_request_t request, pid_t pid, void* addr, void* data);
__END_DECLS
#endif // _LIBC_SYS_PTRACE_H

View File

@@ -0,0 +1,16 @@
#ifndef _LIBC_SYS_SELECT_H
#define _LIBC_SYS_SELECT_H
#include <bits/sys/select.h>
#include <bits/time.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int select(int nfds, fd_set_t* readfds, fd_set_t* writefds, fd_set_t* exceptfds, timeval_t* timeout);
__END_DECLS
#endif // _LIBC_SYS_SELECT_H

View File

@@ -0,0 +1,17 @@
#ifndef _LIBC_SYS_SOCKET_H
#define _LIBC_SYS_SOCKET_H
#include <bits/sys/socket.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int socket(int domain, int type, int protocol);
int bind(int sockfd, const char* name, int len);
int connect(int sockfd, const char* name, int len);
__END_DECLS
#endif // _LIBC_SYS_SOCKET_H

View File

@@ -0,0 +1,15 @@
#ifndef _LIBC_SYS_STAT_H
#define _LIBC_SYS_STAT_H
#include <bits/sys/stat.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int mkdir(const char* path);
int fstat(int nfds, stat_t* stat);
__END_DECLS
#endif

View File

@@ -0,0 +1,14 @@
#ifndef _LIBC_SYS_TIME_H
#define _LIBC_SYS_TIME_H
#include <bits/time.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
int gettimeofday(timeval_t* tv, timezone_t* tz);
int settimeofday(const timeval_t* tv, const timezone_t* tz);
__END_DECLS
#endif

View File

@@ -0,0 +1,8 @@
#ifndef _LIBC_SYS_TYPES_H
#define _LIBC_SYS_TYPES_H
#include <sys/_types/_devs.h>
#include <sys/_types/_ints.h>
#include <sys/_types/_va_list.h>
#endif /* _LIBC_SYS_TYPES_H */

View File

@@ -0,0 +1,13 @@
#ifndef _LIBC_SYS_UTSNAME_H
#define _LIBC_SYS_UTSNAME_H
#include <bits/sys/utsname.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
int uname(utsname_t* buf);
__END_DECLS
#endif // _LIBC_SYS_UTSNAME_H

View File

@@ -0,0 +1,17 @@
#ifndef _LIBC_SYS_WAIT_H
#define _LIBC_SYS_WAIT_H
#include <bits/sys/wait.h>
#include <fcntl.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int wait(int pid);
int waitpid(int pid, int* status, int options);
__END_DECLS
#endif // _LIBC_SYS_WAIT_H