From 5b3987a26fe0a203e0750a11c77d273b1fb912d9 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 13 Mar 2016 13:08:07 -0700 Subject: [PATCH] unix.ffi: adding getsockopt and some socket options. --- basis/unix/ffi/ffi.factor | 1 + basis/unix/ffi/linux/linux.factor | 3 +++ basis/unix/ffi/macosx/macosx.factor | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/basis/unix/ffi/ffi.factor b/basis/unix/ffi/ffi.factor index 622d611ac4..52b8e80234 100644 --- a/basis/unix/ffi/ffi.factor +++ b/basis/unix/ffi/ffi.factor @@ -182,6 +182,7 @@ FUNCTION: int setpgid ( pid_t pid, pid_t gid ) FUNCTION: int setregid ( gid_t rgid, gid_t egid ) FUNCTION: int setreuid ( uid_t ruid, uid_t euid ) FUNCTION: pid_t setsid ( ) +FUNCTION: int getsockopt ( int s, int level, int optname, void* optval, socklen_t* optlen ) FUNCTION: int setsockopt ( int s, int level, int optname, void* optval, socklen_t optlen ) FUNCTION: int setuid ( uid_t uid ) FUNCTION: int socket ( int domain, int type, int protocol ) diff --git a/basis/unix/ffi/linux/linux.factor b/basis/unix/ffi/linux/linux.factor index afa0bbb827..f6d026dbec 100644 --- a/basis/unix/ffi/linux/linux.factor +++ b/basis/unix/ffi/linux/linux.factor @@ -22,7 +22,10 @@ CONSTANT: SOL_SOCKET 1 CONSTANT: FD_SETSIZE 1024 +CONSTANT: SO_DEBUG 1 CONSTANT: SO_REUSEADDR 2 +CONSTANT: SO_TYPE 3 +CONSTANT: SO_ERROR 4 CONSTANT: SO_DONTROUTE 5 CONSTANT: SO_BROADCAST 6 CONSTANT: SO_SNDBUF 7 diff --git a/basis/unix/ffi/macosx/macosx.factor b/basis/unix/ffi/macosx/macosx.factor index 678f4bd007..12847acc3f 100644 --- a/basis/unix/ffi/macosx/macosx.factor +++ b/basis/unix/ffi/macosx/macosx.factor @@ -17,6 +17,8 @@ CONSTANT: O_NOCTTY 0x20000 ALIAS: O_NDELAY O_NONBLOCK CONSTANT: SOL_SOCKET 0xffff +CONSTANT: SO_DEBUG 0x1 +CONSTANT: SO_ACCEPTCONN 0x2 CONSTANT: SO_REUSEADDR 0x4 CONSTANT: SO_KEEPALIVE 0x8 CONSTANT: SO_DONTROUTE 0x10 @@ -24,8 +26,12 @@ CONSTANT: SO_BROADCAST 0x20 CONSTANT: SO_OOBINLINE 0x100 CONSTANT: SO_SNDBUF 0x1001 CONSTANT: SO_RCVBUF 0x1002 +CONSTANT: SO_SNDLOWAT 0x1003 +CONSTANT: SO_RCVLOWAT 0x1004 CONSTANT: SO_SNDTIMEO 0x1005 CONSTANT: SO_RCVTIMEO 0x1006 +CONSTANT: SO_ERROR 0x1007 +CONSTANT: SO_TYPE 0x1008 CONSTANT: F_SETFD 2 CONSTANT: F_SETFL 4