1 ! Copyright (C) 2006 Patrick Mauritz.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: alien.syntax system kernel layouts ;
8 CONSTANT: O_RDONLY HEX: 0000
9 CONSTANT: O_WRONLY HEX: 0001
10 CONSTANT: O_RDWR HEX: 0002
11 CONSTANT: O_APPEND HEX: 0008
12 CONSTANT: O_CREAT HEX: 0100
13 CONSTANT: O_TRUNC HEX: 0200
17 CONSTANT: SOL_SOCKET HEX: ffff
19 : FD_SETSIZE ( -- n ) cell 4 = 1024 65536 ? ;
21 CONSTANT: SO_REUSEADDR 4
22 CONSTANT: SO_OOBINLINE HEX: 0100
23 CONSTANT: SO_SNDTIMEO HEX: 1005
24 CONSTANT: SO_RCVTIMEO HEX: 1006
26 CONSTANT: F_SETFL 4 ! set file status flags
27 CONSTANT: O_NONBLOCK HEX: 80 ! no delay
38 { "char*" "canonname" }
45 { "in_addr_t" "addr" }
46 { "longlong" "unused" } ;
48 C-STRUCT: sockaddr-in6
52 { { "uchar" 16 } "addr" }
53 { "uint" "scopeid" } ;
59 { { "char" max-un-path } "path" } ;
63 CONSTANT: EINPROGRESS 150
65 CONSTANT: SOCK_STREAM 2
66 CONSTANT: SOCK_DGRAM 1
73 ALIAS: PF_UNSPEC AF_UNSPEC
74 ALIAS: PF_UNIX AF_UNIX
75 ALIAS: PF_INET AF_INET
76 ALIAS: PF_INET6 AF_INET6
78 CONSTANT: IPPROTO_TCP 6
79 CONSTANT: IPPROTO_UDP 17
81 CONSTANT: AI_PASSIVE 8