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

Generated on Mon Nov 29 2010 05:18:48 for rpm by  doxygen 1.7.2