summaryrefslogtreecommitdiff
path: root/include/ntp_io.h
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2008-08-17 17:37:33 +0000
committerOllivier Robert <roberto@FreeBSD.org>2008-08-17 17:37:33 +0000
commitcce65f439697627afbccf5a67035a957bb4d784a (patch)
tree16d100fbc9dae63888d48b464e471ba0e5065193 /include/ntp_io.h
parent8c24a1e0ffd629427f94da1b681600008030c41a (diff)
Notes
Diffstat (limited to 'include/ntp_io.h')
-rw-r--r--include/ntp_io.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/ntp_io.h b/include/ntp_io.h
new file mode 100644
index 000000000000..983c6c7dce85
--- /dev/null
+++ b/include/ntp_io.h
@@ -0,0 +1,50 @@
+#if !defined _NTP_IO_H
+#define _NTP_IO_H
+/*
+ * POSIX says use <fnct.h> to get O_* symbols and
+ * SEEK_SET symbol form <unistd.h>.
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#if !defined(SEEK_SET) && defined(L_SET)
+# define SEEK_SET L_SET
+#endif
+
+#ifdef SYS_WINNT
+# include <io.h>
+# include "win32_io.h"
+#endif
+
+/*
+ * Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
+ * to (and can). This is here initially for QNX, but may help for
+ * others as well...
+ */
+#ifndef FNDELAY
+# ifdef O_NONBLOCK
+# define FNDELAY O_NONBLOCK
+# endif
+#endif
+
+#ifndef FASYNC
+# ifdef O_ASYNC
+# define FASYNC O_ASYNC
+# endif
+#endif
+
+#endif