#include <sys/_types.h>
#include <machine/endian.h>
-#ifndef _POSIX_C_SOURCE
+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
typedef __uint32_t tcp_seq;
typedef __uint32_t tcp_cc; /* connection count per rfc1644 */
#define TCPOPT_WINDOW 3
#define TCPOLEN_WINDOW 3
#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
+#define TCPOLEN_SACK_PERMITTED 2
#define TCPOPT_SACK 5 /* Experimental */
#define TCPOLEN_SACK 8 /* len of sack block */
#define TCPOPT_TIMESTAMP 8
#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
/* max space left for options */
-#endif /* _POSIX_C_SOURCE */
+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
/*
* User-settable options (used with setsockopt).
*/
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
-#ifndef _POSIX_C_SOURCE
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_NOPUSH 0x04 /* don't push last block of write */
-#define TCP_NOOPT 0x08 /* don't use TCP options */
-#define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */
-#endif /* _POSIX_C_SOURCE */
+#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
+#define TCP_MAXSEG 0x02 /* set maximum segment size */
+#define TCP_NOPUSH 0x04 /* don't push last block of write */
+#define TCP_NOOPT 0x08 /* don't use TCP options */
+#define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */
+#define TCP_CONNECTIONTIMEOUT 0x20 /* connection timeout */
+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
#endif