aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-12-23 10:06:48 -0200
committerMike Frysinger <vapier@gentoo.org>2008-12-23 10:06:48 -0200
commit56a3e5cd27f2a7b19a0b9855577ae6f6015027aa (patch)
treeb22d92c27ea9d5603c6a380bad11e0e226eae469 /scripts
parentdefine AT_FDCWD for older systems (diff)
downloadsandbox-56a3e5cd27f2a7b19a0b9855577ae6f6015027aa.tar.gz
sandbox-56a3e5cd27f2a7b19a0b9855577ae6f6015027aa.tar.bz2
sandbox-56a3e5cd27f2a7b19a0b9855577ae6f6015027aa.zip
libsandbox: make sure SB_NR_* is always defined
If the host libc does not support a wrapped function, then setup a bogus SB_NR_* define for it still. This way we don't need to fill up the source with ugly #ifdef's. The resulting overhead at runtime should be negligible anyways as it's simply one additional integer compare. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_symbol_header.awk6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/gen_symbol_header.awk b/scripts/gen_symbol_header.awk
index 636f68e..88eff6e 100644
--- a/scripts/gen_symbol_header.awk
+++ b/scripts/gen_symbol_header.awk
@@ -80,11 +80,15 @@ BEGIN {
END {
printf("#ifndef __symbols_h\n");
printf("#define __symbols_h\n\n");
+ printf("#define SB_NR_UNDEF -99999\n\n");
# We use the order in SYMBOLS, as some wrappers depends on others ...
for (i = 1; i <= COUNT; ++i) {
sym_index = SYMBOLS[i];
- split(SYMBOL_LIST[sym_index], sym_full_names);
+ full_count = split(SYMBOL_LIST[sym_index], sym_full_names);
+
+ if (full_count == 0)
+ printf("#define SB_NR_%s SB_NR_UNDEF\n", toupper(sym_index));
for (x in sym_full_names) {
split(sym_full_names[x], symbol_array, /@|@@/);