summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rtld-elf/malloc.c')
-rw-r--r--libexec/rtld-elf/malloc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libexec/rtld-elf/malloc.c b/libexec/rtld-elf/malloc.c
index ed0d1fd..da94a55 100644
--- a/libexec/rtld-elf/malloc.c
+++ b/libexec/rtld-elf/malloc.c
@@ -147,7 +147,7 @@ botch(s)
#endif
/* Debugging stuff */
-extern void xprintf(const char *, ...);
+static void xprintf(const char *, ...);
#define TRACE() xprintf("TRACE %s:%d\n", __FILE__, __LINE__)
void *
@@ -483,3 +483,18 @@ int n;
#endif
return n;
}
+
+/*
+ * Non-mallocing printf, for use by malloc itself.
+ */
+static void
+xprintf(const char *fmt, ...)
+{
+ char buf[256];
+ va_list ap;
+
+ va_start(ap, fmt);
+ vsprintf(buf, fmt, ap);
+ (void)write(STDOUT_FILENO, buf, strlen(buf));
+ va_end(ap);
+}
OpenPOWER on IntegriCloud