user: implement mlibc as the libc, finally.
It's finally done.. Signed-off-by: kaguya <vpshinomiya@protonmail.com>
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
build/
|
build/
|
||||||
user/build
|
user/build
|
||||||
|
toolchains/
|
||||||
+6
-4
@@ -91,7 +91,7 @@ add_custom_target(iso
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(disk_img
|
add_custom_target(disk_img
|
||||||
COMMAND dd if=/dev/zero of=${DISK_IMG} bs=1M count=32
|
COMMAND dd if=/dev/zero of=${DISK_IMG} bs=1M count=512
|
||||||
COMMAND mkfs.ext2 -F -L KIRKOS ${DISK_IMG}
|
COMMAND mkfs.ext2 -F -L KIRKOS ${DISK_IMG}
|
||||||
|
|
||||||
COMMAND guestfish --rw -a ${DISK_IMG} run
|
COMMAND guestfish --rw -a ${DISK_IMG} run
|
||||||
@@ -111,6 +111,7 @@ add_custom_target(run
|
|||||||
-smp 2
|
-smp 2
|
||||||
-device ich9-intel-hda
|
-device ich9-intel-hda
|
||||||
-device hda-duplex
|
-device hda-duplex
|
||||||
|
-cpu qemu64,+fsgsbase
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(debug
|
add_custom_target(debug
|
||||||
@@ -118,13 +119,14 @@ add_custom_target(debug
|
|||||||
COMMAND qemu-system-x86_64
|
COMMAND qemu-system-x86_64
|
||||||
-cdrom ${ISO}
|
-cdrom ${ISO}
|
||||||
-hda ${DISK_IMG}
|
-hda ${DISK_IMG}
|
||||||
-s -S
|
|
||||||
-debugcon stdio
|
-debugcon stdio
|
||||||
|
-s -S
|
||||||
-d int,cpu_reset
|
-d int,cpu_reset
|
||||||
-m 8G
|
-m 8G
|
||||||
-smp 2
|
-smp 2
|
||||||
-device ich9-intel-hda,id=hda
|
-device ich9-intel-hda
|
||||||
-device hda-duplex,id=codec0,bus=hda.0,cad=0
|
-device hda-duplex
|
||||||
|
-cpu qemu64,+fsgsbase
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(KirkOS PRIVATE
|
target_include_directories(KirkOS PRIVATE
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
+3058
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _ABIBITS_ACCESS_H
|
||||||
|
#define _ABIBITS_ACCESS_H
|
||||||
|
|
||||||
|
#define F_OK 0
|
||||||
|
#define X_OK 1
|
||||||
|
#define W_OK 2
|
||||||
|
#define R_OK 4
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_ACCESS_H */
|
||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef _ABIBITS_AUXV_H
|
||||||
|
#define _ABIBITS_AUXV_H
|
||||||
|
|
||||||
|
#define AT_PLATFORM 15
|
||||||
|
#define AT_HWCAP 16
|
||||||
|
#define AT_CLKTCK 17
|
||||||
|
#define AT_FPUCW 18
|
||||||
|
#define AT_SECURE 23
|
||||||
|
#define AT_RANDOM 25
|
||||||
|
#define AT_HWCAP2 26
|
||||||
|
#define AT_HWCAP3 29
|
||||||
|
#define AT_HWCAP4 30
|
||||||
|
#define AT_EXECFN 31
|
||||||
|
#define AT_SYSINFO_EHDR 33
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_AUXV_H */
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _ABIBITS_BLKCNT_T_H
|
||||||
|
#define _ABIBITS_BLKCNT_T_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef __mlibc_int64 blkcnt_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_BLKCNT_T_H */
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_BLKSIZE_T_H
|
||||||
|
#define _ABIBITS_BLKSIZE_T_H
|
||||||
|
|
||||||
|
typedef long blksize_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_BLKSIZE_T_H */
|
||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef _ABIBITS_CLOCKID_T_H
|
||||||
|
#define _ABIBITS_CLOCKID_T_H
|
||||||
|
|
||||||
|
typedef int clockid_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_CLOCKID_T_H */
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_DEV_T_H
|
||||||
|
#define _ABIBITS_DEV_T_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef __mlibc_uint64 dev_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_DEV_T_H */
|
||||||
Executable
+143
@@ -0,0 +1,143 @@
|
|||||||
|
#ifndef _ABIBITS_ERRNO_H
|
||||||
|
#define _ABIBITS_ERRNO_H
|
||||||
|
|
||||||
|
#define EPERM 1
|
||||||
|
#define ENOENT 2
|
||||||
|
#define ESRCH 3
|
||||||
|
#define EINTR 4
|
||||||
|
#define EIO 5
|
||||||
|
#define ENXIO 6
|
||||||
|
#define E2BIG 7
|
||||||
|
#define ENOEXEC 8
|
||||||
|
#define EBADF 9
|
||||||
|
#define ECHILD 10
|
||||||
|
#define EAGAIN 11
|
||||||
|
#define ENOMEM 12
|
||||||
|
#define EACCES 13
|
||||||
|
#define EFAULT 14
|
||||||
|
#define ENOTBLK 15
|
||||||
|
#define EBUSY 16
|
||||||
|
#define EEXIST 17
|
||||||
|
#define EXDEV 18
|
||||||
|
#define ENODEV 19
|
||||||
|
#define ENOTDIR 20
|
||||||
|
#define EISDIR 21
|
||||||
|
#define EINVAL 22
|
||||||
|
#define ENFILE 23
|
||||||
|
#define EMFILE 24
|
||||||
|
#define ENOTTY 25
|
||||||
|
#define ETXTBSY 26
|
||||||
|
#define EFBIG 27
|
||||||
|
#define ENOSPC 28
|
||||||
|
#define ESPIPE 29
|
||||||
|
#define EROFS 30
|
||||||
|
#define EMLINK 31
|
||||||
|
#define EPIPE 32
|
||||||
|
#define EDOM 33
|
||||||
|
#define ERANGE 34
|
||||||
|
#define EDEADLK 35
|
||||||
|
#define ENAMETOOLONG 36
|
||||||
|
#define ENOLCK 37
|
||||||
|
#define ENOSYS 38
|
||||||
|
#define ENOTEMPTY 39
|
||||||
|
#define ELOOP 40
|
||||||
|
#define EWOULDBLOCK EAGAIN
|
||||||
|
#define ENOMSG 42
|
||||||
|
#define EIDRM 43
|
||||||
|
#define ECHRNG 44
|
||||||
|
#define EL2NSYNC 45
|
||||||
|
#define EL3HLT 46
|
||||||
|
#define EL3RST 47
|
||||||
|
#define ELNRNG 48
|
||||||
|
#define EUNATCH 49
|
||||||
|
#define ENOCSI 50
|
||||||
|
#define EL2HLT 51
|
||||||
|
#define EBADE 52
|
||||||
|
#define EBADR 53
|
||||||
|
#define EXFULL 54
|
||||||
|
#define ENOANO 55
|
||||||
|
#define EBADRQC 56
|
||||||
|
#define EBADSLT 57
|
||||||
|
#define EDEADLOCK EDEADLK
|
||||||
|
#define EBFONT 59
|
||||||
|
#define ENOSTR 60
|
||||||
|
#define ENODATA 61
|
||||||
|
#define ETIME 62
|
||||||
|
#define ENOSR 63
|
||||||
|
#define ENONET 64
|
||||||
|
#define ENOPKG 65
|
||||||
|
#define EREMOTE 66
|
||||||
|
#define ENOLINK 67
|
||||||
|
#define EADV 68
|
||||||
|
#define ESRMNT 69
|
||||||
|
#define ECOMM 70
|
||||||
|
#define EPROTO 71
|
||||||
|
#define EMULTIHOP 72
|
||||||
|
#define EDOTDOT 73
|
||||||
|
#define EBADMSG 74
|
||||||
|
#define EOVERFLOW 75
|
||||||
|
#define ENOTUNIQ 76
|
||||||
|
#define EBADFD 77
|
||||||
|
#define EREMCHG 78
|
||||||
|
#define ELIBACC 79
|
||||||
|
#define ELIBBAD 80
|
||||||
|
#define ELIBSCN 81
|
||||||
|
#define ELIBMAX 82
|
||||||
|
#define ELIBEXEC 83
|
||||||
|
#define EILSEQ 84
|
||||||
|
#define ERESTART 85
|
||||||
|
#define ESTRPIPE 86
|
||||||
|
#define EUSERS 87
|
||||||
|
#define ENOTSOCK 88
|
||||||
|
#define EDESTADDRREQ 89
|
||||||
|
#define EMSGSIZE 90
|
||||||
|
#define EPROTOTYPE 91
|
||||||
|
#define ENOPROTOOPT 92
|
||||||
|
#define EPROTONOSUPPORT 93
|
||||||
|
#define ESOCKTNOSUPPORT 94
|
||||||
|
#define EOPNOTSUPP 95
|
||||||
|
#define ENOTSUP EOPNOTSUPP
|
||||||
|
#define EPFNOSUPPORT 96
|
||||||
|
#define EAFNOSUPPORT 97
|
||||||
|
#define EADDRINUSE 98
|
||||||
|
#define EADDRNOTAVAIL 99
|
||||||
|
#define ENETDOWN 100
|
||||||
|
#define ENETUNREACH 101
|
||||||
|
#define ENETRESET 102
|
||||||
|
#define ECONNABORTED 103
|
||||||
|
#define ECONNRESET 104
|
||||||
|
#define ENOBUFS 105
|
||||||
|
#define EISCONN 106
|
||||||
|
#define ENOTCONN 107
|
||||||
|
#define ESHUTDOWN 108
|
||||||
|
#define ETOOMANYREFS 109
|
||||||
|
#define ETIMEDOUT 110
|
||||||
|
#define ECONNREFUSED 111
|
||||||
|
#define EHOSTDOWN 112
|
||||||
|
#define EHOSTUNREACH 113
|
||||||
|
#define EALREADY 114
|
||||||
|
#define EINPROGRESS 115
|
||||||
|
#define ESTALE 116
|
||||||
|
#define EUCLEAN 117
|
||||||
|
#define ENOTNAM 118
|
||||||
|
#define ENAVAIL 119
|
||||||
|
#define EISNAM 120
|
||||||
|
#define EREMOTEIO 121
|
||||||
|
#define EDQUOT 122
|
||||||
|
#define ENOMEDIUM 123
|
||||||
|
#define EMEDIUMTYPE 124
|
||||||
|
#define ECANCELED 125
|
||||||
|
#define ENOKEY 126
|
||||||
|
#define EKEYEXPIRED 127
|
||||||
|
#define EKEYREVOKED 128
|
||||||
|
#define EKEYREJECTED 129
|
||||||
|
#define EOWNERDEAD 130
|
||||||
|
#define ENOTRECOVERABLE 131
|
||||||
|
#define ERFKILL 132
|
||||||
|
#define EHWPOISON 133
|
||||||
|
|
||||||
|
|
||||||
|
/* This is mlibc-specific. */
|
||||||
|
#define EIEIO 4095
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_ERRNO_H */
|
||||||
Executable
+124
@@ -0,0 +1,124 @@
|
|||||||
|
#ifndef _ABIBITS_FCNTL_H
|
||||||
|
#define _ABIBITS_FCNTL_H
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
#include <abi-bits/pid_t.h>
|
||||||
|
|
||||||
|
#define O_PATH 010000000
|
||||||
|
|
||||||
|
#define O_ACCMODE (03 | O_PATH)
|
||||||
|
#define O_RDONLY 00
|
||||||
|
#define O_WRONLY 01
|
||||||
|
#define O_RDWR 02
|
||||||
|
|
||||||
|
#define O_CREAT 0100
|
||||||
|
#define O_EXCL 0200
|
||||||
|
#define O_NOCTTY 0400
|
||||||
|
#define O_TRUNC 01000
|
||||||
|
#define O_APPEND 02000
|
||||||
|
#define O_NONBLOCK 04000
|
||||||
|
#define O_DSYNC 010000
|
||||||
|
#define O_ASYNC 020000
|
||||||
|
#define O_DIRECT 040000
|
||||||
|
#define O_DIRECTORY 0200000
|
||||||
|
#define O_NOFOLLOW 0400000
|
||||||
|
#define O_CLOEXEC 02000000
|
||||||
|
#define O_SYNC 04010000
|
||||||
|
#define O_RSYNC 04010000
|
||||||
|
#define O_LARGEFILE 0100000
|
||||||
|
#define O_NOATIME 01000000
|
||||||
|
#define O_TMPFILE 020000000
|
||||||
|
|
||||||
|
#define O_EXEC O_PATH
|
||||||
|
#define O_SEARCH O_PATH
|
||||||
|
|
||||||
|
#define F_DUPFD 0
|
||||||
|
#define F_GETFD 1
|
||||||
|
#define F_SETFD 2
|
||||||
|
#define F_GETFL 3
|
||||||
|
#define F_SETFL 4
|
||||||
|
|
||||||
|
#define F_SETOWN 8
|
||||||
|
#define F_GETOWN 9
|
||||||
|
#define F_SETSIG 10
|
||||||
|
#define F_GETSIG 11
|
||||||
|
|
||||||
|
#define F_GETLK 5
|
||||||
|
#define F_SETLK 6
|
||||||
|
#define F_SETLK64 F_SETLK
|
||||||
|
#define F_SETLKW 7
|
||||||
|
#define F_SETLKW64 F_SETLKW
|
||||||
|
|
||||||
|
#define F_SETOWN_EX 15
|
||||||
|
#define F_GETOWN_EX 16
|
||||||
|
|
||||||
|
#define F_GETOWNER_UIDS 17
|
||||||
|
|
||||||
|
#define F_SETLEASE 1024
|
||||||
|
#define F_GETLEASE 1025
|
||||||
|
#define F_NOTIFY 1026
|
||||||
|
#define F_DUPFD_CLOEXEC 1030
|
||||||
|
#define F_SETPIPE_SZ 1031
|
||||||
|
#define F_GETPIPE_SZ 1032
|
||||||
|
#define F_ADD_SEALS 1033
|
||||||
|
#define F_GET_SEALS 1034
|
||||||
|
|
||||||
|
#define F_SEAL_SEAL 0x0001
|
||||||
|
#define F_SEAL_SHRINK 0x0002
|
||||||
|
#define F_SEAL_GROW 0x0004
|
||||||
|
#define F_SEAL_WRITE 0x0008
|
||||||
|
|
||||||
|
#define F_OFD_GETLK 36
|
||||||
|
#define F_OFD_SETLK 37
|
||||||
|
#define F_OFD_SETLKW 38
|
||||||
|
|
||||||
|
#define F_RDLCK 0
|
||||||
|
#define F_WRLCK 1
|
||||||
|
#define F_UNLCK 2
|
||||||
|
|
||||||
|
#define FD_CLOEXEC 1
|
||||||
|
|
||||||
|
#define AT_FDCWD -100
|
||||||
|
#define AT_SYMLINK_NOFOLLOW 0x100
|
||||||
|
#define AT_REMOVEDIR 0x200
|
||||||
|
#define AT_SYMLINK_FOLLOW 0x400
|
||||||
|
#define AT_EACCESS 0x200
|
||||||
|
#define AT_NO_AUTOMOUNT 0x800
|
||||||
|
#define AT_EMPTY_PATH 0x1000
|
||||||
|
|
||||||
|
#if __MLIBC_LINUX_OPTION
|
||||||
|
|
||||||
|
#define DN_ACCESS 1
|
||||||
|
#define DN_MODIFY 2
|
||||||
|
#define DN_CREATE 4
|
||||||
|
#define DN_DELETE 8
|
||||||
|
#define DN_RENAME 16
|
||||||
|
#define DN_ATTRIB 32
|
||||||
|
#define DN_MULTISHOT 0x80000000
|
||||||
|
|
||||||
|
#define AT_STATX_SYNC_AS_STAT 0x0000
|
||||||
|
#define AT_STATX_FORCE_SYNC 0x2000
|
||||||
|
#define AT_STATX_DONT_SYNC 0x4000
|
||||||
|
#define AT_STATX_SYNC_TYPE 0x6000
|
||||||
|
|
||||||
|
#endif /* __MLIBC_LINUX_OPTION */
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE)
|
||||||
|
struct f_owner_ex {
|
||||||
|
int type;
|
||||||
|
pid_t pid;
|
||||||
|
};
|
||||||
|
#endif /* _GNU_SOURCE */
|
||||||
|
|
||||||
|
#define F_OWNER_TID 0
|
||||||
|
#define F_OWNER_PID 1
|
||||||
|
#define F_OWNER_PGRP 2
|
||||||
|
|
||||||
|
#define POSIX_FADV_NORMAL 0
|
||||||
|
#define POSIX_FADV_RANDOM 1
|
||||||
|
#define POSIX_FADV_SEQUENTIAL 2
|
||||||
|
#define POSIX_FADV_WILLNEED 3
|
||||||
|
#define POSIX_FADV_DONTNEED 4
|
||||||
|
#define POSIX_FADV_NOREUSE 5
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_FCNTL_H */
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef _ABIBITS_FD_SET_H
|
||||||
|
#define _ABIBITS_FD_SET_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
#define FD_SETSIZE 1024
|
||||||
|
|
||||||
|
typedef struct __attribute__((__aligned__(__alignof__(long)))) {
|
||||||
|
__mlibc_uint8 fds_bits[128];
|
||||||
|
} fd_set;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_FD_SET_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _ABIBITS_FSBLKCNT_T_H
|
||||||
|
#define _ABIBITS_FSBLKCNT_T_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef __mlibc_uint64 fsblkcnt_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_FSBLKCNT_T_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _ABIBITS_FSFILCNT_T_H
|
||||||
|
#define _ABIBITS_FSFILCNT_T_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef __mlibc_uint64 fsfilcnt_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_FSFILCNT_T_H */
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_GID_T_H
|
||||||
|
#define _ABIBITS_GID_T_H
|
||||||
|
|
||||||
|
typedef unsigned int gid_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_GID_T_H */
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
#ifndef _ABIBITS_IN_H
|
||||||
|
#define _ABIBITS_IN_H
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
#include <bits/posix/in_addr_t.h>
|
||||||
|
#include <bits/posix/in_port_t.h>
|
||||||
|
#include <abi-bits/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct in_addr {
|
||||||
|
in_addr_t s_addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sockaddr_in {
|
||||||
|
sa_family_t sin_family;
|
||||||
|
in_port_t sin_port;
|
||||||
|
struct in_addr sin_addr;
|
||||||
|
uint8_t sin_zero[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
#if !__MLIBC_LINUX_OPTION || (!defined(_UAPI_LINUX_IN6_H) && !defined(_UAPI_IPV6_H))
|
||||||
|
struct in6_addr {
|
||||||
|
union {
|
||||||
|
uint8_t __s6_addr[16];
|
||||||
|
uint16_t __s6_addr16[8];
|
||||||
|
uint32_t __s6_addr32[4];
|
||||||
|
} __in6_union;
|
||||||
|
};
|
||||||
|
#define s6_addr __in6_union.__s6_addr
|
||||||
|
#define s6_addr16 __in6_union.__s6_addr16
|
||||||
|
#define s6_addr32 __in6_union.__s6_addr32
|
||||||
|
|
||||||
|
struct sockaddr_in6 {
|
||||||
|
sa_family_t sin6_family;
|
||||||
|
in_port_t sin6_port;
|
||||||
|
uint32_t sin6_flowinfo;
|
||||||
|
struct in6_addr sin6_addr;
|
||||||
|
uint32_t sin6_scope_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ipv6_mreq {
|
||||||
|
struct in6_addr ipv6mr_multiaddr;
|
||||||
|
unsigned ipv6mr_interface;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct in6_pktinfo {
|
||||||
|
struct in6_addr ipi6_addr;
|
||||||
|
uint32_t ipi6_ifindex;
|
||||||
|
};
|
||||||
|
#endif /* !__MLIBC_LINUX_OPTION || (!defined(_UAPI_LINUX_IN6_H) && !defined(_UAPI_IPV6_H)) */
|
||||||
|
|
||||||
|
#define MCAST_INCLUDE 1
|
||||||
|
|
||||||
|
struct ip_mreq {
|
||||||
|
struct in_addr imr_multiaddr;
|
||||||
|
struct in_addr imr_interface;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ip_mreq_source {
|
||||||
|
struct in_addr imr_multiaddr;
|
||||||
|
struct in_addr imr_interface;
|
||||||
|
struct in_addr imr_sourceaddr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ip_mreqn {
|
||||||
|
struct in_addr imr_multiaddr;
|
||||||
|
struct in_addr imr_address;
|
||||||
|
int imr_ifindex;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct in_pktinfo {
|
||||||
|
int ipi_ifindex;
|
||||||
|
struct in_addr ipi_spec_dst;
|
||||||
|
struct in_addr ipi_addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct group_req {
|
||||||
|
uint32_t gr_interface;
|
||||||
|
struct sockaddr_storage gr_group;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct group_source_req {
|
||||||
|
uint32_t gsr_interface;
|
||||||
|
struct sockaddr_storage gsr_group;
|
||||||
|
struct sockaddr_storage gsr_source;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define INADDR_ANY ((in_addr_t) 0x00000000)
|
||||||
|
#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
|
||||||
|
#define INADDR_NONE ((in_addr_t) 0xffffffff)
|
||||||
|
#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
|
||||||
|
|
||||||
|
#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
|
||||||
|
#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
|
||||||
|
#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
|
||||||
|
#define INADDR_ALLSNOOPERS_GROUP ((in_addr_t) 0xe000006a)
|
||||||
|
#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
|
||||||
|
|
||||||
|
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
|
||||||
|
#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
|
||||||
|
|
||||||
|
#define INET_ADDRSTRLEN 16
|
||||||
|
#define INET6_ADDRSTRLEN 46
|
||||||
|
|
||||||
|
#define IPPORT_RESERVED 1024
|
||||||
|
|
||||||
|
#define IPPROTO_IP 0
|
||||||
|
#define IPPROTO_HOPOPTS 0
|
||||||
|
#define IPPROTO_ICMP 1
|
||||||
|
#define IPPROTO_IGMP 2
|
||||||
|
#define IPPROTO_IPIP 4
|
||||||
|
#define IPPROTO_TCP 6
|
||||||
|
#define IPPROTO_EGP 8
|
||||||
|
#define IPPROTO_PUP 12
|
||||||
|
#define IPPROTO_UDP 17
|
||||||
|
#define IPPROTO_IDP 22
|
||||||
|
#define IPPROTO_TP 29
|
||||||
|
#define IPPROTO_DCCP 33
|
||||||
|
#define IPPROTO_IPV6 41
|
||||||
|
#define IPPROTO_ROUTING 43
|
||||||
|
#define IPPROTO_FRAGMENT 44
|
||||||
|
#define IPPROTO_RSVP 46
|
||||||
|
#define IPPROTO_GRE 47
|
||||||
|
#define IPPROTO_ESP 50
|
||||||
|
#define IPPROTO_AH 51
|
||||||
|
#define IPPROTO_ICMPV6 58
|
||||||
|
#define IPPROTO_NONE 59
|
||||||
|
#define IPPROTO_DSTOPTS 60
|
||||||
|
#define IPPROTO_MTP 92
|
||||||
|
#define IPPROTO_BEETPH 94
|
||||||
|
#define IPPROTO_ENCAP 98
|
||||||
|
#define IPPROTO_PIM 103
|
||||||
|
#define IPPROTO_COMP 108
|
||||||
|
#define IPPROTO_SCTP 132
|
||||||
|
#define IPPROTO_MH 135
|
||||||
|
#define IPPROTO_UDPLITE 136
|
||||||
|
#define IPPROTO_MPLS 137
|
||||||
|
#define IPPROTO_RAW 255
|
||||||
|
#define IPPROTO_MAX 256
|
||||||
|
|
||||||
|
#define IP_TOS 1
|
||||||
|
#define IP_TTL 2
|
||||||
|
#define IP_HDRINCL 3
|
||||||
|
#define IP_OPTIONS 4
|
||||||
|
#define IP_RECVOPTS 6
|
||||||
|
#define IP_RETOPTS 7
|
||||||
|
#define IP_PKTINFO 8
|
||||||
|
#define IP_PKTOPTIONS 9
|
||||||
|
#define IP_MTU_DISCOVER 10
|
||||||
|
#define IP_RECVERR 11
|
||||||
|
#define IP_RECVTTL 12
|
||||||
|
#define IP_MTU 14
|
||||||
|
#define IP_MULTICAST_IF 32
|
||||||
|
#define IP_MULTICAST_TTL 33
|
||||||
|
#define IP_MULTICAST_LOOP 34
|
||||||
|
#define IP_ADD_MEMBERSHIP 35
|
||||||
|
#define IP_DROP_MEMBERSHIP 36
|
||||||
|
#define IP_UNBLOCK_SOURCE 37
|
||||||
|
#define IP_BLOCK_SOURCE 38
|
||||||
|
#define IP_ADD_SOURCE_MEMBERSHIP 39
|
||||||
|
#define IP_DROP_SOURCE_MEMBERSHIP 40
|
||||||
|
#define IP_UNICAST_IF 50
|
||||||
|
|
||||||
|
#define IPV6_2292PKTOPTIONS 6
|
||||||
|
#define IPV6_2292HOPLIMIT 8
|
||||||
|
#define IPV6_UNICAST_HOPS 16
|
||||||
|
#define IPV6_MULTICAST_IF 17
|
||||||
|
#define IPV6_MULTICAST_HOPS 18
|
||||||
|
#define IPV6_MULTICAST_LOOP 19
|
||||||
|
#define IPV6_JOIN_GROUP 20
|
||||||
|
#define IPV6_LEAVE_GROUP 21
|
||||||
|
#define IPV6_MTU_DISCOVER 23
|
||||||
|
#define IPV6_MTU 24
|
||||||
|
#define IPV6_RECVERR 25
|
||||||
|
#define IPV6_V6ONLY 26
|
||||||
|
#define IPV6_RECVPKTINFO 49
|
||||||
|
#define IPV6_PKTINFO 50
|
||||||
|
#define IPV6_RECVHOPLIMIT 51
|
||||||
|
#define IPV6_HOPLIMIT 52
|
||||||
|
|
||||||
|
#define IPV6_RECVTCLASS 66
|
||||||
|
#define IPV6_TCLASS 67
|
||||||
|
|
||||||
|
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
|
||||||
|
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
|
||||||
|
|
||||||
|
#define IPV6_PMTUDISC_DONT 0
|
||||||
|
#define IPV6_PMTUDISC_WANT 1
|
||||||
|
#define IPV6_PMTUDISC_DO 2
|
||||||
|
#define IPV6_PMTUDISC_PROBE 3
|
||||||
|
#define IPV6_PMTUDISC_INTERFACE 4
|
||||||
|
#define IPV6_PMTUDISC_OMIT 5
|
||||||
|
|
||||||
|
#define IP_PMTUDISC_DONT 0
|
||||||
|
#define IP_PMTUDISC_WANT 1
|
||||||
|
#define IP_PMTUDISC_DO 2
|
||||||
|
#define IP_PMTUDISC_PROBE 3
|
||||||
|
#define IP_PMTUDISC_INTERFACE 4
|
||||||
|
#define IP_PMTUDISC_OMIT 5
|
||||||
|
|
||||||
|
#define MCAST_JOIN_GROUP 42
|
||||||
|
#define MCAST_BLOCK_SOURCE 43
|
||||||
|
#define MCAST_UNBLOCK_SOURCE 44
|
||||||
|
#define MCAST_JOIN_SOURCE_GROUP 46
|
||||||
|
#define MCAST_LEAVE_SOURCE_GROUP 47
|
||||||
|
|
||||||
|
#if __MLIBC_LINUX_OPTION
|
||||||
|
|
||||||
|
#define __UAPI_DEF_IN_ADDR 0
|
||||||
|
#define __UAPI_DEF_IN_CLASS 0
|
||||||
|
#define __UAPI_DEF_IN_IPPROTO 0
|
||||||
|
#define __UAPI_DEF_IN_PKTINFO 0
|
||||||
|
#define __UAPI_DEF_IP_MREQ 0
|
||||||
|
#define __UAPI_DEF_SOCKADDR_IN 0
|
||||||
|
|
||||||
|
#define __UAPI_DEF_IN6_ADDR 0
|
||||||
|
#define __UAPI_DEF_IN6_ADDR_ALT 1
|
||||||
|
#define __UAPI_DEF_IN6_PKTINFO 0
|
||||||
|
#define __UAPI_DEF_IP6_MTUINFO 0
|
||||||
|
#define __UAPI_DEF_IPPROTO_V6 0
|
||||||
|
#define __UAPI_DEF_IPV6_MREQ 0
|
||||||
|
#define __UAPI_DEF_IPV6_OPTIONS 0
|
||||||
|
#define __UAPI_DEF_SOCKADDR_IN6 0
|
||||||
|
|
||||||
|
#endif /* __MLIBC_LINUX_OPTION */
|
||||||
|
|
||||||
|
#endif /* _ABITBITS_IN_H */
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_INO_T_H
|
||||||
|
#define _ABIBITS_INO_T_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef __mlibc_uint64 ino_t;
|
||||||
|
typedef ino_t ino64_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_INO_T_H */
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef _ABIBITS_IPC_H
|
||||||
|
#define _ABIBITS_IPC_H
|
||||||
|
|
||||||
|
#include <abi-bits/uid_t.h>
|
||||||
|
#include <abi-bits/gid_t.h>
|
||||||
|
#include <abi-bits/mode_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define IPC_CREAT 01000
|
||||||
|
#define IPC_EXCL 02000
|
||||||
|
#define IPC_NOWAIT 04000
|
||||||
|
|
||||||
|
#define IPC_RMID 0
|
||||||
|
#define IPC_SET 1
|
||||||
|
#define IPC_STAT 2
|
||||||
|
#define IPC_INFO 3
|
||||||
|
|
||||||
|
#define IPC_PRIVATE ((key_t) 0)
|
||||||
|
|
||||||
|
#if defined(__aarch64__) || defined(__i386__) || defined(__m68k__)
|
||||||
|
#define IPC_64 0x100
|
||||||
|
#elif defined(__x86_64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch64)
|
||||||
|
#define IPC_64 0
|
||||||
|
#else
|
||||||
|
#error "Unsupported arch!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int key_t;
|
||||||
|
|
||||||
|
struct ipc64_perm {
|
||||||
|
key_t __ipc_perm_key;
|
||||||
|
uid_t uid;
|
||||||
|
gid_t gid;
|
||||||
|
uid_t cuid;
|
||||||
|
gid_t cgid;
|
||||||
|
mode_t mode;
|
||||||
|
int __ipc_perm_seq;
|
||||||
|
long __unused[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ipc_perm ipc64_perm
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _ABIBITS_LIMITS_H
|
||||||
|
#define _ABIBITS_LIMITS_H
|
||||||
|
|
||||||
|
#define IOV_MAX 1024
|
||||||
|
#define LOGIN_NAME_MAX 256
|
||||||
|
#define HOST_NAME_MAX 64
|
||||||
|
#define NAME_MAX 255
|
||||||
|
#define OPEN_MAX 256
|
||||||
|
|
||||||
|
#endif /*_ABIBITS_LIMITS_H */
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_MODE_T_H
|
||||||
|
#define _ABIBITS_MODE_T_H
|
||||||
|
|
||||||
|
typedef unsigned int mode_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_MODE_T_H */
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef _ABIBITS_MQUEUE_H
|
||||||
|
#define _ABIBITS_MQUEUE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct mq_attr {
|
||||||
|
long mq_flags;
|
||||||
|
long mq_maxmsg;
|
||||||
|
long mq_msgsize;
|
||||||
|
long mq_curmsgs;
|
||||||
|
long __pad[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_MQUEUE_H */
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#ifndef _ABIBITS_MSG_H
|
||||||
|
#define _ABIBITS_MSG_H
|
||||||
|
|
||||||
|
#include <sys/ipc.h>
|
||||||
|
#include <bits/ansi/time_t.h>
|
||||||
|
#include <bits/types.h>
|
||||||
|
#include <abi-bits/pid_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned long msglen_t;
|
||||||
|
typedef unsigned long msgqnum_t;
|
||||||
|
|
||||||
|
struct msqid64_ds {
|
||||||
|
struct ipc64_perm msg_perm;
|
||||||
|
#if (UINTPTR_MAX == UINT64_MAX) /* || x32 ABI */
|
||||||
|
time_t msg_stime;
|
||||||
|
time_t msg_rtime;
|
||||||
|
time_t msg_ctime;
|
||||||
|
#else
|
||||||
|
unsigned long msg_stime;
|
||||||
|
unsigned long msg_stime_high;
|
||||||
|
unsigned long msg_rtime;
|
||||||
|
unsigned long msg_rtime_high;
|
||||||
|
unsigned long msg_ctime;
|
||||||
|
unsigned long msg_ctime_high;
|
||||||
|
#endif
|
||||||
|
unsigned long msg_cbytes;
|
||||||
|
msgqnum_t msg_qnum;
|
||||||
|
msglen_t msg_qbytes;
|
||||||
|
pid_t msg_lspid;
|
||||||
|
pid_t msg_lrpid;
|
||||||
|
unsigned long __unused[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define msqid_ds msqid64_ds
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_MSG_H */
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_NLINK_T_H
|
||||||
|
#define _ABIBITS_NLINK_T_H
|
||||||
|
|
||||||
|
typedef unsigned long nlink_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_NLINK_T_H */
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_PID_T_H
|
||||||
|
#define _ABIBITS_PID_T_H
|
||||||
|
|
||||||
|
typedef int pid_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_PID_T_H */
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef _ABIBITS_POLL_H
|
||||||
|
#define _ABIBITS_POLL_H
|
||||||
|
|
||||||
|
#define POLLIN 0x0001
|
||||||
|
#define POLLPRI 0x0002
|
||||||
|
#define POLLOUT 0x0004
|
||||||
|
#define POLLERR 0x0008
|
||||||
|
#define POLLHUP 0x0010
|
||||||
|
#define POLLNVAL 0x0020
|
||||||
|
#define POLLRDNORM 0x0040
|
||||||
|
#define POLLRDBAND 0x0080
|
||||||
|
#define POLLWRNORM 0x0100
|
||||||
|
#define POLLWRBAND 0x0200
|
||||||
|
#define POLLRDHUP 0x2000
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_POLL_H */
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#ifndef _ABIBITS_RESOURCE_H
|
||||||
|
#define _ABIBITS_RESOURCE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/posix/timeval.h>
|
||||||
|
|
||||||
|
#define RUSAGE_SELF 0
|
||||||
|
#define RUSAGE_CHILDREN -1
|
||||||
|
|
||||||
|
#define RLIMIT_CPU 0
|
||||||
|
#define RLIMIT_FSIZE 1
|
||||||
|
#define RLIMIT_DATA 2
|
||||||
|
#define RLIMIT_STACK 3
|
||||||
|
#define RLIMIT_CORE 4
|
||||||
|
#define RLIMIT_RSS 5
|
||||||
|
#define RLIMIT_NPROC 6
|
||||||
|
#define RLIMIT_NOFILE 7
|
||||||
|
#define RLIMIT_MEMLOCK 8
|
||||||
|
#define RLIMIT_AS 9
|
||||||
|
#define RLIMIT_LOCKS 10
|
||||||
|
#define RLIMIT_SIGPENDING 11
|
||||||
|
#define RLIMIT_MSGQUEUE 12
|
||||||
|
#define RLIMIT_NICE 13
|
||||||
|
#define RLIMIT_RTPRIO 14
|
||||||
|
#define RLIMIT_RTTIME 15
|
||||||
|
#define RLIMIT_NLIMITS 16
|
||||||
|
|
||||||
|
struct rusage {
|
||||||
|
struct timeval ru_utime;
|
||||||
|
struct timeval ru_stime;
|
||||||
|
long ru_maxrss;
|
||||||
|
long ru_ixrss;
|
||||||
|
long ru_idrss;
|
||||||
|
long ru_isrss;
|
||||||
|
long ru_minflt;
|
||||||
|
long ru_majflt;
|
||||||
|
long ru_nswap;
|
||||||
|
long ru_inblock;
|
||||||
|
long ru_oublock;
|
||||||
|
long ru_msgsnd;
|
||||||
|
long ru_msgrcv;
|
||||||
|
long ru_nsignals;
|
||||||
|
long ru_nvcsw;
|
||||||
|
long ru_nivcsw;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_RESOURCE_H */
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
#ifndef _ABIBITS_RISCV_HWPROBE_H
|
||||||
|
#define _ABIBITS_RISCV_HWPROBE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct riscv_hwprobe {
|
||||||
|
signed long long int key;
|
||||||
|
unsigned long long int value;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define RISCV_HWPROBE_KEY_MVENDORID 0
|
||||||
|
#define RISCV_HWPROBE_KEY_MARCHID 1
|
||||||
|
#define RISCV_HWPROBE_KEY_MIMPID 2
|
||||||
|
#define RISCV_HWPROBE_KEY_BASE_BEHAVIOR 3
|
||||||
|
#define RISCV_HWPROBE_BASE_BEHAVIOR_IMA (1 << 0)
|
||||||
|
#define RISCV_HWPROBE_KEY_IMA_EXT_0 4
|
||||||
|
#define RISCV_HWPROBE_IMA_FD (1 << 0)
|
||||||
|
#define RISCV_HWPROBE_IMA_C (1 << 1)
|
||||||
|
#define RISCV_HWPROBE_IMA_V (1 << 2)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBA (1 << 3)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBB (1 << 4)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBS (1 << 5)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZICBOZ (1 << 6)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBC (1 << 7)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBKB (1 << 8)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBKC (1 << 9)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZBKX (1 << 10)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZKND (1 << 11)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZKNE (1 << 12)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZKNH (1 << 13)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZKSED (1 << 14)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZKSH (1 << 15)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZKT (1 << 16)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVBB (1 << 17)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVBC (1 << 18)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKB (1 << 19)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKG (1 << 20)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKNED (1 << 21)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKNHA (1 << 22)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKNHB (1 << 23)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKSED (1 << 24)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKSH (1 << 25)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVKT (1 << 26)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZFH (1 << 27)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZFHMIN (1 << 28)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVFH (1 << 30)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVFHMIN (1ULL << 31)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZFA (1ULL << 32)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVE32X (1ULL << 37)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVE32F (1ULL << 38)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVE64X (1ULL << 39)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVE64F (1ULL << 40)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVE64D (1ULL << 41)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 42)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZCA (1ULL << 43)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZCB (1ULL << 44)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZCD (1ULL << 45)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZCF (1ULL << 46)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48)
|
||||||
|
#define RISCV_HWPROBE_EXT_SUPM (1ULL << 49)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZICNTR (1ULL << 50)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZIHPM (1ULL << 51)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZFBFMIN (1ULL << 52)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 53)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZICBOM (1ULL << 55)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZAAMO (1ULL << 56)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZALRSC (1ULL << 57)
|
||||||
|
#define RISCV_HWPROBE_EXT_ZABHA (1ULL << 58)
|
||||||
|
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_SLOW (2 << 0)
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_FAST (3 << 0)
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0)
|
||||||
|
#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
|
||||||
|
#define RISCV_HWPROBE_KEY_HIGHEST_VIRT_ADDRESS 7
|
||||||
|
#define RISCV_HWPROBE_KEY_TIME_CSR_FREQ 8
|
||||||
|
#define RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF 9
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN 0
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_SCALAR_EMULATED 1
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_SCALAR_SLOW 2
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_SCALAR_FAST 3
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED 4
|
||||||
|
#define RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF 10
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN 0
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_VECTOR_SLOW 2
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_VECTOR_FAST 3
|
||||||
|
#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED 4
|
||||||
|
#define RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 11
|
||||||
|
#define RISCV_HWPROBE_KEY_ZICBOM_BLOCK_SIZE 12
|
||||||
|
#define RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 13
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_RISCV_HWPROBE_H */
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _ABIBITS_RLIM_T_H
|
||||||
|
#define _ABIBITS_RLIM_T_H
|
||||||
|
|
||||||
|
#if __INTPTR_WIDTH__ == 32
|
||||||
|
typedef unsigned long long int rlim_t;
|
||||||
|
#else
|
||||||
|
typedef unsigned long int rlim_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_RLIM_T_H */
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef _ABIBITS_SA_FAMILY_T_H
|
||||||
|
#define _ABIBITS_SA_FAMILY_T_H
|
||||||
|
|
||||||
|
typedef unsigned short sa_family_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SA_FAMILY_T_H */
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _ABIBITS_SEEK_WHENCE_H
|
||||||
|
#define _ABIBITS_SEEK_WHENCE_H
|
||||||
|
|
||||||
|
#define SEEK_SET 0
|
||||||
|
#define SEEK_CUR 1
|
||||||
|
#define SEEK_END 2
|
||||||
|
#define SEEK_DATA 3
|
||||||
|
#define SEEK_HOLE 4
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SEEK_WHENCE_H */
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef _ABIBITS_SEM_H
|
||||||
|
#define _ABIBITS_SEM_H
|
||||||
|
|
||||||
|
#include <abi-bits/time.h>
|
||||||
|
#include <abi-bits/ipc.h>
|
||||||
|
|
||||||
|
#define GETPID 11
|
||||||
|
#define GETVAL 12
|
||||||
|
#define GETALL 13
|
||||||
|
#define SETVAL 16
|
||||||
|
#define SETALL 17
|
||||||
|
|
||||||
|
#define SEM_UNDO 0x1000
|
||||||
|
|
||||||
|
struct sembuf {
|
||||||
|
unsigned short int sem_num;
|
||||||
|
short int sem_op;
|
||||||
|
short int sem_flg;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct semid_ds {
|
||||||
|
struct ipc_perm sem_perm;
|
||||||
|
time_t sem_otime;
|
||||||
|
time_t sem_ctime;
|
||||||
|
|
||||||
|
unsigned long sem_nsems;
|
||||||
|
unsigned long __unused[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SEM_H */
|
||||||
Executable
+107
@@ -0,0 +1,107 @@
|
|||||||
|
#ifndef _ABIBITS_SHM_H
|
||||||
|
#define _ABIBITS_SHM_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/ansi/time_t.h>
|
||||||
|
#include <abi-bits/pid_t.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/ipc.h>
|
||||||
|
|
||||||
|
#define SHM_R 0400
|
||||||
|
#define SHM_W 0200
|
||||||
|
|
||||||
|
#define SHM_RDONLY 010000
|
||||||
|
#define SHM_RND 020000
|
||||||
|
#define SHM_REMAP 040000
|
||||||
|
#define SHM_EXEC 0100000
|
||||||
|
|
||||||
|
#define SHM_LOCK 11
|
||||||
|
#define SHM_UNLOCK 12
|
||||||
|
#define SHM_STAT 13
|
||||||
|
#define SHM_INFO 14
|
||||||
|
#define SHM_STAT_ANY 15
|
||||||
|
#define SHM_DEST 01000
|
||||||
|
#define SHM_LOCKED 02000
|
||||||
|
#define SHM_HUGETLB 04000
|
||||||
|
#define SHM_NORESERVE 010000
|
||||||
|
|
||||||
|
#define SHM_HUGE_SHIFT 26
|
||||||
|
#define SHM_HUGE_MASK 0x3f
|
||||||
|
#define SHM_HUGE_64KB (16 << 26)
|
||||||
|
#define SHM_HUGE_512KB (19 << 26)
|
||||||
|
#define SHM_HUGE_1MB (20 << 26)
|
||||||
|
#define SHM_HUGE_2MB (21 << 26)
|
||||||
|
#define SHM_HUGE_8MB (23 << 26)
|
||||||
|
#define SHM_HUGE_16MB (24 << 26)
|
||||||
|
#define SHM_HUGE_32MB (25 << 26)
|
||||||
|
#define SHM_HUGE_256MB (28 << 26)
|
||||||
|
#define SHM_HUGE_512MB (29 << 26)
|
||||||
|
#define SHM_HUGE_1GB (30 << 26)
|
||||||
|
#define SHM_HUGE_2GB (31 << 26)
|
||||||
|
#define SHM_HUGE_16GB (34U << 26)
|
||||||
|
|
||||||
|
typedef unsigned long shmatt_t;
|
||||||
|
|
||||||
|
#if defined(__i386__) || defined(__m68k__)
|
||||||
|
struct shmid_ds {
|
||||||
|
struct ipc_perm shm_perm;
|
||||||
|
size_t shm_segsz;
|
||||||
|
unsigned long __shm_atime_lo;
|
||||||
|
unsigned long __shm_atime_hi;
|
||||||
|
unsigned long __shm_dtime_lo;
|
||||||
|
unsigned long __shm_dtime_hi;
|
||||||
|
unsigned long __shm_ctime_lo;
|
||||||
|
unsigned long __shm_ctime_hi;
|
||||||
|
pid_t shm_cpid;
|
||||||
|
pid_t shm_lpid;
|
||||||
|
unsigned long shm_nattch;
|
||||||
|
unsigned long __unused[3];
|
||||||
|
time_t shm_atime;
|
||||||
|
time_t shm_dtime;
|
||||||
|
time_t shm_ctime;
|
||||||
|
};
|
||||||
|
#elif defined(__x86_64__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch64)
|
||||||
|
struct shmid_ds {
|
||||||
|
struct ipc_perm shm_perm;
|
||||||
|
size_t shm_segsz;
|
||||||
|
time_t shm_atime;
|
||||||
|
time_t shm_dtime;
|
||||||
|
time_t shm_ctime;
|
||||||
|
pid_t shm_cpid;
|
||||||
|
pid_t shm_lpid;
|
||||||
|
unsigned long shm_nattch;
|
||||||
|
unsigned long __unused[2];
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
#error "Missing architecture specific code."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct shminfo {
|
||||||
|
unsigned long shmmax;
|
||||||
|
unsigned long shmmin;
|
||||||
|
unsigned long shmmni;
|
||||||
|
unsigned long shmseg;
|
||||||
|
unsigned long shmall;
|
||||||
|
unsigned long __unused[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct shm_info {
|
||||||
|
int used_ids;
|
||||||
|
unsigned long shm_tot;
|
||||||
|
unsigned long shm_rss;
|
||||||
|
unsigned long shm_swp;
|
||||||
|
unsigned long swap_attempts;
|
||||||
|
unsigned long swap_successes;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SHMLBA (getpagesize())
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SHM_H */
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef _ABIBITS_SIG_LIMITS_H
|
||||||
|
#define _ABIBITS_SIG_LIMITS_H
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
|
||||||
|
#define NSIG_MAX 1024
|
||||||
|
|
||||||
|
#if defined(_DEFAULT_SOURCE) || __MLIBC_XOPEN
|
||||||
|
#define NZERO 20
|
||||||
|
#endif /* defined(_DEFAULT_SOURCE) || __MLIBC_XOPEN */
|
||||||
|
|
||||||
|
#endif /*_ABIBITS_SIG_LIMITS_H */
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef _ABIBITS_SIGEVENT_H
|
||||||
|
#define _ABIBITS_SIGEVENT_H
|
||||||
|
|
||||||
|
#include <abi-bits/sigval.h>
|
||||||
|
#include <abi-bits/pid_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct sigevent {
|
||||||
|
union sigval sigev_value;
|
||||||
|
int sigev_notify;
|
||||||
|
int sigev_signo;
|
||||||
|
void (*sigev_notify_function)(union sigval);
|
||||||
|
struct __mlibc_threadattr *sigev_notify_attributes;
|
||||||
|
pid_t sigev_notify_thread_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SIGEVENT_H */
|
||||||
Executable
+647
@@ -0,0 +1,647 @@
|
|||||||
|
#ifndef _ABIBITS_SIGNAL_H
|
||||||
|
#define _ABIBITS_SIGNAL_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <abi-bits/sigevent.h>
|
||||||
|
#include <abi-bits/pid_t.h>
|
||||||
|
#include <abi-bits/uid_t.h>
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
|
||||||
|
#define POLL_IN 1
|
||||||
|
#define POLL_OUT 2
|
||||||
|
#define POLL_MSG 3
|
||||||
|
#define POLL_ERR 4
|
||||||
|
#define POLL_PRI 5
|
||||||
|
#define POLL_HUP 6
|
||||||
|
|
||||||
|
/* struct taken from musl. */
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int si_signo, si_errno, si_code;
|
||||||
|
union {
|
||||||
|
char __pad[128 - 2*sizeof(int) - sizeof(long)];
|
||||||
|
struct {
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
pid_t si_pid;
|
||||||
|
uid_t si_uid;
|
||||||
|
} __piduid;
|
||||||
|
struct {
|
||||||
|
int si_timerid;
|
||||||
|
int si_overrun;
|
||||||
|
} __timer;
|
||||||
|
} __first;
|
||||||
|
union {
|
||||||
|
union sigval si_value;
|
||||||
|
struct {
|
||||||
|
int si_status;
|
||||||
|
clock_t si_utime, si_stime;
|
||||||
|
} __sigchld;
|
||||||
|
} __second;
|
||||||
|
} __si_common;
|
||||||
|
struct {
|
||||||
|
void *si_addr;
|
||||||
|
short si_addr_lsb;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
void *si_lower;
|
||||||
|
void *si_upper;
|
||||||
|
} __addr_bnd;
|
||||||
|
unsigned si_pkey;
|
||||||
|
} __first;
|
||||||
|
} __sigfault;
|
||||||
|
struct {
|
||||||
|
long si_band;
|
||||||
|
int si_fd;
|
||||||
|
} __sigpoll;
|
||||||
|
struct {
|
||||||
|
void *si_call_addr;
|
||||||
|
int si_syscall;
|
||||||
|
unsigned si_arch;
|
||||||
|
} __sigsys;
|
||||||
|
} __si_fields;
|
||||||
|
} siginfo_t;
|
||||||
|
#define si_pid __si_fields.__si_common.__first.__piduid.si_pid
|
||||||
|
#define si_uid __si_fields.__si_common.__first.__piduid.si_uid
|
||||||
|
#define si_status __si_fields.__si_common.__second.__sigchld.si_status
|
||||||
|
#define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
|
||||||
|
#define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
|
||||||
|
#define si_value __si_fields.__si_common.__second.si_value
|
||||||
|
#define si_addr __si_fields.__sigfault.si_addr
|
||||||
|
#define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
|
||||||
|
#define si_lower __si_fields.__sigfault.__first.__addr_bnd.si_lower
|
||||||
|
#define si_upper __si_fields.__sigfault.__first.__addr_bnd.si_upper
|
||||||
|
#define si_pkey __si_fields.__sigfault.__first.si_pkey
|
||||||
|
#define si_band __si_fields.__sigpoll.si_band
|
||||||
|
#define si_fd __si_fields.__sigpoll.si_fd
|
||||||
|
#define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
|
||||||
|
#define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
|
||||||
|
#define si_ptr si_value.sival_ptr
|
||||||
|
#define si_int si_value.sival_int
|
||||||
|
#define si_call_addr __si_fields.__sigsys.si_call_addr
|
||||||
|
#define si_syscall __si_fields.__sigsys.si_syscall
|
||||||
|
#define si_arch __si_fields.__sigsys.si_arch
|
||||||
|
|
||||||
|
/* Required for sys_sigaction sysdep. */
|
||||||
|
#define SA_NOCLDSTOP 1
|
||||||
|
#define SA_NOCLDWAIT 2
|
||||||
|
#define SA_SIGINFO 4
|
||||||
|
#define SA_ONSTACK 0x08000000
|
||||||
|
#define SA_RESTART 0x10000000
|
||||||
|
#define SA_NODEFER 0x40000000
|
||||||
|
#define SA_RESETHAND 0x80000000
|
||||||
|
#define SA_RESTORER 0x04000000
|
||||||
|
|
||||||
|
/* SA_NOMASK is an alias for SA_NODEFER */
|
||||||
|
/* SA_ONESHOT is an alias for SA_RESETHAND */
|
||||||
|
#define SA_NOMASK SA_NODEFER
|
||||||
|
#define SA_ONESHOT SA_RESETHAND
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Argument for signal() */
|
||||||
|
typedef void (*__sighandler) (int);
|
||||||
|
|
||||||
|
#define SIG_ERR ((__sighandler)(void *)(-1))
|
||||||
|
#define SIG_DFL ((__sighandler)(void *)(0))
|
||||||
|
#define SIG_IGN ((__sighandler)(void *)(1))
|
||||||
|
|
||||||
|
#define SIGABRT 6
|
||||||
|
#define SIGFPE 8
|
||||||
|
#define SIGILL 4
|
||||||
|
#define SIGINT 2
|
||||||
|
#define SIGSEGV 11
|
||||||
|
#define SIGTERM 15
|
||||||
|
#define SIGPROF 27
|
||||||
|
#define SIGIO 29
|
||||||
|
#define SIGPWR 30
|
||||||
|
#define SIGRTMIN 35
|
||||||
|
#define SIGRTMAX 64
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned long sig[1024 / (8 * sizeof(long))];
|
||||||
|
} sigset_t;
|
||||||
|
|
||||||
|
/* constants for sigprocmask() */
|
||||||
|
#define SIG_BLOCK 0
|
||||||
|
#define SIG_UNBLOCK 1
|
||||||
|
#define SIG_SETMASK 2
|
||||||
|
|
||||||
|
#define SIGHUP 1
|
||||||
|
#define SIGQUIT 3
|
||||||
|
#define SIGTRAP 5
|
||||||
|
#define SIGIOT SIGABRT
|
||||||
|
#define SIGBUS 7
|
||||||
|
#define SIGKILL 9
|
||||||
|
#define SIGUSR1 10
|
||||||
|
#define SIGUSR2 12
|
||||||
|
#define SIGPIPE 13
|
||||||
|
#define SIGALRM 14
|
||||||
|
#define SIGSTKFLT 16
|
||||||
|
#define SIGCHLD 17
|
||||||
|
#define SIGCONT 18
|
||||||
|
#define SIGSTOP 19
|
||||||
|
#define SIGTSTP 20
|
||||||
|
#define SIGTTIN 21
|
||||||
|
#define SIGTTOU 22
|
||||||
|
#define SIGURG 23
|
||||||
|
#define SIGXCPU 24
|
||||||
|
#define SIGXFSZ 25
|
||||||
|
#define SIGVTALRM 26
|
||||||
|
#define SIGWINCH 28
|
||||||
|
#define SIGPOLL 29
|
||||||
|
#define SIGSYS 31
|
||||||
|
#define SIGUNUSED SIGSYS
|
||||||
|
#define SIGCANCEL 32
|
||||||
|
#define SIGTIMER 33
|
||||||
|
|
||||||
|
#define MINSIGSTKSZ 2048
|
||||||
|
#define SIGSTKSZ 8192
|
||||||
|
#define SS_ONSTACK 1
|
||||||
|
#define SS_DISABLE 2
|
||||||
|
|
||||||
|
typedef struct __stack {
|
||||||
|
void *ss_sp;
|
||||||
|
int ss_flags;
|
||||||
|
size_t ss_size;
|
||||||
|
} stack_t;
|
||||||
|
|
||||||
|
/* constants for sigev_notify of struct sigevent */
|
||||||
|
#define SIGEV_SIGNAL 0
|
||||||
|
#define SIGEV_NONE 1
|
||||||
|
#define SIGEV_THREAD 2
|
||||||
|
#define SIGEV_THREAD_ID 4
|
||||||
|
|
||||||
|
#define SEGV_MAPERR 1
|
||||||
|
#define SEGV_ACCERR 2
|
||||||
|
|
||||||
|
#define BUS_ADRALN 1
|
||||||
|
#define BUS_ADRERR 2
|
||||||
|
#define BUS_OBJERR 3
|
||||||
|
#define BUS_MCEERR_AR 4
|
||||||
|
#define BUS_MCEERR_AO 5
|
||||||
|
|
||||||
|
#define ILL_ILLOPC 1
|
||||||
|
#define ILL_ILLOPN 2
|
||||||
|
#define ILL_ILLADR 3
|
||||||
|
#define ILL_ILLTRP 4
|
||||||
|
#define ILL_PRVOPC 5
|
||||||
|
#define ILL_PRVREG 6
|
||||||
|
#define ILL_COPROC 7
|
||||||
|
#define ILL_BADSTK 8
|
||||||
|
#define ILL_BADIADDR 9
|
||||||
|
|
||||||
|
#define NSIG 65
|
||||||
|
|
||||||
|
#define SI_ASYNCNL (-60)
|
||||||
|
#define SI_TKILL (-6)
|
||||||
|
#define SI_SIGIO (-5)
|
||||||
|
#define SI_ASYNCIO (-4)
|
||||||
|
#define SI_MESGQ (-3)
|
||||||
|
#define SI_TIMER (-2)
|
||||||
|
#define SI_QUEUE (-1)
|
||||||
|
#define SI_USER 0
|
||||||
|
#define SI_KERNEL 128
|
||||||
|
|
||||||
|
#if defined(__i386__)
|
||||||
|
#define REG_GS 0
|
||||||
|
#define REG_FS 1
|
||||||
|
#define REG_ES 2
|
||||||
|
#define REG_DS 3
|
||||||
|
#define REG_EDI 4
|
||||||
|
#define REG_ESI 5
|
||||||
|
#define REG_EBP 6
|
||||||
|
#define REG_ESP 7
|
||||||
|
#define REG_EBX 8
|
||||||
|
#define REG_EDX 9
|
||||||
|
#define REG_ECX 10
|
||||||
|
#define REG_EAX 11
|
||||||
|
#define REG_TRAPNO 12
|
||||||
|
#define REG_ERR 13
|
||||||
|
#define REG_EIP 14
|
||||||
|
#define REG_CS 15
|
||||||
|
#define REG_EFL 16
|
||||||
|
#define REG_UESP 17
|
||||||
|
#define REG_SS 18
|
||||||
|
#define NGREG 19
|
||||||
|
#elif defined(__x86_64__)
|
||||||
|
#define REG_R8 0
|
||||||
|
#define REG_R9 1
|
||||||
|
#define REG_R10 2
|
||||||
|
#define REG_R11 3
|
||||||
|
#define REG_R12 4
|
||||||
|
#define REG_R13 5
|
||||||
|
#define REG_R14 6
|
||||||
|
#define REG_R15 7
|
||||||
|
#define REG_RDI 8
|
||||||
|
#define REG_RSI 9
|
||||||
|
#define REG_RBP 10
|
||||||
|
#define REG_RBX 11
|
||||||
|
#define REG_RDX 12
|
||||||
|
#define REG_RAX 13
|
||||||
|
#define REG_RCX 14
|
||||||
|
#define REG_RSP 15
|
||||||
|
#define REG_RIP 16
|
||||||
|
#define REG_EFL 17
|
||||||
|
#define REG_CSGSFS 18
|
||||||
|
#define REG_ERR 19
|
||||||
|
#define REG_TRAPNO 20
|
||||||
|
#define REG_OLDMASK 21
|
||||||
|
#define REG_CR2 22
|
||||||
|
#define NGREG 23
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/threads.h>
|
||||||
|
|
||||||
|
struct sigaction {
|
||||||
|
union {
|
||||||
|
void (*sa_handler)(int);
|
||||||
|
void (*sa_sigaction)(int, siginfo_t *, void *);
|
||||||
|
} __sa_handler;
|
||||||
|
unsigned long sa_flags;
|
||||||
|
void (*sa_restorer)(void);
|
||||||
|
sigset_t sa_mask;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define sa_handler __sa_handler.sa_handler
|
||||||
|
#define sa_sigaction __sa_handler.sa_sigaction
|
||||||
|
|
||||||
|
/* Taken from the linux kernel headers */
|
||||||
|
|
||||||
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
|
|
||||||
|
struct _fpreg {
|
||||||
|
unsigned short significand[4];
|
||||||
|
unsigned short exponent;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _fpxreg {
|
||||||
|
unsigned short significand[4];
|
||||||
|
unsigned short exponent;
|
||||||
|
unsigned short padding[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _xmmreg {
|
||||||
|
uint32_t element[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _fpstate {
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
uint16_t cwd;
|
||||||
|
uint16_t swd;
|
||||||
|
uint16_t ftw;
|
||||||
|
uint16_t fop;
|
||||||
|
uint64_t rip;
|
||||||
|
uint64_t rdp;
|
||||||
|
uint32_t mxcsr;
|
||||||
|
uint32_t mxcr_mask;
|
||||||
|
struct _fpxreg _st[8];
|
||||||
|
struct _xmmreg _xmm[16];
|
||||||
|
uint32_t padding[24];
|
||||||
|
#elif defined(__i386__)
|
||||||
|
uint32_t cw;
|
||||||
|
uint32_t sw;
|
||||||
|
uint32_t tag;
|
||||||
|
uint32_t ipoff;
|
||||||
|
uint32_t cssel;
|
||||||
|
uint32_t dataoff;
|
||||||
|
uint32_t datasel;
|
||||||
|
struct _fpreg _st[8];
|
||||||
|
uint16_t status;
|
||||||
|
uint16_t magic;
|
||||||
|
|
||||||
|
/* FXSR FPU */
|
||||||
|
|
||||||
|
uint32_t _fxsr_env[6];
|
||||||
|
uint32_t mxscr;
|
||||||
|
uint32_t reserved;
|
||||||
|
struct _fpxreg _fxsr_st[8];
|
||||||
|
struct _xmmreg _xmm[8];
|
||||||
|
|
||||||
|
uint32_t padding2[56];
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sigcontext {
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
|
||||||
|
unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
|
||||||
|
unsigned short cs, gs, fs, __pad0;
|
||||||
|
unsigned long err, trapno, oldmask, cr2;
|
||||||
|
struct _fpstate *fpstate;
|
||||||
|
unsigned long __reserved1[8];
|
||||||
|
#elif defined(__i386__)
|
||||||
|
unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
|
||||||
|
unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
|
||||||
|
unsigned long trapno, err, eip;
|
||||||
|
unsigned short cs, __csh;
|
||||||
|
unsigned long eflags, esp_at_signal;
|
||||||
|
unsigned short ss, __ssh;
|
||||||
|
struct _fpstate *fpstate;
|
||||||
|
unsigned long oldmask, cr2;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned long gregs[NGREG];
|
||||||
|
struct _fpstate *fpregs;
|
||||||
|
unsigned long __reserved1[8];
|
||||||
|
} mcontext_t;
|
||||||
|
|
||||||
|
typedef struct __ucontext {
|
||||||
|
unsigned long uc_flags;
|
||||||
|
struct __ucontext *uc_link;
|
||||||
|
stack_t uc_stack;
|
||||||
|
mcontext_t uc_mcontext;
|
||||||
|
sigset_t uc_sigmask;
|
||||||
|
} ucontext_t;
|
||||||
|
|
||||||
|
#elif defined(__riscv) && __riscv_xlen == 64
|
||||||
|
/* Definitions from Linux kernel headers. */
|
||||||
|
|
||||||
|
#define NGREG 32
|
||||||
|
|
||||||
|
enum {
|
||||||
|
REG_PC = 0,
|
||||||
|
#define REG_PC REG_PC
|
||||||
|
REG_RA = 1,
|
||||||
|
#define REG_RA REG_RA
|
||||||
|
REG_SP = 2,
|
||||||
|
#define REG_SP REG_SP
|
||||||
|
REG_TP = 4,
|
||||||
|
#define REG_TP REG_TP
|
||||||
|
REG_S0 = 8,
|
||||||
|
#define REG_S0 REG_S0
|
||||||
|
REG_A0 = 10
|
||||||
|
#define REG_A0 REG_A0
|
||||||
|
};
|
||||||
|
|
||||||
|
struct __riscv_f_ext_state {
|
||||||
|
uint32_t f[32];
|
||||||
|
uint32_t fcsr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct __riscv_d_ext_state {
|
||||||
|
uint64_t f[32];
|
||||||
|
uint32_t fcsr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct __riscv_q_ext_state {
|
||||||
|
uint64_t f[64] __attribute__((__aligned__(16)));
|
||||||
|
uint32_t fcsr;
|
||||||
|
uint32_t reserved[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
union __riscv_fp_state {
|
||||||
|
struct __riscv_f_ext_state f;
|
||||||
|
struct __riscv_d_ext_state d;
|
||||||
|
struct __riscv_q_ext_state q;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef unsigned long __riscv_mc_gp_state[NGREG];
|
||||||
|
|
||||||
|
typedef struct sigcontext {
|
||||||
|
__riscv_mc_gp_state gregs;
|
||||||
|
union __riscv_fp_state fpregs;
|
||||||
|
} mcontext_t;
|
||||||
|
|
||||||
|
typedef struct __ucontext {
|
||||||
|
unsigned long uc_flags;
|
||||||
|
struct ucontext *uc_link;
|
||||||
|
stack_t uc_stack;
|
||||||
|
sigset_t uc_sigmask;
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
uint8_t __unused[1024 / 8 - sizeof(sigset_t)];
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
mcontext_t uc_mcontext;
|
||||||
|
} ucontext_t;
|
||||||
|
|
||||||
|
#elif defined (__aarch64__)
|
||||||
|
|
||||||
|
#define NGREG 34
|
||||||
|
|
||||||
|
typedef struct sigcontext {
|
||||||
|
uint64_t fault_address;
|
||||||
|
uint64_t regs[31];
|
||||||
|
uint64_t sp;
|
||||||
|
uint64_t pc;
|
||||||
|
uint64_t pstate;
|
||||||
|
uint8_t __reserved[4096];
|
||||||
|
} mcontext_t;
|
||||||
|
|
||||||
|
#define FPSIMD_MAGIC 0x46508001
|
||||||
|
#define ESR_MAGIC 0x45535201
|
||||||
|
#define EXTRA_MAGIC 0x45585401
|
||||||
|
#define SVE_MAGIC 0x53564501
|
||||||
|
struct _aarch64_ctx {
|
||||||
|
uint32_t magic;
|
||||||
|
uint32_t size;
|
||||||
|
};
|
||||||
|
struct fpsimd_context {
|
||||||
|
struct _aarch64_ctx head;
|
||||||
|
uint32_t fpsr;
|
||||||
|
uint32_t fpcr;
|
||||||
|
__uint128_t vregs[32];
|
||||||
|
};
|
||||||
|
struct esr_context {
|
||||||
|
struct _aarch64_ctx head;
|
||||||
|
uint64_t esr;
|
||||||
|
};
|
||||||
|
struct extra_context {
|
||||||
|
struct _aarch64_ctx head;
|
||||||
|
uint64_t datap;
|
||||||
|
uint32_t size;
|
||||||
|
uint32_t __reserved[3];
|
||||||
|
};
|
||||||
|
struct sve_context {
|
||||||
|
struct _aarch64_ctx head;
|
||||||
|
uint16_t vl;
|
||||||
|
uint16_t __reserved[3];
|
||||||
|
};
|
||||||
|
#define SVE_VQ_BYTES 16
|
||||||
|
#define SVE_VQ_MIN 1
|
||||||
|
#define SVE_VQ_MAX 512
|
||||||
|
#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
|
||||||
|
#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
|
||||||
|
#define SVE_NUM_ZREGS 32
|
||||||
|
#define SVE_NUM_PREGS 16
|
||||||
|
#define sve_vl_valid(vl) \
|
||||||
|
((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
|
||||||
|
#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
|
||||||
|
#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
|
||||||
|
#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
|
||||||
|
#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
|
||||||
|
#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
|
||||||
|
#define SVE_SIG_REGS_OFFSET \
|
||||||
|
((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
|
||||||
|
/ SVE_VQ_BYTES * SVE_VQ_BYTES)
|
||||||
|
#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
|
||||||
|
#define SVE_SIG_ZREG_OFFSET(vq, n) \
|
||||||
|
(SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
|
||||||
|
#define SVE_SIG_ZREGS_SIZE(vq) \
|
||||||
|
(SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
|
||||||
|
#define SVE_SIG_PREGS_OFFSET(vq) \
|
||||||
|
(SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
|
||||||
|
#define SVE_SIG_PREG_OFFSET(vq, n) \
|
||||||
|
(SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
|
||||||
|
#define SVE_SIG_PREGS_SIZE(vq) \
|
||||||
|
(SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
|
||||||
|
#define SVE_SIG_FFR_OFFSET(vq) \
|
||||||
|
(SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
|
||||||
|
#define SVE_SIG_REGS_SIZE(vq) \
|
||||||
|
(SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
|
||||||
|
#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
|
||||||
|
|
||||||
|
typedef struct __ucontext {
|
||||||
|
unsigned long uc_flags;
|
||||||
|
struct __ucontext *uc_link;
|
||||||
|
stack_t uc_stack;
|
||||||
|
sigset_t uc_sigmask;
|
||||||
|
mcontext_t uc_mcontext;
|
||||||
|
} ucontext_t;
|
||||||
|
|
||||||
|
#elif defined (__m68k__)
|
||||||
|
|
||||||
|
/* taken from musl */
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE) || defined(__MLIBC_BUILDING_MLIBC)
|
||||||
|
enum { R_D0 = 0 };
|
||||||
|
#define R_D0 R_D0
|
||||||
|
enum { R_D1 = 1 };
|
||||||
|
#define R_D1 R_D1
|
||||||
|
enum { R_D2 = 2 };
|
||||||
|
#define R_D2 R_D2
|
||||||
|
enum { R_D3 = 3 };
|
||||||
|
#define R_D3 R_D3
|
||||||
|
enum { R_D4 = 4 };
|
||||||
|
#define R_D4 R_D4
|
||||||
|
enum { R_D5 = 5 };
|
||||||
|
#define R_D5 R_D5
|
||||||
|
enum { R_D6 = 6 };
|
||||||
|
#define R_D6 R_D6
|
||||||
|
enum { R_D7 = 7 };
|
||||||
|
#define R_D7 R_D7
|
||||||
|
enum { R_A0 = 8 };
|
||||||
|
#define R_A0 R_A0
|
||||||
|
enum { R_A1 = 9 };
|
||||||
|
#define R_A1 R_A1
|
||||||
|
enum { R_A2 = 10 };
|
||||||
|
#define R_A2 R_A2
|
||||||
|
enum { R_A3 = 11 };
|
||||||
|
#define R_A3 R_A3
|
||||||
|
enum { R_A4 = 12 };
|
||||||
|
#define R_A4 R_A4
|
||||||
|
enum { R_A5 = 13 };
|
||||||
|
#define R_A5 R_A5
|
||||||
|
enum { R_A6 = 14 };
|
||||||
|
#define R_A6 R_A6
|
||||||
|
enum { R_A7 = 15 };
|
||||||
|
#define R_A7 R_A7
|
||||||
|
enum { R_SP = 15 };
|
||||||
|
#define R_SP R_SP
|
||||||
|
enum { R_PC = 16 };
|
||||||
|
#define R_PC R_PC
|
||||||
|
enum { R_PS = 17 };
|
||||||
|
#define R_PS R_PS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(__MLIBC_BUILDING_MLIBC)
|
||||||
|
|
||||||
|
struct sigcontext {
|
||||||
|
unsigned long sc_mask, sc_usp, sc_d0, sc_d1, sc_a0, sc_a1;
|
||||||
|
unsigned short sc_sr;
|
||||||
|
unsigned long sc_pc;
|
||||||
|
unsigned short sc_formatvec;
|
||||||
|
unsigned long sc_fpregs[6], sc_fpcntl[3];
|
||||||
|
unsigned char sc_fpstate[216];
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef int greg_t, gregset_t[18];
|
||||||
|
typedef struct {
|
||||||
|
int f_pcr, f_psr, f_fpiaddr, f_fpregs[8][3];
|
||||||
|
} fpregset_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int version;
|
||||||
|
gregset_t gregs;
|
||||||
|
fpregset_t fpregs;
|
||||||
|
} mcontext_t;
|
||||||
|
#else
|
||||||
|
typedef struct {
|
||||||
|
int __version;
|
||||||
|
int __gregs[18];
|
||||||
|
int __fpregs[27];
|
||||||
|
} mcontext_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct sigaltstack {
|
||||||
|
void *ss_sp;
|
||||||
|
int ss_flags;
|
||||||
|
size_t ss_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct __ucontext {
|
||||||
|
unsigned long uc_flags;
|
||||||
|
struct __ucontext *uc_link;
|
||||||
|
stack_t uc_stack;
|
||||||
|
mcontext_t uc_mcontext;
|
||||||
|
long __reserved[80];
|
||||||
|
sigset_t uc_sigmask;
|
||||||
|
} ucontext_t;
|
||||||
|
|
||||||
|
#elif defined(__loongarch64)
|
||||||
|
/* Taken from musl. */
|
||||||
|
|
||||||
|
#define NGREG 32
|
||||||
|
#define REG_RA 1
|
||||||
|
#define REG_SP 3
|
||||||
|
#define REG_S0 23
|
||||||
|
#define REG_S1 24
|
||||||
|
#define REG_A0 4
|
||||||
|
#define REG_S2 25
|
||||||
|
#define REG_NARGS 8
|
||||||
|
|
||||||
|
typedef unsigned long greg_t, gregset_t[32];
|
||||||
|
|
||||||
|
struct sigcontext {
|
||||||
|
unsigned long sc_pc;
|
||||||
|
unsigned long sc_regs[32];
|
||||||
|
unsigned sc_flags;
|
||||||
|
unsigned long sc_extcontext[1] __attribute__((__aligned__(16)));
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned long pc;
|
||||||
|
unsigned long gregs[32];
|
||||||
|
unsigned flags;
|
||||||
|
unsigned long extcontext[1] __attribute__((__aligned__(16)));
|
||||||
|
} mcontext_t;
|
||||||
|
|
||||||
|
struct sigaltstack {
|
||||||
|
void *ss_sp;
|
||||||
|
int ss_flags;
|
||||||
|
size_t ss_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct __ucontext {
|
||||||
|
unsigned long uc_flags;
|
||||||
|
struct __ucontext *uc_link;
|
||||||
|
stack_t uc_stack;
|
||||||
|
sigset_t uc_sigmask;
|
||||||
|
long __uc_pad;
|
||||||
|
mcontext_t uc_mcontext;
|
||||||
|
} ucontext_t;
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error "Missing architecture specific code."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SIGNAL_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _ABIBITS_SIGSET_T_H
|
||||||
|
#define _ABIBITS_SIGSET_T_H
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned long __sig[1024 / (8 * sizeof(long))];
|
||||||
|
} sigset_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SIGSET_T_H */
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef _ABIBITS_SIGVAL_H
|
||||||
|
#define _ABIBITS_SIGVAL_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
union sigval {
|
||||||
|
int sival_int;
|
||||||
|
void *sival_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SIGVAL_H */
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef _ABIBITS_SOCKADDR_STORAGE_H
|
||||||
|
#define _ABIBITS_SOCKADDR_STORAGE_H
|
||||||
|
|
||||||
|
#include <abi-bits/sa_family_t.h>
|
||||||
|
|
||||||
|
struct sockaddr_storage {
|
||||||
|
sa_family_t ss_family;
|
||||||
|
char __padding[128 - sizeof(sa_family_t) - sizeof(long)];
|
||||||
|
long __force_alignment;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SOCKADDR_STORAGE_H */
|
||||||
Executable
+329
@@ -0,0 +1,329 @@
|
|||||||
|
#ifndef _ABIBITS_SOCKET_H
|
||||||
|
#define _ABIBITS_SOCKET_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <abi-bits/socklen_t.h>
|
||||||
|
#include <bits/posix/iovec.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned short sa_family_t;
|
||||||
|
|
||||||
|
struct msghdr {
|
||||||
|
void *msg_name;
|
||||||
|
socklen_t msg_namelen;
|
||||||
|
struct iovec *msg_iov;
|
||||||
|
size_t msg_iovlen; /* int in POSIX */
|
||||||
|
void *msg_control;
|
||||||
|
size_t msg_controllen; /* socklen_t in POSIX */
|
||||||
|
int msg_flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sockaddr_storage {
|
||||||
|
sa_family_t ss_family;
|
||||||
|
char __padding[128 - sizeof(sa_family_t) - sizeof(long)];
|
||||||
|
long __force_alignment;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct mmsghdr {
|
||||||
|
struct msghdr msg_hdr;
|
||||||
|
unsigned int msg_len;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct cmsghdr {
|
||||||
|
size_t cmsg_len; /* socklen_t in POSIX */
|
||||||
|
int cmsg_level;
|
||||||
|
int cmsg_type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SCM_RIGHTS 1
|
||||||
|
#define SCM_CREDENTIALS 2
|
||||||
|
|
||||||
|
#define SHUT_RD 0
|
||||||
|
#define SHUT_WR 1
|
||||||
|
#define SHUT_RDWR 2
|
||||||
|
|
||||||
|
#ifndef SOCK_STREAM
|
||||||
|
#define SOCK_STREAM 1
|
||||||
|
#define SOCK_DGRAM 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SOCK_RAW 3
|
||||||
|
#define SOCK_RDM 4
|
||||||
|
#define SOCK_SEQPACKET 5
|
||||||
|
#define SOCK_DCCP 6
|
||||||
|
#define SOCK_PACKET 10
|
||||||
|
|
||||||
|
#ifndef SOCK_CLOEXEC
|
||||||
|
#define SOCK_CLOEXEC 02000000
|
||||||
|
#define SOCK_NONBLOCK 04000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define PF_UNSPEC 0
|
||||||
|
#define PF_LOCAL 1
|
||||||
|
#define PF_UNIX PF_LOCAL
|
||||||
|
#define PF_FILE PF_LOCAL
|
||||||
|
#define PF_INET 2
|
||||||
|
#define PF_AX25 3
|
||||||
|
#define PF_IPX 4
|
||||||
|
#define PF_APPLETALK 5
|
||||||
|
#define PF_NETROM 6
|
||||||
|
#define PF_BRIDGE 7
|
||||||
|
#define PF_ATMPVC 8
|
||||||
|
#define PF_X25 9
|
||||||
|
#define PF_INET6 10
|
||||||
|
#define PF_ROSE 11
|
||||||
|
#define PF_DECnet 12
|
||||||
|
#define PF_NETBEUI 13
|
||||||
|
#define PF_SECURITY 14
|
||||||
|
#define PF_KEY 15
|
||||||
|
#define PF_NETLINK 16
|
||||||
|
#define PF_ROUTE PF_NETLINK
|
||||||
|
#define PF_PACKET 17
|
||||||
|
#define PF_ASH 18
|
||||||
|
#define PF_ECONET 19
|
||||||
|
#define PF_ATMSVC 20
|
||||||
|
#define PF_RDS 21
|
||||||
|
#define PF_SNA 22
|
||||||
|
#define PF_IRDA 23
|
||||||
|
#define PF_PPPOX 24
|
||||||
|
#define PF_WANPIPE 25
|
||||||
|
#define PF_LLC 26
|
||||||
|
#define PF_IB 27
|
||||||
|
#define PF_MPLS 28
|
||||||
|
#define PF_CAN 29
|
||||||
|
#define PF_TIPC 30
|
||||||
|
#define PF_BLUETOOTH 31
|
||||||
|
#define PF_IUCV 32
|
||||||
|
#define PF_RXRPC 33
|
||||||
|
#define PF_ISDN 34
|
||||||
|
#define PF_PHONET 35
|
||||||
|
#define PF_IEEE802154 36
|
||||||
|
#define PF_CAIF 37
|
||||||
|
#define PF_ALG 38
|
||||||
|
#define PF_NFC 39
|
||||||
|
#define PF_VSOCK 40
|
||||||
|
#define PF_KCM 41
|
||||||
|
#define PF_QIPCRTR 42
|
||||||
|
#define PF_SMC 43
|
||||||
|
#define PF_XDP 44
|
||||||
|
#define PF_MAX 45
|
||||||
|
|
||||||
|
#define AF_UNSPEC PF_UNSPEC
|
||||||
|
#define AF_LOCAL PF_LOCAL
|
||||||
|
#define AF_UNIX AF_LOCAL
|
||||||
|
#define AF_FILE AF_LOCAL
|
||||||
|
#define AF_INET PF_INET
|
||||||
|
#define AF_AX25 PF_AX25
|
||||||
|
#define AF_IPX PF_IPX
|
||||||
|
#define AF_APPLETALK PF_APPLETALK
|
||||||
|
#define AF_NETROM PF_NETROM
|
||||||
|
#define AF_BRIDGE PF_BRIDGE
|
||||||
|
#define AF_ATMPVC PF_ATMPVC
|
||||||
|
#define AF_X25 PF_X25
|
||||||
|
#define AF_INET6 PF_INET6
|
||||||
|
#define AF_ROSE PF_ROSE
|
||||||
|
#define AF_DECnet PF_DECnet
|
||||||
|
#define AF_NETBEUI PF_NETBEUI
|
||||||
|
#define AF_SECURITY PF_SECURITY
|
||||||
|
#define AF_KEY PF_KEY
|
||||||
|
#define AF_NETLINK PF_NETLINK
|
||||||
|
#define AF_ROUTE PF_ROUTE
|
||||||
|
#define AF_PACKET PF_PACKET
|
||||||
|
#define AF_ASH PF_ASH
|
||||||
|
#define AF_ECONET PF_ECONET
|
||||||
|
#define AF_ATMSVC PF_ATMSVC
|
||||||
|
#define AF_RDS PF_RDS
|
||||||
|
#define AF_SNA PF_SNA
|
||||||
|
#define AF_IRDA PF_IRDA
|
||||||
|
#define AF_PPPOX PF_PPPOX
|
||||||
|
#define AF_WANPIPE PF_WANPIPE
|
||||||
|
#define AF_LLC PF_LLC
|
||||||
|
#define AF_IB PF_IB
|
||||||
|
#define AF_MPLS PF_MPLS
|
||||||
|
#define AF_CAN PF_CAN
|
||||||
|
#define AF_TIPC PF_TIPC
|
||||||
|
#define AF_BLUETOOTH PF_BLUETOOTH
|
||||||
|
#define AF_IUCV PF_IUCV
|
||||||
|
#define AF_RXRPC PF_RXRPC
|
||||||
|
#define AF_ISDN PF_ISDN
|
||||||
|
#define AF_PHONET PF_PHONET
|
||||||
|
#define AF_IEEE802154 PF_IEEE802154
|
||||||
|
#define AF_CAIF PF_CAIF
|
||||||
|
#define AF_ALG PF_ALG
|
||||||
|
#define AF_NFC PF_NFC
|
||||||
|
#define AF_VSOCK PF_VSOCK
|
||||||
|
#define AF_KCM PF_KCM
|
||||||
|
#define AF_QIPCRTR PF_QIPCRTR
|
||||||
|
#define AF_SMC PF_SMC
|
||||||
|
#define AF_XDP PF_XDP
|
||||||
|
#define AF_MAX PF_MAX
|
||||||
|
|
||||||
|
#define SO_DEBUG 1
|
||||||
|
#define SO_REUSEADDR 2
|
||||||
|
#define SO_TYPE 3
|
||||||
|
#define SO_ERROR 4
|
||||||
|
#define SO_DONTROUTE 5
|
||||||
|
#define SO_BROADCAST 6
|
||||||
|
#define SO_SNDBUF 7
|
||||||
|
#define SO_RCVBUF 8
|
||||||
|
#define SO_KEEPALIVE 9
|
||||||
|
#define SO_OOBINLINE 10
|
||||||
|
#define SO_NO_CHECK 11
|
||||||
|
#define SO_PRIORITY 12
|
||||||
|
#define SO_LINGER 13
|
||||||
|
#define SO_BSDCOMPAT 14
|
||||||
|
#define SO_REUSEPORT 15
|
||||||
|
#define SO_PASSCRED 16
|
||||||
|
#define SO_PEERCRED 17
|
||||||
|
#define SO_RCVLOWAT 18
|
||||||
|
#define SO_SNDLOWAT 19
|
||||||
|
#define SO_ACCEPTCONN 30
|
||||||
|
#define SO_PEERSEC 31
|
||||||
|
#define SO_SNDBUFFORCE 32
|
||||||
|
#define SO_RCVBUFFORCE 33
|
||||||
|
#define SO_PROTOCOL 38
|
||||||
|
#define SO_DOMAIN 39
|
||||||
|
|
||||||
|
#ifndef SO_RCVTIMEO
|
||||||
|
#if __LONG_MAX == 0x7fffffff
|
||||||
|
#define SO_RCVTIMEO 66
|
||||||
|
#else
|
||||||
|
#define SO_RCVTIMEO 20
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SO_RCVTIMEO_OLD
|
||||||
|
#define SO_RCVTIMEO_OLD 20
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SO_SNDTIMEO
|
||||||
|
#if __LONG_MAX == 0x7fffffff
|
||||||
|
#define SO_SNDTIMEO 67
|
||||||
|
#else
|
||||||
|
#define SO_SNDTIMEO 21
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SO_SNDTIMEO_OLD
|
||||||
|
#define SO_SNDTIMEO_OLD 21
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SO_TIMESTAMP
|
||||||
|
#if __LONG_MAX == 0x7fffffff
|
||||||
|
#define SO_TIMESTAMP 63
|
||||||
|
#define SO_TIMESTAMPNS 64
|
||||||
|
#define SO_TIMESTAMPING 65
|
||||||
|
#else
|
||||||
|
#define SO_TIMESTAMP 29
|
||||||
|
#define SO_TIMESTAMPNS 35
|
||||||
|
#define SO_TIMESTAMPING 37
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SO_SECURITY_AUTHENTICATION 22
|
||||||
|
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
|
||||||
|
#define SO_SECURITY_ENCRYPTION_NETWORK 24
|
||||||
|
|
||||||
|
#define SO_BINDTODEVICE 25
|
||||||
|
|
||||||
|
#define SO_ATTACH_FILTER 26
|
||||||
|
#define SO_DETACH_FILTER 27
|
||||||
|
#define SO_GET_FILTER SO_ATTACH_FILTER
|
||||||
|
|
||||||
|
#define SO_PEERNAME 28
|
||||||
|
#define SCM_TIMESTAMP SO_TIMESTAMP
|
||||||
|
#define SO_PASSSEC 34
|
||||||
|
#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
|
||||||
|
#define SO_MARK 36
|
||||||
|
#define SCM_TIMESTAMPING SO_TIMESTAMPING
|
||||||
|
#define SO_RXQ_OVFL 40
|
||||||
|
#define SO_WIFI_STATUS 41
|
||||||
|
#define SCM_WIFI_STATUS SO_WIFI_STATUS
|
||||||
|
#define SO_PEEK_OFF 42
|
||||||
|
#define SO_NOFCS 43
|
||||||
|
#define SO_LOCK_FILTER 44
|
||||||
|
#define SO_SELECT_ERR_QUEUE 45
|
||||||
|
#define SO_BUSY_POLL 46
|
||||||
|
#define SO_MAX_PACING_RATE 47
|
||||||
|
#define SO_BPF_EXTENSIONS 48
|
||||||
|
#define SO_INCOMING_CPU 49
|
||||||
|
#define SO_ATTACH_BPF 50
|
||||||
|
#define SO_DETACH_BPF SO_DETACH_FILTER
|
||||||
|
#define SO_ATTACH_REUSEPORT_CBPF 51
|
||||||
|
#define SO_ATTACH_REUSEPORT_EBPF 52
|
||||||
|
#define SO_CNX_ADVICE 53
|
||||||
|
#define SCM_TIMESTAMPING_OPT_STATS 54
|
||||||
|
#define SO_MEMINFO 55
|
||||||
|
#define SO_INCOMING_NAPI_ID 56
|
||||||
|
#define SO_COOKIE 57
|
||||||
|
#define SCM_TIMESTAMPING_PKTINFO 58
|
||||||
|
#define SO_PEERGROUPS 59
|
||||||
|
#define SO_ZEROCOPY 60
|
||||||
|
#define SO_TXTIME 61
|
||||||
|
#define SCM_TXTIME SO_TXTIME
|
||||||
|
#define SO_BINDTOIFINDEX 62
|
||||||
|
#define SO_DETACH_REUSEPORT_BPF 68
|
||||||
|
|
||||||
|
#define SOL_SOCKET 1
|
||||||
|
|
||||||
|
#define SOL_IP 0
|
||||||
|
#define SOL_IPV6 41
|
||||||
|
#define SOL_ICMPV6 58
|
||||||
|
|
||||||
|
#define SOL_RAW 255
|
||||||
|
#define SOL_DECNET 261
|
||||||
|
#define SOL_X25 262
|
||||||
|
#define SOL_PACKET 263
|
||||||
|
#define SOL_ATM 264
|
||||||
|
#define SOL_AAL 265
|
||||||
|
#define SOL_IRDA 266
|
||||||
|
#define SOL_NETBEUI 267
|
||||||
|
#define SOL_LLC 268
|
||||||
|
#define SOL_DCCP 269
|
||||||
|
#define SOL_NETLINK 270
|
||||||
|
#define SOL_TIPC 271
|
||||||
|
#define SOL_RXRPC 272
|
||||||
|
#define SOL_PPPOL2TP 273
|
||||||
|
#define SOL_BLUETOOTH 274
|
||||||
|
#define SOL_PNPIPE 275
|
||||||
|
#define SOL_RDS 276
|
||||||
|
#define SOL_IUCV 277
|
||||||
|
#define SOL_CAIF 278
|
||||||
|
#define SOL_ALG 279
|
||||||
|
#define SOL_NFC 280
|
||||||
|
#define SOL_KCM 281
|
||||||
|
#define SOL_TLS 282
|
||||||
|
#define SOL_XDP 283
|
||||||
|
|
||||||
|
#define SOMAXCONN 128
|
||||||
|
|
||||||
|
#define MSG_OOB 0x0001
|
||||||
|
#define MSG_PEEK 0x0002
|
||||||
|
#define MSG_DONTROUTE 0x0004
|
||||||
|
#define MSG_CTRUNC 0x0008
|
||||||
|
#define MSG_PROXY 0x0010
|
||||||
|
#define MSG_TRUNC 0x0020
|
||||||
|
#define MSG_DONTWAIT 0x0040
|
||||||
|
#define MSG_EOR 0x0080
|
||||||
|
#define MSG_WAITALL 0x0100
|
||||||
|
#define MSG_FIN 0x0200
|
||||||
|
#define MSG_SYN 0x0400
|
||||||
|
#define MSG_CONFIRM 0x0800
|
||||||
|
#define MSG_RST 0x1000
|
||||||
|
#define MSG_ERRQUEUE 0x2000
|
||||||
|
#define MSG_NOSIGNAL 0x4000
|
||||||
|
#define MSG_MORE 0x8000
|
||||||
|
#define MSG_WAITFORONE 0x10000
|
||||||
|
#define MSG_BATCH 0x40000
|
||||||
|
#define MSG_ZEROCOPY 0x4000000
|
||||||
|
#define MSG_FASTOPEN 0x20000000
|
||||||
|
#define MSG_CMSG_CLOEXEC 0x40000000
|
||||||
|
|
||||||
|
#endif
|
||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef _ABIBITS_SOCKLEN_T_H
|
||||||
|
#define _ABIBITS_SOCKLEN_T_H
|
||||||
|
|
||||||
|
typedef unsigned socklen_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SOCKLEN_T_H */
|
||||||
Executable
+148
@@ -0,0 +1,148 @@
|
|||||||
|
#ifndef _ABIBITS_STAT_H
|
||||||
|
#define _ABIBITS_STAT_H
|
||||||
|
|
||||||
|
#include <abi-bits/uid_t.h>
|
||||||
|
#include <abi-bits/gid_t.h>
|
||||||
|
#include <bits/off_t.h>
|
||||||
|
#include <abi-bits/mode_t.h>
|
||||||
|
#include <abi-bits/dev_t.h>
|
||||||
|
#include <abi-bits/ino_t.h>
|
||||||
|
#include <abi-bits/blksize_t.h>
|
||||||
|
#include <abi-bits/blkcnt_t.h>
|
||||||
|
#include <abi-bits/nlink_t.h>
|
||||||
|
#include <bits/ansi/time_t.h>
|
||||||
|
#include <bits/ansi/timespec.h>
|
||||||
|
|
||||||
|
#define S_IFMT 0x0F000
|
||||||
|
#define S_IFBLK 0x06000
|
||||||
|
#define S_IFCHR 0x02000
|
||||||
|
#define S_IFIFO 0x01000
|
||||||
|
#define S_IFREG 0x08000
|
||||||
|
#define S_IFDIR 0x04000
|
||||||
|
#define S_IFLNK 0x0A000
|
||||||
|
#define S_IFSOCK 0x0C000
|
||||||
|
|
||||||
|
#define S_IRWXU 0700
|
||||||
|
#define S_IRUSR 0400
|
||||||
|
#define S_IWUSR 0200
|
||||||
|
#define S_IXUSR 0100
|
||||||
|
#define S_IRWXG 070
|
||||||
|
#define S_IRGRP 040
|
||||||
|
#define S_IWGRP 020
|
||||||
|
#define S_IXGRP 010
|
||||||
|
#define S_IRWXO 07
|
||||||
|
#define S_IROTH 04
|
||||||
|
#define S_IWOTH 02
|
||||||
|
#define S_IXOTH 01
|
||||||
|
#define S_ISUID 04000
|
||||||
|
#define S_ISGID 02000
|
||||||
|
#define S_ISVTX 01000
|
||||||
|
|
||||||
|
#define S_IREAD S_IRUSR
|
||||||
|
#define S_IWRITE S_IWUSR
|
||||||
|
#define S_IEXEC S_IXUSR
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
|
||||||
|
struct stat {
|
||||||
|
dev_t st_dev;
|
||||||
|
ino_t st_ino;
|
||||||
|
nlink_t st_nlink;
|
||||||
|
mode_t st_mode;
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
|
unsigned int __pad0;
|
||||||
|
dev_t st_rdev;
|
||||||
|
off_t st_size;
|
||||||
|
blksize_t st_blksize;
|
||||||
|
blkcnt_t st_blocks;
|
||||||
|
struct timespec st_atim;
|
||||||
|
struct timespec st_mtim;
|
||||||
|
struct timespec st_ctim;
|
||||||
|
long __unused[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
#elif (defined(__riscv) && __riscv_xlen == 64) || defined (__aarch64__) || defined(__loongarch64)
|
||||||
|
|
||||||
|
struct stat {
|
||||||
|
dev_t st_dev;
|
||||||
|
ino_t st_ino;
|
||||||
|
mode_t st_mode;
|
||||||
|
nlink_t st_nlink;
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
|
dev_t st_rdev;
|
||||||
|
dev_t __pad1;
|
||||||
|
off_t st_size;
|
||||||
|
blksize_t st_blksize;
|
||||||
|
int __pad2;
|
||||||
|
blkcnt_t st_blocks;
|
||||||
|
struct timespec st_atim;
|
||||||
|
struct timespec st_mtim;
|
||||||
|
struct timespec st_ctim;
|
||||||
|
int __pad3[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#elif defined(__i386__)
|
||||||
|
|
||||||
|
struct stat {
|
||||||
|
dev_t st_dev;
|
||||||
|
int __st_dev_padding;
|
||||||
|
long __st_ino_truncated;
|
||||||
|
mode_t st_mode;
|
||||||
|
nlink_t st_nlink;
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
|
dev_t st_rdev;
|
||||||
|
int __st_rdev_padding;
|
||||||
|
off_t st_size;
|
||||||
|
blksize_t st_blksize;
|
||||||
|
blkcnt_t st_blocks;
|
||||||
|
struct {
|
||||||
|
long tv_sec;
|
||||||
|
long tv_nsec;
|
||||||
|
} __st_atim32, __st_mtim32, __st_ctim32;
|
||||||
|
ino_t st_ino;
|
||||||
|
|
||||||
|
/* These fields are not in the ABI. Their values are */
|
||||||
|
/* copied from __st_atim32, __st_mtim32, __st_ctim32 */
|
||||||
|
/* accordingly. */
|
||||||
|
|
||||||
|
struct timespec st_atim;
|
||||||
|
struct timespec st_mtim;
|
||||||
|
struct timespec st_ctim;
|
||||||
|
};
|
||||||
|
#elif defined (__m68k__)
|
||||||
|
|
||||||
|
struct stat {
|
||||||
|
dev_t st_dev;
|
||||||
|
unsigned char __st_dev_padding[2];
|
||||||
|
unsigned long __st_ino;
|
||||||
|
mode_t st_mode;
|
||||||
|
nlink_t st_nlink;
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
|
dev_t st_rdev;
|
||||||
|
unsigned char __st_rdev_padding;
|
||||||
|
long long st_size; /* TODO: off64_t? */
|
||||||
|
blksize_t st_blksize;
|
||||||
|
blkcnt_t st_blocks;
|
||||||
|
struct timespec st_atim;
|
||||||
|
struct timespec st_mtim;
|
||||||
|
struct timespec st_ctim;
|
||||||
|
ino_t st_ino;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define stat64 stat
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_STAT_H */
|
||||||
Executable
+51
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef _ABIBITS_STATVFS_H
|
||||||
|
#define _ABIBITS_STATVFS_H
|
||||||
|
|
||||||
|
#include <abi-bits/fsblkcnt_t.h>
|
||||||
|
#include <abi-bits/fsfilcnt_t.h>
|
||||||
|
|
||||||
|
#define ST_RDONLY 1
|
||||||
|
#define ST_NOSUID 2
|
||||||
|
#define ST_NODEV 4
|
||||||
|
#define ST_NOEXEC 8
|
||||||
|
#define ST_SYNCHRONOUS 16
|
||||||
|
#define ST_MANDLOCK 64
|
||||||
|
#define ST_WRITE 128
|
||||||
|
#define ST_APPEND 256
|
||||||
|
#define ST_IMMUTABLE 512
|
||||||
|
#define ST_NOATIME 1024
|
||||||
|
#define ST_NODIRATIME 2048
|
||||||
|
|
||||||
|
/* On Linux, this struct is not directly used by the kernel. */
|
||||||
|
|
||||||
|
/* WARNING: keep `statvfs` and `statvfs64` in sync or bad things will happen! */
|
||||||
|
struct statvfs {
|
||||||
|
unsigned long f_bsize;
|
||||||
|
unsigned long f_frsize;
|
||||||
|
fsblkcnt_t f_blocks;
|
||||||
|
fsblkcnt_t f_bfree;
|
||||||
|
fsblkcnt_t f_bavail;
|
||||||
|
fsfilcnt_t f_files;
|
||||||
|
fsfilcnt_t f_ffree;
|
||||||
|
fsfilcnt_t f_favail;
|
||||||
|
unsigned long f_fsid;
|
||||||
|
unsigned long f_flag;
|
||||||
|
unsigned long f_namemax;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* WARNING: keep `statvfs` and `statvfs64` in sync or bad things will happen! */
|
||||||
|
struct statvfs64 {
|
||||||
|
unsigned long f_bsize;
|
||||||
|
unsigned long f_frsize;
|
||||||
|
fsblkcnt_t f_blocks;
|
||||||
|
fsblkcnt_t f_bfree;
|
||||||
|
fsblkcnt_t f_bavail;
|
||||||
|
fsfilcnt_t f_files;
|
||||||
|
fsfilcnt_t f_ffree;
|
||||||
|
fsfilcnt_t f_favail;
|
||||||
|
unsigned long f_fsid;
|
||||||
|
unsigned long f_flag;
|
||||||
|
unsigned long f_namemax;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_STATVFS_H */
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _ABIBITS_SUSECONDS_T_H
|
||||||
|
#define _ABIBITS_SUSECONDS_T_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef long suseconds_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_SUSECONDS_T_H */
|
||||||
Executable
+155
@@ -0,0 +1,155 @@
|
|||||||
|
#ifndef _ABIBITS_TERMIOS_H
|
||||||
|
#define _ABIBITS_TERMIOS_H
|
||||||
|
|
||||||
|
typedef unsigned char cc_t;
|
||||||
|
typedef unsigned int speed_t;
|
||||||
|
typedef unsigned int tcflag_t;
|
||||||
|
|
||||||
|
/* indices for the c_cc array in struct termios */
|
||||||
|
#define NCCS 32
|
||||||
|
#define VINTR 0
|
||||||
|
#define VQUIT 1
|
||||||
|
#define VERASE 2
|
||||||
|
#define VKILL 3
|
||||||
|
#define VEOF 4
|
||||||
|
#define VTIME 5
|
||||||
|
#define VMIN 6
|
||||||
|
#define VSWTC 7
|
||||||
|
#define VSTART 8
|
||||||
|
#define VSTOP 9
|
||||||
|
#define VSUSP 10
|
||||||
|
#define VEOL 11
|
||||||
|
#define VREPRINT 12
|
||||||
|
#define VDISCARD 13
|
||||||
|
#define VWERASE 14
|
||||||
|
#define VLNEXT 15
|
||||||
|
#define VEOL2 16
|
||||||
|
|
||||||
|
/* bitwise flags for c_iflag in struct termios */
|
||||||
|
#define IGNBRK 0000001
|
||||||
|
#define BRKINT 0000002
|
||||||
|
#define IGNPAR 0000004
|
||||||
|
#define PARMRK 0000010
|
||||||
|
#define INPCK 0000020
|
||||||
|
#define ISTRIP 0000040
|
||||||
|
#define INLCR 0000100
|
||||||
|
#define IGNCR 0000200
|
||||||
|
#define ICRNL 0000400
|
||||||
|
#define IUCLC 0001000
|
||||||
|
#define IXON 0002000
|
||||||
|
#define IXANY 0004000
|
||||||
|
#define IXOFF 0010000
|
||||||
|
#define IMAXBEL 0020000
|
||||||
|
#define IUTF8 0040000
|
||||||
|
|
||||||
|
/* bitwise flags for c_oflag in struct termios */
|
||||||
|
#define OPOST 0000001
|
||||||
|
#define OLCUC 0000002
|
||||||
|
#define ONLCR 0000004
|
||||||
|
#define OCRNL 0000010
|
||||||
|
#define ONOCR 0000020
|
||||||
|
#define ONLRET 0000040
|
||||||
|
#define OFILL 0000100
|
||||||
|
#define OFDEL 0000200
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
|
||||||
|
|
||||||
|
#define NLDLY 0000400
|
||||||
|
#define NL0 0000000
|
||||||
|
#define NL1 0000400
|
||||||
|
|
||||||
|
#define CRDLY 0003000
|
||||||
|
#define CR0 0000000
|
||||||
|
#define CR1 0001000
|
||||||
|
#define CR2 0002000
|
||||||
|
#define CR3 0003000
|
||||||
|
|
||||||
|
#define TABDLY 0014000
|
||||||
|
#define TAB0 0000000
|
||||||
|
#define TAB1 0004000
|
||||||
|
#define TAB2 0010000
|
||||||
|
#define TAB3 0014000
|
||||||
|
|
||||||
|
#define BSDLY 0020000
|
||||||
|
#define BS0 0000000
|
||||||
|
#define BS1 0020000
|
||||||
|
|
||||||
|
#define FFDLY 0100000
|
||||||
|
#define FF0 0000000
|
||||||
|
#define FF1 0100000
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define VTDLY 0040000
|
||||||
|
#define VT0 0000000
|
||||||
|
#define VT1 0040000
|
||||||
|
|
||||||
|
/* bitwise constants for c_cflag in struct termios */
|
||||||
|
#define CSIZE 0000060
|
||||||
|
#define CS5 0000000
|
||||||
|
#define CS6 0000020
|
||||||
|
#define CS7 0000040
|
||||||
|
#define CS8 0000060
|
||||||
|
|
||||||
|
#define CSTOPB 0000100
|
||||||
|
#define CREAD 0000200
|
||||||
|
#define PARENB 0000400
|
||||||
|
#define PARODD 0001000
|
||||||
|
#define HUPCL 0002000
|
||||||
|
#define CLOCAL 0004000
|
||||||
|
|
||||||
|
/* bitwise constants for c_lflag in struct termios */
|
||||||
|
#define ISIG 0000001
|
||||||
|
#define ICANON 0000002
|
||||||
|
#define ECHO 0000010
|
||||||
|
#define ECHOE 0000020
|
||||||
|
#define ECHOK 0000040
|
||||||
|
#define ECHONL 0000100
|
||||||
|
#define NOFLSH 0000200
|
||||||
|
#define TOSTOP 0000400
|
||||||
|
#define IEXTEN 0100000
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||||
|
|
||||||
|
#define EXTA 0000016
|
||||||
|
#define EXTB 0000017
|
||||||
|
#define CBAUD 0010017
|
||||||
|
#define CBAUDEX 0010000
|
||||||
|
#define CIBAUD 002003600000
|
||||||
|
#define CMSPAR 010000000000
|
||||||
|
#define CRTSCTS 020000000000
|
||||||
|
|
||||||
|
#define XCASE 0000004
|
||||||
|
#define ECHOCTL 0001000
|
||||||
|
#define ECHOPRT 0002000
|
||||||
|
#define ECHOKE 0004000
|
||||||
|
#define FLUSHO 0010000
|
||||||
|
#define PENDIN 0040000
|
||||||
|
#define EXTPROC 0200000
|
||||||
|
|
||||||
|
#define XTABS 0014000
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct termios {
|
||||||
|
tcflag_t c_iflag;
|
||||||
|
tcflag_t c_oflag;
|
||||||
|
tcflag_t c_cflag;
|
||||||
|
tcflag_t c_lflag;
|
||||||
|
cc_t c_line;
|
||||||
|
cc_t c_cc[NCCS];
|
||||||
|
speed_t ibaud;
|
||||||
|
speed_t obaud;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define NCC 8
|
||||||
|
struct termio {
|
||||||
|
unsigned short c_iflag;
|
||||||
|
unsigned short c_oflag;
|
||||||
|
unsigned short c_cflag;
|
||||||
|
unsigned short c_lflag;
|
||||||
|
unsigned char c_line;
|
||||||
|
unsigned char c_cc[NCC];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef _ABIBITS_TIME_H
|
||||||
|
#define _ABIBITS_TIME_H
|
||||||
|
|
||||||
|
#include <bits/posix/timeval.h>
|
||||||
|
|
||||||
|
struct itimerval {
|
||||||
|
struct timeval it_interval; /* Interval for periodic timer */
|
||||||
|
struct timeval it_value; /* Time until next expiration */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ITIMER_REAL 0
|
||||||
|
#define ITIMER_VIRTUAL 1
|
||||||
|
#define ITIMER_PROF 2
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_TIME_H */
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#ifndef _ABIBITS_UID_T_H
|
||||||
|
#define _ABIBITS_UID_T_H
|
||||||
|
|
||||||
|
typedef unsigned int uid_t;
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_UID_T_H */
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef _ABIBITS_UTMP_DEFINES_H
|
||||||
|
#define _ABIBITS_UTMP_DEFINES_H
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
|
||||||
|
#define EMPTY 0
|
||||||
|
#define RUN_LVL 1
|
||||||
|
#define BOOT_TIME 2
|
||||||
|
#define NEW_TIME 3
|
||||||
|
#define OLD_TIME 4
|
||||||
|
#define INIT_PROCESS 5
|
||||||
|
#define LOGIN_PROCESS 6
|
||||||
|
#define USER_PROCESS 7
|
||||||
|
#define DEAD_PROCESS 8
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
#define ACCOUNTING 9
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __MLIBC_LINUX_OPTION
|
||||||
|
#define UTMP_FILE "/var/run/utmp"
|
||||||
|
#define WTMP_FILE "/var/log/wtmp"
|
||||||
|
#endif /* __MLIBC_LINUX_OPTION */
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_UTMP_DEFINES_H */
|
||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef _ABIBITS_UTMPX_H
|
||||||
|
#define _ABIBITS_UTMPX_H
|
||||||
|
|
||||||
|
#include <abi-bits/pid_t.h>
|
||||||
|
#include <bits/posix/timeval.h>
|
||||||
|
|
||||||
|
#define __UT_HOSTSIZE 256
|
||||||
|
#define __UT_NAMESIZE 32
|
||||||
|
#define __UT_LINESIZE 32
|
||||||
|
|
||||||
|
/* Struct definition taken from musl */
|
||||||
|
struct utmpx {
|
||||||
|
short ut_type;
|
||||||
|
short __ut_pad1;
|
||||||
|
pid_t ut_pid;
|
||||||
|
char ut_line[__UT_LINESIZE];
|
||||||
|
char ut_id[4];
|
||||||
|
char ut_user[__UT_NAMESIZE];
|
||||||
|
char ut_host[__UT_HOSTSIZE];
|
||||||
|
struct {
|
||||||
|
short __e_termination;
|
||||||
|
short __e_exit;
|
||||||
|
} ut_exit;
|
||||||
|
int ut_session, __ut_pad2;
|
||||||
|
struct timeval ut_tv;
|
||||||
|
unsigned ut_addr_v6[4];
|
||||||
|
char __unused[20];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define e_exit __e_exit
|
||||||
|
#define e_termination __e_termination
|
||||||
|
|
||||||
|
#define UTMPX_FILE "/var/run/utmp"
|
||||||
|
#define WTMPX_FILE "/var/log/wtmp"
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_UTMPX_H */
|
||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef _ABIBITS_UTSNAME_T_H
|
||||||
|
#define _ABIBITS_UTSNAME_T_H
|
||||||
|
|
||||||
|
struct utsname {
|
||||||
|
char sysname[65];
|
||||||
|
char nodename[65];
|
||||||
|
char release[65];
|
||||||
|
char version[65];
|
||||||
|
char machine[65];
|
||||||
|
char domainname[65];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_UTSNAME_T_H */
|
||||||
Executable
+81
@@ -0,0 +1,81 @@
|
|||||||
|
#ifndef _ABIBITS_VM_FLAGS_H
|
||||||
|
#define _ABIBITS_VM_FLAGS_H
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
|
||||||
|
#define PROT_NONE 0x00
|
||||||
|
#define PROT_READ 0x01
|
||||||
|
#define PROT_WRITE 0x02
|
||||||
|
#define PROT_EXEC 0x04
|
||||||
|
|
||||||
|
#define MAP_FAILED ((void *)(-1))
|
||||||
|
#define MAP_FILE 0x00
|
||||||
|
#define MAP_SHARED 0x01
|
||||||
|
#define MAP_PRIVATE 0x02
|
||||||
|
#define MAP_FIXED 0x10
|
||||||
|
#define MAP_ANON 0x20
|
||||||
|
#define MAP_ANONYMOUS 0x20
|
||||||
|
|
||||||
|
#if __MLIBC_LINUX_OPTION
|
||||||
|
|
||||||
|
#define MAP_GROWSDOWN 0x100
|
||||||
|
#define MAP_DENYWRITE 0x800
|
||||||
|
#define MAP_EXECUTABLE 0x1000
|
||||||
|
#define MAP_LOCKED 0x2000
|
||||||
|
#define MAP_NORESERVE 0x4000
|
||||||
|
#define MAP_POPULATE 0x8000
|
||||||
|
#define MAP_NONBLOCK 0x10000
|
||||||
|
#define MAP_STACK 0x20000
|
||||||
|
#define MAP_HUGETLB 0x40000
|
||||||
|
#define MAP_SYNC 0x80000
|
||||||
|
#define MAP_FIXED_NOREPLACE 0x100000
|
||||||
|
|
||||||
|
#endif /* __MLIBC_LINUX_OPTION */
|
||||||
|
|
||||||
|
#define MS_ASYNC 0x01
|
||||||
|
#define MS_INVALIDATE 0x02
|
||||||
|
#define MS_SYNC 0x04
|
||||||
|
|
||||||
|
#define MCL_CURRENT 0x01
|
||||||
|
#define MCL_FUTURE 0x02
|
||||||
|
|
||||||
|
#define POSIX_MADV_NORMAL 0
|
||||||
|
#define POSIX_MADV_RANDOM 1
|
||||||
|
#define POSIX_MADV_SEQUENTIAL 2
|
||||||
|
#define POSIX_MADV_WILLNEED 3
|
||||||
|
#define POSIX_MADV_DONTNEED 4
|
||||||
|
|
||||||
|
#if __MLIBC_LINUX_OPTION
|
||||||
|
|
||||||
|
#define MADV_NORMAL 0
|
||||||
|
#define MADV_RANDOM 1
|
||||||
|
#define MADV_SEQUENTIAL 2
|
||||||
|
#define MADV_WILLNEED 3
|
||||||
|
#define MADV_DONTNEED 4
|
||||||
|
#define MADV_FREE 8
|
||||||
|
#define MADV_REMOVE 9
|
||||||
|
#define MADV_DONTFORK 10
|
||||||
|
#define MADV_DOFORK 11
|
||||||
|
#define MADV_MERGEABLE 12
|
||||||
|
#define MADV_UNMERGEABLE 13
|
||||||
|
#define MADV_HUGEPAGE 14
|
||||||
|
#define MADV_NOHUGEPAGE 15
|
||||||
|
#define MADV_DONTDUMP 16
|
||||||
|
#define MADV_DODUMP 17
|
||||||
|
#define MADV_WIPEONFORK 18
|
||||||
|
#define MADV_KEEPONFORK 19
|
||||||
|
#define MADV_COLD 20
|
||||||
|
#define MADV_PAGEOUT 21
|
||||||
|
#define MADV_HWPOISON 100
|
||||||
|
#define MADV_SOFT_OFFLINE 101
|
||||||
|
|
||||||
|
#define MREMAP_MAYMOVE 1
|
||||||
|
#define MREMAP_FIXED 2
|
||||||
|
|
||||||
|
#define MFD_CLOEXEC 1U
|
||||||
|
#define MFD_ALLOW_SEALING 2U
|
||||||
|
#define MFD_HUGETLB 4U
|
||||||
|
|
||||||
|
#endif /* __MLIBC_LINUX_OPTION */
|
||||||
|
|
||||||
|
#endif /* _ABIBITS_VM_FLAGS_H */
|
||||||
Executable
+34
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef _ABIBITS_WAIT_H
|
||||||
|
#define _ABIBITS_WAIT_H
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
|
||||||
|
#define WNOHANG 1
|
||||||
|
#define WUNTRACED 2
|
||||||
|
#define WSTOPPED 2
|
||||||
|
#define WEXITED 4
|
||||||
|
#define WCONTINUED 8
|
||||||
|
#define WNOWAIT 0x01000000
|
||||||
|
|
||||||
|
#if __MLIBC_LINUX_OPTION
|
||||||
|
|
||||||
|
#define __WALL 0x40000000
|
||||||
|
#define __WCLONE 0x80000000
|
||||||
|
|
||||||
|
#endif /* __MLIBC_LINUX_OPTION */
|
||||||
|
|
||||||
|
#define WCOREFLAG 0x80
|
||||||
|
|
||||||
|
#define WEXITSTATUS(x) (((x) & 0xff00) >> 8)
|
||||||
|
#define WTERMSIG(x) ((x) & 0x7f)
|
||||||
|
#define WSTOPSIG(x) WEXITSTATUS(x)
|
||||||
|
#define WIFEXITED(x) (WTERMSIG(x) == 0)
|
||||||
|
#define WIFSIGNALED(x) (((signed char) (((x) & 0x7f) + 1) >> 1) > 0)
|
||||||
|
#define WIFSTOPPED(x) (((x) & 0xff) == 0x7f)
|
||||||
|
#define WIFCONTINUED(x) ((x) == 0xffff)
|
||||||
|
#define WCOREDUMP(x) ((x) & WCOREFLAG)
|
||||||
|
|
||||||
|
/* glibc extension, but also useful for kernels */
|
||||||
|
#define W_EXITCODE(ret, sig) (((ret) << 8) | (sig))
|
||||||
|
|
||||||
|
#endif /*_ABIBITS_WAIT_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
#ifndef _ALLOCA_H
|
||||||
|
#define _ALLOCA_H
|
||||||
|
|
||||||
|
#define alloca __builtin_alloca
|
||||||
|
|
||||||
|
#endif /* _ALLOCA_H */
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
#ifndef _AR_H
|
||||||
|
#define _AR_H
|
||||||
|
|
||||||
|
#define ARMAG "!<arch>\n"
|
||||||
|
#define SARMAG 8
|
||||||
|
#define ARFMAG "`\n"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct ar_hdr {
|
||||||
|
char ar_name[16];
|
||||||
|
char ar_date[12];
|
||||||
|
char ar_uid[6];
|
||||||
|
char ar_gid[6];
|
||||||
|
char ar_mode[8];
|
||||||
|
char ar_size[10];
|
||||||
|
char ar_fmag[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#ifndef _ARPA_INET_H
|
||||||
|
#define _ARPA_INET_H
|
||||||
|
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
uint32_t htonl(uint32_t __x);
|
||||||
|
uint16_t htons(uint16_t __x);
|
||||||
|
uint32_t ntohl(uint32_t __x);
|
||||||
|
uint16_t ntohs(uint16_t __x);
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
/* IPv4 address manipulation. */
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
in_addr_t inet_addr(const char *__cp);
|
||||||
|
in_addr_t inet_network(const char *__cp);
|
||||||
|
char *inet_ntoa(struct in_addr __in);
|
||||||
|
|
||||||
|
/* GLIBC replacement for inet_addr(). */
|
||||||
|
int inet_aton(const char *__cp, struct in_addr *__dest);
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
/* Generic IP address manipulation. */
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
const char *inet_ntop(int __af, const void *__restrict __src, char *__restrict __dst,
|
||||||
|
socklen_t __size) __attribute__((__nonnull__(3)));
|
||||||
|
int inet_pton(int __af, const char *__restrict __src, void *__restrict __dst);
|
||||||
|
|
||||||
|
struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host);
|
||||||
|
in_addr_t inet_netof(struct in_addr __in);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ARPA_INET_H */
|
||||||
|
|
||||||
@@ -0,0 +1,266 @@
|
|||||||
|
#ifndef _ARPA_NAMESER_H
|
||||||
|
#define _ARPA_NAMESER_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NS_PACKETSZ 512
|
||||||
|
#define NS_MAXDNAME 1025
|
||||||
|
#define NS_MAXLABEL 63
|
||||||
|
|
||||||
|
typedef enum __ns_rcode {
|
||||||
|
ns_r_noerror = 0,
|
||||||
|
ns_r_formerr = 1,
|
||||||
|
ns_r_servfail = 2,
|
||||||
|
ns_r_nxdomain = 3,
|
||||||
|
ns_r_notimpl = 4,
|
||||||
|
ns_r_refused = 5,
|
||||||
|
ns_r_yxdomain = 6,
|
||||||
|
ns_r_yxrrset = 7,
|
||||||
|
ns_r_nxrrset = 8,
|
||||||
|
ns_r_notauth = 9,
|
||||||
|
ns_r_notzone = 10,
|
||||||
|
ns_r_max = 11,
|
||||||
|
ns_r_badvers = 16,
|
||||||
|
ns_r_badsig = 16,
|
||||||
|
ns_r_badkey = 17,
|
||||||
|
ns_r_badtime = 18
|
||||||
|
} ns_rcode;
|
||||||
|
|
||||||
|
typedef enum __ns_type {
|
||||||
|
ns_t_invalid = 0,
|
||||||
|
ns_t_a = 1,
|
||||||
|
ns_t_ns = 2,
|
||||||
|
ns_t_md = 3,
|
||||||
|
ns_t_mf = 4,
|
||||||
|
ns_t_cname = 5,
|
||||||
|
ns_t_soa = 6,
|
||||||
|
ns_t_mb = 7,
|
||||||
|
ns_t_mg = 8,
|
||||||
|
ns_t_mr = 9,
|
||||||
|
ns_t_null = 10,
|
||||||
|
ns_t_wks = 11,
|
||||||
|
ns_t_ptr = 12,
|
||||||
|
ns_t_hinfo = 13,
|
||||||
|
ns_t_minfo = 14,
|
||||||
|
ns_t_mx = 15,
|
||||||
|
ns_t_txt = 16,
|
||||||
|
ns_t_rp = 17,
|
||||||
|
ns_t_afsdb = 18,
|
||||||
|
ns_t_x25 = 19,
|
||||||
|
ns_t_isdn = 20,
|
||||||
|
ns_t_rt = 21,
|
||||||
|
ns_t_nsap = 22,
|
||||||
|
ns_t_nsap_ptr = 23,
|
||||||
|
ns_t_sig = 24,
|
||||||
|
ns_t_key = 25,
|
||||||
|
ns_t_px = 26,
|
||||||
|
ns_t_gpos = 27,
|
||||||
|
ns_t_aaaa = 28,
|
||||||
|
ns_t_loc = 29,
|
||||||
|
ns_t_nxt = 30,
|
||||||
|
ns_t_eid = 31,
|
||||||
|
ns_t_nimloc = 32,
|
||||||
|
ns_t_srv = 33,
|
||||||
|
ns_t_atma = 34,
|
||||||
|
ns_t_naptr = 35,
|
||||||
|
ns_t_kx = 36,
|
||||||
|
ns_t_cert = 37,
|
||||||
|
ns_t_a6 = 38,
|
||||||
|
ns_t_dname = 39,
|
||||||
|
ns_t_sink = 40,
|
||||||
|
ns_t_opt = 41,
|
||||||
|
ns_t_apl = 42,
|
||||||
|
ns_t_tkey = 249,
|
||||||
|
ns_t_tsig = 250,
|
||||||
|
ns_t_ixfr = 251,
|
||||||
|
ns_t_axfr = 252,
|
||||||
|
ns_t_mailb = 253,
|
||||||
|
ns_t_maila = 254,
|
||||||
|
ns_t_any = 255,
|
||||||
|
ns_t_zxfr = 256,
|
||||||
|
ns_t_max = 65536
|
||||||
|
} ns_type;
|
||||||
|
|
||||||
|
typedef enum __ns_class {
|
||||||
|
ns_c_invalid = 0,
|
||||||
|
ns_c_in = 1,
|
||||||
|
ns_c_2 = 2,
|
||||||
|
ns_c_chaos = 3,
|
||||||
|
ns_c_hs = 4,
|
||||||
|
ns_c_none = 254,
|
||||||
|
ns_c_any = 255,
|
||||||
|
ns_c_max = 65536
|
||||||
|
} ns_class;
|
||||||
|
|
||||||
|
typedef enum __ns_sect {
|
||||||
|
ns_s_qd = 0,
|
||||||
|
ns_s_zn = 0,
|
||||||
|
ns_s_an = 1,
|
||||||
|
ns_s_pr = 1,
|
||||||
|
ns_s_ns = 2,
|
||||||
|
ns_s_ud = 2,
|
||||||
|
ns_s_ar = 3,
|
||||||
|
ns_s_max = 4
|
||||||
|
} ns_sect;
|
||||||
|
|
||||||
|
typedef struct __ns_msg {
|
||||||
|
const unsigned char *_msg, *_eom;
|
||||||
|
uint16_t _id, _flags, _counts[ns_s_max];
|
||||||
|
const unsigned char *_sections[ns_s_max];
|
||||||
|
ns_sect _sect;
|
||||||
|
int _rrnum;
|
||||||
|
const unsigned char *_msg_ptr;
|
||||||
|
} ns_msg;
|
||||||
|
|
||||||
|
#define ns_msg_id(handle) ((handle)._id + 0)
|
||||||
|
#define ns_msg_base(handle) ((handle)._msg + 0)
|
||||||
|
#define ns_msg_end(handle) ((handle)._eom + 0)
|
||||||
|
#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
|
||||||
|
#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
|
||||||
|
|
||||||
|
typedef struct __ns_rr {
|
||||||
|
char name[NS_MAXDNAME];
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t rr_class;
|
||||||
|
uint32_t ttl;
|
||||||
|
uint16_t rdlength;
|
||||||
|
const unsigned char *rdata;
|
||||||
|
} ns_rr;
|
||||||
|
|
||||||
|
#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
|
||||||
|
#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
|
||||||
|
#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
|
||||||
|
#define ns_rr_ttl(rr) ((rr).ttl + 0)
|
||||||
|
#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
|
||||||
|
#define ns_rr_rdata(rr) ((rr).rdata + 0)
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
#define NS_GET16(s, cp) (void)((s) = ns_get16(((cp) += 2) - 2))
|
||||||
|
#define NS_GET32(l, cp) (void)((l) = ns_get32(((cp) += 4) - 4))
|
||||||
|
#define NS_PUT16(s, cp) ns_put16((s), ((cp) += 2) - 2)
|
||||||
|
#define NS_PUT32(l, cp) ns_put32((l), ((cp) += 4) - 4)
|
||||||
|
|
||||||
|
unsigned ns_get16(const unsigned char *__src);
|
||||||
|
unsigned long ns_get32(const unsigned char *__src);
|
||||||
|
void ns_put16(unsigned int __value, unsigned char *__src);
|
||||||
|
void ns_put32(unsigned long __value, unsigned char *__src);
|
||||||
|
|
||||||
|
int ns_initparse(const unsigned char *__msg, int __msglen, ns_msg *__handle);
|
||||||
|
int ns_parserr(ns_msg *__msg, ns_sect __section, int __rrnum, ns_rr *__rr);
|
||||||
|
int ns_name_uncompress(const unsigned char *__msg, const unsigned char *__eom,
|
||||||
|
const unsigned char *__src, char *__dst, size_t __dstsize);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned id :16;
|
||||||
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
unsigned qr: 1;
|
||||||
|
unsigned opcode: 4;
|
||||||
|
unsigned aa: 1;
|
||||||
|
unsigned tc: 1;
|
||||||
|
unsigned rd: 1;
|
||||||
|
unsigned ra: 1;
|
||||||
|
unsigned unused :1;
|
||||||
|
unsigned ad: 1;
|
||||||
|
unsigned cd: 1;
|
||||||
|
unsigned rcode :4;
|
||||||
|
#else
|
||||||
|
unsigned rd :1;
|
||||||
|
unsigned tc :1;
|
||||||
|
unsigned aa :1;
|
||||||
|
unsigned opcode :4;
|
||||||
|
unsigned qr :1;
|
||||||
|
unsigned rcode :4;
|
||||||
|
unsigned cd: 1;
|
||||||
|
unsigned ad: 1;
|
||||||
|
unsigned unused :1;
|
||||||
|
unsigned ra :1;
|
||||||
|
#endif
|
||||||
|
unsigned qdcount :16;
|
||||||
|
unsigned ancount :16;
|
||||||
|
unsigned nscount :16;
|
||||||
|
unsigned arcount :16;
|
||||||
|
} HEADER;
|
||||||
|
|
||||||
|
#define PACKETSZ NS_PACKETSZ
|
||||||
|
#define MAXDNAME NS_MAXDNAME
|
||||||
|
|
||||||
|
#define NOERROR ns_r_noerror
|
||||||
|
#define FORMERR ns_r_formerr
|
||||||
|
#define SERVFAIL ns_r_servfail
|
||||||
|
#define NXDOMAIN ns_r_nxdomain
|
||||||
|
#define NOTIMP ns_r_notimpl
|
||||||
|
#define REFUSED ns_r_refused
|
||||||
|
#define YXDOMAIN ns_r_yxdomain
|
||||||
|
#define YXRRSET ns_r_yxrrset
|
||||||
|
#define NXRRSET ns_r_nxrrset
|
||||||
|
#define NOTAUTH ns_r_notauth
|
||||||
|
#define NOTZONE ns_r_notzone
|
||||||
|
|
||||||
|
#define T_A ns_t_a
|
||||||
|
#define T_NS ns_t_ns
|
||||||
|
#define T_MD ns_t_md
|
||||||
|
#define T_MF ns_t_mf
|
||||||
|
#define T_CNAME ns_t_cname
|
||||||
|
#define T_SOA ns_t_soa
|
||||||
|
#define T_MB ns_t_mb
|
||||||
|
#define T_MG ns_t_mg
|
||||||
|
#define T_MR ns_t_mr
|
||||||
|
#define T_NULL ns_t_null
|
||||||
|
#define T_WKS ns_t_wks
|
||||||
|
#define T_PTR ns_t_ptr
|
||||||
|
#define T_HINFO ns_t_hinfo
|
||||||
|
#define T_MINFO ns_t_minfo
|
||||||
|
#define T_MX ns_t_mx
|
||||||
|
#define T_TXT ns_t_txt
|
||||||
|
#define T_RP ns_t_rp
|
||||||
|
#define T_AFSDB ns_t_afsdb
|
||||||
|
#define T_X25 ns_t_x25
|
||||||
|
#define T_ISDN ns_t_isdn
|
||||||
|
#define T_RT ns_t_rt
|
||||||
|
#define T_NSAP ns_t_nsap
|
||||||
|
#define T_NSAP_PTR ns_t_nsap_ptr
|
||||||
|
#define T_SIG ns_t_sig
|
||||||
|
#define T_KEY ns_t_key
|
||||||
|
#define T_PX ns_t_px
|
||||||
|
#define T_GPOS ns_t_gpos
|
||||||
|
#define T_AAAA ns_t_aaaa
|
||||||
|
#define T_LOC ns_t_loc
|
||||||
|
#define T_NXT ns_t_nxt
|
||||||
|
#define T_EID ns_t_eid
|
||||||
|
#define T_NIMLOC ns_t_nimloc
|
||||||
|
#define T_SRV ns_t_srv
|
||||||
|
#define T_ATMA ns_t_atma
|
||||||
|
#define T_NAPTR ns_t_naptr
|
||||||
|
#define T_A6 ns_t_a6
|
||||||
|
#define T_DNAME ns_t_dname
|
||||||
|
#define T_TSIG ns_t_tsig
|
||||||
|
#define T_IXFR ns_t_ixfr
|
||||||
|
#define T_AXFR ns_t_axfr
|
||||||
|
#define T_MAILB ns_t_mailb
|
||||||
|
#define T_MAILA ns_t_maila
|
||||||
|
#define T_ANY ns_t_any
|
||||||
|
|
||||||
|
#define C_IN ns_c_in
|
||||||
|
#define C_CHAOS ns_c_chaos
|
||||||
|
#define C_HS ns_c_hs
|
||||||
|
#define C_NONE ns_c_none
|
||||||
|
#define C_ANY ns_c_any
|
||||||
|
|
||||||
|
#define GETSHORT NS_GET16
|
||||||
|
#define GETLONG NS_GET32
|
||||||
|
#define PUTSHORT NS_PUT16
|
||||||
|
#define PUTLONG NS_PUT32
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ARPA_NAMESER_H */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include <arpa/nameser.h>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
#ifndef _ASSERT_H
|
||||||
|
#define _ASSERT_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
/* NOTE: This is not ISO C. Declared in LSB */
|
||||||
|
__attribute__ ((__noreturn__)) void __assert_fail(const char *assertion, const char *file, unsigned int line,
|
||||||
|
const char *function);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ASSERT_H */
|
||||||
|
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
|
||||||
|
#if __MLIBC_GLIBC_OPTION
|
||||||
|
# include <bits/glibc/glibc_assert.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* NOTE: [7.2] requires this be outside the include guard */
|
||||||
|
#ifdef NDEBUG
|
||||||
|
|
||||||
|
#undef assert
|
||||||
|
#define assert(ignore) ((void)0)
|
||||||
|
|
||||||
|
#else /* NDEBUG */
|
||||||
|
|
||||||
|
#undef assert
|
||||||
|
#define assert(assertion) ((void)((assertion) \
|
||||||
|
|| (__assert_fail(#assertion, __FILE__, __LINE__, __func__), 0)))
|
||||||
|
|
||||||
|
#endif /* NDEBUG */
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
|
#undef static_assert
|
||||||
|
#define static_assert _Static_assert
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
#ifndef MLIBC_FENV_H
|
||||||
|
#define MLIBC_FENV_H
|
||||||
|
|
||||||
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
|
|
||||||
|
#define FE_DENORMAL 2
|
||||||
|
#define FE_DIVBYZERO 4
|
||||||
|
#define FE_INEXACT 32
|
||||||
|
#define FE_INVALID 1
|
||||||
|
#define FE_OVERFLOW 8
|
||||||
|
#define FE_UNDERFLOW 16
|
||||||
|
|
||||||
|
#define FE_ALL_EXCEPT (FE_DENORMAL | FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
|
||||||
|
|
||||||
|
#define FE_TONEAREST 0
|
||||||
|
#define FE_DOWNWARD 0x400
|
||||||
|
#define FE_UPWARD 0x800
|
||||||
|
#define FE_TOWARDZERO 0xC00
|
||||||
|
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
|
||||||
|
#define FE_INVALID 1
|
||||||
|
#define FE_DIVBYZERO 2
|
||||||
|
#define FE_OVERFLOW 4
|
||||||
|
#define FE_UNDERFLOW 8
|
||||||
|
#define FE_INEXACT 16
|
||||||
|
|
||||||
|
#define FE_ALL_EXCEPT 31
|
||||||
|
|
||||||
|
#define FE_TONEAREST 0
|
||||||
|
#define FE_UPWARD 0x400000
|
||||||
|
#define FE_DOWNWARD 0x800000
|
||||||
|
#define FE_TOWARDZERO 0xC00000
|
||||||
|
|
||||||
|
#elif defined(__riscv) && __riscv_xlen == 64
|
||||||
|
|
||||||
|
#define FE_INEXACT 1
|
||||||
|
#define FE_UNDERFLOW 2
|
||||||
|
#define FE_OVERFLOW 4
|
||||||
|
#define FE_DIVBYZERO 8
|
||||||
|
#define FE_INVALID 16
|
||||||
|
|
||||||
|
#define FE_ALL_EXCEPT 31
|
||||||
|
|
||||||
|
#define FE_TONEAREST 0
|
||||||
|
#define FE_TOWARDZERO 1
|
||||||
|
#define FE_DOWNWARD 2
|
||||||
|
#define FE_UPWARD 3
|
||||||
|
|
||||||
|
#elif defined (__m68k__)
|
||||||
|
|
||||||
|
#if __HAVE_68881__ || __mcffpu__ || __HAVE_FPU_
|
||||||
|
|
||||||
|
#define FE_INEXACT 8
|
||||||
|
#define FE_DIVBYZERO 16
|
||||||
|
#define FE_UNDERFLOW 32
|
||||||
|
#define FE_OVERFLOW 64
|
||||||
|
#define FE_INVALID 128
|
||||||
|
|
||||||
|
#define FE_ALL_EXCEPT 0xf8
|
||||||
|
|
||||||
|
#define FE_TONEAREST 0
|
||||||
|
#define FE_TOWARDZERO 16
|
||||||
|
#define FE_DOWNWARD 32
|
||||||
|
#define FE_UPWARD 48
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define FE_ALL_EXCEPT 0
|
||||||
|
#define FE_TONEAREST 0
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined(__loongarch64)
|
||||||
|
|
||||||
|
#define FE_INEXACT 0x010000
|
||||||
|
#define FE_UNDERFLOW 0x020000
|
||||||
|
#define FE_OVERFLOW 0x040000
|
||||||
|
#define FE_DIVBYZERO 0x080000
|
||||||
|
#define FE_INVALID 0x100000
|
||||||
|
|
||||||
|
#define FE_ALL_EXCEPT (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
|
||||||
|
|
||||||
|
#define FE_TONEAREST 0x000
|
||||||
|
#define FE_TOWARDZERO 0x100
|
||||||
|
#define FE_UPWARD 0x200
|
||||||
|
#define FE_DOWNWARD 0x300
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error Unknown architecture
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_FENV_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_TIME_T
|
||||||
|
#define MLIBC_TIME_T
|
||||||
|
|
||||||
|
typedef long time_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_TIMESPEC_H
|
||||||
|
#define MLIBC_TIMESPEC_H
|
||||||
|
|
||||||
|
#include <bits/ansi/time_t.h>
|
||||||
|
|
||||||
|
struct timespec {
|
||||||
|
time_t tv_sec;
|
||||||
|
long tv_nsec;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* MLIBC_TIMESPEC_H */
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_BSD_STDLIB_H
|
||||||
|
#define MLIBC_BSD_STDLIB_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int getloadavg(double *__loadavg, int __count);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_BSD_STDLIB_H */
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef _BSD_UNISTD_H
|
||||||
|
#define _BSD_UNISTD_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
void *sbrk(intptr_t __increment);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _BSD_UNISTD_H */
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef _MLIBC_INTERNAL_CPU_SET_H
|
||||||
|
#define _MLIBC_INTERNAL_CPU_SET_H
|
||||||
|
|
||||||
|
typedef unsigned long __cpu_mask;
|
||||||
|
|
||||||
|
#define CPU_SETSIZE 1024
|
||||||
|
#define __NCPUBITS (8 * sizeof(__cpu_mask))
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
__cpu_mask __bits[CPU_SETSIZE / __NCPUBITS];
|
||||||
|
} cpu_set_t;
|
||||||
|
|
||||||
|
#endif /* _MLIBC_INTERNAL_CPU_SET_H */
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_ENSURE_H
|
||||||
|
#define MLIBC_ENSURE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
void __ensure_fail(const char *assertion, const char *file, unsigned int line,
|
||||||
|
const char *function);
|
||||||
|
|
||||||
|
void __ensure_warn(const char *assertion, const char *file, unsigned int line,
|
||||||
|
const char *function);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#define __ensure(assertion) do { if(!(assertion)) \
|
||||||
|
__ensure_fail(#assertion, __FILE__, __LINE__, __func__); } while(0)
|
||||||
|
|
||||||
|
#define MLIBC_UNIMPLEMENTED() __ensure_fail("Functionality is not implemented", \
|
||||||
|
__FILE__, __LINE__, __func__)
|
||||||
|
|
||||||
|
#define MLIBC_MISSING_SYSDEP() __ensure_warn("Library function fails due to missing sysdep", \
|
||||||
|
__FILE__, __LINE__, __func__)
|
||||||
|
|
||||||
|
#define MLIBC_CHECK_OR_ENOSYS(sysdep, ret) ({ \
|
||||||
|
if (!(sysdep)) { \
|
||||||
|
__ensure_warn("Library function fails due to missing sysdep", \
|
||||||
|
__FILE__, __LINE__, __func__); \
|
||||||
|
errno = ENOSYS; \
|
||||||
|
return (ret); \
|
||||||
|
} \
|
||||||
|
sysdep; \
|
||||||
|
})
|
||||||
|
|
||||||
|
#define MLIBC_STUB_BODY ({ MLIBC_UNIMPLEMENTED(); __builtin_unreachable(); })
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_ENSURE_H */
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef MLIBC_ETHER_ADDR_H
|
||||||
|
#define MLIBC_ETHER_ADDR_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
struct ether_addr {
|
||||||
|
uint8_t ether_addr_octet[6];
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
|
#endif /* MLIBC_ETHER_ADDR_H */
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef MLIBC_FILE_T_H
|
||||||
|
#define MLIBC_FILE_T_H
|
||||||
|
|
||||||
|
typedef struct __mlibc_file_base FILE;
|
||||||
|
|
||||||
|
#endif /* MLIBC_FILE_T_H */
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef MLIBC_BITS_GETOPT
|
||||||
|
#define MLIBC_BITS_GETOPT
|
||||||
|
|
||||||
|
struct option {
|
||||||
|
const char *name;
|
||||||
|
int has_arg;
|
||||||
|
int *flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define no_argument 0
|
||||||
|
#define required_argument 1
|
||||||
|
#define optional_argument 2
|
||||||
|
|
||||||
|
#endif /* MLIBC_BITS_GETOPT */
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#ifndef MLIBC_GLIBC_ASSERT_H
|
||||||
|
#define MLIBC_GLIBC_ASSERT_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
__attribute__ ((__noreturn__)) void __assert_fail_perror(int __errno, const char *__file, unsigned int __line,
|
||||||
|
const char *__function);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_GLIBC_ASSERT_H */
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
|
||||||
|
#undef assert_perror
|
||||||
|
#define assert_perror(ignore) ((void)0)
|
||||||
|
|
||||||
|
#else /* NDEBUG */
|
||||||
|
|
||||||
|
#undef assert_perror
|
||||||
|
#define assert_perror(errno) (!(errno) \
|
||||||
|
|| (__assert_fail_perror((errno), __FILE__, __LINE__, __func__), 0))
|
||||||
|
|
||||||
|
#endif /* NDEBUG */
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef _GLIBC_NETINET_ICMP6_H
|
||||||
|
#define _GLIBC_NETINET_ICMP6_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ND_OPT_SOURCE_LINKADDR 1
|
||||||
|
#define ND_OPT_TARGET_LINKADDR 2
|
||||||
|
#define ND_OPT_PREFIX_INFORMATION 3
|
||||||
|
#define ND_OPT_REDIRECTED_HEADER 4
|
||||||
|
#define ND_OPT_MTU 5
|
||||||
|
#define ND_OPT_RTR_ADV_INTERVAL 7
|
||||||
|
#define ND_OPT_HOME_AGENT_INFO 8
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _GLIBC_NETINET_ICMP6_H */
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef _GLIBC_MALLOC_H
|
||||||
|
#define _GLIBC_MALLOC_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
|
||||||
|
size_t malloc_usable_size(void *__ptr);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _GLIBC_MALLOC_H */
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef _GLIBC_SEARCH_H
|
||||||
|
#define _GLIBC_SEARCH_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/search.h>
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int hcreate_r(size_t __num_entries, struct hsearch_data *__htab);
|
||||||
|
void hdestroy_r(struct hsearch_data *__htab);
|
||||||
|
int hsearch_r(ENTRY __item, ACTION __action, ENTRY **__ret, struct hsearch_data *__htab);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _GLIBC_SEARCH_H */
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef MLIBC_GLIBC_SIGNAL_H
|
||||||
|
#define MLIBC_GLIBC_SIGNAL_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int tgkill(int __tgid, int __tid, int __sig);
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE)
|
||||||
|
|
||||||
|
typedef void (*sighandler_t)(int __signo);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_GLIBC_SIGNAL_H */
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef MLIBC_GLIBC_STDLIB_H
|
||||||
|
#define MLIBC_GLIBC_STDLIB_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int (*comparison_fn_t) (const void *__a, const void *__b);
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int rpmatch(const char *__resp);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_GLIBC_STDLIB_H */
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef MLIBC_INLINE_DEFINITION_H
|
||||||
|
#define MLIBC_INLINE_DEFINITION_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MLIBC_EMIT_INLINE_DEFINITIONS
|
||||||
|
#define __MLIBC_INLINE_DEFINITION
|
||||||
|
#else
|
||||||
|
#define __MLIBC_INLINE_DEFINITION __attribute__((__gnu_inline__)) extern __inline__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_INLINE_DEFINITION_H */
|
||||||
|
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_MACHINE_H
|
||||||
|
#define MLIBC_MACHINE_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#if defined (__i386__)
|
||||||
|
struct __mlibc_jmpbuf_register_state {
|
||||||
|
uint32_t ebx;
|
||||||
|
uint32_t ebp;
|
||||||
|
uint32_t esi;
|
||||||
|
uint32_t edi;
|
||||||
|
uint32_t esp;
|
||||||
|
uint32_t eip;
|
||||||
|
};
|
||||||
|
#elif defined (__x86_64__)
|
||||||
|
struct __mlibc_jmpbuf_register_state {
|
||||||
|
uint64_t rbx;
|
||||||
|
uint64_t rbp;
|
||||||
|
uint64_t r12;
|
||||||
|
uint64_t r13;
|
||||||
|
uint64_t r14;
|
||||||
|
uint64_t r15;
|
||||||
|
uint64_t rsp;
|
||||||
|
uint64_t rip;
|
||||||
|
};
|
||||||
|
#elif defined (__aarch64__)
|
||||||
|
struct __mlibc_jmpbuf_register_state {
|
||||||
|
uint64_t x19;
|
||||||
|
uint64_t x20;
|
||||||
|
uint64_t x21;
|
||||||
|
uint64_t x22;
|
||||||
|
uint64_t x23;
|
||||||
|
uint64_t x24;
|
||||||
|
uint64_t x25;
|
||||||
|
uint64_t x26;
|
||||||
|
uint64_t x27;
|
||||||
|
uint64_t x28;
|
||||||
|
uint64_t x29;
|
||||||
|
uint64_t x30;
|
||||||
|
uint64_t sp;
|
||||||
|
uint64_t pad;
|
||||||
|
uint64_t d8;
|
||||||
|
uint64_t d9;
|
||||||
|
uint64_t d10;
|
||||||
|
uint64_t d11;
|
||||||
|
uint64_t d12;
|
||||||
|
uint64_t d13;
|
||||||
|
uint64_t d14;
|
||||||
|
uint64_t d15;
|
||||||
|
};
|
||||||
|
#elif defined (__riscv) && __riscv_xlen == 64
|
||||||
|
struct __mlibc_jmpbuf_register_state {
|
||||||
|
uint64_t ra;
|
||||||
|
uint64_t s0;
|
||||||
|
uint64_t s1;
|
||||||
|
uint64_t s2;
|
||||||
|
uint64_t s3;
|
||||||
|
uint64_t s4;
|
||||||
|
uint64_t s5;
|
||||||
|
uint64_t s6;
|
||||||
|
uint64_t s7;
|
||||||
|
uint64_t s8;
|
||||||
|
uint64_t s9;
|
||||||
|
uint64_t s10;
|
||||||
|
uint64_t s11;
|
||||||
|
uint64_t sp;
|
||||||
|
double fs0;
|
||||||
|
double fs1;
|
||||||
|
double fs2;
|
||||||
|
double fs3;
|
||||||
|
double fs4;
|
||||||
|
double fs5;
|
||||||
|
double fs6;
|
||||||
|
double fs7;
|
||||||
|
double fs8;
|
||||||
|
double fs9;
|
||||||
|
double fs10;
|
||||||
|
double fs11;
|
||||||
|
};
|
||||||
|
#elif defined (__m68k__)
|
||||||
|
struct __mlibc_jmpbuf_register_state {
|
||||||
|
uint32_t d2;
|
||||||
|
uint32_t d3;
|
||||||
|
uint32_t d4;
|
||||||
|
uint32_t d5;
|
||||||
|
uint32_t d6;
|
||||||
|
uint32_t d7;
|
||||||
|
uint32_t a2;
|
||||||
|
uint32_t a3;
|
||||||
|
uint32_t a4;
|
||||||
|
uint32_t a5;
|
||||||
|
uint32_t a6;
|
||||||
|
uint32_t a7;
|
||||||
|
uint32_t sp;
|
||||||
|
uint32_t pc;
|
||||||
|
};
|
||||||
|
#elif defined (__loongarch64)
|
||||||
|
struct __mlibc_jmpbuf_register_state {
|
||||||
|
uint64_t ra;
|
||||||
|
uint64_t sp;
|
||||||
|
uint64_t u0;
|
||||||
|
uint64_t s0;
|
||||||
|
uint64_t s1;
|
||||||
|
uint64_t s2;
|
||||||
|
uint64_t s3;
|
||||||
|
uint64_t s4;
|
||||||
|
uint64_t s5;
|
||||||
|
uint64_t s6;
|
||||||
|
uint64_t s7;
|
||||||
|
uint64_t s8;
|
||||||
|
double fs0;
|
||||||
|
double fs1;
|
||||||
|
double fs2;
|
||||||
|
double fs3;
|
||||||
|
double fs4;
|
||||||
|
double fs5;
|
||||||
|
double fs6;
|
||||||
|
double fs7;
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
# error "Missing architecture specific code"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_MACHINE_H */
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef MLIBC_MBSTATE_H
|
||||||
|
#define MLIBC_MBSTATE_H
|
||||||
|
|
||||||
|
typedef struct __mlibc_mbstate {
|
||||||
|
short __progress;
|
||||||
|
short __shift;
|
||||||
|
unsigned int __cpoint;
|
||||||
|
} mbstate_t;
|
||||||
|
|
||||||
|
#define __MLIBC_MBSTATE_INITIALIZER {0, 0, 0}
|
||||||
|
|
||||||
|
#endif /* MLIBC_MBSTATE_H */
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
|
||||||
|
#ifndef _NL_ITEM_H
|
||||||
|
#define _NL_ITEM_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int nl_item;
|
||||||
|
|
||||||
|
#define ABDAY_1 0x60000
|
||||||
|
#define ABDAY_2 0x60001
|
||||||
|
#define ABDAY_3 0x60002
|
||||||
|
#define ABDAY_4 0x60003
|
||||||
|
#define ABDAY_5 0x60004
|
||||||
|
#define ABDAY_6 0x60005
|
||||||
|
#define ABDAY_7 0x60006
|
||||||
|
|
||||||
|
#define DAY_1 0x60007
|
||||||
|
#define DAY_2 0x60008
|
||||||
|
#define DAY_3 0x60009
|
||||||
|
#define DAY_4 0x6000A
|
||||||
|
#define DAY_5 0x6000B
|
||||||
|
#define DAY_6 0x6000C
|
||||||
|
#define DAY_7 0x6000D
|
||||||
|
|
||||||
|
#define ABMON_1 0x6000E
|
||||||
|
#define ABMON_2 0x6000F
|
||||||
|
#define ABMON_3 0x60010
|
||||||
|
#define ABMON_4 0x60011
|
||||||
|
#define ABMON_5 0x60012
|
||||||
|
#define ABMON_6 0x60013
|
||||||
|
#define ABMON_7 0x60014
|
||||||
|
#define ABMON_8 0x60015
|
||||||
|
#define ABMON_9 0x60016
|
||||||
|
#define ABMON_10 0x60017
|
||||||
|
#define ABMON_11 0x60018
|
||||||
|
#define ABMON_12 0x60019
|
||||||
|
|
||||||
|
#define MON_1 0x6001A
|
||||||
|
#define MON_2 0x6001B
|
||||||
|
#define MON_3 0x6001C
|
||||||
|
#define MON_4 0x6001D
|
||||||
|
#define MON_5 0x6001E
|
||||||
|
#define MON_6 0x6001F
|
||||||
|
#define MON_7 0x60020
|
||||||
|
#define MON_8 0x60021
|
||||||
|
#define MON_9 0x60022
|
||||||
|
#define MON_10 0x60023
|
||||||
|
#define MON_11 0x60024
|
||||||
|
#define MON_12 0x60025
|
||||||
|
|
||||||
|
#define AM_STR 0x60026
|
||||||
|
#define PM_STR 0x60027
|
||||||
|
|
||||||
|
#define D_T_FMT 0x60028
|
||||||
|
#define D_FMT 0x60029
|
||||||
|
#define T_FMT 0x6002A
|
||||||
|
#define T_FMT_AMPM 0x6002B
|
||||||
|
|
||||||
|
#define ERA 0x6002C
|
||||||
|
#define ERA_D_FMT 0x6002D
|
||||||
|
#define ALT_DIGITS 0x6002E
|
||||||
|
#define ERA_D_T_FMT 0x6002F
|
||||||
|
#define ERA_T_FMT 0x60030
|
||||||
|
|
||||||
|
#define CODESET 0x30000
|
||||||
|
|
||||||
|
#define CRNCYSTR 0x40000
|
||||||
|
|
||||||
|
#define RADIXCHAR 0x50000
|
||||||
|
#define DECIMAL_POINT RADIXCHAR
|
||||||
|
#define THOUSEP 0x50001
|
||||||
|
#define THOUSANDS_SEP THOUSEP
|
||||||
|
|
||||||
|
#define YESEXPR 0x70000
|
||||||
|
#define NOEXPR 0x70001
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _NL_ITEM_H */
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_NULL_H
|
||||||
|
#define MLIBC_NULL_H
|
||||||
|
|
||||||
|
#ifdef NULL
|
||||||
|
#undef NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
|
# define NULL ((void *)0)
|
||||||
|
#else
|
||||||
|
# define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_NULL_H */
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef MLIBC_OFF_T_H
|
||||||
|
#define MLIBC_OFF_T_H
|
||||||
|
|
||||||
|
/* TODO: use something like int64_t instead? */
|
||||||
|
typedef long off_t;
|
||||||
|
typedef long off64_t;
|
||||||
|
|
||||||
|
#endif /* MLIBC_OFF_T_H */
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef MLIBC_FD_SET_H
|
||||||
|
#define MLIBC_FD_SET_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
__mlibc_uint8 fds_bits[128];
|
||||||
|
} fd_set;
|
||||||
|
|
||||||
|
#endif /* MLIBC_FD_SET_H */
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef _MLIBC_ID_T_H
|
||||||
|
#define _MLIBC_ID_T_H
|
||||||
|
|
||||||
|
typedef unsigned int id_t;
|
||||||
|
|
||||||
|
#endif /* _MLIBC_ID_T_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef MLIBC_IN_ADDR_H
|
||||||
|
#define MLIBC_IN_ADDR_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
typedef uint32_t in_addr_t;
|
||||||
|
|
||||||
|
#endif /* MLIBC_IN_ADDR_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef MLIBC_IN_PORT_H
|
||||||
|
#define MLIBC_IN_PORT_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
typedef uint16_t in_port_t;
|
||||||
|
|
||||||
|
#endif /* MLIBC_IN_PORT_H */
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef MLIBC_IOVEC_H
|
||||||
|
#define MLIBC_IOVEC_H
|
||||||
|
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
struct iovec {
|
||||||
|
void *iov_base;
|
||||||
|
__mlibc_size iov_len;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* MLIBC_IOVEC_H */
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef _LOCALE_T_H
|
||||||
|
#define _LOCALE_T_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef void *locale_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _LOCALE_T_H */
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef _POSIX_CTYPE_H
|
||||||
|
#define _POSIX_CTYPE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/posix/locale_t.h>
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int isalnum_l(int __c, locale_t __loc);
|
||||||
|
int isalpha_l(int __c, locale_t __loc);
|
||||||
|
int isblank_l(int __c, locale_t __loc);
|
||||||
|
int iscntrl_l(int __c, locale_t __loc);
|
||||||
|
int isdigit_l(int __c, locale_t __loc);
|
||||||
|
int isgraph_l(int __c, locale_t __loc);
|
||||||
|
int islower_l(int __c, locale_t __loc);
|
||||||
|
int isprint_l(int __c, locale_t __loc);
|
||||||
|
int ispunct_l(int __c, locale_t __loc);
|
||||||
|
int isspace_l(int __c, locale_t __loc);
|
||||||
|
int isupper_l(int __c, locale_t __loc);
|
||||||
|
int isxdigit_l(int __c, locale_t __loc);
|
||||||
|
|
||||||
|
int isascii_l(int __c, locale_t __loc);
|
||||||
|
|
||||||
|
int tolower_l(int __c, locale_t __loc);
|
||||||
|
int toupper_l(int __c, locale_t __loc);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _POSIX_CTYPE_H */
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef MLIBC_POSIX_LOCALE_H
|
||||||
|
#define MLIBC_POSIX_LOCALE_H
|
||||||
|
|
||||||
|
#include <bits/posix/locale_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
locale_t newlocale(int __category_mask, const char *__locale, locale_t __base);
|
||||||
|
void freelocale(locale_t __locobj);
|
||||||
|
locale_t uselocale(locale_t __locobj);
|
||||||
|
locale_t duplocale(locale_t __locobj);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_POSIX_LOCALE_H */
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_POSIX_SIGNAL_H
|
||||||
|
#define MLIBC_POSIX_SIGNAL_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <bits/ansi/time_t.h>
|
||||||
|
#include <bits/ansi/timespec.h>
|
||||||
|
#include <bits/posix/pthread_t.h>
|
||||||
|
#include <bits/sigset_t.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <mlibc-config.h>
|
||||||
|
|
||||||
|
#define FPE_INTDIV 1 /* integer divide by zero */
|
||||||
|
#define FPE_INTOVF 2 /* integer overflow */
|
||||||
|
#define FPE_FLTDIV 3 /* floating point divide by zero */
|
||||||
|
#define FPE_FLTOVF 4 /* floating point overflow */
|
||||||
|
#define FPE_FLTUND 5 /* floating point underflow */
|
||||||
|
#define FPE_FLTRES 6 /* floating point inexact result */
|
||||||
|
#define FPE_FLTINV 7 /* floating point invalid operation */
|
||||||
|
#define FPE_FLTSUB 8 /* subscript out of range */
|
||||||
|
|
||||||
|
#define TRAP_BRKPT 1 /* process breakpoint */
|
||||||
|
#define TRAP_TRACE 2 /* process trace trap */
|
||||||
|
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
/* Start Glibc stuff */
|
||||||
|
|
||||||
|
struct _libc_fpxreg {
|
||||||
|
unsigned short int significand[4];
|
||||||
|
unsigned short int exponent;
|
||||||
|
unsigned short int __glibc_reserved1[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _libc_xmmreg {
|
||||||
|
uint32_t element[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _libc_fpstate {
|
||||||
|
uint16_t cwd;
|
||||||
|
int16_t swd;
|
||||||
|
uint16_t ftw;
|
||||||
|
uint16_t fop;
|
||||||
|
uint64_t rip;
|
||||||
|
uint64_t dp;
|
||||||
|
uint32_t mxcsr;
|
||||||
|
uint32_t mxcr_mask;
|
||||||
|
struct _libc_fpxreg _st[8];
|
||||||
|
struct _libc_xmmreg _xmm[16];
|
||||||
|
uint32_t __glibc_reserved1[24];
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _libc_fpstate *fpregset_t;
|
||||||
|
/* End Glibc stuff */
|
||||||
|
|
||||||
|
typedef unsigned long int greg_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define FPE_INTDIV 1 /* integer divide by zero */
|
||||||
|
#define FPE_INTOVF 2 /* integer overflow */
|
||||||
|
#define FPE_FLTDIV 3 /* floating point divide by zero */
|
||||||
|
#define FPE_FLTOVF 4 /* floating point overflow */
|
||||||
|
#define FPE_FLTUND 5 /* floating point underflow */
|
||||||
|
#define FPE_FLTRES 6 /* floating point inexact result */
|
||||||
|
#define FPE_FLTINV 7 /* floating point invalid operation */
|
||||||
|
#define FPE_FLTSUB 8 /* subscript out of range */
|
||||||
|
|
||||||
|
#define TRAP_BRKPT 1 /* process breakpoint */
|
||||||
|
#define TRAP_TRACE 2 /* process trace trap */
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
/* functions to block / wait for signals */
|
||||||
|
int sigsuspend(const sigset_t *__sigmask);
|
||||||
|
int sigprocmask(int __how, const sigset_t *__restrict __sigmask, sigset_t *__restrict __oldmask);
|
||||||
|
|
||||||
|
int pthread_sigmask(int __how, const sigset_t *__restrict __sigmask, sigset_t *__restrict __oldmask);
|
||||||
|
int pthread_kill(pthread_t __thrd, int __sig);
|
||||||
|
|
||||||
|
/* functions to handle signals */
|
||||||
|
int sigaction(int __signum, const struct sigaction *__restrict __act, struct sigaction *__restrict __oldact);
|
||||||
|
int sigpending(sigset_t *__set);
|
||||||
|
|
||||||
|
int siginterrupt(int __sig, int __flag);
|
||||||
|
|
||||||
|
int sigaltstack(const stack_t *__restrict __ss, stack_t *__restrict __oss);
|
||||||
|
|
||||||
|
/* functions to raise signals */
|
||||||
|
int kill(pid_t __pid, int __number);
|
||||||
|
int killpg(int __pgrp, int __sig);
|
||||||
|
|
||||||
|
int sigtimedwait(const sigset_t *__restrict __set, siginfo_t *__restrict __info, const struct timespec *__restrict __timeout);
|
||||||
|
int sigwait(const sigset_t *__restrict __set, int *__restrict __sig);
|
||||||
|
int sigwaitinfo(const sigset_t *__restrict __set, siginfo_t *__restrict __info);
|
||||||
|
|
||||||
|
/* Glibc extension */
|
||||||
|
#if __MLIBC_GLIBC_OPTION
|
||||||
|
int sigisemptyset(const sigset_t *__set);
|
||||||
|
#endif /* __MLIBC_GLIBC_OPTION */
|
||||||
|
|
||||||
|
int sigqueue(pid_t __pid, int __sig, const union sigval __value);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_POSIX_SIGNAL_H */
|
||||||
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_POSIX_STDIO_H
|
||||||
|
#define MLIBC_POSIX_STDIO_H
|
||||||
|
|
||||||
|
#include <bits/off_t.h>
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
#include <bits/ssize_t.h>
|
||||||
|
#include <bits/file.h>
|
||||||
|
|
||||||
|
/* MISSING: var_list */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define P_tmpdir "/tmp"
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int fileno(FILE *__file);
|
||||||
|
FILE *fdopen(int __fd, const char *__mode);
|
||||||
|
|
||||||
|
FILE *fmemopen(void *__restrict __buf, size_t __size, const char *__restrict __mode);
|
||||||
|
int pclose(FILE *__file);
|
||||||
|
FILE *popen(const char *__command, const char *__type);
|
||||||
|
FILE *open_memstream(char **__buf, size_t *__sizeloc);
|
||||||
|
|
||||||
|
int fseeko(FILE *__stream, off_t __offset, int __whence);
|
||||||
|
int fseeko64(FILE *__stream, off64_t __offset, int __whence);
|
||||||
|
off_t ftello(FILE *__stream);
|
||||||
|
off64_t ftello64(FILE *__stream);
|
||||||
|
|
||||||
|
__attribute__((format(__printf__, 2, 3))) int dprintf(int __fd, const char *__format, ...);
|
||||||
|
__attribute__((format(__printf__, 2, 0)))
|
||||||
|
int vdprintf(int __fd, const char *__format, __builtin_va_list __args);
|
||||||
|
|
||||||
|
char *fgetln(FILE *__stream, size_t *__size);
|
||||||
|
|
||||||
|
char *tempnam(const char *__dir, const char *__pfx);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#define RENAME_EXCHANGE (1 << 1)
|
||||||
|
|
||||||
|
/* GNU extensions */
|
||||||
|
typedef ssize_t (cookie_read_function_t)(void *__cookie, char *__buffer, size_t __size);
|
||||||
|
typedef ssize_t (cookie_write_function_t)(void *__cookie, const char *__buffer, size_t __size);
|
||||||
|
typedef int (cookie_seek_function_t)(void *__cookie, off_t *, int);
|
||||||
|
typedef int (cookie_close_function_t)(void *__cookie);
|
||||||
|
|
||||||
|
typedef struct _IO_cookie_io_functions_t {
|
||||||
|
cookie_read_function_t *read;
|
||||||
|
cookie_write_function_t *write;
|
||||||
|
cookie_seek_function_t *seek;
|
||||||
|
cookie_close_function_t *close;
|
||||||
|
} cookie_io_functions_t;
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
#if defined(_GNU_SOURCE)
|
||||||
|
|
||||||
|
FILE *fopencookie(void *__restrict __cookie, const char *__restrict __mode, cookie_io_functions_t __io_funcs);
|
||||||
|
|
||||||
|
#endif /* defined(_GNU_SOURCE) */
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* MISSING: various functions and macros */
|
||||||
|
|
||||||
|
#endif /* MLIBC_POSIX_STDIO_H */
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_POSIX_STDLIB_H
|
||||||
|
#define MLIBC_POSIX_STDLIB_H
|
||||||
|
|
||||||
|
#include <bits/posix/locale_t.h>
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
long random(void);
|
||||||
|
double drand48(void);
|
||||||
|
double erand48(unsigned short __s[3]);
|
||||||
|
unsigned short *seed48(unsigned short __s[3]);
|
||||||
|
void srand48(long int __seed);
|
||||||
|
long int mrand48(void);
|
||||||
|
long jrand48(unsigned short __s[3]);
|
||||||
|
char *initstate(unsigned int __seed, char *__state, size_t __size);
|
||||||
|
char *setstate(char *__state);
|
||||||
|
void srandom(unsigned int __seed);
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
/* Environment. */
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int putenv(char *__string);
|
||||||
|
int setenv(const char *__name, const char *__value, int __overwrite);
|
||||||
|
int unsetenv(const char *__name);
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
/* Path handling. */
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int mkstemp(char *__pattern);
|
||||||
|
int mkstemps(char *__pattern, int __suffixlen);
|
||||||
|
int mkostemp(char *__pattern, int __flags);
|
||||||
|
int mkostemps(char *__pattern, int __suffixlen, int __flags);
|
||||||
|
char *mkdtemp(char *__path);
|
||||||
|
|
||||||
|
char *realpath(const char *__restrict __path, char *__restrict __out);
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
/* Pseudoterminals */
|
||||||
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int posix_openpt(int __flags);
|
||||||
|
int grantpt(int __fd);
|
||||||
|
int unlockpt(int __fd);
|
||||||
|
char *ptsname(int __fd);
|
||||||
|
int ptsname_r(int __fd, char *__buf, size_t __len);
|
||||||
|
|
||||||
|
double strtod_l(const char *__restrict__ __nptr, char ** __restrict__ __endptr, locale_t __loc);
|
||||||
|
long double strtold_l(const char *__restrict__ __nptr, char ** __restrict__ __endptr, locale_t __loc);
|
||||||
|
float strtof_l(const char *__restrict __string, char **__restrict __end, locale_t __loc);
|
||||||
|
|
||||||
|
int getsubopt(char **__restrict__ __optionp, char *const *__restrict__ __tokens, char **__restrict__ __valuep);
|
||||||
|
|
||||||
|
/* GNU extension */
|
||||||
|
char *secure_getenv(const char *__name);
|
||||||
|
char *canonicalize_file_name(const char *__name);
|
||||||
|
|
||||||
|
/* BSD extension */
|
||||||
|
void *reallocarray(void *__ptr, size_t __count, size_t __size);
|
||||||
|
|
||||||
|
int clearenv(void);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_POSIX_STDLIB_H */
|
||||||
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
|
||||||
|
#ifndef MLIBC_POSIX_STRING_H
|
||||||
|
#define MLIBC_POSIX_STRING_H
|
||||||
|
|
||||||
|
#include <alloca.h>
|
||||||
|
#include <bits/posix/locale_t.h>
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
char *strdup(const char *__string);
|
||||||
|
char *strndup(const char *__string, size_t __max_size);
|
||||||
|
size_t strnlen(const char *__s, size_t __max_size);
|
||||||
|
char *strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __ptr);
|
||||||
|
char *strsep(char **__stringp, const char *__delim);
|
||||||
|
char *strsignal(int __sig);
|
||||||
|
char *stpcpy(char *__restrict __dest, const char *__restrict __src);
|
||||||
|
char *stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n);
|
||||||
|
void *memccpy(void *__restrict __dest, const void *__restrict __src, int __c, size_t __n);
|
||||||
|
|
||||||
|
int strcoll_l(const char *__s1, const char *__s2, locale_t __locale);
|
||||||
|
|
||||||
|
char *strerror_l(int __errnum, locale_t __locale);
|
||||||
|
|
||||||
|
/* GNU extensions. */
|
||||||
|
#if defined(_GNU_SOURCE)
|
||||||
|
char *strcasestr(const char *__s1, const char *__s2);
|
||||||
|
#define strdupa(x) ({ \
|
||||||
|
const char *__str = (x); \
|
||||||
|
size_t __len = strlen(__str) + 1; \
|
||||||
|
char *__buf = alloca(__len); \
|
||||||
|
(char *) memcpy(__buf, __str, __len); \
|
||||||
|
})
|
||||||
|
#define strndupa(x, y) ({ \
|
||||||
|
const char *__str = (x); \
|
||||||
|
size_t __len = strnlen(__str, (y)) + 1; \
|
||||||
|
char *__buf = alloca(__len); \
|
||||||
|
__buf[__len - 1] = '\0'; \
|
||||||
|
(char *) memcpy(__buf, __str, __len - 1); \
|
||||||
|
})
|
||||||
|
void *memrchr(const void *__m, int __c, size_t __n);
|
||||||
|
#endif /* defined(_GNU_SOURCE) */
|
||||||
|
|
||||||
|
/* BSD extensions */
|
||||||
|
size_t strlcpy(char *__d, const char *__s, size_t __n);
|
||||||
|
size_t strlcat(char *__d, const char *__s, size_t __n);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_POSIX_STRING_H */
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef MLIBC_POSIX_TIME_H
|
||||||
|
#define MLIBC_POSIX_TIME_H
|
||||||
|
|
||||||
|
#include <abi-bits/clockid_t.h>
|
||||||
|
#include <abi-bits/sigevent.h>
|
||||||
|
#include <bits/ansi/timespec.h>
|
||||||
|
#include <bits/posix/timer_t.h>
|
||||||
|
#include <bits/posix/timeval.h>
|
||||||
|
|
||||||
|
#define TIMER_ABSTIME 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct itimerspec {
|
||||||
|
struct timespec it_interval;
|
||||||
|
struct timespec it_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int timer_getoverrun(timer_t __timerid);
|
||||||
|
|
||||||
|
int utimes(const char *__filename, const struct timeval __tv[2]);
|
||||||
|
|
||||||
|
/* Not standardized, Linux and BSDs have it */
|
||||||
|
int futimes(int __fd, const struct timeval __tv[2]);
|
||||||
|
int lutimes(const char *__filename, const struct timeval __tv[2]);
|
||||||
|
|
||||||
|
int timer_create(clockid_t __clockid, struct sigevent *__restrict __sevp, timer_t *__restrict __timerid);
|
||||||
|
int timer_settime(timer_t __timerid, int __flags, const struct itimerspec *__restrict __new_value,
|
||||||
|
struct itimerspec *__restrict __old_value);
|
||||||
|
int timer_gettime(timer_t __timerid, struct itimerspec *__curr_value);
|
||||||
|
int timer_delete(timer_t __timerid);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* MLIBC_POSIX_TIME_H */
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef _POSIX_WCTYPE_H
|
||||||
|
#define _POSIX_WCTYPE_H
|
||||||
|
|
||||||
|
#include <bits/posix/locale_t.h>
|
||||||
|
#include <bits/wint_t.h>
|
||||||
|
#include <bits/wctype_t.h>
|
||||||
|
#include <bits/wctrans_t.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
int iswalnum_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswblank_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswcntrl_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswdigit_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswgraph_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswlower_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswprint_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswpunct_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswspace_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswupper_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswxdigit_l(wint_t __wc, locale_t __loc);
|
||||||
|
int iswalpha_l(wint_t __wc, locale_t __loc);
|
||||||
|
|
||||||
|
wctype_t wctype_l(const char *__string, locale_t __loc);
|
||||||
|
int iswctype_l(wint_t __wc, wctype_t __type, locale_t __loc);
|
||||||
|
|
||||||
|
wint_t towlower_l(wint_t __wc, locale_t __loc);
|
||||||
|
wint_t towupper_l(wint_t __wc, locale_t __loc);
|
||||||
|
|
||||||
|
wctrans_t wctrans_l(const char *__string, locale_t __loc);
|
||||||
|
wint_t towctrans_l(wint_t __wc, wctrans_t __trans, locale_t __loc);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _POSIX_WCTYPE_H */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _MLIBC_BITS_PTHREAD_T_HPP
|
||||||
|
#define _MLIBC_BITS_PTHREAD_T_HPP
|
||||||
|
|
||||||
|
#include <bits/threads.h>
|
||||||
|
|
||||||
|
typedef struct __mlibc_thread_data *pthread_t;
|
||||||
|
|
||||||
|
#endif /* _MLIBC_BITS_PTHREAD_T_HPP */
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef MLIBC_STAT_H
|
||||||
|
#define MLIBC_STAT_H
|
||||||
|
|
||||||
|
#include <abi-bits/stat.h>
|
||||||
|
|
||||||
|
/* Used by utimensat and friends */
|
||||||
|
#define UTIME_NOW ((1l << 30) - 1l)
|
||||||
|
#define UTIME_OMIT ((1l << 30) - 2l)
|
||||||
|
|
||||||
|
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||||
|
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||||
|
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||||
|
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||||
|
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||||
|
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||||
|
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||||
|
|
||||||
|
/* POSIX compatibility macros */
|
||||||
|
#define st_atime st_atim.tv_sec
|
||||||
|
#define st_mtime st_mtim.tv_sec
|
||||||
|
#define st_ctime st_ctim.tv_sec
|
||||||
|
|
||||||
|
#endif /* MLIBC_STAT_H */
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef _MLIBC_TIMER_T_H
|
||||||
|
#define _MLIBC_TIMER_T_H
|
||||||
|
|
||||||
|
typedef void * timer_t;
|
||||||
|
|
||||||
|
#endif /* _MLIBC_TIMER_T_H */
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef MLIBC_TIMEVAL_H
|
||||||
|
#define MLIBC_TIMEVAL_H
|
||||||
|
|
||||||
|
#include <bits/ansi/time_t.h>
|
||||||
|
#include <abi-bits/suseconds_t.h>
|
||||||
|
|
||||||
|
struct timeval {
|
||||||
|
time_t tv_sec;
|
||||||
|
suseconds_t tv_usec;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* MLIBC_TIMEVAL_H */
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef _MLIBC_INTERNAL_SEARCH_H
|
||||||
|
#define _MLIBC_INTERNAL_SEARCH_H
|
||||||
|
|
||||||
|
#include <bits/size_t.h>
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FIND,
|
||||||
|
ENTER
|
||||||
|
} ACTION;
|
||||||
|
|
||||||
|
typedef struct entry {
|
||||||
|
char *key;
|
||||||
|
void *data;
|
||||||
|
} ENTRY;
|
||||||
|
|
||||||
|
struct _ENTRY;
|
||||||
|
|
||||||
|
struct hsearch_data {
|
||||||
|
struct _ENTRY *table;
|
||||||
|
unsigned int size;
|
||||||
|
unsigned int filled;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _MLIBC_INTERNAL_SEARCH_H */
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef MLIBC_BITS_SIGSET_T_H
|
||||||
|
#define MLIBC_BITS_SIGSET_T_H
|
||||||
|
|
||||||
|
#include <abi-bits/signal.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MLIBC_ABI_ONLY
|
||||||
|
|
||||||
|
/* functions to manage sigset_t */
|
||||||
|
int sigemptyset(sigset_t *__sigset);
|
||||||
|
int sigfillset(sigset_t *__sigset);
|
||||||
|
int sigaddset(sigset_t *__sigset, int __sig);
|
||||||
|
int sigdelset(sigset_t *__sigset, int __sig);
|
||||||
|
int sigismember(const sigset_t *__sigset, int __sig);
|
||||||
|
|
||||||
|
#endif /* !__MLIBC_ABI_ONLY */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*MLIBC_BITS_SIGSET_T_H */
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user