return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_DIRFD 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5
$as_echo "not usable" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock" >&5
$as_echo_n "checking for flock... " >&6; }
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOCK 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5
$as_echo "not usable" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysctl" >&5
$as_echo_n "checking for sysctl... " >&6; }
dnl check for dirfd()
AC_MSG_CHECKING(for dirfd)
-AC_TRY_COMPILE(
+AC_TRY_LINK(
[#include <sys/types.h>
#include <dirent.h>],
[DIR * dir=opendir("dirname"); dirfd(dir);],
dnl check for flock()
AC_MSG_CHECKING(for flock)
-AC_TRY_COMPILE(
+AC_TRY_LINK(
[#include <sys/file.h>],
[flock(10, LOCK_SH);],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOCK), AC_MSG_RESULT(not usable))
// Is there any system that doesn't have access()?
#define USE_MCH_ACCESS
+#if defined(__hpux) && !defined(HAVE_DIRFD)
+# define dirfd(x) ((x)->__dd_fd)
+# define HAVE_DIRFD
+#endif
+
static char_u *next_fenc(char_u **pp, int *alloced);
#ifdef FEAT_EVAL
static char_u *readfile_charconvert(char_u *fname, char_u *fenc, int *fdp);
EXTERN int sc_col; // column for shown command
#ifdef TEMPDIRNAMES
-# if defined(UNIX) && defined(HAVE_FLOCK) && defined(HAVE_DIRFD)
+# if defined(UNIX) && defined(HAVE_FLOCK) \
+ && (defined(HAVE_DIRFD) || defined(__hpux))
EXTERN DIR *vim_tempdir_dp INIT(= NULL); // File descriptor of temp dir
# endif
EXTERN char_u *vim_tempdir INIT(= NULL); // Name of Vim's own temp dir.