/* Define to 1 if you have the `getgrset' function. */
#undef HAVE_GETGRSET
+/* Define to 1 if you have the `gethrtime' function. */
+#undef HAVE_GETHRTIME
+
/* Define to 1 if you have the `getifaddrs' function. */
#undef HAVE_GETIFADDRS
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
- for ac_func in pstat_getproc
+ for ac_func in pstat_getproc gethrtime
do :
- ac_fn_c_check_func "$LINENO" "pstat_getproc" "ac_cv_func_pstat_getproc"
-if test "x$ac_cv_func_pstat_getproc" = xyes; then :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+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
-#define HAVE_PSTAT_GETPROC 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
;;
esac
- for ac_func in pstat_getproc
+ for ac_func in pstat_getproc gethrtime
do :
- ac_fn_c_check_func "$LINENO" "pstat_getproc" "ac_cv_func_pstat_getproc"
-if test "x$ac_cv_func_pstat_getproc" = xyes; then :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+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
-#define HAVE_PSTAT_GETPROC 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
- AC_CHECK_FUNCS([pstat_getproc])
+ AC_CHECK_FUNCS([pstat_getproc gethrtime])
;;
*-*-hpux*)
AC_DEFINE([PAM_SUN_CODEBASE])
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
;;
esac
- AC_CHECK_FUNCS([pstat_getproc])
+ AC_CHECK_FUNCS([pstat_getproc gethrtime])
;;
*-dec-osf*)
# ignore envariables wrt dynamic lib path
}
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__)
int
sudo_gettime_mono_v1(struct timespec *ts)
}
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__)
int
sudo_gettime_awake_v1(struct timespec *ts)