Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
redbean requirements for serenityos kernel
/*
redbean: kernel requirements
x86-64 linux system five abi
rax name rdi rsi rdx r10 r8 r9
----- -------------- ------------------------ --------------------------- ------------------------------ -------------------------- ------------------------ ---------------
0x000 read unsigned int fd char *buf size_t count - - -
0x003 close unsigned int fd - - - - -
0x005 fstat unsigned int fd struct stat - - - -
0x007 poll struct pollfd *ufds unsigned int nfds int timeout - - -
0x008 lseek unsigned int fd off_t offset unsigned int whence - - -
0x009 mmap void *addr size_t size int protect int flags int fd int64_t off
0x00b munmap unsigned long addr size_t len - - - -
0x00d rt_sigaction int const struct sigaction * struct sigaction * size_t - -
0x00e rt_sigprocmask int how sigset_t *set sigset_t *oset size_t sigsetsize - -
0x010 ioctl unsigned int fd unsigned int cmd unsigned long arg - - -
0x011 pread64 unsigned int fd char *buf size_t count loff_t pos - -
0x013 readv unsigned long fd const struct iovec *vec unsigned long vlen - - -
0x014 writev unsigned long fd const struct iovec *vec unsigned long vlen - - -
0x016 pipe int *fildes - - - - -
0x018 sched_yield - - - - - -
0x020 dup unsigned int fildes - - - - -
0x023 nanosleep struct timespec struct timespec - - - -
0x027 getpid - - - - - -
0x029 socket int int int - - -
0x02c sendto int void * size_t unsigned struct sockaddr * int
0x031 bind int struct sockaddr * int - - -
0x032 listen int int - - - -
0x033 getsockname int struct sockaddr * int * - - -
0x036 setsockopt int fd int level int optname char *optval int optlen -
0x039 fork - - - - - -
0x03b execve const char *filename const char *const *argv const char *const *envp - - -
0x03d wait4 pid_t pid int *stat_addr int options struct rusage *ru - -
0x03e kill pid_t pid int sig - - - -
0x03f uname struct old_utsname * - - - - -
0x048 fcntl unsigned int fd unsigned int cmd unsigned long arg - - -
0x04b fdatasync unsigned int fd - - - - -
0x04d ftruncate unsigned int fd unsigned long length - - - -
0x04f getcwd char *buf unsigned long size - - - -
0x059 readlink const char *path char *buf int bufsiz - - -
0x05b fchmod unsigned int fd umode_t mode - - - -
0x05d fchown unsigned int fd uid_t user gid_t group - - -
0x05f umask int mask - - - - -
0x060 gettimeofday struct timeval *tv struct timezone *tz - - - -
0x062 getrusage int who struct rusage *ru - - - -
0x069 setuid uid_t uid - - - - -
0x06a setgid gid_t gid - - - - -
0x06b geteuid - - - - - -
0x06d setpgid pid_t pid pid_t pgid - - - -
0x06e getppid - - - - - -
0x070 setsid - - - - - -
0x0d9 getdents64 unsigned int fd struct linux_dirent64 unsigned int count - - -
0x0dd fadvise int fd loff_t offset size_t len int advice - -
0x0e4 clock_gettime clockid_t which_clock struct timespec - - - -
0x0e7 exit_group int error_code - - - - -
0x0eb utimes char *filename struct timeval *utimes - - - -
0x101 openat int dfd const char *filename int flags umode_t mode - -
0x102 mkdirat int dfd const char * pathname umode_t mode - - -
0x106 fstatat int dfd const char *filename struct stat *statbuf int flag - -
0x107 unlinkat int dfd const char * pathname int flag - - -
0x108 renameat int olddfd const char * oldname int newdfd const char * newname - -
0x10d faccessat int dfd const char *filename int mode - - -
0x120 accept4 int struct sockaddr * int * int - -
0x124 dup3 unsigned int oldfd unsigned int newfd int flags - - -
0x13e getrandom char *buf size_t count unsigned int flags - - -
*/
struct iovec {
uint8_t iov_base[8];
uint8_t iov_len[8];
};
struct pollfd {
uint8_t fd[4];
uint8_t events[2];
uint8_t revents[2];
};
struct timeval {
uint8_t tv_sec[8];
uint8_t tv_usec[8];
};
struct timespec {
uint8_t tv_sec[8];
uint8_t tv_nsec[8];
};
struct timezone {
uint8_t tz_minuteswest[4];
uint8_t tz_dsttime[4];
};
struct sigaction {
uint8_t handler[8];
uint8_t flags[8];
uint8_t restorer[8];
uint8_t mask[8];
};
struct winsize {
uint8_t ws_row[2];
uint8_t ws_col[2];
uint8_t ws_xpixel[2];
uint8_t ws_ypixel[2];
};
struct termios {
uint8_t c_iflag[4];
uint8_t c_oflag[4];
uint8_t c_cflag[4];
uint8_t c_lflag[4];
uint8_t c_cc[32];
uint8_t c_ispeed[4];
uint8_t c_ospeed[4];
};
struct sockaddr_in {
uint8_t sin_family[2];
uint16_t sin_port;
uint32_t sin_addr;
uint8_t sin_zero[8];
};
struct stat {
uint8_t st_dev[8];
uint8_t st_ino[8];
uint8_t st_nlink[8];
uint8_t st_mode[4];
uint8_t st_uid[4];
uint8_t st_gid[4];
uint8_t __pad[4];
uint8_t st_rdev[8];
uint8_t st_size[8];
uint8_t st_blksize[8];
uint8_t st_blocks[8];
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
};
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
uint8_t ru_maxrss[8];
uint8_t ru_ixrss[8];
uint8_t ru_idrss[8];
uint8_t ru_isrss[8];
uint8_t ru_minflt[8];
uint8_t ru_majflt[8];
uint8_t ru_nswap[8];
uint8_t ru_inblock[8];
uint8_t ru_oublock[8];
uint8_t ru_msgsnd[8];
uint8_t ru_msgrcv[8];
uint8_t ru_nsignals[8];
uint8_t ru_nvcsw[8];
uint8_t ru_nivcsw[8];
};
struct siginfo {
uint8_t si_signo[4];
uint8_t si_errno[4];
uint8_t si_code[4];
uint8_t __pad[4];
uint8_t payload[112];
};
struct fpstate {
uint8_t cwd[2];
uint8_t swd[2];
uint8_t ftw[2];
uint8_t fop[2];
uint8_t rip[8];
uint8_t rdp[8];
uint8_t mxcsr[4];
uint8_t mxcr_mask[4];
uint8_t st[8][16];
uint8_t xmm[16][16];
uint8_t __padding[96];
};
struct ucontext {
uint8_t uc_flags[8];
uint8_t uc_link[8];
uint8_t ss_sp[8];
uint8_t ss_flags[4];
uint8_t __pad0[4];
uint8_t ss_size[8];
uint8_t r8[8];
uint8_t r9[8];
uint8_t r10[8];
uint8_t r11[8];
uint8_t r12[8];
uint8_t r13[8];
uint8_t r14[8];
uint8_t r15[8];
uint8_t rdi[8];
uint8_t rsi[8];
uint8_t rbp[8];
uint8_t rbx[8];
uint8_t rdx[8];
uint8_t rax[8];
uint8_t rcx[8];
uint8_t rsp[8];
uint8_t rip[8];
uint8_t eflags[8];
uint8_t cs[2];
uint8_t gs[2];
uint8_t fs[2];
uint8_t ss[2];
uint8_t err[8];
uint8_t trapno[8];
uint8_t oldmask[8];
uint8_t cr2[8];
uint8_t fpstate[8];
uint8_t __pad1[64];
uint8_t uc_sigmask[8];
};
/* errnos */
#define ENOSYS 38
#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 EDQUOT 122
#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 ENOTEMPTY 39
#define ELOOP 40
#define ENOMSG 42
#define EIDRM 43
#define ETIME 62
#define EPROTO 71
#define EOVERFLOW 75
#define EILSEQ 84
#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 ENOTSUP 95
#define EOPNOTSUPP 95
#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 EREMOTE 66
#define EBADMSG 74
#define ECANCELED 125
#define EOWNERDEAD 130
#define ENOTRECOVERABLE 131
#define ENONET 64
#define ERESTART 85
#define ENOSR 63
#define ENOSTR 60
#define ENODATA 61
#define EMULTIHOP 72
#define ENOLINK 67
#define ENOMEDIUM 123
#define EMEDIUMTYPE 124
#define EWOULDBLOCK 11
/* signals */
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGBUS 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGUSR1 10
#define SIGSEGV 11
#define SIGUSR2 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#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 SIGPROF 27
#define SIGWINCH 28
#define SIGIO 29
#define SIGSYS 31
#define SIGRTMAX 0
#define SIGRTMIN 0
#define SIGEMT 0
#define SIGPOLL 29
#define SIGIOT 6
#define SIGPWR 30
/* open() flags */
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_ACCMODE 3
#define O_APPEND 0x00000400
#define O_CREAT 0x00000040
#define O_EXCL 0x00000080
#define O_TRUNC 0x00000200
#define O_DIRECTORY 0x00010000
#define O_CLOEXEC 0x00080000
/* #define O_DIRECT 0x00004000 */
/* #define O_TMPFILE 0x00410000 */
/* #define O_SPARSE 0 */
/* #define O_NDELAY 0x00000800 */
/* #define O_NONBLOCK 0x00000800 */
/* #define O_ASYNC 0x00002000 */
/* #define O_NOFOLLOW 0x00020000 */
/* #define O_SYNC 0x00101000 */
/* #define O_NOCTTY 0x00000100 */
/* #define O_NOATIME 0x00040000 */
/* #define O_EXEC 0 */
/* #define O_DSYNC 0x00001000 */
/* #define O_RSYNC 0x00101000 */
/* #define O_PATH 0x00200000 */
/* #define O_TTY_INIT 0 */
/* mmap() flags */
#define MAP_FILE 0
#define MAP_SHARED 1
#define MAP_PRIVATE 2
#define MAP_TYPE 15
#define MAP_FIXED 0x10
#define MAP_ANONYMOUS 0x20
/* #define MAP_GROWSDOWN 0x0100 */
/* #define MAP_NORESERVE 0x4000 */
/* #define MAP_HUGETLB 0x040000 */
/* #define MAP_HUGE_MASK 63 */
/* #define MAP_HUGE_SHIFT 26 */
/* #define MAP_LOCKED 0x2000 */
/* #define MAP_NONBLOCK 0x10000 */
/* #define MAP_POPULATE 0x8000 */
/* mmap(), mprotect(), etc. */
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
#define PROT_EXEC 4
/* #define PROT_GROWSDOWN 0x01000000 */
/* #define PROT_GROWSUP 0x02000000 */
/* sigprocmask() flags */
#define SIG_BLOCK 0
#define SIG_UNBLOCK 1
#define SIG_SETMASK 2
/* faccessat() */
#define F_OK 0
#define X_OK 1
#define W_OK 2
#define R_OK 4
/* wait4() flags */
#define WNOHANG 1
/* #define WUNTRACED 2 */
/* #define WCONTINUED 8 */
/* stat::st_mode constants */
#define S_IFREG 0100000
#define S_IFBLK 0060000
#define S_IFCHR 0020000
#define S_IFDIR 0040000
#define S_IFIFO 0010000
#define S_IFLNK 0120000
#define S_IFSOCK 0140000
#define S_IFMT 0170000
#define S_ISVTX 0001000
#define S_ISGID 0002000
#define S_ISUID 0004000
#define S_IEXEC 0000100
#define S_IWRITE 0000200
#define S_IREAD 0000400
#define S_IXUSR 0000100
#define S_IWUSR 0000200
#define S_IRUSR 0000400
#define S_IRWXU 0000700
#define S_IXGRP 0000010
#define S_IWGRP 0000020
#define S_IRGRP 0000040
#define S_IRWXG 0000070
#define S_IXOTH 0000001
#define S_IWOTH 0000002
#define S_IROTH 0000004
#define S_IRWXO 0000007
/* fcntl() POSIX Advisory Locks */
#define F_SETLK 6
#define F_SETLKW 7
#define F_GETLK 5
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
/* openat(), fstatat(), linkat(), etc. magnums */
#define AT_FDCWD -100
/* #define AT_SYMLINK_FOLLOW 0x0400 */
/* #define AT_SYMLINK_NOFOLLOW 0x0100 */
/* #define AT_REMOVEDIR 0x0200 */
/* #define AT_EACCESS 0x0200 */
/* #define AT_SYMLINK_FOLLOW 0x0400 */
/* #define AT_EMPTY_PATH 0x1000 */
/* getauxval() keys */
#define AT_EXECFN 31
#define AT_RANDOM 25
/* #define AT_EXECFD 2 */
/* #define AT_PHDR 3 */
/* #define AT_PHENT 4 */
/* #define AT_PHNUM 5 */
/* #define AT_PAGESZ 6 */
/* #define AT_BASE 7 */
/* #define AT_FLAGS 8 */
/* #define AT_ENTRY 9 */
/* #define AT_NOTELF 10 */
/* #define AT_OSRELDATE 0 */
/* #define AT_UID 11 */
/* #define AT_EUID 12 */
/* #define AT_GID 13 */
/* #define AT_EGID 14 */
/* #define AT_PLATFORM 15 */
/* #define AT_HWCAP 16 */
/* #define AT_CLKTCK 17 */
/* #define AT_DCACHEBSIZE 19 */
/* #define AT_ICACHEBSIZE 20 */
/* #define AT_UCACHEBSIZE 21 */
/* #define AT_SECURE 23 */
/* #define AT_BASE_PLATFORM 24 */
/* #define AT_HWCAP2 26 */
/* #define AT_SYSINFO_EHDR 33 */
/* #define AT_NO_AUTOMOUNT 0x0800 */
/* sigaction() codes */
#define SA_SIGINFO 4
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
/* #define SA_NOCLDSTOP 1 */
/* #define SA_NOCLDWAIT 2 */
/* #define SA_ONSTACK 0x08000000 */
/* #define SA_RESTART 0x10000000 */
/* #define SA_NOMASK 0x40000000 */
/* #define SA_ONESHOT 0x80000000 */
/* clock_{gettime,settime} timers */
#define CLOCK_MONOTONIC 1
/* #define CLOCK_REALTIME 0 */
/* #define CLOCK_PROCESS_CPUTIME_ID 2 */
/* #define CLOCK_THREAD_CPUTIME_ID 3 */
/* #define CLOCK_MONOTONIC_RAW 4 */
/* #define CLOCK_REALTIME_COARSE 5 */
/* #define CLOCK_MONOTONIC_COARSE 6 */
/* #define CLOCK_BOOTTIME 7 */
/* #define CLOCK_REALTIME_ALARM 8 */
/* #define CLOCK_BOOTTIME_ALARM 9 */
/* #define CLOCK_TAI 11 */
/* poll() */
#define POLLIN 1
#define POLLPRI 2
#define POLLOUT 4
#define POLLERR 8
#define POLLHUP 0x10
#define POLLNVAL 0x20
/* #define POLLRDBAND 0x80 */
/* #define POLLRDNORM 0x40 */
/* #define POLLWRBAND 0x0200 */
/* #define POLLWRNORM 0x0100 */
/* #define POLLRDHUP 0x2000 */
/* {set,get}sockopt(fd, level=SOL_SOCKET, X, ...) */
#define SO_REUSEADDR 2
#define SO_LINGER 13
#define SO_REUSEPORT 15
#define SO_RCVTIMEO 20
#define SO_SNDTIMEO 21
/* #define SO_KEEPALIVE 9 */
/* #define SO_DONTROUTE 5 */
/* #define SO_BROADCAST 6 */
/* #define SO_DEBUG 1 */
/* #define SO_ACCEPTCONN 30 */
/* #define SO_ERROR 4 */
/* #define SO_OOBINLINE 10 */
/* #define SO_SNDBUF 7 */
/* #define SO_RCVBUF 8 */
/* #define SO_RCVLOWAT 18 */
/* #define SO_EXCLUSIVEADDRUSE 0 */
/* #define SO_SNDLOWAT 19 */
/* #define SO_TYPE 3 */
/* #define SO_TIMESTAMP 29 */
/* #define SO_DOMAIN 39 */
/* #define SO_MAX_PACING_RATE 47 */
/* #define SO_PEERCRED 17 */
/* #define SO_PROTOCOL 38 */
/* #define SO_ATTACH_BPF 50 */
/* #define SO_ATTACH_FILTER 26 */
/* #define SO_ATTACH_REUSEPORT_CBPF 51 */
/* #define SO_ATTACH_REUSEPORT_EBPF 52 */
/* #define SO_BINDTODEVICE 25 */
/* #define SO_BPF_EXTENSIONS 48 */
/* #define SO_BSDCOMPAT 14 */
/* #define SO_BUSY_POLL 46 */
/* #define SO_CNX_ADVICE 53 */
/* #define SO_DETACH_BPF 27 */
/* #define SO_DETACH_FILTER 27 */
/* #define SO_GET_FILTER 26 */
/* #define SO_INCOMING_CPU 49 */
/* #define SO_LOCK_FILTER 44 */
/* #define SO_MARK 36 */
/* #define SO_NOFCS 43 */
/* #define SO_NO_CHECK 11 */
/* #define SO_PASSCRED 0x10 */
/* #define SO_PASSSEC 34 */
/* #define SO_PEEK_OFF 42 */
/* #define SO_PEERNAME 28 */
/* #define SO_PEERSEC 31 */
/* #define SO_PRIORITY 12 */
/* #define SO_RCVBUFFORCE 33 */
/* #define SO_RXQ_OVFL 40 */
/* #define SO_SECURITY_AUTHENTICATION 22 */
/* #define SO_SECURITY_ENCRYPTION_NETWORK 24 */
/* #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 */
/* #define SO_SELECT_ERR_QUEUE 45 */
/* #define SO_SNDBUFFORCE 0x20 */
/* #define SO_TIMESTAMPING 37 */
/* #define SO_TIMESTAMPNS 35 */
/* #define SO_WIFI_STATUS 41 */
#define SOL_IP 0
#define SOL_SOCKET 1
#define SOL_TCP 6
#define SOL_UDP 17
/* #define SOL_IPV6 41 */
/* #define SOL_ICMPV6 58 */
/* #define SOL_AAL 265 */
/* #define SOL_ALG 279 */
/* #define SOL_ATM 264 */
/* #define SOL_BLUETOOTH 274 */
/* #define SOL_CAIF 278 */
/* #define SOL_DCCP 269 */
/* #define SOL_DECNET 261 */
/* #define SOL_IRDA 266 */
/* #define SOL_IUCV 277 */
/* #define SOL_KCM 281 */
/* #define SOL_LLC 268 */
/* #define SOL_NETBEUI 267 */
/* #define SOL_NETLINK 270 */
/* #define SOL_NFC 280 */
/* #define SOL_PACKET 263 */
/* #define SOL_PNPIPE 275 */
/* #define SOL_PPPOL2TP 273 */
/* #define SOL_RAW 255 */
/* #define SOL_RDS 276 */
/* #define SOL_RXRPC 272 */
/* #define SOL_TIPC 271 */
/* #define SOL_X25 262 */
/* {set,get}sockopt(fd, level=IPPROTO_TCP, X, ...) */
#define TCP_NODELAY 1
#define TCP_CORK 3
#define TCP_FASTOPEN 23
#define TCP_QUICKACK 12
/* #define TCP_MAXSEG 2 */
/* #define TCP_KEEPIDLE 4 */
/* #define TCP_KEEPINTVL 5 */
/* #define TCP_KEEPCNT 6 */
/* #define TCP_SYNCNT 7 */
/* #define TCP_COOKIE_TRANSACTIONS 15 */
/* #define TCP_LINGER2 8 */
/* #define TCP_NOTSENT_LOWAT 25 */
/* #define TCP_INFO 11 */
/* #define TCP_CC_INFO 26 */
/* #define TCP_CONGESTION 13 */
/* #define TCP_MD5SIG 14 */
/* #define TCP_MD5SIG_MAXKEYLEN 80 */
/* #define TCP_TIMESTAMP 24 */
/* #define TCP_USER_TIMEOUT 18 */
/* #define TCP_SAVE_SYN 27 */
/* #define TCP_SAVED_SYN 28 */
/* #define TCP_THIN_DUPACK 17 */
/* #define TCP_QUEUE_SEQ 21 */
/* #define TCP_WINDOW_CLAMP 10 */
/* #define TCP_DEFER_ACCEPT 9 */
/* #define TCP_REPAIR 19 */
/* #define TCP_REPAIR_OPTIONS 22 */
/* #define TCP_REPAIR_QUEUE 20 */
/* #define TCP_THIN_LINEAR_TIMEOUTS 16 */
#define SIOCGIFCONF 0x8912
#define SIOCGIFNETMASK 0x891b
/* #define SIOCADDMULTI 0x8931 */
/* #define SIOCATMARK 0x8905 */
/* #define SIOCDELMULTI 0x8932 */
/* #define SIOCDIFADDR 0x8936 */
/* #define SIOCGIFADDR 0x8915 */
/* #define SIOCGIFBRDADDR 0x8919 */
/* #define SIOCGIFDSTADDR 0x8917 */
/* #define SIOCGIFFLAGS 0x8913 */
/* #define SIOCGIFMETRIC 0x891d */
/* #define SIOCGPGRP 0x8904 */
/* #define SIOCSIFADDR 0x8916 */
/* #define SIOCSIFBRDADDR 0x891a */
/* #define SIOCSIFDSTADDR 0x8918 */
/* #define SIOCSIFFLAGS 0x8914 */
/* #define SIOCSIFMETRIC 0x891e */
/* #define SIOCSIFNETMASK 0x891c */
/* #define SIOCSPGRP 0x8902 */
/* #define SIOCGIFMTU 0x8921 */
/* #define SIOCSIFMTU 0x8922 */
/* #define SIOCGIFINDEX 0x8933 */
/* #define SIOCSIFNAME 0x8923 */
/* #define SIOCADDDLCI 0x8980 */
/* #define SIOCADDRT 0x890b */
/* #define SIOCDARP 0x8953 */
/* #define SIOCDELDLCI 0x8981 */
/* #define SIOCDELRT 0x890c */
/* #define SIOCDEVPRIVATE 0x89f0 */
/* #define SIOCDRARP 0x8960 */
/* #define SIOCGARP 0x8954 */
/* #define SIOCGIFBR 0x8940 */
/* #define SIOCGIFCOUNT 0x8938 */
/* #define SIOCGIFENCAP 0x8925 */
/* #define SIOCGIFHWADDR 0x8927 */
/* #define SIOCGIFMAP 0x8970 */
/* #define SIOCGIFMEM 0x891f */
/* #define SIOCGIFNAME 0x8910 */
/* #define SIOCGIFPFLAGS 0x8935 */
/* #define SIOCGIFSLAVE 0x8929 */
/* #define SIOCGIFTXQLEN 0x8942 */
/* #define SIOCGRARP 0x8961 */
/* #define SIOCGSTAMP 0x8906 */
/* #define SIOCGSTAMPNS 0x8907 */
/* #define SIOCPROTOPRIVATE 0x89e0 */
/* #define SIOCRTMSG 0x890d */
/* #define SIOCSARP 0x8955 */
/* #define SIOCSIFBR 0x8941 */
/* #define SIOCSIFENCAP 0x8926 */
/* #define SIOCSIFHWADDR 0x8924 */
/* #define SIOCSIFHWBROADCAST 0x8937 */
/* #define SIOCSIFLINK 0x8911 */
/* #define SIOCSIFMAP 0x8971 */
/* #define SIOCSIFMEM 0x8920 */
/* #define SIOCSIFPFLAGS 0x8934 */
/* #define SIOCSIFSLAVE 0x8930 */
/* #define SIOCSIFTXQLEN 0x8943 */
/* #define SIOCSRARP 0x8962 */
/* #define SIOGIFINDEX 0x8933 */
#define AF_UNSPEC 0
#define AF_INET 2
/* #define AF_UNIX 1 */
/* #define AF_LOCAL 1 */
/* #define AF_FILE 1 */
/* #define AF_AX25 3 */
/* #define AF_IPX 4 */
/* #define AF_APPLETALK 5 */
/* #define AF_NETROM 6 */
/* #define AF_BRIDGE 7 */
/* #define AF_ATMPVC 8 */
/* #define AF_X25 9 */
/* #define AF_INET6 10 */
/* #define AF_ROSE 11 */
/* #define AF_NETBEUI 13 */
/* #define AF_SECURITY 14 */
/* #define AF_KEY 15 */
/* #define AF_ROUTE 16 */
/* #define AF_NETLINK 16 */
/* #define AF_PACKET 17 */
/* #define AF_ASH 18 */
/* #define AF_ECONET 19 */
/* #define AF_ATMSVC 20 */
/* #define AF_RDS 21 */
/* #define AF_SNA 22 */
/* #define AF_IRDA 23 */
/* #define AF_PPPOX 24 */
/* #define AF_WANPIPE 25 */
/* #define AF_LLC 26 */
/* #define AF_IB 27 */
/* #define AF_MPLS 28 */
/* #define AF_CAN 29 */
/* #define AF_TIPC 30 */
/* #define AF_BLUETOOTH 31 */
/* #define AF_IUCV 0x20 */
/* #define AF_RXRPC 33 */
/* #define AF_ISDN 34 */
/* #define AF_PHONET 35 */
/* #define AF_IEEE802154 36 */
/* #define AF_CAIF 37 */
/* #define AF_ALG 38 */
/* #define AF_NFC 39 */
/* #define AF_VSOCK 40 */
/* #define AF_KCM 41 */
/* #define AF_MAX 42 */
/* getdents() constants */
#define DT_UNKNOWN 0
#define DT_CHR 2
#define DT_DIR 4
#define DT_REG 8
/* #define DT_FIFO 1 */
/* #define DT_BLK 6 */
/* #define DT_LNK 10 */
/* #define DT_SOCK 12 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment