1 /*
2  * os.h: getting the OS includes we need with the help of autoconf results
3  *
4  * Copyright(c) 1997-2000 - All Rights Reserved
5  *
6  * See the COPYRIGHT file.
7  */
8 
9 #include "setup.h"
10 
11 #if HAVE_STDIO_H
12 # include <stdio.h>
13 #endif
14 
15 #if HAVE_STDLIB_H
16 # include <stdlib.h>
17 #endif
18 
19 #if HAVE_UNISTD_H
20 # include <unistd.h>
21 #endif
22 
23 #include <errno.h>
24 
25 #include <ctype.h>
26 #include <assert.h>
27 
28 #include <sys/ioctl.h>	/* used to be checked for by configure */
29 #include <sys/stat.h>
30 #include <fcntl.h>	/* for open() in term.c, and for server.c */
31 #include <sys/ioctl.h>	/* for ioctl() in term.c */
32 #include <termios.h>
33 
34 #include <signal.h>
35 
36 #ifdef HAVE_STRINGS_H
37 # include <strings.h>
38 #endif
39 
40 #if STDC_HEADERS
41 # include <string.h>
42 #else
43 # ifndef HAVE_STRCHR
44 #  define strchr index
45 #  define strrchr rindex
46 # endif
47           char *strchr (), *strrchr ();
48 # ifndef HAVE_MEMCPY
49 #  define memcpy(d, s, n) bcopy ((s), (d), (n))
50 #  define memmove(d, s, n) bcopy ((s), (d), (n))
51 # endif
52 #endif
53 
54 #if TIME_WITH_SYS_TIME
55 # include <sys/time.h>
56 # include <time.h>
57 #else
58 # if HAVE_SYS_TIME_H
59 #  include <sys/time.h>
60 # else
61 #  include <time.h>
62 # endif
63 #endif
64 
65 #include <stdarg.h>
66 
67 #include <sys/types.h>
68 
69 #if defined(HAVE_SYS_SELECT_H)
70 # include <sys/select.h>
71 #endif
72 
73 #include <netdb.h>
74 #include <sys/socket.h>
75 #include <netinet/in.h>
76 #include <arpa/inet.h>
77 
78 #if !defined(INADDR_NONE)
79 # define INADDR_NONE (unsigned long) -1
80 #endif
81 
82 #ifdef BIND_HATRED
83 # undef inet_ntoa
84 # undef inet_addr
85 #endif
86 
87 #if defined(UNSIGNED_LONG32) || defined(UNSIGNED_UNKNOWN32)
88 typedef	unsigned long	u_32int_t;
89 #endif
90 #ifdef UNSIGNED_INT32
91 typedef	unsigned int	u_32int_t;
92 #endif
93 
94 #if defined(HAVE_REGEX_H) && !defined(USE_GNU_RX)
95 # define HAVE_REGEXP
96 # include <regex.h>
97 #endif
98 
99 #if defined(USE_GNU_RX) && !defined(SDNS)
100 # include <rxposix.h>
101 # if !defined(rx_version_string)
102     extern char rx_version_string[];
103 # endif
104 #endif
105 
106 #if defined(__NetBSD__)
107 # include <sys/param.h>
108 # if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 104120000)
109 #   define PUTS_ARG_TYPE (void (*)(int))
110 # else
111 	/* NetBSD's prototype for tputs is fixed as of 1.4K */
112 #   define PUTS_ARG_TYPE
113 # endif
114 #else
115 # define PUTS_ARG_TYPE
116 #endif
117 
118 #if defined(HAVE_PTHREAD_H)
119 # include <pthread.h>
120 #endif
121 
122 #if defined(GNU_PTH)
123 # include <pth.h>
124 #endif
125