summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac25
-rw-r--r--openbsd-compat/bsd-misc.h2
2 files changed, 26 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a33acac85..b1b3bdacf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4025,6 +4025,8 @@ if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
4025 [define if you have struct addrinfo data type]) 4025 [define if you have struct addrinfo data type])
4026fi 4026fi
4027 4027
4028AC_HEADER_TIME
4029
4028AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ 4030AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
4029 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], 4031 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]],
4030 [[ struct timeval tv; tv.tv_sec = 1;]])], 4032 [[ struct timeval tv; tv.tv_sec = 1;]])],
@@ -4037,7 +4039,28 @@ if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
4037 have_struct_timeval=1 4039 have_struct_timeval=1
4038fi 4040fi
4039 4041
4040AC_CHECK_TYPES([struct timespec]) 4042AC_CACHE_CHECK([for struct timespec], ac_cv_have_struct_timespec, [
4043 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4044 #ifdef TIME_WITH_SYS_TIME
4045 # include <sys/time.h>
4046 # include <time.h>
4047 #else
4048 # ifdef HAVE_SYS_TIME_H
4049 # include <sys/time.h>
4050 # else
4051 # include <time.h>
4052 # endif
4053 #endif
4054 ]],
4055 [[ struct timespec ts; ts.tv_sec = 1;]])],
4056 [ ac_cv_have_struct_timespec="yes" ],
4057 [ ac_cv_have_struct_timespec="no"
4058 ])
4059])
4060if test "x$ac_cv_have_struct_timespec" = "xyes" ; then
4061 AC_DEFINE([HAVE_STRUCT_TIMESPEC], [1], [define if you have struct timespec])
4062 have_struct_timespec=1
4063fi
4041 4064
4042# We need int64_t or else certain parts of the compile will fail. 4065# We need int64_t or else certain parts of the compile will fail.
4043if test "x$ac_cv_have_int64_t" = "xno" && \ 4066if test "x$ac_cv_have_int64_t" = "xno" && \
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 7bf7b048a..3a7dd6f4c 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -88,10 +88,12 @@ struct timespec {
88#endif /* !HAVE_STRUCT_TIMESPEC */ 88#endif /* !HAVE_STRUCT_TIMESPEC */
89 89
90#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) 90#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
91# include <time.h>
91int nanosleep(const struct timespec *, struct timespec *); 92int nanosleep(const struct timespec *, struct timespec *);
92#endif 93#endif
93 94
94#ifndef HAVE_UTIMENSAT 95#ifndef HAVE_UTIMENSAT
96# include <time.h>
95/* start with the high bits and work down to minimise risk of overlap */ 97/* start with the high bits and work down to minimise risk of overlap */
96# ifndef AT_SYMLINK_NOFOLLOW 98# ifndef AT_SYMLINK_NOFOLLOW
97# define AT_SYMLINK_NOFOLLOW 0x80000000 99# define AT_SYMLINK_NOFOLLOW 0x80000000