12 #ifdef HAVE_SYS_PARAM_H
13 #include <sys/param.h>
16 /* <unistd.h> should be included before any preprocessor test
20 #if !defined(__GLIBC__)
22 #include <crt_externs.h>
23 #define environ (*_NSGetEnviron())
25 extern char ** environ;
26 #endif /* __APPLE__ */
30 #if !defined(HAVE_STPCPY)
31 char * stpcpy(char * dest, const char * src);
34 #if !defined(HAVE_STPNCPY)
35 char * stpncpy(char * dest, const char * src, size_t n);
38 #if HAVE___SECURE_GETENV
39 #define getenv(_s) __secure_getenv(_s)
50 # define NLENGTH(direct) (strlen((direct)->d_name))
51 #else /* not HAVE_DIRENT_H */
52 # define dirent direct
53 # define NLENGTH(direct) ((direct)->d_namlen)
54 # ifdef HAVE_SYS_NDIR_H
55 # include <sys/ndir.h>
56 # endif /* HAVE_SYS_NDIR_H */
57 # ifdef HAVE_SYS_DIR_H
59 # endif /* HAVE_SYS_DIR_H */
62 # endif /* HAVE_NDIR_H */
63 #endif /* HAVE_DIRENT_H */
70 #ifdef _POSIX_PATH_MAX
71 #define PATH_MAX _POSIX_PATH_MAX
72 #elif defined MAXPATHLEN
73 #define PATH_MAX MAXPATHLEN
80 #include <selinux/selinux.h>
81 #include <selinux/label.h>
82 #include <selinux/avc.h>
84 typedef char * security_context_t;
88 #define setfilecon(_fn, _c) (-1)
89 #define lsetfilecon(_fn, _c) (-1)
91 #define is_selinux_enabled() (0)
93 #define matchpathcon_init(_fn) (-1)
94 #define matchpathcon_fini() (0)
95 #define matchpathcon(_fn, _fm, _c) (-1)
97 #define selabel_lookup_raw(_hnd, _scon, _key,_type) (-1)
99 #define selinux_file_context_path() (0)
101 #define rpm_execcon(_v, _fn, _av, _envp) (0)
104 #include "rpmio/rpmutil.h"
105 /* compatibility macros to avoid a mass-renaming all over the codebase */
106 #define xmalloc(_size) rmalloc((_size))
107 #define xcalloc(_nmemb, _size) rcalloc((_nmemb), (_size))
108 #define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))
109 #define xstrdup(_str) rstrdup((_str))
110 #define _free(_ptr) rfree((_ptr))
112 /* Retrofit glibc __progname */
113 #if defined __GLIBC__ && __GLIBC__ >= 2
114 #if __GLIBC_MINOR__ >= 1
115 #define __progname __assert_program_name
117 #define setprogname(pn)
119 #define __progname program_name
120 #define setprogname(pn) \
121 { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
122 else __progname = pn; \
125 extern const char *__progname;
127 /* Take care of NLS matters. */
130 # include <libintl.h>
131 # define _(Text) dgettext (PACKAGE, Text)
133 # define _(Text) Text
136 #define N_(Text) Text
138 /* ============== from misc/miscfn.h */
140 #include "misc/fnmatch.h"
144 #endif /* H_SYSTEM */