aboutsummaryrefslogtreecommitdiffstats
path: root/include/debug.h
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2025-05-20 20:08:09 +0200
committerKarel Zak <kzak@redhat.com>2025-05-20 20:08:09 +0200
commit78914c80540663e666841713b3a3ef7ae5396e05 (patch)
treef41bd2bfb2f7792131d861d4ff2f1c8c308a62f4 /include/debug.h
parentf8d41ab00438a85cc955b9b2004f3034b8fa6029 (diff)
downloadutil-linux-78914c80540663e666841713b3a3ef7ae5396e05.tar.gz
treewide: improve getauxval(AT_SECURE) usage
Let's enhance portability and readability slightly. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/debug.h')
-rw-r--r--include/debug.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/debug.h b/include/debug.h
index a59de3442b..b6c0e1a92a 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -36,7 +36,8 @@
#include <stdarg.h>
#include <string.h>
-#include <sys/auxv.h> // for getauxval()
+
+#include "c.h"
struct ul_debug_maskname {
const char *name;
@@ -90,7 +91,7 @@ struct ul_debug_maskname {
} else \
lib ## _debug_mask = mask; \
if (lib ## _debug_mask) { \
- if (getauxval(AT_SECURE)) { \
+ if (is_privileged_execution()) { \
lib ## _debug_mask |= __UL_DEBUG_FL_NOADDR; \
fprintf(stderr, "%d: %s: don't print memory addresses (SUID executable).\n", getpid(), # lib); \
} \