diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2011-04-29 18:48:23 -0300 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2011-04-29 18:48:23 -0300 |
commit | 5f49c7d6b7d382690c750ddc943f72457a02adc7 (patch) | |
tree | d497472e5825895d743fbcf30c35643f57b057be /vio/viosocket.c | |
parent | 4eebae08f7f6896458ad8f3f3e87e74d4ef2a7c8 (diff) | |
download | mariadb-git-5f49c7d6b7d382690c750ddc943f72457a02adc7.tar.gz |
FIONREAD is located in sys/filio.h on Solaris.
Diffstat (limited to 'vio/viosocket.c')
-rw-r--r-- | vio/viosocket.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vio/viosocket.c b/vio/viosocket.c index 0f3a32d62ae..9ad7134312c 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -22,6 +22,10 @@ #include "vio_priv.h" +#ifdef FIONREAD_IN_SYS_FILIO +# include <sys/filio.h> +#endif + int vio_errno(Vio *vio __attribute__((unused))) { return socket_errno; /* On Win32 this mapped to WSAGetLastError() */ @@ -583,13 +587,13 @@ static my_bool socket_poll_read(my_socket sd, uint timeout) static my_bool socket_peek_read(Vio *vio, uint *bytes) { -#ifdef __WIN__ +#if defined(_WIN32) int len; if (ioctlsocket(vio->sd, FIONREAD, &len)) return TRUE; *bytes= len; return FALSE; -#elif FIONREAD_IN_SYS_IOCTL +#elif defined(FIONREAD_IN_SYS_IOCTL) || defined(FIONREAD_IN_SYS_FILIO) int len; if (ioctl(vio->sd, FIONREAD, &len) < 0) return TRUE; |