diff options
| author | Dan Fandrich <dan@coneharvesters.com> | 2007-09-05 22:01:57 +0000 | 
|---|---|---|
| committer | Dan Fandrich <dan@coneharvesters.com> | 2007-09-05 22:01:57 +0000 | 
| commit | 8147c3659d427110fe7febccaa2f60d4ab1a5cc7 (patch) | |
| tree | 26895a391d93a58efb1eb591b855d11543626514 | |
| parent | 73e91ce20cb76df8b617c8e97974d7c15a0fa590 (diff) | |
Minix doesn't support getsockopt on UDP sockets or send/recv on TCP
sockets.
| -rw-r--r-- | lib/connect.c | 7 | ||||
| -rw-r--r-- | lib/setup_once.h | 17 | 
2 files changed, 22 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c index cfdf5680a..c8c82a1b7 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -441,6 +441,13 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)      err = 0;    }  #endif +#ifdef __minix +  /* Minix 3.1.x doesn't support getsockopt on UDP sockets */ +  if (EBADIOCTL == err) { +    SET_SOCKERRNO(0); +    err = 0; +  } +#endif    if ((0 == err) || (EISCONN == err))      /* we are connected, awesome! */      rc = TRUE; diff --git a/lib/setup_once.h b/lib/setup_once.h index 08ead5eb2..1622f0cc8 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -98,6 +98,13 @@ struct timeval {  #endif +#if defined(__minix) +/* Minix doesn't support recv on TCP sockets */ +#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \ +                                   (RECV_TYPE_ARG2)(y), \ +                                   (RECV_TYPE_ARG3)(z)) + +#elif defined(HAVE_RECV)  /*   * The definitions for the return type and arguments types   * of functions recv() and send() belong and come from the @@ -120,7 +127,6 @@ struct timeval {   * SEND_TYPE_RETV must also be defined.   */ -#ifdef HAVE_RECV  #if !defined(RECV_TYPE_ARG1) || \      !defined(RECV_TYPE_ARG2) || \      !defined(RECV_TYPE_ARG3) || \ @@ -143,7 +149,14 @@ struct timeval {  #endif  #endif /* HAVE_RECV */ -#ifdef HAVE_SEND + +#if defined(__minix) +/* Minix doesn't support send on TCP sockets */ +#define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ +                                    (SEND_TYPE_ARG2)(y), \ +                                    (SEND_TYPE_ARG3)(z)) + +#elif defined(HAVE_SEND)  #if !defined(SEND_TYPE_ARG1) || \      !defined(SEND_QUAL_ARG2) || \      !defined(SEND_TYPE_ARG2) || \  | 
