summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2011-04-29 18:48:23 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2011-04-29 18:48:23 -0300
commit2b5b3e1ea70c4653b17fdfbe5fe17fc213a69a99 (patch)
treed497472e5825895d743fbcf30c35643f57b057be /vio
parenta6acc73bb18f3a662649c40a12c37063bfae37d6 (diff)
downloadmariadb-git-2b5b3e1ea70c4653b17fdfbe5fe17fc213a69a99.tar.gz
FIONREAD is located in sys/filio.h on Solaris.
Diffstat (limited to 'vio')
-rw-r--r--vio/viosocket.c8
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;