HP-UX doesn't suport CLOCK_MONOTONIC but we can use gethrtime() instead.
This commit is contained in:
@@ -298,6 +298,9 @@
|
|||||||
/* Define to 1 if you have the `getgrset' function. */
|
/* Define to 1 if you have the `getgrset' function. */
|
||||||
#undef HAVE_GETGRSET
|
#undef HAVE_GETGRSET
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `gethrtime' function. */
|
||||||
|
#undef HAVE_GETHRTIME
|
||||||
|
|
||||||
/* Define to 1 if you have the `getifaddrs' function. */
|
/* Define to 1 if you have the `getifaddrs' function. */
|
||||||
#undef HAVE_GETIFADDRS
|
#undef HAVE_GETIFADDRS
|
||||||
|
|
||||||
|
18
configure
vendored
18
configure
vendored
@@ -15604,12 +15604,13 @@ _ACEOF
|
|||||||
# HP-UX won't unlink a shared lib that is open
|
# HP-UX won't unlink a shared lib that is open
|
||||||
INSTALL_BACKUP='~'
|
INSTALL_BACKUP='~'
|
||||||
|
|
||||||
for ac_func in pstat_getproc
|
for ac_func in pstat_getproc gethrtime
|
||||||
do :
|
do :
|
||||||
ac_fn_c_check_func "$LINENO" "pstat_getproc" "ac_cv_func_pstat_getproc"
|
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
if test "x$ac_cv_func_pstat_getproc" = xyes; then :
|
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||||
|
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
#define HAVE_PSTAT_GETPROC 1
|
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -15720,12 +15721,13 @@ $as_echo "$sudo_cv_var_daportable" >&6; }
|
|||||||
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
|
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
for ac_func in pstat_getproc
|
for ac_func in pstat_getproc gethrtime
|
||||||
do :
|
do :
|
||||||
ac_fn_c_check_func "$LINENO" "pstat_getproc" "ac_cv_func_pstat_getproc"
|
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
if test "x$ac_cv_func_pstat_getproc" = xyes; then :
|
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||||
|
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
#define HAVE_PSTAT_GETPROC 1
|
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@@ -1875,7 +1875,7 @@ case "$host" in
|
|||||||
# HP-UX won't unlink a shared lib that is open
|
# HP-UX won't unlink a shared lib that is open
|
||||||
INSTALL_BACKUP='~'
|
INSTALL_BACKUP='~'
|
||||||
|
|
||||||
AC_CHECK_FUNCS([pstat_getproc])
|
AC_CHECK_FUNCS([pstat_getproc gethrtime])
|
||||||
;;
|
;;
|
||||||
*-*-hpux*)
|
*-*-hpux*)
|
||||||
AC_DEFINE([PAM_SUN_CODEBASE])
|
AC_DEFINE([PAM_SUN_CODEBASE])
|
||||||
@@ -1954,7 +1954,7 @@ case "$host" in
|
|||||||
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
|
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AC_CHECK_FUNCS([pstat_getproc])
|
AC_CHECK_FUNCS([pstat_getproc gethrtime])
|
||||||
;;
|
;;
|
||||||
*-dec-osf*)
|
*-dec-osf*)
|
||||||
# ignore envariables wrt dynamic lib path
|
# ignore envariables wrt dynamic lib path
|
||||||
|
@@ -111,6 +111,18 @@ sudo_gettime_mono_v1(struct timespec *ts)
|
|||||||
}
|
}
|
||||||
debug_return_int(0);
|
debug_return_int(0);
|
||||||
}
|
}
|
||||||
|
#elif defined(HAVE_GETHRTIME)
|
||||||
|
int
|
||||||
|
sudo_gettime_mono_v1(struct timespec *ts)
|
||||||
|
{
|
||||||
|
hrtime_t nsec;
|
||||||
|
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL)
|
||||||
|
|
||||||
|
nsec = gethrtime();
|
||||||
|
ts->tv_sec = nsec / 1000000000;
|
||||||
|
ts->tv_nsec = nsec % 1000000000;
|
||||||
|
debug_return_int(0);
|
||||||
|
}
|
||||||
#elif defined(__MACH__)
|
#elif defined(__MACH__)
|
||||||
int
|
int
|
||||||
sudo_gettime_mono_v1(struct timespec *ts)
|
sudo_gettime_mono_v1(struct timespec *ts)
|
||||||
@@ -167,6 +179,19 @@ sudo_gettime_awake_v1(struct timespec *ts)
|
|||||||
}
|
}
|
||||||
debug_return_int(0);
|
debug_return_int(0);
|
||||||
}
|
}
|
||||||
|
#elif defined(HAVE_GETHRTIME)
|
||||||
|
int
|
||||||
|
sudo_gettime_awake_v1(struct timespec *ts)
|
||||||
|
{
|
||||||
|
hrtime_t nsec;
|
||||||
|
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL)
|
||||||
|
|
||||||
|
/* Currently the same as sudo_gettime_mono() */
|
||||||
|
nsec = gethrtime();
|
||||||
|
ts->tv_sec = nsec / 1000000000;
|
||||||
|
ts->tv_nsec = nsec % 1000000000;
|
||||||
|
debug_return_int(0);
|
||||||
|
}
|
||||||
#elif defined(__MACH__)
|
#elif defined(__MACH__)
|
||||||
int
|
int
|
||||||
sudo_gettime_awake_v1(struct timespec *ts)
|
sudo_gettime_awake_v1(struct timespec *ts)
|
||||||
|
Reference in New Issue
Block a user