?RCS: $Id: sockopt.U 167 2013-05-08 17:58:00Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic License, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic License; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: sockopt.U,v $ ?RCS: Revision 3.0.1.1 1995/07/25 14:16:14 ram ?RCS: patch56: obsoleted KEEPALIVE in favor of CAN_KEEPALIVE for consistency ?RCS: ?RCS: Revision 3.0 1993/08/18 12:09:48 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_keepalive: cat rm contains +cc +ccflags socketlib sockethdr \ d_oldsock libs Oldconfig Setvar Findhdr ?MAKE: -pick add $@ %< ?S:d_keepalive: ?S: This symbol conditionally defines CAN_KEEPALIVE which indicates to the C ?S: program that setsockopt SO_KEEPALIVE will work properly. ?S:. ?C:CAN_KEEPALIVE (KEEPALIVE): ?C: This symbol if defined indicates to the C program that the SO_KEEPALIVE ?C: option of setsockopt() will work as advertised in the manual. ?C:. ?H:#$d_keepalive CAN_KEEPALIVE /**/ ?H:. ?F:!socket ?LINT:set d_keepalive : see if setsockopt with SO_KEEPALIVE works as advertised echo " " case "$d_oldsock" in "$undef") if $contains SO_KEEPALIVE `./findhdr sys/socket.h` \ /dev/null >/dev/null 2>&1 then echo "OK, let's see if SO_KEEPALIVE works as advertised..." >&4 $cat > socket.c < #include #include #include int main() { int s = socket(AF_INET, SOCK_STREAM, 0); if (s == -1) exit(1); if (-1 == setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, 0, 0)) exit(2); exit(0); } EOP if $cc $ccflags $sockethdr -o socket socket.c $libs \ $socketlib >/dev/null 2>&1; then ./socket >/dev/null 2>&1 case $? in 0) echo "Yes, it does!" val="$define";; 1) $cat <