Fix the sys/fcntl.h problem reported by Peter Prymmer.
Jarkko Hietaniemi [Wed, 21 Feb 2001 15:09:33 +0000 (15:09 +0000)]
p4raw-id: //depot/perl@8877

Configure

index 22db84f..0abc4fe 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Wed Feb 21 16:35:15 EET 2001 [metaconfig 3.0 PL70]
+# Generated on Wed Feb 21 17:01:28 EET 2001 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -8812,11 +8812,13 @@ esac
 
 : check for non-blocking I/O stuff
 case "$h_sysfile" in
-true) echo "#include <sys/file.h>" >  head.c;;
-esac
-case "$h_fcntl" in
-true) echo "#include <fcntl.h>"    >> head.c;;
-*) echo "#include <sys/fcntl.h>"   >> head.c;;
+true) echo "#include <sys/file.h>" > head.c;;
+*)
+       case "$h_fcntl" in
+       true) echo "#include <fcntl.h>" > head.c;;
+       *) echo "#include <sys/fcntl.h>" > head.c;;
+       esac
+       ;;
 esac
 echo " "
 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
@@ -8896,8 +8898,12 @@ int main()
                int ret;
                close(pd[1]);   /* Parent reads from pd[0] */
                close(pu[0]);   /* Parent writes (blocking) to pu[1] */
+#ifdef F_SETFL
                if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
                        exit(1);
+#else
+               exit(4);
+#endif
                signal(SIGALRM, blech);
                alarm(5);
                if ((ret = read(pd[0], buf, 1)) > 0)    /* Nothing to read! */
@@ -8944,6 +8950,7 @@ EOCP
                1) echo "Could not perform non-blocking setting!";;
                2) echo "I did a successful read() for something that was not there!";;
                3) echo "Hmm... non-blocking I/O does not seem to be working!";;
+               4) echo "Could not find F_SETFL!";;
                *) echo "Something terribly wrong happened during testing.";;
                esac
                rd_nodata=`$cat try.ret`