USING: alien alien.c-types alien.libraries alien.syntax classes.struct combinators kernel system unix unix.time unix.types vocabs vocabs.loader ; IN: unix.ffi CONSTANT: MAXPATHLEN 1024 CONSTANT: O_RDONLY 0x0000 CONSTANT: O_WRONLY 0x0001 CONSTANT: O_RDWR 0x0002 CONSTANT: O_NONBLOCK 0x0004 CONSTANT: O_APPEND 0x0008 CONSTANT: O_CREAT 0x0200 CONSTANT: O_TRUNC 0x0400 CONSTANT: O_EXCL 0x0800 CONSTANT: O_NOCTTY 0x20000 ALIAS: O_NDELAY O_NONBLOCK CONSTANT: SOL_SOCKET 0xffff CONSTANT: SO_REUSEADDR 0x4 CONSTANT: SO_KEEPALIVE 0x8 CONSTANT: SO_DONTROUTE 0x10 CONSTANT: SO_BROADCAST 0x20 CONSTANT: SO_OOBINLINE 0x100 CONSTANT: SO_SNDBUF 0x1001 CONSTANT: SO_RCVBUF 0x1002 CONSTANT: SO_SNDTIMEO 0x1005 CONSTANT: SO_RCVTIMEO 0x1006 CONSTANT: F_SETFD 2 CONSTANT: F_SETFL 4 CONSTANT: FD_CLOEXEC 1 STRUCT: sockaddr-in { len uchar } { family uchar } { port ushort } { addr in_addr_t } { unused longlong } ; STRUCT: sockaddr-in6 { len uchar } { family uchar } { port ushort } { flowinfo uint } { addr uchar[16] } { scopeid uint } ; STRUCT: sockaddr-un { len uchar } { family uchar } { path char[104] } ; STRUCT: passwd { pw_name c-string } { pw_passwd c-string } { pw_uid uid_t } { pw_gid gid_t } { pw_change time_t } { pw_class c-string } { pw_gecos c-string } { pw_dir c-string } { pw_shell c-string } { pw_expire time_t } { pw_fields int } ; CONSTANT: max-un-path 104 CONSTANT: SOCK_STREAM 1 CONSTANT: SOCK_DGRAM 2 CONSTANT: SOCK_RAW 3 CONSTANT: AF_UNSPEC 0 CONSTANT: AF_UNIX 1 CONSTANT: AF_INET 2 ALIAS: PF_UNSPEC AF_UNSPEC ALIAS: PF_UNIX AF_UNIX ALIAS: PF_INET AF_INET CONSTANT: IPPROTO_TCP 6 CONSTANT: IPPROTO_UDP 17 CONSTANT: AI_PASSIVE 1 CONSTANT: SEEK_SET 0 CONSTANT: SEEK_CUR 1 CONSTANT: SEEK_END 2 CONSTANT: FD_SETSIZE 1024 CONSTANT: AF_INET6 30 ALIAS: PF_INET6 AF_INET6 STRUCT: addrinfo { flags int } { family int } { socktype int } { protocol int } { addrlen socklen_t } { canonname c-string } { addr void* } { next addrinfo* } ; CONSTANT: _UTX_USERSIZE 256 CONSTANT: _UTX_LINESIZE 32 CONSTANT: _UTX_IDSIZE 4 CONSTANT: _UTX_HOSTSIZE 256 STRUCT: utmpx { ut_user { char _UTX_USERSIZE } } { ut_id { char _UTX_IDSIZE } } { ut_line { char _UTX_LINESIZE } } { ut_pid pid_t } { ut_type short } { ut_tv timeval } { ut_host { char _UTX_HOSTSIZE } } { ut_pad { uint 16 } } ; CONSTANT: __DARWIN_MAXPATHLEN 1024 CONSTANT: __DARWIN_MAXNAMELEN 255 CONSTANT: __DARWIN_MAXNAMELEN+1 256 STRUCT: dirent { d_ino ino_t } { d_reclen __uint16_t } { d_type __uint8_t } { d_namlen __uint8_t } { d_name { char __DARWIN_MAXNAMELEN+1 } } ; CONSTANT: EPERM 1 CONSTANT: ENOENT 2 CONSTANT: ESRCH 3 CONSTANT: EINTR 4 CONSTANT: EIO 5 CONSTANT: ENXIO 6 CONSTANT: E2BIG 7 CONSTANT: ENOEXEC 8 CONSTANT: EBADF 9 CONSTANT: ECHILD 10 CONSTANT: EDEADLK 11 CONSTANT: ENOMEM 12 CONSTANT: EACCES 13 CONSTANT: EFAULT 14 CONSTANT: ENOTBLK 15 CONSTANT: EBUSY 16 CONSTANT: EEXIST 17 CONSTANT: EXDEV 18 CONSTANT: ENODEV 19 CONSTANT: ENOTDIR 20 CONSTANT: EISDIR 21 CONSTANT: EINVAL 22 CONSTANT: ENFILE 23 CONSTANT: EMFILE 24 CONSTANT: ENOTTY 25 CONSTANT: ETXTBSY 26 CONSTANT: EFBIG 27 CONSTANT: ENOSPC 28 CONSTANT: ESPIPE 29 CONSTANT: EROFS 30 CONSTANT: EMLINK 31 CONSTANT: EPIPE 32 CONSTANT: EDOM 33 CONSTANT: ERANGE 34 CONSTANT: EAGAIN 35 ALIAS: EWOULDBLOCK EAGAIN CONSTANT: EINPROGRESS 36 CONSTANT: EALREADY 37 CONSTANT: ENOTSOCK 38 CONSTANT: EDESTADDRREQ 39 CONSTANT: EMSGSIZE 40 CONSTANT: EPROTOTYPE 41 CONSTANT: ENOPROTOOPT 42 CONSTANT: EPROTONOSUPPORT 43 CONSTANT: ESOCKTNOSUPPORT 44 CONSTANT: ENOTSUP 45 CONSTANT: EPFNOSUPPORT 46 CONSTANT: EAFNOSUPPORT 47 CONSTANT: EADDRINUSE 48 CONSTANT: EADDRNOTAVAIL 49 CONSTANT: ENETDOWN 50 CONSTANT: ENETUNREACH 51 CONSTANT: ENETRESET 52 CONSTANT: ECONNABORTED 53 CONSTANT: ECONNRESET 54 CONSTANT: ENOBUFS 55 CONSTANT: EISCONN 56 CONSTANT: ENOTCONN 57 CONSTANT: ESHUTDOWN 58 CONSTANT: ETOOMANYREFS 59 CONSTANT: ETIMEDOUT 60 CONSTANT: ECONNREFUSED 61 CONSTANT: ELOOP 62 CONSTANT: ENAMETOOLONG 63 CONSTANT: EHOSTDOWN 64 CONSTANT: EHOSTUNREACH 65 CONSTANT: ENOTEMPTY 66 CONSTANT: EPROCLIM 67 CONSTANT: EUSERS 68 CONSTANT: EDQUOT 69 CONSTANT: ESTALE 70 CONSTANT: EREMOTE 71 CONSTANT: EBADRPC 72 CONSTANT: ERPCMISMATCH 73 CONSTANT: EPROGUNAVAIL 74 CONSTANT: EPROGMISMATCH 75 CONSTANT: EPROCUNAVAIL 76 CONSTANT: ENOLCK 77 CONSTANT: ENOSYS 78 CONSTANT: EFTYPE 79 CONSTANT: EAUTH 80 CONSTANT: ENEEDAUTH 81 CONSTANT: EPWROFF 82 CONSTANT: EDEVERR 83 CONSTANT: EOVERFLOW 84 CONSTANT: EBADEXEC 85 CONSTANT: EBADARCH 86 CONSTANT: ESHLIBVERS 87 CONSTANT: EBADMACHO 88 CONSTANT: ECANCELED 89 CONSTANT: EIDRM 90 CONSTANT: ENOMSG 91 CONSTANT: EILSEQ 92 CONSTANT: ENOATTR 93 CONSTANT: EBADMSG 94 CONSTANT: EMULTIHOP 95 CONSTANT: ENODATA 96 CONSTANT: ENOLINK 97 CONSTANT: ENOSR 98 CONSTANT: ENOSTR 99 CONSTANT: EPROTO 100 CONSTANT: ETIME 101 CONSTANT: EOPNOTSUPP 102 CONSTANT: ENOPOLICY 103 CONSTANT: SIGHUP 1 CONSTANT: SIGINT 2 CONSTANT: SIGQUIT 3 CONSTANT: SIGILL 4 CONSTANT: SIGTRAP 5 CONSTANT: SIGABRT 6 CONSTANT: SIGEMT 7 CONSTANT: SIGFPE 8 CONSTANT: SIGKILL 9 CONSTANT: SIGBUS 10 CONSTANT: SIGSEGV 11 CONSTANT: SIGSYS 12 CONSTANT: SIGPIPE 13 CONSTANT: SIGALRM 14 CONSTANT: SIGTERM 15 CONSTANT: SIGURG 16 CONSTANT: SIGSTOP 17 CONSTANT: SIGTSTP 18 CONSTANT: SIGCONT 19 CONSTANT: SIGCHLD 20 CONSTANT: SIGTTIN 21 CONSTANT: SIGTTOU 22 CONSTANT: SIGIO 23 CONSTANT: SIGXCPU 24 CONSTANT: SIGXFSZ 25 CONSTANT: SIGVTALRM 26 CONSTANT: SIGPROF 27 CONSTANT: SIGWINCH 28 CONSTANT: SIGINFO 29 CONSTANT: SIGUSR1 30 CONSTANT: SIGUSR2 31 STRUCT: sf_hdtr { headers void* } { hdr_cnt int } { trailers void* } { trl_cnt int } ; FUNCTION: int sendfile ( int fd, int s, off_t offset, off_t* len, sf_hdtr* hdtr, int flags ) ;