aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-04-15 22:02:03 +0000
committerMike Frysinger <vapier@gentoo.org>2005-04-15 22:02:03 +0000
commit198296b9800168ccf016709382e4c71b28e11d08 (patch)
treef10d92633ee58cbad6d31c8f0d1a9f68c458d058 /paxelf.h
parent- EM_ST19 does not appear to be defined on older uclibc/glibc installs (diff)
downloadpax-utils-198296b9800168ccf016709382e4c71b28e11d08.tar.gz
pax-utils-198296b9800168ccf016709382e4c71b28e11d08.tar.bz2
pax-utils-198296b9800168ccf016709382e4c71b28e11d08.zip
move common warn/warnf/err macros to paxelf.h
Diffstat (limited to 'paxelf.h')
-rw-r--r--paxelf.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/paxelf.h b/paxelf.h
index 9f09309..f5c1dc0 100644
--- a/paxelf.h
+++ b/paxelf.h
@@ -80,6 +80,16 @@ extern const char *get_elfdtype(int type);
extern const char *get_elfstttype(int type);
extern void *elf_findsecbyname(elfobj *elf, const char *name);
+/* helper functions for showing errors */
+#define warn(fmt, args...) \
+ fprintf(stderr, "%s: " fmt "\n", argv0, ## args)
+#define warnf(fmt, args...) warn("%s(): " fmt, __FUNCTION__, ## args)
+#define err(fmt, args...) \
+ do { \
+ warn(fmt, ## args); \
+ exit(EXIT_FAILURE); \
+ } while (0)
+
/* PaX flags (to be read in elfhdr.e_flags) */
#define HF_PAX_PAGEEXEC 1 /* 0: Paging based non-exec pages */
#define HF_PAX_EMUTRAMP 2 /* 0: Emulate trampolines */