rpm 5.2.1

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

- File List
- Globals

system.h
Go to the documentation of this file.

    00001
    00005 #ifndef H_SYSTEM
    00006 #define H_SYSTEM
    00007
    00008 #ifdef HAVE_CONFIG_H
    00009 #include "config.h"
    00010 #endif
    00011
    00012 #if HAVE_SYSLOG_H
    00013 #include <syslog.h>
    00014 #endif
    00015
    00016 #include <sys/types.h>
    00017
    00018 #if defined(__LCLINT__)
    00019 /*@-redef@*/
    00020 typedef unsigned int u_int32_t;
    00021 typedef unsigned short u_int16_t;
    00022 typedef unsigned char u_int8_t;
    00023 /*@-incondefs@*/        /* LCLint 3.0.0.15 */
    00024 typedef int int32_t;
    00025 /*@=incondefs@*/
    00026 /* XXX from /usr/include/bits/sigset.h */
    00027 /*@-sizeoftype@*/
    00028 # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
    00029 typedef struct
    00030   {
    00031     unsigned long int __val[_SIGSET_NWORDS];
    00032   } __sigset_t;
    00033 /*@=sizeoftype@*/
    00034 /*@=redef@*/
    00035 #endif
    00036
    00037 #include <sys/stat.h>
    00038 #include <stdio.h>
    00039
    00040 #ifdef HAVE_SYS_PARAM_H
    00041 #include <sys/param.h>
    00042 #endif
    00043
    00044 /* <unistd.h> should be included before any preprocessor test
    00045    of _POSIX_VERSION.  */
    00046 #ifdef HAVE_UNISTD_H
    00047 #include <unistd.h>
    00048 #if defined(__LCLINT__)
    00049 /*@-superuser -declundef -incondefs @*/ /* LCL: modifies clause missing */
    00050 extern int chroot (const char *__path)
    00051         /*@globals errno, systemState @*/
    00052         /*@modifies errno, systemState @*/;
    00053 /*@=superuser =declundef =incondefs @*/
    00054 #endif
    00055 #if !defined(__GLIBC__) && !defined(__LCLINT__)
    00056 #ifdef __APPLE__
    00057 #include <crt_externs.h>
    00058 #define environ (*_NSGetEnviron())
    00059 #else
    00060 extern char ** environ;
    00061 #endif /* __APPLE__ */
    00062 #endif
    00063 #endif
    00064
    00065 #ifdef TIME_WITH_SYS_TIME
    00066 # include <sys/time.h>
    00067 # include <time.h>
    00068 #else
    00069 # ifdef HAVE_SYS_TIME_H
    00070 #  include <sys/time.h>
    00071 # else
    00072 #  include <time.h>
    00073 # endif
    00074 #endif
    00075
    00076 /* Since major is a function on SVR4, we can't use `ifndef major'.  */
    00077 #if defined(MAJOR_IN_MKDEV)
    00078 #include <sys/mkdev.h>
    00079 #define HAVE_MAJOR
    00080 #endif
    00081 #if defined(MAJOR_IN_SYSMACROS)
    00082 #include <sys/sysmacros.h>
    00083 #define HAVE_MAJOR
    00084 #endif
    00085 #ifdef major                    /* Might be defined in sys/types.h.  */
    00086 #define HAVE_MAJOR
    00087 #endif
    00088
    00089 #ifndef HAVE_MAJOR
    00090 #define major(dev)  (((dev) >> 8) & 0xff)
    00091 #define minor(dev)  ((dev) & 0xff)
    00092 #define makedev(maj, min)  (((maj) << 8) | (min))
    00093 #endif
    00094 #undef HAVE_MAJOR
    00095
    00096 #ifdef HAVE_UTIME_H
    00097 #include <utime.h>
    00098 #endif
    00099
    00100 #ifdef HAVE_STRING_H
    00101 # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
    00102 #  include <memory.h>
    00103 # endif
    00104 # include <string.h>
    00105 #else
    00106 # include <strings.h>
    00107 char *memchr ();
    00108 #endif
    00109
    00110 #if !defined(HAVE_STPCPY)
    00111 char * stpcpy(/*@out@*/ char * dest, const char * src);
    00112 #endif
    00113
    00114 #if !defined(HAVE_STPNCPY)
    00115 char * stpncpy(/*@out@*/ char * dest, const char * src, size_t n);
    00116 #endif
    00117
    00118 #include <errno.h>
    00119 #ifndef errno
    00120 /*@-declundef @*/
    00121 extern int errno;
    00122 /*@=declundef @*/
    00123 #endif
    00124
    00125 #if defined(__LCLINT__)
    00126 /*@-declundef @*/
    00127 /*@exits@*/
    00128 extern void error(int status, int errnum, const char *format, ...)
    00129         __attribute__ ((__format__ (__printf__, 3, 4)))
    00130         /*@globals fileSystem @*/
    00131         /*@modifies fileSystem @*/;
    00132 /*@=declundef @*/
    00133 #else
    00134 #if defined(HAVE_ERROR) && defined(HAVE_ERROR_H)
    00135 #include <error.h>
    00136 #endif
    00137 #endif
    00138
    00139 #if defined(HAVE___SECURE_GETENV) && !defined(__LCLINT__)
    00140 #define getenv(_s)      __secure_getenv(_s)
    00141 #endif
    00142
    00143 #ifdef STDC_HEADERS
    00144 /*@-macrounrecog -incondefs -globuse -mustmod @*/ /* FIX: shrug */
    00145 #define getopt system_getopt
    00146 /*@=macrounrecog =incondefs =globuse =mustmod @*/
    00147 /*@-skipansiheaders@*/
    00148 #include <stdlib.h>
    00149 /*@=skipansiheaders@*/
    00150 #undef getopt
    00151 #if defined(__LCLINT__)
    00152 /*@-declundef -incondefs @*/    /* LCL: modifies clause missing */
    00153 extern char * realpath (const char * file_name, /*@out@*/ char * resolved_name)
    00154         /*@globals errno, fileSystem @*/
    00155         /*@requires maxSet(resolved_name) >=  (PATH_MAX - 1); @*/
    00156         /*@modifies *resolved_name, errno, fileSystem @*/;
    00157 /*@=declundef =incondefs @*/
    00158 #endif
    00159 #else /* not STDC_HEADERS */
    00160 char *getenv (const char *name);
    00161 #if !defined(HAVE_REALPATH)
    00162 char *realpath(const char *path, char resolved_path []);
    00163 #endif
    00164 #endif /* STDC_HEADERS */
    00165
    00166 /* XXX solaris2.5.1 has not */
    00167 #if !defined(EXIT_FAILURE)
    00168 #define EXIT_FAILURE    1
    00169 #endif
    00170
    00171 #ifdef HAVE_FCNTL_H
    00172 #include <fcntl.h>
    00173 #else
    00174 #include <sys/file.h>
    00175 #endif
    00176
    00177 #if !defined(SEEK_SET) && !defined(__LCLINT__)
    00178 #define SEEK_SET 0
    00179 #define SEEK_CUR 1
    00180 #define SEEK_END 2
    00181 #endif
    00182 #if !defined(F_OK) && !defined(__LCLINT__)
    00183 #define F_OK 0
    00184 #define X_OK 1
    00185 #define W_OK 2
    00186 #define R_OK 4
    00187 #endif
    00188
    00189 #ifdef HAVE_SIGNAL_H
    00190 # include <signal.h>
    00191 #endif
    00192
    00193 #ifdef HAVE_DIRENT_H
    00194 # include <dirent.h>
    00195 # define NLENGTH(direct) (strlen((direct)->d_name))
    00196 #else /* not HAVE_DIRENT_H */
    00197 # define dirent direct
    00198 # define NLENGTH(direct) ((direct)->d_namlen)
    00199 # ifdef HAVE_SYS_NDIR_H
    00200 #  include <sys/ndir.h>
    00201 # endif /* HAVE_SYS_NDIR_H */
    00202 # ifdef HAVE_SYS_DIR_H
    00203 #  include <sys/dir.h>
    00204 # endif /* HAVE_SYS_DIR_H */
    00205 # ifdef HAVE_NDIR_H
    00206 #  include <ndir.h>
    00207 # endif /* HAVE_NDIR_H */
    00208 #endif /* HAVE_DIRENT_H */
    00209
    00210 #if defined(__LCLINT__)
    00211 /*@-declundef -incondefs @*/ /* LCL: missing annotation */
    00212 /*@only@*/ /*@out@*/ void * alloca (size_t __size)
    00213         /*@ensures maxSet(result) == (__size - 1) @*/
    00214         /*@*/;
    00215 /*@=declundef =incondefs @*/
    00216 #endif
    00217
    00218 #ifdef __GNUC__
    00219 # undef alloca
    00220 # define alloca __builtin_alloca
    00221 #else
    00222 # ifdef HAVE_ALLOCA_H
    00223 #  include <alloca.h>
    00224 # else
    00225 #  ifndef _AIX
    00226 /* AIX alloca decl has to be the first thing in the file, bletch! */
    00227 char *alloca ();
    00228 #  endif
    00229 # endif
    00230 #endif
    00231
    00232 #if defined (__GLIBC__) && defined(__LCLINT__)
    00233 /*@-declundef@*/
    00234 /*@unchecked@*/
    00235 extern __const __int32_t *__ctype_tolower;
    00236 /*@unchecked@*/
    00237 extern __const __int32_t *__ctype_toupper;
    00238 /*@=declundef@*/
    00239 #endif
    00240
    00241 #include <ctype.h>
    00242
    00243 #if defined (__GLIBC__) && defined(__LCLINT__)
    00244 /*@-exportlocal@*/
    00245 extern int isalnum(int) __THROW /*@*/;
    00246 extern int iscntrl(int) __THROW /*@*/;
    00247 extern int isgraph(int) __THROW /*@*/;
    00248 extern int islower(int) __THROW /*@*/;
    00249 extern int ispunct(int) __THROW /*@*/;
    00250 extern int isxdigit(int) __THROW        /*@*/;
    00251 extern int isascii(int) __THROW /*@*/;
    00252 extern int toascii(int) __THROW /*@*/;
    00253 extern int _toupper(int) __THROW        /*@*/;
    00254 extern int _tolower(int) __THROW        /*@*/;
    00255 /*@=exportlocal@*/
    00256
    00257 #endif
    00258
    00259 #if defined(HAVE_SYS_MMAN_H) && !defined(__LCLINT__)
    00260 #include <sys/mman.h>
    00261 #endif
    00262
    00263 #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
    00264 #define MAP_ANONYMOUS MAP_ANON
    00265 #endif
    00266
    00267 /* XXX FIXME: popt on sunos4.1.3: <sys/resource.h> requires <sys/time.h> */
    00268 #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_SYS_TIME_H)
    00269 #include <sys/resource.h>
    00270 #endif
    00271
    00272 #if defined(HAVE_SYS_UTSNAME_H)
    00273 #include <sys/utsname.h>
    00274 #endif
    00275
    00276 #if defined(HAVE_SYS_WAIT_H)
    00277 #include <sys/wait.h>
    00278 #endif
    00279
    00280 #if defined(HAVE_GETOPT_H)
    00281 /*@-noparams@*/
    00282 #include <getopt.h>
    00283 /*@=noparams@*/
    00284 #endif
    00285
    00286 #if defined(HAVE_GRP_H)
    00287 #include <grp.h>
    00288 #endif
    00289
    00290 #if defined(HAVE_LIMITS_H)
    00291 #include <limits.h>
    00292 #endif
    00293
    00294 #if defined(HAVE_ERR_H)
    00295 #include <err.h>
    00296 #endif
    00297
    00298 #if defined(HAVE_LIBGEN_H)
    00299 #include <libgen.h>
    00300 #endif
    00301
    00302 #if defined(WITH_SELINUX)
    00303 #include <selinux/selinux.h>
    00304 #else
    00305 typedef char * security_context_t;
    00306
    00307 #define freecon(_c) do {} while(0)
    00308
    00309 #define getfilecon(_fn, _c)     (-1)
    00310 #define lgetfilecon(_fn, _c)    (-1)
    00311 #define fgetfilecon(_fd, _c)    (-1)
    00312
    00313 #define setfilecon(_fn, _c)     (-1)
    00314 #define lsetfilecon(_fn, _c)    (-1)
    00315 #define fsetfilecon(_fd, _c)    (-1)
    00316
    00317 #define security_check_context(_c)      (0)
    00318
    00319 #define is_selinux_enabled()    (-1)
    00320
    00321 #define rpm_execcon(_v, _fn, _av, _envp)        (0)
    00322
    00323 #define matchpathcon_init(_fn)  (-1)
    00324 #define matchpathcon(_fn, _fmode, _s)   (-1)
    00325 #define matchpathcon_fini() do {} while(0)
    00326 #endif
    00327
    00328 #if defined(WITH_SELINUX) && defined(__LCLINT__)
    00329 /*@-incondefs@*/
    00330 extern void freecon(/*@only@*/ security_context_t con)
    00331         /*@modifies con @*/;
    00332
    00333 extern int getfilecon(const char *path, /*@out@*/ security_context_t *con)
    00334         /*@modifies *con @*/;
    00335 extern int lgetfilecon(const char *path, /*@out@*/ security_context_t *con)
    00336         /*@modifies *con @*/;
    00337 extern int fgetfilecon(int fd, /*@out@*/ security_context_t *con)
    00338         /*@modifies *con @*/;
    00339
    00340 extern int setfilecon(const char *path, security_context_t con)
    00341         /*@globals fileSystem @*/
    00342         /*@modifies fileSystem @*/;
    00343 extern int lsetfilecon(const char *path, security_context_t con)
    00344         /*@globals fileSystem @*/
    00345         /*@modifies fileSystem @*/;
    00346 extern int fsetfilecon(int fd, security_context_t con)
    00347         /*@globals fileSystem @*/
    00348         /*@modifies fileSystem @*/;
    00349
    00350 extern int getcon(/*@out@*/ security_context_t *con)
    00351         /*@modifies *con @*/;
    00352 extern int getexeccon(/*@out@*/ security_context_t *con)
    00353         /*@modifies *con @*/;
    00354 extern int setexeccon(security_context_t con)
    00355         /*@globals fileSystem @*/
    00356         /*@modifies fileSystem @*/;
    00357
    00358 extern int security_check_context(security_context_t con)
    00359         /*@globals fileSystem @*/
    00360         /*@modifies fileSystem @*/;
    00361 extern int security_getenforce(void)
    00362         /*@globals fileSystem @*/
    00363         /*@modifies fileSystem @*/;
    00364
    00365 extern int is_selinux_enabled(void)
    00366         /*@globals fileSystem @*/
    00367         /*@modifies fileSystem @*/;
    00368 /*@=incondefs@*/
    00369 #endif
    00370
    00371 /*@-declundef -incondefs @*/ /* FIX: these are macros */
    00374 /*@mayexit@*/ /*@only@*/ /*@out@*/ void * xmalloc (size_t size)
    00375         /*@globals errno @*/
    00376         /*@ensures maxSet(result) == (size - 1) @*/
    00377         /*@modifies errno @*/;
    00378
    00381 /*@mayexit@*/ /*@only@*/ void * xcalloc (size_t nmemb, size_t size)
    00382         /*@ensures maxSet(result) == (nmemb - 1) @*/
    00383         /*@*/;
    00384
    00388 /*@mayexit@*/ /*@only@*/ void * xrealloc (/*@null@*/ /*@only@*/ void * ptr,
    00389                                         size_t size)
    00390         /*@ensures maxSet(result) == (size - 1) @*/
    00391         /*@modifies *ptr @*/;
    00392
    00395 /*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str)
    00396         /*@*/;
    00397 /*@=declundef =incondefs @*/
    00398
    00401 /*@unused@*/ /*@exits@*/ /*@only@*/ void * vmefail(size_t size)
    00402         /*@*/;
    00403
    00404 #if defined(HAVE_MCHECK_H)
    00405 #include <mcheck.h>
    00406 #if defined(__LCLINT__)
    00407 /*@-declundef -incondefs @*/ /* LCL: missing annotations */
    00408 #if 0
    00409 enum mcheck_status
    00410   {
    00411     MCHECK_DISABLED = -1,       /* Consistency checking is not turned on.  */
    00412     MCHECK_OK,                  /* Block is fine.  */
    00413     MCHECK_FREE,                /* Block freed twice.  */
    00414     MCHECK_HEAD,                /* Memory before the block was clobbered.  */
    00415     MCHECK_TAIL                 /* Memory after the block was clobbered.  */
    00416   };
    00417 #endif
    00418
    00419 extern int mcheck (void (*__abortfunc) (enum mcheck_status))
    00420         /*@globals internalState@*/
    00421         /*@modifies internalState @*/;
    00422 extern int mcheck_pedantic (void (*__abortfunc) (enum mcheck_status))
    00423         /*@globals internalState@*/
    00424         /*@modifies internalState @*/;
    00425 extern void mcheck_check_all (void)
    00426         /*@globals internalState@*/
    00427         /*@modifies internalState @*/;
    00428 extern enum mcheck_status mprobe (void *__ptr)
    00429         /*@globals internalState@*/
    00430         /*@modifies internalState @*/;
    00431 extern void mtrace (void)
    00432         /*@globals internalState@*/
    00433         /*@modifies internalState @*/;
    00434 extern void muntrace (void)
    00435         /*@globals internalState@*/
    00436         /*@modifies internalState @*/;
    00437 /*@=declundef =incondefs @*/
    00438 #endif /* defined(__LCLINT__) */
    00439
    00440 /* Memory allocation via macro defs to get meaningful locations from mtrace() */
    00441 #if defined(__GNUC__)
    00442 #define xmalloc(_size)          (malloc(_size) ? : vmefail(_size))
    00443 #define xcalloc(_nmemb, _size)  (calloc((_nmemb), (_size)) ? : vmefail(_size))
    00444 #define xrealloc(_ptr, _size)   (realloc((_ptr), (_size)) ? : vmefail(_size))
    00445 #define xstrdup(_str)   (strcpy((malloc(strlen(_str)+1) ? : vmefail(strlen(_str)+1)), (_str)))
    00446 #endif  /* defined(__GNUC__) */
    00447 #endif  /* HAVE_MCHECK_H */
    00448
    00449 /* Retrofit glibc __progname */
    00450 #if defined __GLIBC__ && __GLIBC__ >= 2
    00451 #if __GLIBC_MINOR__ >= 1
    00452 #define __progname      __assert_program_name
    00453 #endif
    00454 #define setprogname(pn)
    00455 #else
    00456 #define __progname      program_name
    00457 #define setprogname(pn) \
    00458   { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
    00459     else __progname = pn;               \
    00460   }
    00461 #endif
    00462 /*@unchecked@*/
    00463 extern const char *__progname;
    00464
    00465 #if defined(HAVE_NETDB_H)
    00466 #include <netdb.h>
    00467 #endif
    00468
    00469 #if defined(HAVE_NETINET_IN_H)
    00470 #include <netinet/in.h>
    00471 #endif
    00472 #if defined(HAVE_ARPA_INET_H)
    00473 #include <arpa/inet.h>
    00474 #endif
    00475
    00476 #if defined(HAVE_PWD_H)
    00477 #include <pwd.h>
    00478 #endif
    00479
    00480 /* Take care of NLS matters.  */
    00481
    00482 #if defined(HAVE_LOCALE_H)
    00483 # include <locale.h>
    00484 #endif
    00485 #if !defined(HAVE_SETLOCALE)
    00486 # define setlocale(Category, Locale) /* empty */
    00487 #endif
    00488
    00489 #if defined(ENABLE_NLS) && !defined(__LCLINT__)
    00490 # include <libintl.h>
    00491 # define _(Text) dgettext (PACKAGE, Text)
    00492 # define D_(Text) Text
    00493 #else
    00494 # undef bindtextdomain
    00495 # define bindtextdomain(Domain, Directory) /* empty */
    00496 # undef textdomain
    00497 # define textdomain(Domain) /* empty */
    00498 # define _(Text) Text
    00499 # define D_(Text) Text
    00500 # undef dgettext
    00501 # define dgettext(DomainName, Text) Text
    00502 #endif
    00503
    00504 #define N_(Text) Text
    00505
    00506 /* ============== from misc/miscfn.h */
    00507
    00508 /*@-noparams@*/
    00509 #include "rpmio/glob.h"
    00510 #include "rpmio/fnmatch.h"
    00511 /*@=noparams@*/
    00512
    00513 #if defined(__LCLINT__)
    00514 /*@-declundef -incondefs @*/ /* LCL: missing annotation */
    00515 #if 0
    00516 typedef /*@concrete@*/ struct
    00517   {
    00518     size_t gl_pathc;
    00519     char **gl_pathv;
    00520     size_t gl_offs;
    00521     int gl_flags;
    00522
    00523     void (*gl_closedir) (void *);
    00524 #ifdef _GNU_SOURCE
    00525     struct dirent *(*gl_readdir) (void *);
    00526 #else
    00527     void *(*gl_readdir) (void *);
    00528 #endif
    00529     ptr_t (*gl_opendir) (const char *);
    00530 #ifdef _GNU_SOURCE
    00531     int (*gl_lstat) (const char *restrict, struct stat *restrict);
    00532     int (*gl_stat) (const char *restrict, struct stat *restrict);
    00533 #else
    00534     int (*gl_lstat) (const char *restrict, void *restrict);
    00535     int (*gl_stat) (const char *restrict, void *restrict);
    00536 #endif
    00537   } glob_t;
    00538 #endif
    00539
    00540 #if 0
    00541 /*@-constuse@*/
    00542 /*@constant int GLOB_ERR@*/
    00543 /*@constant int GLOB_MARK@*/
    00544 /*@constant int GLOB_NOSORT@*/
    00545 /*@constant int GLOB_DOOFFS@*/
    00546 /*@constant int GLOB_NOCHECK@*/
    00547 /*@constant int GLOB_APPEND@*/
    00548 /*@constant int GLOB_NOESCAPE@*/
    00549 /*@constant int GLOB_PERIOD@*/
    00550
    00551 #ifdef _GNU_SOURCE
    00552 /*@constant int GLOB_MAGCHAR@*/
    00553 /*@constant int GLOB_ALTDIRFUNC@*/
    00554 /*@constant int GLOB_BRACE@*/
    00555 /*@constant int GLOB_NOMAGIC@*/
    00556 /*@constant int GLOB_TILDE@*/
    00557 /*@constant int GLOB_ONLYDIR@*/
    00558 /*@constant int GLOB_TILDE_CHECK@*/
    00559 #endif
    00560
    00561 /*@constant int GLOB_FLAGS@*/
    00562
    00563 /*@constant int GLOB_NOSPACE@*/
    00564 /*@constant int GLOB_ABORTED@*/
    00565 /*@constant int GLOB_NOMATCH@*/
    00566 /*@constant int GLOB_NOSYS@*/
    00567 #ifdef _GNU_SOURCE
    00568 /*@constant int GLOB_ABEND@*/
    00569 #endif
    00570 /*@=constuse@*/
    00571 #endif
    00572
    00573 /*@-protoparammatch -redecl@*/
    00574 /*@-type@*/     /* XXX glob64_t */
    00575 extern int glob (const char *__pattern, int __flags,
    00576                       int (*__errfunc) (const char *, int),
    00577                       /*@out@*/ glob_t *__pglob)
    00578         /*@globals errno, fileSystem @*/
    00579         /*@modifies *__pglob, errno, fileSystem @*/;
    00580         /* XXX only annotation is a white lie */
    00581 extern void globfree (/*@only@*/ glob_t *__pglob)
    00582         /*@modifies *__pglob @*/;
    00583 /*@=type@*/
    00584 #ifdef _GNU_SOURCE
    00585 extern int glob_pattern_p (const char *__pattern, int __quote)
    00586         /*@*/;
    00587 #endif
    00588 /*@=protoparammatch =redecl@*/
    00589
    00590 #if 0
    00591 /*@-constuse@*/
    00592 /*@constant int FNM_PATHNAME@*/
    00593 /*@constant int FNM_NOESCAPE@*/
    00594 /*@constant int FNM_PERIOD@*/
    00595
    00596 #ifdef _GNU_SOURCE
    00597 /*@constant int FNM_FILE_NAME@*/        /* GNU extension */
    00598 /*@constant int FNM_LEADING_DIR@*/      /* GNU extension */
    00599 /*@constant int FNM_CASEFOLD@*/         /* GNU extension */
    00600 /*@constant int FNM_EXTMATCH@*/         /* GNU extension */
    00601 #endif
    00602
    00603 /*@constant int FNM_NOMATCH@*/
    00604
    00605 #ifdef _XOPEN_SOURCE
    00606 /*@constant int FNM_NOSYS@*/            /* X/Open */
    00607 #endif
    00608 /*@=constuse@*/
    00609 #endif
    00610
    00611 /*@-redecl@*/
    00612 extern int fnmatch (const char *__pattern, const char *__name, int __flags)
    00613         /*@*/;
    00614 /*@=redecl@*/
    00615 /*@=declundef =incondefs @*/
    00616 #endif
    00617
    00618 #if !defined(HAVE_S_IFSOCK)
    00619 #define S_IFSOCK (0xc000)
    00620 #endif
    00621
    00622 #if !defined(HAVE_S_ISLNK)
    00623 #define S_ISLNK(mode) ((mode & 0xf000) == S_IFLNK)
    00624 #endif
    00625
    00626 #if !defined(HAVE_S_ISSOCK)
    00627 #define S_ISSOCK(mode) ((mode & 0xf000) == S_IFSOCK)
    00628 #endif
    00629
    00630 #if defined(NEED_STRINGS_H)
    00631 #include <strings.h>
    00632 #endif
    00633
    00634 #if defined(NEED_MYREALLOC)
    00635 #define realloc(ptr,size) myrealloc(ptr,size)
    00636 extern void *myrealloc(void *, size_t);
    00637 #endif
    00638
    00639 #if !defined(HAVE_SETENV)
    00640 extern int setenv(const char *name, const char *value, int replace);
    00641 extern void unsetenv(const char *name);
    00642 #endif
    00643
    00644 #if defined(HAVE_SYS_SOCKET_H)
    00645 #include <sys/types.h>
    00646 #include <sys/socket.h>
    00647 #endif
    00648
    00649 #if defined(HAVE_POLL_H)
    00650 #include <poll.h>
    00651 #else
    00652 #if defined(HAVE_SYS_SELECT_H) && !defined(__LCLINT__)
    00653 #include <sys/select.h>
    00654 #endif
    00655 #endif
    00656
    00657 /* Solaris <= 2.6 limits getpass return to only 8 chars */
    00658 #if defined(HAVE_GETPASSPHRASE)
    00659 #define getpass getpassphrase
    00660 #endif
    00661
    00662 #if !defined(HAVE_LCHOWN)
    00663 #define lchown chown
    00664 #endif
    00665
    00666 #if defined(HAVE_GETMNTINFO) || defined(HAVE_GETMNTINFO_R) || defined(HAVE_MNTCTL)
    00667 # define GETMNTENT_ONE 0
    00668 # define GETMNTENT_TWO 0
    00669 # if defined(HAVE_SYS_MNTCTL_H)
    00670 #  include <sys/mntctl.h>
    00671 # endif
    00672 # if defined(HAVE_SYS_VMOUNT_H)
    00673 #  include <sys/vmount.h>
    00674 # endif
    00675 # if defined(HAVE_SYS_MOUNT_H)
    00676 #  include <sys/mount.h>
    00677 # endif
    00678 #elif defined(HAVE_MNTENT_H) || !defined(HAVE_GETMNTENT) || defined(HAVE_STRUCT_MNTTAB)
    00679 # if defined(HAVE_MNTENT_H)
    00680 #  include <stdio.h>
    00681 #  include <mntent.h>
    00682 #  define our_mntent struct mntent
    00683 #  define our_mntdir mnt_dir
    00684 # elif defined(HAVE_STRUCT_MNTTAB)
    00685 #  include <stdio.h>
    00686 #  include <mnttab.h>
    00687    struct our_mntent {
    00688        char * our_mntdir;
    00689    };
    00690    struct our_mntent *getmntent(FILE *filep);
    00691 #  define our_mntent struct our_mntent
    00692 # else
    00693 #  include <stdio.h>
    00694    struct our_mntent {
    00695        char * our_mntdir;
    00696    };
    00697    struct our_mntent *getmntent(FILE *filep);
    00698 #  define our_mntent struct our_mntent
    00699 # endif
    00700 # define GETMNTENT_ONE 1
    00701 # define GETMNTENT_TWO 0
    00702 #elif defined(HAVE_SYS_MNTTAB_H)
    00703 # include <stdio.h>
    00704 # include <sys/mnttab.h>
    00705 # define GETMNTENT_ONE 0
    00706 # define GETMNTENT_TWO 1
    00707 # define our_mntent struct mnttab
    00708 # define our_mntdir mnt_mountp
    00709 #else /* if !HAVE_MNTCTL */
    00710 # error Neither mntent.h, mnttab.h, or mntctl() exists. I cannot build on this system.
    00711 #endif
    00712
    00713 #ifndef MOUNTED
    00714 #define MOUNTED "/etc/mnttab"
    00715 #endif
    00716
    00717 #if defined(__LCLINT__)
    00718 #define FILE_RCSID(id)
    00719 #else
    00720 #define FILE_RCSID(id) \
    00721 static inline const char *rcsid(const char *p) { \
    00722         return rcsid(p = id); \
    00723 }
    00724 #endif
    00725
    00726 #if defined(HAVE_SEARCH_H)
    00727 #include <search.h>
    00728 #endif
    00729
    00735 #if defined(__QNXNTO__)
    00736 #include <sys/netmgr.h>
    00737 #define Makedev(x,y)   makedev(ND_LOCAL_NODE,(x),(y))
    00738 #else
    00739 #define Makedev(x,y)   makedev((x),(y))
    00740 #endif
    00741
    00742 #if defined(WITH_PTHREADS)
    00743 #if defined(HAVE_PTHREAD_H) && !defined(__LCLINT__)
    00744 #include <pthread.h>
    00745 #endif
    00746 #endif
    00747
    00751 #define SUPPORT_INITDB          1
    00752 #define SUPPORT_VERIFYDB        1
    00753
    00757 #undef SUPPORT_IMPLICIT_TAG_DATA_TYPES  /* XXX postpone to rpm-5.1 */
    00758
    00762 #undef  SUPPORT_AR_PAYLOADS
    00763
    00764 #endif  /* H_SYSTEM */