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 #ifdef __APPLE__
00053 #include <crt_externs.h>
00054 #define environ (*_NSGetEnviron())
00055 #else
00056 extern char ** environ;
00057 #endif /* __APPLE__ */
00058 #endif
00059 #endif
00060 
00061 #if TIME_WITH_SYS_TIME
00062 # include <sys/time.h>
00063 # include <time.h>
00064 #else
00065 # if HAVE_SYS_TIME_H
00066 #  include <sys/time.h>
00067 # else
00068 #  include <time.h>
00069 # endif
00070 #endif
00071 
00072 #if NEED_TIMEZONE
00073 extern time_t timezone;
00074 #endif
00075 
00076 /* Since major is a function on SVR4, we can't use `ifndef major'.  */
00077 #if MAJOR_IN_MKDEV
00078 #include <sys/mkdev.h>
00079 #define HAVE_MAJOR
00080 #endif
00081 #if 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 !STDC_HEADERS && 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 HAVE_ERROR && HAVE_ERROR_H
00135 #include <error.h>
00136 #endif
00137 #endif
00138 
00139 #if 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 ! 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_DIRENT_H
00190 # include <dirent.h>
00191 # define NLENGTH(direct) (strlen((direct)->d_name))
00192 #else /* not HAVE_DIRENT_H */
00193 # define dirent direct
00194 # define NLENGTH(direct) ((direct)->d_namlen)
00195 # ifdef HAVE_SYS_NDIR_H
00196 #  include <sys/ndir.h>
00197 # endif /* HAVE_SYS_NDIR_H */
00198 # ifdef HAVE_SYS_DIR_H
00199 #  include <sys/dir.h>
00200 # endif /* HAVE_SYS_DIR_H */
00201 # ifdef HAVE_NDIR_H
00202 #  include <ndir.h>
00203 # endif /* HAVE_NDIR_H */
00204 #endif /* HAVE_DIRENT_H */
00205 
00206 #if defined(__LCLINT__)
00207 /*@-declundef -incondefs @*/ /* LCL: missing annotation */
00208 /*@only@*/ /*@out@*/ void * alloca (size_t __size)
00209         /*@ensures maxSet(result) == (__size - 1) @*/
00210         /*@*/;
00211 /*@=declundef =incondefs @*/
00212 #endif
00213 
00214 #ifdef __GNUC__
00215 # undef alloca
00216 # define alloca __builtin_alloca
00217 #else
00218 # ifdef HAVE_ALLOCA_H
00219 #  include <alloca.h>
00220 # else
00221 #  ifndef _AIX
00222 /* AIX alloca decl has to be the first thing in the file, bletch! */
00223 char *alloca ();
00224 #  endif
00225 # endif
00226 #endif
00227 
00228 #if defined (__GLIBC__) && defined(__LCLINT__)
00229 /*@-declundef@*/
00230 /*@unchecked@*/
00231 extern __const __int32_t *__ctype_tolower;
00232 /*@unchecked@*/
00233 extern __const __int32_t *__ctype_toupper;
00234 /*@=declundef@*/
00235 #endif
00236 
00237 #include <ctype.h>
00238 
00239 #if defined (__GLIBC__) && defined(__LCLINT__)
00240 /*@-exportlocal@*/
00241 extern int isalnum(int) __THROW /*@*/;
00242 extern int iscntrl(int) __THROW /*@*/;
00243 extern int isgraph(int) __THROW /*@*/;
00244 extern int islower(int) __THROW /*@*/;
00245 extern int ispunct(int) __THROW /*@*/;
00246 extern int isxdigit(int) __THROW        /*@*/;
00247 extern int isascii(int) __THROW /*@*/;
00248 extern int toascii(int) __THROW /*@*/;
00249 extern int _toupper(int) __THROW        /*@*/;
00250 extern int _tolower(int) __THROW        /*@*/;
00251 /*@=exportlocal@*/
00252 
00253 #endif
00254 
00255 #if HAVE_SYS_MMAN_H && !defined(__LCLINT__)
00256 #include <sys/mman.h>
00257 #endif
00258 
00259 /* XXX FIXME: popt on sunos4.1.3: <sys/resource.h> requires <sys/time.h> */
00260 #if HAVE_SYS_RESOURCE_H && HAVE_SYS_TIME_H
00261 #include <sys/resource.h>
00262 #endif
00263 
00264 #if HAVE_SYS_UTSNAME_H
00265 #include <sys/utsname.h>
00266 #endif
00267 
00268 #if HAVE_SYS_WAIT_H
00269 #include <sys/wait.h>
00270 #endif
00271 
00272 #if HAVE_GETOPT_H
00273 /*@-noparams@*/
00274 #include <getopt.h>
00275 /*@=noparams@*/
00276 #endif
00277 
00278 #if HAVE_GRP_H
00279 #include <grp.h>
00280 #endif
00281 
00282 #if HAVE_LIMITS_H
00283 #include <limits.h>
00284 #endif
00285 
00286 #if HAVE_ERR_H
00287 #include <err.h>
00288 #endif
00289 
00290 #if HAVE_MALLOC_H && !defined(__LCLINT__)
00291 #include <malloc.h>
00292 #endif
00293 
00294 #if WITH_SELINUX
00295 #include <selinux/selinux.h>
00296 #else
00297 typedef char * security_context_t;
00298 
00299 #define freecon(_c)
00300 
00301 #define getfilecon(_fn, _c)     (-1)
00302 #define lgetfilecon(_fn, _c)    (-1)
00303 #define fgetfilecon(_fd, _c)    (-1)
00304 
00305 #define setfilecon(_fn, _c)     (-1)
00306 #define lsetfilecon(_fn, _c)    (-1)
00307 #define fsetfilecon(_fd, _c)    (-1)
00308 
00309 #define security_check_context(_c)      (0)
00310 
00311 #define is_selinux_enabled()    (-1)
00312 
00313 #define rpm_execcon(_v, _fn, _av, _envp)        (0)
00314 #endif
00315 
00316 #if defined(__LCLINT__)
00317 /*@-incondefs@*/
00318 extern void freecon(/*@only@*/ security_context_t con)
00319         /*@modifies con @*/;
00320 
00321 extern int getfilecon(const char *path, /*@out@*/ security_context_t *con)
00322         /*@modifies *con @*/;
00323 extern int lgetfilecon(const char *path, /*@out@*/ security_context_t *con)
00324         /*@modifies *con @*/;
00325 extern int fgetfilecon(int fd, /*@out@*/ security_context_t *con)
00326         /*@modifies *con @*/;
00327 
00328 extern int setfilecon(const char *path, security_context_t con)
00329         /*@globals fileSystem @*/
00330         /*@modifies fileSystem @*/;
00331 extern int lsetfilecon(const char *path, security_context_t con)
00332         /*@globals fileSystem @*/
00333         /*@modifies fileSystem @*/;
00334 extern int fsetfilecon(int fd, security_context_t con)
00335         /*@globals fileSystem @*/
00336         /*@modifies fileSystem @*/;
00337 
00338 extern int getcon(/*@out@*/ security_context_t *con)
00339         /*@modifies *con @*/;
00340 extern int getexeccon(/*@out@*/ security_context_t *con)
00341         /*@modifies *con @*/;
00342 extern int setexeccon(security_context_t con)
00343         /*@globals fileSystem @*/
00344         /*@modifies fileSystem @*/;
00345 
00346 extern int security_check_context(security_context_t con)
00347         /*@globals fileSystem @*/
00348         /*@modifies fileSystem @*/;
00349 extern int security_getenforce(void)
00350         /*@globals fileSystem @*/
00351         /*@modifies fileSystem @*/;
00352 
00353 extern int is_selinux_enabled(void)
00354         /*@globals fileSystem @*/
00355         /*@modifies fileSystem @*/;
00356 /*@=incondefs@*/
00357 #endif
00358 
00359 /*@-declundef -incondefs @*/ /* FIX: these are macros */
00362 /*@mayexit@*/ /*@only@*/ /*@out@*/ void * xmalloc (size_t size)
00363         /*@globals errno @*/
00364         /*@ensures maxSet(result) == (size - 1) @*/
00365         /*@modifies errno @*/;
00366 
00369 /*@mayexit@*/ /*@only@*/ void * xcalloc (size_t nmemb, size_t size)
00370         /*@ensures maxSet(result) == (nmemb - 1) @*/
00371         /*@*/;
00372 
00376 /*@mayexit@*/ /*@only@*/ void * xrealloc (/*@null@*/ /*@only@*/ void * ptr,
00377                                         size_t size)
00378         /*@ensures maxSet(result) == (size - 1) @*/
00379         /*@modifies *ptr @*/;
00380 
00383 /*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str)
00384         /*@*/;
00385 /*@=declundef =incondefs @*/
00386 
00389 /*@unused@*/ /*@exits@*/ /*@only@*/ void * vmefail(size_t size)
00390         /*@*/;
00391 
00392 #if HAVE_MCHECK_H
00393 #include <mcheck.h>
00394 #if defined(__LCLINT__)
00395 /*@-declundef -incondefs @*/ /* LCL: missing annotations */
00396 #if 0
00397 enum mcheck_status
00398   {
00399     MCHECK_DISABLED = -1,       /* Consistency checking is not turned on.  */
00400     MCHECK_OK,                  /* Block is fine.  */
00401     MCHECK_FREE,                /* Block freed twice.  */
00402     MCHECK_HEAD,                /* Memory before the block was clobbered.  */
00403     MCHECK_TAIL                 /* Memory after the block was clobbered.  */
00404   };
00405 #endif
00406 
00407 extern int mcheck (void (*__abortfunc) (enum mcheck_status))
00408         /*@globals internalState@*/
00409         /*@modifies internalState @*/;
00410 extern int mcheck_pedantic (void (*__abortfunc) (enum mcheck_status))
00411         /*@globals internalState@*/
00412         /*@modifies internalState @*/;
00413 extern void mcheck_check_all (void)
00414         /*@globals internalState@*/
00415         /*@modifies internalState @*/;
00416 extern enum mcheck_status mprobe (void *__ptr)
00417         /*@globals internalState@*/
00418         /*@modifies internalState @*/;
00419 extern void mtrace (void)
00420         /*@globals internalState@*/
00421         /*@modifies internalState @*/;
00422 extern void muntrace (void)
00423         /*@globals internalState@*/
00424         /*@modifies internalState @*/;
00425 /*@=declundef =incondefs @*/
00426 #endif /* defined(__LCLINT__) */
00427 
00428 /* Memory allocation via macro defs to get meaningful locations from mtrace() */
00429 #if defined(__GNUC__)
00430 #define xmalloc(_size)          (malloc(_size) ? : vmefail(_size))
00431 #define xcalloc(_nmemb, _size)  (calloc((_nmemb), (_size)) ? : vmefail(_size))
00432 #define xrealloc(_ptr, _size)   (realloc((_ptr), (_size)) ? : vmefail(_size))
00433 #define xstrdup(_str)   (strcpy((malloc(strlen(_str)+1) ? : vmefail(strlen(_str)+1)), (_str)))
00434 #endif  /* defined(__GNUC__) */
00435 #endif  /* HAVE_MCHECK_H */
00436 
00437 /* Retrofit glibc __progname */
00438 #if defined __GLIBC__ && __GLIBC__ >= 2
00439 #if __GLIBC_MINOR__ >= 1
00440 #define __progname      __assert_program_name
00441 #endif
00442 #define setprogname(pn)
00443 #else
00444 #define __progname      program_name
00445 #define setprogname(pn) \
00446   { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
00447     else __progname = pn;               \
00448   }
00449 #endif
00450 /*@unchecked@*/
00451 extern const char *__progname;
00452 
00453 #if HAVE_NETDB_H
00454 #include <netdb.h>
00455 #endif
00456 
00457 #if HAVE_PWD_H
00458 #include <pwd.h>
00459 #endif
00460 
00461 /* Take care of NLS matters.  */
00462 
00463 #if HAVE_LOCALE_H
00464 # include <locale.h>
00465 #endif
00466 #if !HAVE_SETLOCALE
00467 # define setlocale(Category, Locale) /* empty */
00468 #endif
00469 
00470 #if ENABLE_NLS && !defined(__LCLINT__)
00471 # include <libintl.h>
00472 # define _(Text) gettext (Text)
00473 #else
00474 # undef bindtextdomain
00475 # define bindtextdomain(Domain, Directory) /* empty */
00476 # undef textdomain
00477 # define textdomain(Domain) /* empty */
00478 # define _(Text) Text
00479 # undef dgettext
00480 # define dgettext(DomainName, Text) Text
00481 #endif
00482 
00483 #define N_(Text) Text
00484 
00485 /* ============== from misc/miscfn.h */
00486 
00487 #if !defined(USE_GNU_GLOB) || defined(__LCLINT__)
00488 #if HAVE_FNMATCH_H
00489 /*@-noparams@*/
00490 #include <fnmatch.h>
00491 /*@=noparams@*/
00492 #endif
00493 
00494 #if HAVE_GLOB_H || defined(__LCLINT__)
00495 /*@-noparams@*/
00496 #include <glob.h>
00497 /*@=noparams@*/
00498 #endif
00499 #else
00500 /*@-noparams@*/
00501 #include "misc/glob.h"
00502 #include "misc/fnmatch.h"
00503 /*@=noparams@*/
00504 #endif
00505 
00506 #if defined(__LCLINT__)
00507 /*@-declundef -incondefs @*/ /* LCL: missing annotation */
00508 #if 0
00509 typedef /*@concrete@*/ struct
00510   {
00511     size_t gl_pathc;
00512     char **gl_pathv;
00513     size_t gl_offs;
00514     int gl_flags;
00515 
00516     void (*gl_closedir) (void *);
00517 #ifdef _GNU_SOURCE
00518     struct dirent *(*gl_readdir) (void *);
00519 #else
00520     void *(*gl_readdir) (void *);
00521 #endif
00522     ptr_t (*gl_opendir) (const char *);
00523 #ifdef _GNU_SOURCE
00524     int (*gl_lstat) (const char *restrict, struct stat *restrict);
00525     int (*gl_stat) (const char *restrict, struct stat *restrict);
00526 #else
00527     int (*gl_lstat) (const char *restrict, void *restrict);
00528     int (*gl_stat) (const char *restrict, void *restrict);
00529 #endif
00530   } glob_t;
00531 #endif
00532 
00533 #if 0
00534 /*@-constuse@*/
00535 /*@constant int GLOB_ERR@*/
00536 /*@constant int GLOB_MARK@*/
00537 /*@constant int GLOB_NOSORT@*/
00538 /*@constant int GLOB_DOOFFS@*/
00539 /*@constant int GLOB_NOCHECK@*/
00540 /*@constant int GLOB_APPEND@*/
00541 /*@constant int GLOB_NOESCAPE@*/
00542 /*@constant int GLOB_PERIOD@*/
00543 
00544 #ifdef _GNU_SOURCE
00545 /*@constant int GLOB_MAGCHAR@*/
00546 /*@constant int GLOB_ALTDIRFUNC@*/
00547 /*@constant int GLOB_BRACE@*/
00548 /*@constant int GLOB_NOMAGIC@*/
00549 /*@constant int GLOB_TILDE@*/
00550 /*@constant int GLOB_ONLYDIR@*/
00551 /*@constant int GLOB_TILDE_CHECK@*/
00552 #endif
00553 
00554 /*@constant int GLOB_FLAGS@*/
00555 
00556 /*@constant int GLOB_NOSPACE@*/
00557 /*@constant int GLOB_ABORTED@*/
00558 /*@constant int GLOB_NOMATCH@*/
00559 /*@constant int GLOB_NOSYS@*/
00560 #ifdef _GNU_SOURCE
00561 /*@constant int GLOB_ABEND@*/
00562 #endif
00563 /*@=constuse@*/
00564 #endif
00565 
00566 /*@-type@*/     /* XXX glob64_t */
00567 extern int glob (const char *__pattern, int __flags,
00568                       int (*__errfunc) (const char *, int),
00569                       /*@out@*/ glob_t *__pglob)
00570         /*@globals errno, fileSystem @*/
00571         /*@modifies *__pglob, errno, fileSystem @*/;
00572         /* XXX only annotation is a white lie */
00573 extern void globfree (/*@only@*/ glob_t *__pglob)
00574         /*@modifies *__pglob @*/;
00575 /*@=type@*/
00576 #ifdef _GNU_SOURCE
00577 extern int glob_pattern_p (const char *__pattern, int __quote)
00578         /*@*/;
00579 #endif
00580 
00581 #if 0
00582 /*@-constuse@*/
00583 /*@constant int FNM_PATHNAME@*/
00584 /*@constant int FNM_NOESCAPE@*/
00585 /*@constant int FNM_PERIOD@*/
00586 
00587 #ifdef _GNU_SOURCE
00588 /*@constant int FNM_FILE_NAME@*/        /* GNU extension */
00589 /*@constant int FNM_LEADING_DIR@*/      /* GNU extension */
00590 /*@constant int FNM_CASEFOLD@*/         /* GNU extension */
00591 /*@constant int FNM_EXTMATCH@*/         /* GNU extension */
00592 #endif
00593 
00594 /*@constant int FNM_NOMATCH@*/
00595 
00596 #ifdef _XOPEN_SOURCE
00597 /*@constant int FNM_NOSYS@*/            /* X/Open */
00598 #endif
00599 /*@=constuse@*/
00600 #endif
00601 
00602 extern int fnmatch (const char *__pattern, const char *__name, int __flags)
00603         /*@*/;
00604 /*@=declundef =incondefs @*/
00605 #endif
00606 
00607 #if ! HAVE_S_IFSOCK
00608 #define S_IFSOCK (0xc000)
00609 #endif
00610 
00611 #if ! HAVE_S_ISLNK
00612 #define S_ISLNK(mode) ((mode & 0xf000) == S_IFLNK)
00613 #endif
00614 
00615 #if ! HAVE_S_ISSOCK
00616 #define S_ISSOCK(mode) ((mode & 0xf000) == S_IFSOCK)
00617 #endif
00618 
00619 #if NEED_STRINGS_H
00620 #include <strings.h>
00621 #endif
00622 
00623 #if NEED_MYREALLOC
00624 #define realloc(ptr,size) myrealloc(ptr,size)
00625 extern void *myrealloc(void *, size_t);
00626 #endif
00627 
00628 #if ! HAVE_SETENV
00629 extern int setenv(const char *name, const char *value, int replace);
00630 extern void unsetenv(const char *name);
00631 #endif
00632 
00633 #if HAVE_SYS_SOCKET_H
00634 #include <sys/types.h>
00635 #include <sys/socket.h>
00636 #endif
00637 
00638 #if HAVE_POLL_H
00639 #include <poll.h>
00640 #else
00641 #if HAVE_SYS_SELECT_H && !defined(__LCLINT__)
00642 #include <sys/select.h>
00643 #endif
00644 #endif
00645 
00646 /* Solaris <= 2.6 limits getpass return to only 8 chars */
00647 #if HAVE_GETPASSPHRASE
00648 #define getpass getpassphrase
00649 #endif
00650 
00651 #if ! HAVE_LCHOWN
00652 #define lchown chown
00653 #endif
00654 
00655 #if HAVE_GETMNTINFO || HAVE_GETMNTINFO_R || HAVE_MNTCTL
00656 # define GETMNTENT_ONE 0
00657 # define GETMNTENT_TWO 0
00658 # if HAVE_SYS_MNTCTL_H
00659 #  include <sys/mntctl.h>
00660 # endif
00661 # if HAVE_SYS_VMOUNT_H
00662 #  include <sys/vmount.h>
00663 # endif
00664 # if HAVE_SYS_MOUNT_H
00665 #  include <sys/mount.h>
00666 # endif
00667 #elif HAVE_MNTENT_H || !(HAVE_GETMNTENT) || HAVE_STRUCT_MNTTAB
00668 # if HAVE_MNTENT_H
00669 #  include <stdio.h>
00670 #  include <mntent.h>
00671 #  define our_mntent struct mntent
00672 #  define our_mntdir mnt_dir
00673 # elif HAVE_STRUCT_MNTTAB
00674 #  include <stdio.h>
00675 #  include <mnttab.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 # else
00682 #  include <stdio.h>
00683    struct our_mntent {
00684        char * our_mntdir;
00685    };
00686    struct our_mntent *getmntent(FILE *filep);
00687 #  define our_mntent struct our_mntent
00688 # endif
00689 # define GETMNTENT_ONE 1
00690 # define GETMNTENT_TWO 0
00691 #elif HAVE_SYS_MNTTAB_H
00692 # include <stdio.h>
00693 # include <sys/mnttab.h>
00694 # define GETMNTENT_ONE 0
00695 # define GETMNTENT_TWO 1
00696 # define our_mntent struct mnttab
00697 # define our_mntdir mnt_mountp
00698 #else /* if !HAVE_MNTCTL */
00699 # error Neither mntent.h, mnttab.h, or mntctl() exists. I cannot build on this system.
00700 #endif
00701 
00702 #ifndef MOUNTED
00703 #define MOUNTED "/etc/mnttab"
00704 #endif
00705 
00706 #if defined(__LCLINT__)
00707 #define FILE_RCSID(id)
00708 #else
00709 #define FILE_RCSID(id) \
00710 static inline const char *rcsid(const char *p) { \
00711         return rcsid(p = id); \
00712 }
00713 #endif
00714 
00715 #endif  /* H_SYSTEM */

Generated on Fri Oct 12 08:44:55 2007 for rpm by  doxygen 1.5.2