1 ! Copyright (C) 2010 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.syntax classes.struct unix.time
7 CONSTANT: MAXPATHLEN 1024
9 CONSTANT: O_RDONLY 0x0000
10 CONSTANT: O_WRONLY 0x0001
11 CONSTANT: O_RDWR 0x0002
12 CONSTANT: O_CREAT 0x0040
13 CONSTANT: O_EXCL 0x0080
14 CONSTANT: O_NOCTTY 0x0100
15 CONSTANT: O_TRUNC 0x0200
16 CONSTANT: O_APPEND 0x0400
17 CONSTANT: O_NONBLOCK 0x0800
19 ALIAS: O_NDELAY O_NONBLOCK
21 CONSTANT: SOL_SOCKET 1
23 CONSTANT: FD_SETSIZE 1024
26 CONSTANT: SO_REUSEADDR 2
29 CONSTANT: SO_DONTROUTE 5
30 CONSTANT: SO_BROADCAST 6
33 CONSTANT: SO_KEEPALINE 9
34 CONSTANT: SO_OOBINLINE 10
35 CONSTANT: SO_SNDTIMEO 0x15
36 CONSTANT: SO_RCVTIMEO 0x14
39 CONSTANT: FD_CLOEXEC 1
50 { canonname c-string }
66 CONSTANT: max-un-path 108
70 { path { char max-un-path } } ;
72 CONSTANT: SOCK_STREAM 1
73 CONSTANT: SOCK_DGRAM 2
81 ALIAS: PF_UNSPEC AF_UNSPEC
82 ALIAS: PF_UNIX AF_UNIX
83 ALIAS: PF_INET AF_INET
84 ALIAS: PF_INET6 AF_INET6
86 CONSTANT: IPPROTO_TCP 6
87 CONSTANT: IPPROTO_UDP 17
89 ! Flags only valid in gnu libcs' getaddrinfo
90 CONSTANT: AI_IDN 0x0040
91 CONSTANT: AI_CANONIDN 0x0080
92 CONSTANT: AI_IDN_ALLOW_UNASSIGNED 0x0100
93 CONSTANT: AI_IDN_USE_STD3_ASCII_RULES 0x0200
94 CONSTANT: AI_NUMERICSERV 0x0400
103 { pw_passwd c-string }
106 { pw_gecos c-string }
108 { pw_shell c-string } ;
116 { d_name char[256] } ;
118 FUNCTION: int open64 ( c-string path, int flags, int prot )
119 FUNCTION: dirent* readdir64 ( DIR* dirp )
120 FUNCTION: int readdir64_r ( void* dirp, dirent* entry, dirent** result )
122 FUNCTION: ssize_t sendfile ( int out_fd, int in_fd, off_t* offset, size_t count )
124 FUNCTION: int pipe2 ( int* filedes, int flags )
126 CONSTANT: __UT_LINESIZE 32
127 CONSTANT: __UT_NAMESIZE 32
128 CONSTANT: __UT_HOSTSIZE 256
131 { e_termination short }
137 { ut_line char[__UT_LINESIZE] }
139 { ut_user char[__UT_NAMESIZE] }
140 { ut_host char[__UT_HOSTSIZE] }
141 { ut_exit exit_status }
144 { ut_addr_v6 int[4] }
145 { __unused char[20] } ;