]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
HPUX: Disable positional I/O
authorAndrew Deason <adeason@sinenomine.net>
Mon, 14 Feb 2011 19:53:11 +0000 (13:53 -0600)
committerDerrick Brashear <shadow@dementia.org>
Wed, 16 Feb 2011 19:40:59 +0000 (11:40 -0800)
Some versions of HP-UX have the pread() and pwrite() functions, but
they behave in odd ways; most notably, ignoring the offset argument
when _FILE_OFFSET_BITS is defined to 64.

This is noted in recent gnulib documentation
<http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/posix-functions/pwrite.texi>,
and slightly less clear references to pread() being broken can be
found on the development mailing list for git itself.

It is not completely clear what specific HP-UX versions are affected
by this. An autoconf run-time test may also be insufficient, because
the same binaries should be usable on machines with broken and
non-broken pread() implementations. So, to be safe, disable positional
I/O on HP-UX unconditionally.

Reviewed-on: http://gerrit.openafs.org/3949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 11b2c6d6fe4dbbf5a54ae1e08e979c35ab6b7fa0)

Change-Id: Iaa27ae965482aafd0f981e70ce33df438af650e9
Reviewed-on: http://gerrit.openafs.org/3964
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
acinclude.m4

index 0315f69e0e64c8431a000df1cbdc11a3c7e1aea3..891e75c02c7dfee7e869b9341e7c17b694c6151d 100644 (file)
@@ -1256,22 +1256,29 @@ AC_CHECK_FUNCS(setvbuf vsyslog getcwd)
 AC_CHECK_FUNCS(regcomp regexec regerror)
 AC_CHECK_FUNCS(fseeko64 ftello64 pread preadv pwrite pwritev)
 
-AC_MSG_CHECKING([for positional I/O])
-if test "$ac_cv_func_pread" = "yes" && \
-        test "$ac_cv_func_pwrite" = "yes"; then
-   AC_DEFINE(HAVE_PIO, 1, [define if you have pread() and pwrite()])
-   AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-fi
-AC_MSG_CHECKING([for vectored positional I/O])
-if test "$ac_cv_func_preadv" = "yes" && \
-        test "$ac_cv_func_pwritev" = "yes"; then
-   AC_DEFINE(HAVE_PIOV, 1, [define if you have preadv() and pwritev()])
-   AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-fi
+case $AFS_SYSNAME in
+*hp_ux* | *hpux*)
+   AC_MSG_WARN([Some versions of HP-UX have a buggy positional I/O implementation. Forcing no positional I/O.])
+   ;;
+*)
+   AC_MSG_CHECKING([for positional I/O])
+   if test "$ac_cv_func_pread" = "yes" && \
+           test "$ac_cv_func_pwrite" = "yes"; then
+      AC_DEFINE(HAVE_PIO, 1, [define if you have pread() and pwrite()])
+      AC_MSG_RESULT(yes)
+   else
+     AC_MSG_RESULT(no)
+   fi
+   AC_MSG_CHECKING([for vectored positional I/O])
+   if test "$ac_cv_func_preadv" = "yes" && \
+           test "$ac_cv_func_pwritev" = "yes"; then
+      AC_DEFINE(HAVE_PIOV, 1, [define if you have preadv() and pwritev()])
+      AC_MSG_RESULT(yes)
+   else
+     AC_MSG_RESULT(no)
+   fi
+   ;;
+esac
 
 AC_MSG_CHECKING([for POSIX regex library])
 if test "$ac_cv_header_regex_h" = "yes" && \