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