Browse Source

iscsi: use <sys/filio.h> on Solaris.

Needed for FIONREAD.
Rusty Russell 14 years ago
parent
commit
c4f43d26dc
3 changed files with 7 additions and 0 deletions
  1. 4 0
      ccan/iscsi/socket.c
  2. 1 0
      config.h
  3. 2 0
      tools/configurator/configurator.c

+ 4 - 0
ccan/iscsi/socket.c

@@ -15,6 +15,7 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -31,6 +32,9 @@
 #include "iscsi.h"
 #include "iscsi-private.h"
 #include "dlinklist.h"
+#if HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
 
 static void set_nonblocking(int fd)
 {

+ 1 - 0
config.h

@@ -46,6 +46,7 @@
 #define HAVE_SECTION_START_STOP 1
 #define HAVE_STACK_GROWS_UPWARDS 0
 #define HAVE_STATEMENT_EXPR 1
+#define HAVE_SYS_FILIO_H 0
 #define HAVE_TYPEOF 1
 #define HAVE_UTIME 1
 #define HAVE_WARN_UNUSED_RESULT 1

+ 2 - 0
tools/configurator/configurator.c

@@ -200,6 +200,8 @@ static struct test tests[] = {
 	  "}\n" },
 	{ "HAVE_STATEMENT_EXPR", INSIDE_MAIN, NULL,
 	  "return ({ int x = argc; x == argc ? 0 : 1; });" },
+	{ "HAVE_SYS_FILIO_H", OUTSIDE_MAIN, NULL, /* Solaris needs this for FIONREAD */
+	  "#include <sys/filio.h>\n" },
 	{ "HAVE_TYPEOF", INSIDE_MAIN, NULL,
 	  "__typeof__(argc) i; i = argc; return i == argc ? 0 : 1;" },
 	{ "HAVE_UTIME", DEFINES_FUNC, NULL,