1 dnl ---------------------------------------------------------------------------
2 dnl Macro: SETSOCKOPT_SANITY
3 dnl ---------------------------------------------------------------------------
4 AC_DEFUN([SETSOCKOPT_SANITY],[
9 #include <sys/socket.h>
14 int sock = socket(AF_INET, SOCK_STREAM, 0);
15 struct timeval waittime;
18 waittime.tv_usec= 500;
20 if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
21 &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
22 if (errno == ENOPROTOOPT) {
28 [AC_DEFINE(HAVE_SNDTIMEO, 1, [Define to 1 if you have a working SO_SNDTIMEO])])
32 #include <sys/types.h>
33 #include <sys/socket.h>
38 int sock = socket(AF_INET, SOCK_STREAM, 0);
39 struct timeval waittime;
42 waittime.tv_usec= 500;
44 if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
45 &waittime, (socklen_t)sizeof(struct timeval)) == -1) {
46 if (errno == ENOPROTOOPT) {
51 ]])], [AC_DEFINE(HAVE_RCVTIMEO, 1, [Define to 1 if you have a working SO_RCVTIMEO])])
55 dnl ---------------------------------------------------------------------------
56 dnl End Macro: SETSOCKOPT_SANITY
57 dnl ---------------------------------------------------------------------------