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