]> diplodocus.org Git - nmh/blob - h/nmh.h
Add back missing include of <sys/wait.h>
[nmh] / h / nmh.h
1
2 /*
3 * nmh.h -- system configuration header file
4 */
5
6 #include <config.h>
7
8 #include <unistd.h>
9 #include <stdio.h>
10 #include <ctype.h>
11 #include <sys/stat.h>
12
13 #if HAVE_DIRENT_H
14 # include <dirent.h>
15 # define NLENGTH(dirent) strlen((dirent)->d_name)
16 #else
17 # define dirent direct
18 # define NLENGTH(dirent) (dirent)->d_namlen
19 # if HAVE_SYS_NDIR_H
20 # include <sys/ndir.h>
21 # endif
22 # if HAVE_SYS_DIR_H
23 # include <sys/dir.h>
24 # endif
25 # if HAVE_NDIR_H
26 # include <ndir.h>
27 # endif
28 #endif
29
30 #include <stdlib.h>
31 #include <stdarg.h>
32 #include <string.h>
33
34 #ifdef HAVE_SYS_PARAM_H
35 # include <sys/param.h>
36 #endif
37
38 # include <locale.h>
39 # include <limits.h>
40
41 /*
42 * symbolic constants for lseek and fseek
43 */
44 #ifndef SEEK_SET
45 # define SEEK_SET 0
46 #endif
47 #ifndef SEEK_CUR
48 # define SEEK_CUR 1
49 #endif
50 #ifndef SEEK_END
51 # define SEEK_END 2
52 #endif
53
54 /*
55 * we should be getting this value from pathconf(_PC_PATH_MAX)
56 */
57 #ifndef PATH_MAX
58 # ifdef MAXPATHLEN
59 # define PATH_MAX MAXPATHLEN
60 # else
61 /* so we will just pick something */
62 # define PATH_MAX 1024
63 # endif
64 #endif
65
66 /*
67 * we should get this value from sysconf(_SC_NGROUPS_MAX)
68 */
69 #ifndef NGROUPS_MAX
70 # ifdef NGROUPS
71 # define NGROUPS_MAX NGROUPS
72 # else
73 # define NGROUPS_MAX 16
74 # endif
75 #endif
76
77 /*
78 * we should be getting this value from sysconf(_SC_OPEN_MAX)
79 */
80 #ifndef OPEN_MAX
81 # ifdef NOFILE
82 # define OPEN_MAX NOFILE
83 # else
84 /* so we will just pick something */
85 # define OPEN_MAX 64
86 # endif
87 #endif
88
89 #include <signal.h>
90
91 #define bcmp(b1,b2,length) memcmp(b1, b2, length)
92 #define bcopy(b1,b2,length) memcpy (b2, b1, length)
93 #define bcpy(b1,b2,length) memcmp (b1, b2, length)
94 #define bzero(b,length) memset (b, 0, length)
95
96 /*
97 * If your stat macros are broken,
98 * we will just undefine them.
99 */
100 #ifdef STAT_MACROS_BROKEN
101 # ifdef S_ISBLK
102 # undef S_ISBLK
103 # endif
104 # ifdef S_ISCHR
105 # undef S_ISCHR
106 # endif
107 # ifdef S_ISDIR
108 # undef S_ISDIR
109 # endif
110 # ifdef S_ISFIFO
111 # undef S_ISFIFO
112 # endif
113 # ifdef S_ISLNK
114 # undef S_ISLNK
115 # endif
116 # ifdef S_ISMPB
117 # undef S_ISMPB
118 # endif
119 # ifdef S_ISMPC
120 # undef S_ISMPC
121 # endif
122 # ifdef S_ISNWK
123 # undef S_ISNWK
124 # endif
125 # ifdef S_ISREG
126 # undef S_ISREG
127 # endif
128 # ifdef S_ISSOCK
129 # undef S_ISSOCK
130 # endif
131 #endif /* STAT_MACROS_BROKEN. */
132