rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

system.h
Go to the documentation of this file.
1
5 #ifndef H_SYSTEM
6 #define H_SYSTEM
7
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11
12 #if HAVE_SYSLOG_H
13 #include <syslog.h>
14 #endif
15
16 #include <sys/types.h>
17
18 #if defined(__LCLINT__)
19 /*@-redef@*/
20 typedef unsigned int u_int32_t;
21 typedef unsigned short u_int16_t;
22 typedef unsigned char u_int8_t;
23 /*@-incondefs@*/ /* LCLint 3.0.0.15 */
24 typedef int int32_t;
25 /*@=incondefs@*/
26 /* XXX from /usr/include/bits/sigset.h */
27 /*@-sizeoftype@*/
28 # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
29 typedef struct
30 {
31 unsigned long int __val[_SIGSET_NWORDS];
32 } __sigset_t;
33 /*@=sizeoftype@*/
34 /*@=redef@*/
35 #endif
36
37 #include <sys/stat.h>
38 #include <stdio.h>
39
40 #ifdef HAVE_SYS_PARAM_H
41 #include <sys/param.h>
42 #endif
43
44 /* <unistd.h> should be included before any preprocessor test
45 of _POSIX_VERSION. */
46 #ifdef HAVE_UNISTD_H
47 #include <unistd.h>
48 #if defined(__LCLINT__)
49 /*@-superuser -declundef -incondefs @*/ /* LCL: modifies clause missing */
50 extern int chroot (const char *__path)
51 /*@globals errno, systemState @*/
52 /*@modifies errno, systemState @*/;
53 /*@=superuser =declundef =incondefs @*/
54 #endif
55 #if !defined(__GLIBC__) && !defined(__LCLINT__)
56 #ifdef __APPLE__
57 #include <crt_externs.h>
58 #define environ (*_NSGetEnviron())
59 #else
60 extern char ** environ;
61 #endif /* __APPLE__ */
62 #endif
63 #endif
64
65 #ifdef TIME_WITH_SYS_TIME
66 # include <sys/time.h>
67 # include <time.h>
68 #else
69 # ifdef HAVE_SYS_TIME_H
70 # include <sys/time.h>
71 # else
72 # include <time.h>
73 # endif
74 #endif
75
76 /* Since major is a function on SVR4, we can't use `ifndef major'. */
77 #if defined(MAJOR_IN_MKDEV)
78 #include <sys/mkdev.h>
79 #define HAVE_MAJOR
80 #endif
81 #if defined(MAJOR_IN_SYSMACROS)
82 #include <sys/sysmacros.h>
83 #define HAVE_MAJOR
84 #endif
85 #ifdef major /* Might be defined in sys/types.h. */
86 #define HAVE_MAJOR
87 #endif
88
89 #ifndef HAVE_MAJOR
90 #define major(dev) (((dev) >> 8) & 0xff)
91 #define minor(dev) ((dev) & 0xff)
92 #define makedev(maj, min) (((maj) << 8) | (min))
93 #endif
94 #undef HAVE_MAJOR
95
96 #ifdef HAVE_UTIME_H
97 #include <utime.h>
98 #endif
99
100 #ifdef HAVE_STRING_H
101 # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
102 # include <memory.h>
103 # endif
104 # include <string.h>
105 #else
106 # include <strings.h>
107 char *memchr ();
108 #endif
109
110 #if !defined(HAVE_STPCPY)
111 char * stpcpy(/*@out@*/ char * dest, const char * src);
112 #endif
113
114 #if !defined(HAVE_STPNCPY)
115 char * stpncpy(/*@out@*/ char * dest, const char * src, size_t n);
116 #endif
117
118 #include <errno.h>
119 #ifndef errno
120 /*@-declundef @*/
121 extern int errno;
122 /*@=declundef @*/
123 #endif
124
125 #if defined(__LCLINT__)
126 /*@-declundef @*/
127 /*@exits@*/
128 extern void error(int status, int errnum, const char *format, ...)
129 __attribute__ ((__format__ (__printf__, 3, 4)))
130 /*@globals fileSystem @*/
131 /*@modifies fileSystem @*/;
132 /*@=declundef @*/
133 #else
134 #if defined(HAVE_ERROR) && defined(HAVE_ERROR_H)
135 #include <error.h>
136 #endif
137 #endif
138
139 #if defined(HAVE___SECURE_GETENV) && !defined(__LCLINT__)
140 #define getenv(_s) __secure_getenv(_s)
141 #endif
142
143 #ifdef STDC_HEADERS
144 /*@-macrounrecog -incondefs -globuse -mustmod @*/ /* FIX: shrug */
145 #define getopt system_getopt
146 /*@=macrounrecog =incondefs =globuse =mustmod @*/
147 /*@-skipansiheaders@*/
148 #include <stdlib.h>
149 /*@=skipansiheaders@*/
150 #undef getopt
151 #if defined(__LCLINT__)
152 /*@-declundef -incondefs @*/ /* LCL: modifies clause missing */
153 extern char * realpath (const char * file_name, /*@out@*/ char * resolved_name)
154 /*@globals errno, fileSystem @*/
155 /*@requires maxSet(resolved_name) >= (PATH_MAX - 1); @*/
156 /*@modifies *resolved_name, errno, fileSystem @*/;
157 /*@=declundef =incondefs @*/
158 #endif
159 #else /* not STDC_HEADERS */
160 char *getenv (const char *name);
161 #if !defined(HAVE_REALPATH)
162 char *realpath(const char *path, char resolved_path []);
163 #endif
164 #endif /* STDC_HEADERS */
165
166 /* XXX solaris2.5.1 has not */
167 #if !defined(EXIT_FAILURE)
168 #define EXIT_FAILURE 1
169 #endif
170
171 #ifdef HAVE_FCNTL_H
172 #include <fcntl.h>
173 #else
174 #include <sys/file.h>
175 #endif
176
177 #if !defined(SEEK_SET) && !defined(__LCLINT__)
178 #define SEEK_SET 0
179 #define SEEK_CUR 1
180 #define SEEK_END 2
181 #endif
182 #if !defined(F_OK) && !defined(__LCLINT__)
183 #define F_OK 0
184 #define X_OK 1
185 #define W_OK 2
186 #define R_OK 4
187 #endif
188
189 #ifdef HAVE_SIGNAL_H
190 # include <signal.h>
191 #endif
192
193 #ifdef HAVE_DIRENT_H
194 # include <dirent.h>
195 # define NLENGTH(direct) (strlen((direct)->d_name))
196 #else /* not HAVE_DIRENT_H */
197 # define dirent direct
198 # define NLENGTH(direct) ((direct)->d_namlen)
199 # ifdef HAVE_SYS_NDIR_H
200 # include <sys/ndir.h>
201 # endif /* HAVE_SYS_NDIR_H */
202 # ifdef HAVE_SYS_DIR_H
203 # include <sys/dir.h>
204 # endif /* HAVE_SYS_DIR_H */
205 # ifdef HAVE_NDIR_H
206 # include <ndir.h>
207 # endif /* HAVE_NDIR_H */
208 #endif /* HAVE_DIRENT_H */
209
210 #if defined(__LCLINT__)
211 /*@-declundef -incondefs @*/ /* LCL: missing annotation */
212 /*@only@*/ /*@out@*/ void * alloca (size_t __size)
213 /*@ensures maxSet(result) == (__size - 1) @*/
214 /*@*/;
215 /*@=declundef =incondefs @*/
216 #endif
217
218 #ifdef __GNUC__
219 # undef alloca
220 # define alloca __builtin_alloca
221 #else
222 # ifdef HAVE_ALLOCA_H
223 # include <alloca.h>
224 # else
225 # ifndef _AIX
226 /* AIX alloca decl has to be the first thing in the file, bletch! */
227 char *alloca ();
228 # endif
229 # endif
230 #endif
231
232 #if defined (__GLIBC__) && defined(__LCLINT__)
233 /*@-declundef@*/
234 /*@unchecked@*/
235 extern __const __int32_t *__ctype_tolower;
236 /*@unchecked@*/
237 extern __const __int32_t *__ctype_toupper;
238 /*@=declundef@*/
239 #endif
240
241 #include <ctype.h>
242
243 #if defined (__GLIBC__) && defined(__LCLINT__)
244 /*@-exportlocal@*/
245 extern int isalnum(int) __THROW /*@*/;
246 extern int iscntrl(int) __THROW /*@*/;
247 extern int isgraph(int) __THROW /*@*/;
248 extern int islower(int) __THROW /*@*/;
249 extern int ispunct(int) __THROW /*@*/;
250 extern int isxdigit(int) __THROW /*@*/;
251 extern int isascii(int) __THROW /*@*/;
252 extern int toascii(int) __THROW /*@*/;
253 extern int _toupper(int) __THROW /*@*/;
254 extern int _tolower(int) __THROW /*@*/;
255 /*@=exportlocal@*/
256
257 #endif
258
259 #if defined(HAVE_SYS_MMAN_H) && !defined(__LCLINT__)
260 #include <sys/mman.h>
261 #endif
262
263 #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
264 #define MAP_ANONYMOUS MAP_ANON
265 #endif
266
267 /* XXX FIXME: popt on sunos4.1.3: <sys/resource.h> requires <sys/time.h> */
268 #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_SYS_TIME_H)
269 #include <sys/resource.h>
270 #endif
271
272 #if defined(HAVE_SYS_UTSNAME_H)
273 #include <sys/utsname.h>
274 #endif
275
276 #if defined(HAVE_SYS_WAIT_H)
277 #include <sys/wait.h>
278 #endif
279
280 #if defined(HAVE_GETOPT_H)
281 /*@-noparams@*/
282 #include <getopt.h>
283 /*@=noparams@*/
284 #endif
285
286 #if defined(HAVE_GRP_H)
287 #include <grp.h>
288 #endif
289
290 #if defined(HAVE_LIMITS_H)
291 #include <limits.h>
292 #endif
293
294 #if defined(HAVE_ERR_H)
295 #include <err.h>
296 #endif
297
298 #if defined(HAVE_LIBGEN_H)
299 #include <libgen.h>
300 #endif
301
302 #if defined(WITH_SELINUX)
303 #include <selinux/selinux.h>
304 #else
305 typedef char * security_context_t;
306
307 #define freecon(_c) do {} while(0)
308
309 #define getfilecon(_fn, _c) (-1)
310 #define lgetfilecon(_fn, _c) (-1)
311 #define fgetfilecon(_fd, _c) (-1)
312
313 #define setfilecon(_fn, _c) (-1)
314 #define lsetfilecon(_fn, _c) (-1)
315 #define fsetfilecon(_fd, _c) (-1)
316
317 #define security_check_context(_c) (0)
318
319 #define is_selinux_enabled() (-1)
320
321 #define rpm_execcon(_v, _fn, _av, _envp) (0)
322
323 #define matchpathcon_init(_fn) (-1)
324 #define matchpathcon(_fn, _fmode, _s) (-1)
325 #define matchpathcon_fini() do {} while(0)
326 #endif
327
328 #if defined(WITH_SELINUX) && defined(__LCLINT__)
329 /*@-incondefs@*/
330 extern void freecon(/*@only@*/ security_context_t con)
331 /*@modifies con @*/;
332
333 extern int getfilecon(const char *path, /*@out@*/ security_context_t *con)
334 /*@modifies *con @*/;
335 extern int lgetfilecon(const char *path, /*@out@*/ security_context_t *con)
336 /*@modifies *con @*/;
337 extern int fgetfilecon(int fd, /*@out@*/ security_context_t *con)
338 /*@modifies *con @*/;
339
340 extern int setfilecon(const char *path, security_context_t con)
341 /*@globals fileSystem @*/
342 /*@modifies fileSystem @*/;
343 extern int lsetfilecon(const char *path, security_context_t con)
344 /*@globals fileSystem @*/
345 /*@modifies fileSystem @*/;
346 extern int fsetfilecon(int fd, security_context_t con)
347 /*@globals fileSystem @*/
348 /*@modifies fileSystem @*/;
349
350 extern int getcon(/*@out@*/ security_context_t *con)
351 /*@modifies *con @*/;
352 extern int getexeccon(/*@out@*/ security_context_t *con)
353 /*@modifies *con @*/;
354 extern int setexeccon(security_context_t con)
355 /*@globals fileSystem @*/
356 /*@modifies fileSystem @*/;
357
358 extern int security_check_context(security_context_t con)
359 /*@globals fileSystem @*/
360 /*@modifies fileSystem @*/;
361 extern int security_getenforce(void)
362 /*@globals fileSystem @*/
363 /*@modifies fileSystem @*/;
364
365 extern int is_selinux_enabled(void)
366 /*@globals fileSystem @*/
367 /*@modifies fileSystem @*/;
368 /*@=incondefs@*/
369 #endif
370
371 /*@-declundef -incondefs @*/ /* FIX: these are macros */
374 /*@mayexit@*/ /*@only@*/ /*@out@*/ void * xmalloc (size_t size)
375 /*@globals errno @*/
376 /*@ensures maxSet(result) == (size - 1) @*/
377 /*@modifies errno @*/;
378
381 /*@mayexit@*/ /*@only@*/ void * xcalloc (size_t nmemb, size_t size)
382 /*@ensures maxSet(result) == (nmemb - 1) @*/
383 /*@*/;
384
388 /*@mayexit@*/ /*@only@*/ void * xrealloc (/*@null@*/ /*@only@*/ void * ptr,
389 size_t size)
390 /*@ensures maxSet(result) == (size - 1) @*/
391 /*@modifies *ptr @*/;
392
395 /*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str)
396 /*@*/;
397 /*@=declundef =incondefs @*/
398
401 /*@unused@*/ /*@exits@*/ /*@only@*/ void * vmefail(size_t size)
402 /*@*/;
403
404 #if defined(HAVE_MCHECK_H)
405 #include <mcheck.h>
406 #if defined(__LCLINT__)
407 /*@-declundef -incondefs @*/ /* LCL: missing annotations */
408 #if 0
409 enum mcheck_status
410 {
411 MCHECK_DISABLED = -1, /* Consistency checking is not turned on. */
412 MCHECK_OK, /* Block is fine. */
413 MCHECK_FREE, /* Block freed twice. */
414 MCHECK_HEAD, /* Memory before the block was clobbered. */
415 MCHECK_TAIL /* Memory after the block was clobbered. */
416 };
417 #endif
418
419 extern int mcheck (void (*__abortfunc) (enum mcheck_status))
420 /*@globals internalState@*/
421 /*@modifies internalState @*/;
422 extern int mcheck_pedantic (void (*__abortfunc) (enum mcheck_status))
423 /*@globals internalState@*/
424 /*@modifies internalState @*/;
425 extern void mcheck_check_all (void)
426 /*@globals internalState@*/
427 /*@modifies internalState @*/;
428 extern enum mcheck_status mprobe (void *__ptr)
429 /*@globals internalState@*/
430 /*@modifies internalState @*/;
431 extern void mtrace (void)
432 /*@globals internalState@*/
433 /*@modifies internalState @*/;
434 extern void muntrace (void)
435 /*@globals internalState@*/
436 /*@modifies internalState @*/;
437 /*@=declundef =incondefs @*/
438 #endif /* defined(__LCLINT__) */
439
440 /* Memory allocation via macro defs to get meaningful locations from mtrace() */
441 #if defined(__GNUC__)
442 #define xmalloc(_size) (malloc(_size) ? : vmefail(_size))
443 #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail(_size))
444 #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail(_size))
445 #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail(strlen(_str)+1)), (_str)))
446 #endif /* defined(__GNUC__) */
447 #endif /* HAVE_MCHECK_H */
448
449 /* Retrofit glibc __progname */
450 #if defined __GLIBC__ && __GLIBC__ >= 2
451 #if __GLIBC_MINOR__ >= 1
452 #define __progname __assert_program_name
453 #endif
454 #define setprogname(pn)
455 #else
456 #define __progname program_name
457 #define setprogname(pn) \
458 { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
459 else __progname = pn; \
460 }
461 #endif
462 /*@unchecked@*/
463 extern const char *__progname;
464
465 #if defined(HAVE_NETDB_H)
466 #include <netdb.h>
467 #endif
468
469 #if defined(HAVE_NETINET_IN_H)
470 #include <netinet/in.h>
471 #endif
472 #if defined(HAVE_ARPA_INET_H)
473 #include <arpa/inet.h>
474 #endif
475
476 #if defined(HAVE_PWD_H)
477 #include <pwd.h>
478 #endif
479
480 /* Take care of NLS matters. */
481
482 #if defined(HAVE_LOCALE_H)
483 # include <locale.h>
484 #endif
485 #if !defined(HAVE_SETLOCALE)
486 # define setlocale(Category, Locale) /* empty */
487 #endif
488
489 #if defined(ENABLE_NLS) && !defined(__LCLINT__)
490 # include <libintl.h>
491 # define _(Text) dgettext (PACKAGE, Text)
492 # define D_(Text) Text
493 #else
494 # undef bindtextdomain
495 # define bindtextdomain(Domain, Directory) /* empty */
496 # undef textdomain
497 # define textdomain(Domain) /* empty */
498 # define _(Text) Text
499 # define D_(Text) Text
500 # undef dgettext
501 # define dgettext(DomainName, Text) Text
502 #endif
503
504 #define N_(Text) Text
505
506 /* ============== from misc/miscfn.h */
507
508 /*@-noparams@*/
509 #include "rpmio/glob.h"
510 #include "rpmio/fnmatch.h"
511 /*@=noparams@*/
512
513 #if defined(__LCLINT__)
514 /*@-declundef -incondefs @*/ /* LCL: missing annotation */
515 #if 0
516 typedef /*@concrete@*/ struct
517 {
518 size_t gl_pathc;
519 char **gl_pathv;
520 size_t gl_offs;
521 int gl_flags;
522
523 void (*gl_closedir) (void *);
524 #ifdef _GNU_SOURCE
525 struct dirent *(*gl_readdir) (void *);
526 #else
527 void *(*gl_readdir) (void *);
528 #endif
529 ptr_t (*gl_opendir) (const char *);
530 #ifdef _GNU_SOURCE
531 int (*gl_lstat) (const char *restrict, struct stat *restrict);
532 int (*gl_stat) (const char *restrict, struct stat *restrict);
533 #else
534 int (*gl_lstat) (const char *restrict, void *restrict);
535 int (*gl_stat) (const char *restrict, void *restrict);
536 #endif
537 } glob_t;
538 #endif
539
540 #if 0
541 /*@-constuse@*/
542 /*@constant int GLOB_ERR@*/
543 /*@constant int GLOB_MARK@*/
544 /*@constant int GLOB_NOSORT@*/
545 /*@constant int GLOB_DOOFFS@*/
546 /*@constant int GLOB_NOCHECK@*/
547 /*@constant int GLOB_APPEND@*/
548 /*@constant int GLOB_NOESCAPE@*/
549 /*@constant int GLOB_PERIOD@*/
550
551 #ifdef _GNU_SOURCE
552 /*@constant int GLOB_MAGCHAR@*/
553 /*@constant int GLOB_ALTDIRFUNC@*/
554 /*@constant int GLOB_BRACE@*/
555 /*@constant int GLOB_NOMAGIC@*/
556 /*@constant int GLOB_TILDE@*/
557 /*@constant int GLOB_ONLYDIR@*/
558 /*@constant int GLOB_TILDE_CHECK@*/
559 #endif
560
561 /*@constant int GLOB_FLAGS@*/
562
563 /*@constant int GLOB_NOSPACE@*/
564 /*@constant int GLOB_ABORTED@*/
565 /*@constant int GLOB_NOMATCH@*/
566 /*@constant int GLOB_NOSYS@*/
567 #ifdef _GNU_SOURCE
568 /*@constant int GLOB_ABEND@*/
569 #endif
570 /*@=constuse@*/
571 #endif
572
573 /*@-protoparammatch -redecl@*/
574 /*@-type@*/ /* XXX glob64_t */
575 extern int glob (const char *__pattern, int __flags,
576 int (*__errfunc) (const char *, int),
577 /*@out@*/ glob_t *__pglob)
578 /*@globals errno, fileSystem @*/
579 /*@modifies *__pglob, errno, fileSystem @*/;
580 /* XXX only annotation is a white lie */
581 extern void globfree (/*@only@*/ glob_t *__pglob)
582 /*@modifies *__pglob @*/;
583 /*@=type@*/
584 #ifdef _GNU_SOURCE
585 extern int glob_pattern_p (const char *__pattern, int __quote)
586 /*@*/;
587 #endif
588 /*@=protoparammatch =redecl@*/
589
590 #if 0
591 /*@-constuse@*/
592 /*@constant int FNM_PATHNAME@*/
593 /*@constant int FNM_NOESCAPE@*/
594 /*@constant int FNM_PERIOD@*/
595
596 #ifdef _GNU_SOURCE
597 /*@constant int FNM_FILE_NAME@*/ /* GNU extension */
598 /*@constant int FNM_LEADING_DIR@*/ /* GNU extension */
599 /*@constant int FNM_CASEFOLD@*/ /* GNU extension */
600 /*@constant int FNM_EXTMATCH@*/ /* GNU extension */
601 #endif
602
603 /*@constant int FNM_NOMATCH@*/
604
605 #ifdef _XOPEN_SOURCE
606 /*@constant int FNM_NOSYS@*/ /* X/Open */
607 #endif
608 /*@=constuse@*/
609 #endif
610
611 /*@-redecl@*/
612 extern int fnmatch (const char *__pattern, const char *__name, int __flags)
613 /*@*/;
614 /*@=redecl@*/
615 /*@=declundef =incondefs @*/
616 #endif
617
618 #if !defined(HAVE_S_IFSOCK)
619 #define S_IFSOCK (0xc000)
620 #endif
621
622 #if !defined(HAVE_S_ISLNK)
623 #define S_ISLNK(mode) ((mode & 0xf000) == S_IFLNK)
624 #endif
625
626 #if !defined(HAVE_S_ISSOCK)
627 #define S_ISSOCK(mode) ((mode & 0xf000) == S_IFSOCK)
628 #endif
629
630 #if defined(NEED_STRINGS_H)
631 #include <strings.h>
632 #endif
633
634 #if defined(NEED_MYREALLOC)
635 #define realloc(ptr,size) myrealloc(ptr,size)
636 extern void *myrealloc(void *, size_t);
637 #endif
638
639 #if !defined(HAVE_SETENV)
640 extern int setenv(const char *name, const char *value, int replace);
641 extern void unsetenv(const char *name);
642 #endif
643
644 #if defined(HAVE_SYS_SOCKET_H)
645 #include <sys/types.h>
646 #include <sys/socket.h>
647 #endif
648
649 #if defined(HAVE_POLL_H)
650 #include <poll.h>
651 #else
652 #if defined(HAVE_SYS_SELECT_H) && !defined(__LCLINT__)
653 #include <sys/select.h>
654 #endif
655 #endif
656
657 /* Solaris <= 2.6 limits getpass return to only 8 chars */
658 #if defined(HAVE_GETPASSPHRASE)
659 #define getpass getpassphrase
660 #endif
661
662 #if !defined(HAVE_LCHOWN)
663 #define lchown chown
664 #endif
665
666 #if defined(HAVE_GETMNTINFO) || defined(HAVE_GETMNTINFO_R) || defined(HAVE_MNTCTL)
667 # define GETMNTENT_ONE 0
668 # define GETMNTENT_TWO 0
669 # if defined(HAVE_SYS_MNTCTL_H)
670 # include <sys/mntctl.h>
671 # endif
672 # if defined(HAVE_SYS_VMOUNT_H)
673 # include <sys/vmount.h>
674 # endif
675 # if defined(HAVE_SYS_MOUNT_H)
676 # include <sys/mount.h>
677 # endif
678 #elif defined(HAVE_MNTENT_H) || !defined(HAVE_GETMNTENT) || defined(HAVE_STRUCT_MNTTAB)
679 # if defined(HAVE_MNTENT_H)
680 # include <stdio.h>
681 # include <mntent.h>
682 # define our_mntent struct mntent
683 # define our_mntdir mnt_dir
684 # elif defined(HAVE_STRUCT_MNTTAB)
685 # include <stdio.h>
686 # include <mnttab.h>
687 struct our_mntent {
688 char * our_mntdir;
689 };
690 struct our_mntent *getmntent(FILE *filep);
691 # define our_mntent struct our_mntent
692 # else
693 # include <stdio.h>
694 struct our_mntent {
695 char * our_mntdir;
696 };
697 struct our_mntent *getmntent(FILE *filep);
698 # define our_mntent struct our_mntent
699 # endif
700 # define GETMNTENT_ONE 1
701 # define GETMNTENT_TWO 0
702 #elif defined(HAVE_SYS_MNTTAB_H)
703 # include <stdio.h>
704 # include <sys/mnttab.h>
705 # define GETMNTENT_ONE 0
706 # define GETMNTENT_TWO 1
707 # define our_mntent struct mnttab
708 # define our_mntdir mnt_mountp
709 #else /* if !HAVE_MNTCTL */
710 # error Neither mntent.h, mnttab.h, or mntctl() exists. I cannot build on this system.
711 #endif
712
713 #ifndef MOUNTED
714 #define MOUNTED "/etc/mnttab"
715 #endif
716
717 #if defined(__LCLINT__)
718 #define FILE_RCSID(id)
719 #else
720 #define FILE_RCSID(id) \
721 static inline const char *rcsid(const char *p) { \
722 return rcsid(p = id); \
723 }
724 #endif
725
726 #if defined(HAVE_SEARCH_H)
727 #include <search.h>
728 #endif
729
735 #if defined(__QNXNTO__)
736 #include <sys/netmgr.h>
737 #define Makedev(x,y) makedev(ND_LOCAL_NODE,(x),(y))
738 #else
739 #define Makedev(x,y) makedev((x),(y))
740 #endif
741
742 #if defined(WITH_PTHREADS)
743 #if defined(HAVE_PTHREAD_H) && !defined(__LCLINT__)
744 #include <pthread.h>
745 #endif
746 #endif
747
751 #define SUPPORT_INITDB 1
752 #define SUPPORT_VERIFYDB 1
753
757 #undef SUPPORT_IMPLICIT_TAG_DATA_TYPES /* XXX postpone to rpm-5.1 */
758
762 #undef SUPPORT_AR_PAYLOADS
763
764 #endif /* H_SYSTEM */