]> granicus.if.org Git - php/commitdiff
Another Linux x86 system returns ELIMIT so we need to check errno as well
authorSascha Schumann <sas@php.net>
Wed, 2 Oct 2002 08:32:26 +0000 (08:32 +0000)
committerSascha Schumann <sas@php.net>
Wed, 2 Oct 2002 08:32:26 +0000 (08:32 +0000)
before assuming that pread/pwrite work.

acinclude.m4

index 3926bd08bf70364557e5c65ab5b9b9087492d85e..7f8f57a18186928872694924a593810559bfaffd 100644 (file)
@@ -380,6 +380,7 @@ AC_DEFUN(PHP_DOES_PWRITE_WORK,[
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <errno.h>
 $1
     main() {
     int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
@@ -387,7 +388,7 @@ $1
     if (fd < 0) exit(1);
     if (pwrite(fd, "text", 4, 0) != 4) exit(1);
     /* Linux glibc breakage until 2.2.5 */
-    if (pwrite(fd, "text", 4, -1) != -1) exit(1);
+    if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
     exit(0);
     }
 
@@ -407,6 +408,7 @@ AC_DEFUN(PHP_DOES_PREAD_WORK,[
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <errno.h>
 $1
     main() {
     char buf[3]; 
@@ -414,7 +416,7 @@ $1
     if (fd < 0) exit(1);
     if (pread(fd, buf, 2, 0) != 2) exit(1);
     /* Linux glibc breakage until 2.2.5 */
-    if (pread(fd, buf, 2, -1) != -1) exit(1);
+    if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
     exit(0);
     }
   ],[