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)
40 #elif HAVE___SECURE_GETENV
41 #define getenv(_s) __secure_getenv(_s)
52 # define NLENGTH(direct) (strlen((direct)->d_name))
53 #else /* not HAVE_DIRENT_H */
54 # define dirent direct
55 # define NLENGTH(direct) ((direct)->d_namlen)
56 # ifdef HAVE_SYS_NDIR_H
57 # include <sys/ndir.h>
58 # endif /* HAVE_SYS_NDIR_H */
59 # ifdef HAVE_SYS_DIR_H
61 # endif /* HAVE_SYS_DIR_H */
64 # endif /* HAVE_NDIR_H */
65 #endif /* HAVE_DIRENT_H */
72 #ifdef _POSIX_PATH_MAX
73 #define PATH_MAX _POSIX_PATH_MAX
74 #elif defined MAXPATHLEN
75 #define PATH_MAX MAXPATHLEN
82 #include <selinux/selinux.h>
83 #include <selinux/label.h>
84 #include <selinux/avc.h>
86 typedef char * security_context_t;
90 #define setfilecon(_fn, _c) (-1)
91 #define lsetfilecon(_fn, _c) (-1)
93 #define is_selinux_enabled() (0)
95 #define matchpathcon_init(_fn) (-1)
96 #define matchpathcon_fini() (0)
97 #define matchpathcon(_fn, _fm, _c) (-1)
99 #define selabel_lookup_raw(_hnd, _scon, _key,_type) (-1)
101 #define selinux_file_context_path() (0)
103 #define rpm_execcon(_v, _fn, _av, _envp) (0)
106 #include "rpmio/rpmutil.h"
107 /* compatibility macros to avoid a mass-renaming all over the codebase */
108 #define xmalloc(_size) rmalloc((_size))
109 #define xcalloc(_nmemb, _size) rcalloc((_nmemb), (_size))
110 #define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))
111 #define xstrdup(_str) rstrdup((_str))
112 #define _free(_ptr) rfree((_ptr))
114 /* Retrofit glibc __progname */
115 #if defined __GLIBC__ && __GLIBC__ >= 2
116 #if __GLIBC_MINOR__ >= 1
117 #define __progname __assert_program_name
119 #define setprogname(pn)
121 #define __progname program_name
122 #define setprogname(pn) \
123 { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
124 else __progname = pn; \
127 extern const char *__progname;
129 /* Take care of NLS matters. */
132 # include <libintl.h>
133 # define _(Text) dgettext (PACKAGE, Text)
135 # define _(Text) Text
138 #define N_(Text) Text
140 /* ============== from misc/miscfn.h */
142 #include "misc/fnmatch.h"
146 #endif /* H_SYSTEM */