From: Sascha Schumann Date: Wed, 2 Oct 2002 08:32:26 +0000 (+0000) Subject: Another Linux x86 system returns ELIMIT so we need to check errno as well X-Git-Tag: MODERN_SYMMETRIC_SESSION_BEHAVIOUR_20021003~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66833340662ec055592b9cca3a23825fa619da8e;p=php Another Linux x86 system returns ELIMIT so we need to check errno as well before assuming that pread/pwrite work. --- diff --git a/acinclude.m4 b/acinclude.m4 index 3926bd08bf..7f8f57a181 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -380,6 +380,7 @@ AC_DEFUN(PHP_DOES_PWRITE_WORK,[ #include #include #include +#include $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 #include #include +#include $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); } ],[