aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-compat/openbsd-compat.h
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-11-17 20:48:27 +0100
committerGilles Chehade <gilles@poolp.org>2019-11-17 20:48:27 +0100
commit8fd35cfe468c22f8cc69bce7b65c59e0779fbad9 (patch)
tree95a72444bd4d7ce89bcef1a690ea409431c01943 /openbsd-compat/openbsd-compat.h
parentfix arc4random.c (diff)
downloadOpenSMTPD-8fd35cfe468c22f8cc69bce7b65c59e0779fbad9.tar.xz
OpenSMTPD-8fd35cfe468c22f8cc69bce7b65c59e0779fbad9.zip
conditionally build nanosec() and usleep()
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r--openbsd-compat/openbsd-compat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index ab23a933..be9b90e1 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -290,6 +290,24 @@ char * strnlen(const char *, size_t);
#endif
+
+#ifndef HAVE_STRUCT_TIMEVAL
+struct timeval {
+ long tv_sec;
+ long tv_usec;
+}
+#endif
+
+#ifdef NEED_NANOSLEEP
+#ifndef HAVE_STRUCT_TIMESPEC
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+#endif
+int nanosleep(const struct timespec *, struct timespec *);
+#endif
+
#ifdef NEED_SIGNAL
typedef void (*mysig_t)(int);
mysig_t mysignal(int sig, mysig_t act);
@@ -300,5 +318,8 @@ mysig_t mysignal(int sig, mysig_t act);
const char *strerror(int);
#endif
+#ifdef NEED_USLEEP
+int usleep(unsigned int useconds);
+#endif
#endif /* _OPENBSD_COMPAT_H */