]> diplodocus.org Git - nmh/blob - h/nmh.h
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / h / nmh.h
1 /* nmh.h -- system configuration header file
2 */
3
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7
8 #include <unistd.h>
9 #include <stdio.h>
10 #include <ctype.h>
11 #ifndef NDEBUG
12 /* See etc/gen-ctype-checked.c. */
13 # include <sbr/ctype-checked.h>
14 #endif
15 #include <assert.h>
16
17 #ifdef HAVE_STDBOOL_H
18 # include <stdbool.h>
19 #else
20 # define bool int
21 # define true 1
22 # define false 0
23 #endif
24
25 #include <sys/stat.h>
26 #include <sys/wait.h>
27
28 # include <dirent.h>
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 #include <errno.h>
41
42 /*
43 * we should be getting this value from pathconf(_PC_PATH_MAX)
44 */
45 #ifndef PATH_MAX
46 # ifdef MAXPATHLEN
47 # define PATH_MAX MAXPATHLEN
48 # else
49 /* so we will just pick something */
50 # define PATH_MAX 1024
51 # endif
52 #endif
53
54 /*
55 * we should get this value from sysconf(_SC_NGROUPS_MAX)
56 */
57 #ifndef NGROUPS_MAX
58 # ifdef NGROUPS
59 # define NGROUPS_MAX NGROUPS
60 # else
61 # define NGROUPS_MAX 16
62 # endif
63 #endif
64
65 /*
66 * we should be getting this value from sysconf(_SC_OPEN_MAX)
67 */
68 #ifndef OPEN_MAX
69 # ifdef NOFILE
70 # define OPEN_MAX NOFILE
71 # else
72 /* so we will just pick something */
73 # define OPEN_MAX 64
74 # endif
75 #endif
76
77 #ifndef HAVE_GETLINE
78 ssize_t getline(char **lineptr, size_t *n, FILE *stream);
79 #endif