/* Per-platform definitions of TCP socket options. */
#if defined (__linux__)
-#define COMPAT_SOCKET_LEVEL SOL_TCP
#define COMPAT_TCP_LEVEL SOL_TCP
#define COMPAT_TCP_ABORT_THRESHOLD 0 /* Does not exist on linux. */
#define COMPAT_TCP_KEEPIDLE TCP_KEEPIDLE
#elif defined (__sun__) /* ! defined (__linux__) */
-#define COMPAT_SOCKET_LEVEL SOL_SOCKET
#define COMPAT_TCP_LEVEL IPPROTO_TCP
#ifdef TCP_KEEPALIVE_THRESHOLD
#else /* ! defined (__linux__) && ! defined (__sun__) */
-#define COMPAT_SOCKET_LEVEL 0
#define COMPAT_TCP_LEVEL 0
#define COMPAT_TCP_ABORT_THRESHOLD 0
#define COMPAT_TCP_KEEPIDLE 0
goto end;
}
- ret = setsockopt(socket_fd, COMPAT_SOCKET_LEVEL, SO_KEEPALIVE, &val,
+ ret = setsockopt(socket_fd, SOL_SOCKET, SO_KEEPALIVE, &val,
sizeof(val));
if (ret < 0) {
PERROR("setsockopt so_keepalive");