Bug #23557 IRIX 5 does not define SHUT_RDWR
Submitted: 23 Oct 2006 19:32 Modified: 27 Nov 2006 14:32
Reporter: Georg Schwarz Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.26 OS:Other (IRIX 5.3)
Assigned to: CPU Architecture:Any

[23 Oct 2006 19:32] Georg Schwarz
Description:
IRIX 5.3 does not define SHUT_RDWR, so mysql5 fails to compile. (IRIX 6 does define it in /usr/include/sys/socket.h)

shutdown(2) on IRIX 5.3 says:

"NAME
     shutdown - shut down part of a full-duplex connection

SYNOPSIS
     int shutdown (int s, int how);

DESCRIPTION
     The shutdown call causes all or part of a full-duplex connection on the
     socket associated with s to be shut down.  If how is 0, then further
     receives will be disallowed.  If how is 1, then further sends will be
     disallowed.  If how is 2, then further sends and receives will be
     disallowed."

How to repeat:
compile it on IRIX 5.3 (and probably earlier as well)

Suggested fix:
The following patch fixes the issue:

--- include/my_net.h.orig       2006-10-23 21:21:16.000000000 +0200
+++ include/my_net.h    2006-10-23 21:24:11.000000000 +0200
@@ -71,6 +71,15 @@
 
 #endif
 
+#if defined(__sgi) && !defined(SHUT_RDWR)
+
+/*
+  IRIX 5 does not define SHUT_RDWR
+*/
+
+#define SHUT_RDWR 2
+#endif
+
 /*
   On OSes which don't have the in_addr_t, we guess that using uint32 is the best
   possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD64bit
[27 Nov 2006 14:32] Valeriy Kravchuk
Thank you for a problem report. Sorry, but we do have any IRIX 5.3 machine, and do not support it formally. But looks like you are right. On IRIX 6.5 it is really defined:

mysqldev@octane2:~> uname -a
IRIX64 octane2 6.5 07080050 IP30
mysqldev@octane2:~> grep -n SHUT_RDWR /usr/include/sys/socket.h
121:#define SHUT_RDWR           2       /* disable further send/recv oper's */

So, your patch looks valid, and may be useful to other IRIX 5 users.