Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

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

Generated on Fri Jul 29 02:38:04 2005 for rpm by  doxygen 1.3.9.1