diff options
author | Sascha Schumann <sas@php.net> | 2002-10-02 06:05:16 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2002-10-02 06:05:16 +0000 |
commit | e1dd35bddb25e4f88567c543d96418fe985afbd4 (patch) | |
tree | 7aaa42aa046d67965d04be36610dc44c26eaaf44 /ext/session | |
parent | d4c7e8bbaf83905b8e83295c5546d0bf328182a5 (diff) | |
download | php-git-e1dd35bddb25e4f88567c543d96418fe985afbd4.tar.gz |
The pread/pwrite macros check for a bug in the Linux glibc now.
The bug causes the kernel not to return -1/EAGAIN. The new test case
has been borrowed from the Linux Test Project.
This also fixes a bug which apparently caused HAVE_PREAD/WRITE to be
defined even if the more complex checks failed (ac_cv_func_NAME=no
was set albeit with no difference).
Diffstat (limited to 'ext/session')
-rw-r--r-- | ext/session/config.m4 | 1 | ||||
-rw-r--r-- | ext/session/mod_files.c | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/ext/session/config.m4 b/ext/session/config.m4 index 8bb43b676b..4e5a4ddd2c 100644 --- a/ext/session/config.m4 +++ b/ext/session/config.m4 @@ -9,7 +9,6 @@ PHP_ARG_WITH(mm,for mm support, [ --with-mm[=DIR] Include mm support for session storage], no, no) if test "$PHP_SESSION" != "no"; then - AC_CHECK_FUNCS(pread pwrite) PHP_PWRITE_TEST PHP_PREAD_TEST PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared) diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 1a784e8b1e..541adbea91 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -271,7 +271,7 @@ PS_READ_FUNC(files) data->st_size = *vallen = sbuf.st_size; *val = emalloc(sbuf.st_size); -#if defined(HAVE_WORKING_PREAD_TEST) && defined(HAVE_PREAD) +#if defined(HAVE_PREAD) n = pread(data->fd, *val, sbuf.st_size, 0); #else lseek(data->fd, 0, SEEK_SET); @@ -307,7 +307,7 @@ PS_WRITE_FUNC(files) if (vallen < (int)data->st_size) ftruncate(data->fd, 0); -#if defined(HAVE_WORKING_PWRITE_TEST) && defined(HAVE_PWRITE) +#if defined(HAVE_PWRITE) n = pwrite(data->fd, val, vallen, 0); #else lseek(data->fd, 0, SEEK_SET); |