xref: /freebsd/contrib/ntp/include/ntp_io.h (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1 #if !defined _NTP_IO_H
2 #define _NTP_IO_H
3 /*
4  * POSIX says use <fnct.h> to get O_* symbols and
5  * SEEK_SET symbol form <unistd.h>.
6  */
7 #ifdef HAVE_CONFIG_H
8 # include <config.h>
9 #endif
10 
11 #ifdef HAVE_SYS_TYPES_H
12 # include <sys/types.h>
13 #endif
14 #ifdef HAVE_UNISTD_H
15 # include <unistd.h>
16 #endif
17 #include <stdio.h>
18 #ifdef HAVE_SYS_FILE_H
19 # include <sys/file.h>
20 #endif
21 #ifdef HAVE_FCNTL_H
22 # include <fcntl.h>
23 #endif
24 #if !defined(SEEK_SET) && defined(L_SET)
25 # define SEEK_SET L_SET
26 #endif
27 
28 #ifdef SYS_WINNT
29 # include <io.h>
30 # include "win32_io.h"
31 #endif
32 
33 /*
34  * Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
35  * to (and can).  This is here initially for QNX, but may help for
36  * others as well...
37  */
38 #ifndef FNDELAY
39 # ifdef O_NONBLOCK
40 #  define FNDELAY O_NONBLOCK
41 # endif
42 #endif
43 
44 #ifndef FASYNC
45 # ifdef O_ASYNC
46 #  define FASYNC O_ASYNC
47 # endif
48 #endif
49 
50 #endif
51