Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/ktruss ktruss: Remove symbol clash with libc
details: https://anonhg.NetBSD.org/src/rev/7834548d42bf
branches: trunk
changeset: 319580:7834548d42bf
user: kamil <kamil%NetBSD.org@localhost>
date: Sun Jun 03 13:41:30 2018 +0000
description:
ktruss: Remove symbol clash with libc
Rename local function wprintf() to xwprintf().
This is needed for installing interceptors in sanitizers.
Sponsored by <The NetBSD Foundation>
diffstat:
usr.bin/ktruss/dump.c | 86 +++++++++++++++++++++++++-------------------------
1 files changed, 43 insertions(+), 43 deletions(-)
diffs (284 lines):
diff -r 348e40aa1ac7 -r 7834548d42bf usr.bin/ktruss/dump.c
--- a/usr.bin/ktruss/dump.c Sun Jun 03 13:23:58 2018 +0000
+++ b/usr.bin/ktruss/dump.c Sun Jun 03 13:41:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dump.c,v 1.42 2012/07/17 14:39:08 njoly Exp $ */
+/* $NetBSD: dump.c,v 1.43 2018/06/03 13:41:30 kamil Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
-__RCSID("$NetBSD: dump.c,v 1.42 2012/07/17 14:39:08 njoly Exp $");
+__RCSID("$NetBSD: dump.c,v 1.43 2018/06/03 13:41:30 kamil Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -112,11 +112,11 @@
void syscallnameprint(int);
void syscallprint(struct ktr_header *);
void sysretprint(struct ktr_header *);
-int wprintf(const char *, ...) __printflike(1, 2);
+int xwprintf(const char *, ...) __printflike(1, 2);
void *xrealloc(void *, size_t *, size_t);
int
-wprintf(const char *fmt, ...)
+xwprintf(const char *fmt, ...)
{
va_list ap;
int w;
@@ -146,7 +146,7 @@
{
while (width < col)
- if (wprintf(" ") < 0)
+ if (xwprintf(" ") < 0)
break;
}
@@ -350,10 +350,10 @@
union timeholder temp;
temp.tv.tv_sec = temp.tv.tv_usec = 0;
- wprintf("%6d ", kth->ktr_pid);
+ xwprintf("%6d ", kth->ktr_pid);
if (kth->ktr_version > KTRFAC_VERSION(KTRFACv0))
- wprintf("%6d ", kth->ktr_lid);
- wprintf("%-8.*s ", MAXCOMLEN, kth->ktr_comm);
+ xwprintf("%6d ", kth->ktr_lid);
+ xwprintf("%-8.*s ", MAXCOMLEN, kth->ktr_comm);
if (timestamp) {
if (timestamp == 2) {
switch (kth->ktr_version) {
@@ -404,10 +404,10 @@
}
}
if (kth->ktr_version == KTRFAC_VERSION(KTRFACv0))
- wprintf("%lld.%06ld ",
+ xwprintf("%lld.%06ld ",
(long long)temp.tv.tv_sec, (long)temp.tv.tv_usec);
else
- wprintf("%lld.%09ld ",
+ xwprintf("%lld.%09ld ",
(long long)temp.ts.tv_sec, (long)temp.ts.tv_nsec);
}
}
@@ -423,13 +423,13 @@
*dir++ = 'R';
*dir = '\0';
- wprintf(decimal ? ", _IO%s('%c',%ld" : ", _IO%s('%c',%#lx",
+ xwprintf(decimal ? ", _IO%s('%c',%ld" : ", _IO%s('%c',%#lx",
dirbuf, (int) ((cmd >> 8) & 0xff), cmd & 0xff);
if ((cmd & IOC_VOID) == 0)
- wprintf(decimal ? ",%ld)" : ",%#lx)",
+ xwprintf(decimal ? ",%ld)" : ",%#lx)",
(cmd >> 16) & 0xff);
else
- wprintf(")");
+ xwprintf(")");
}
void
@@ -447,7 +447,7 @@
if (kte == NULL)
argprint(prefix, ap, argsize);
else {
- wprintf("%s", prefix);
+ xwprintf("%s", prefix);
nameiprint(&kte->kte_kth);
free(kte);
(*ap)++;
@@ -460,9 +460,9 @@
{
if (code >= cur_emul->nsysnames || code < 0)
- wprintf("[%d]", code);
+ xwprintf("[%d]", code);
else
- wprintf("%s", cur_emul->sysnames[code]);
+ xwprintf("%s", cur_emul->sysnames[code]);
}
void
@@ -470,9 +470,9 @@
{
if (decimal)
- wprintf("%s%ld", prefix, (long)**ap);
+ xwprintf("%s%ld", prefix, (long)**ap);
else
- wprintf("%s%#lx", prefix, (long)**ap);
+ xwprintf("%s%#lx", prefix, (long)**ap);
(*ap)++;
*argsize -= sizeof(register_t);
}
@@ -492,7 +492,7 @@
*/
argsize = ktr->ktr_argsize;
if (argsize == 0) {
- wprintf("(");
+ xwprintf("(");
goto noargument;
}
@@ -558,7 +558,7 @@
break;
case SYS_compat_16___sigaction14 :
- wprintf("(%s", signals[(int)*ap].name);
+ xwprintf("(%s", signals[(int)*ap].name);
ap++;
argsize -= sizeof(register_t);
break;
@@ -566,7 +566,7 @@
case SYS_ioctl :
argprint("(", &ap, &argsize);
if ((s = ioctlname(*ap)) != NULL)
- wprintf(", %s", s);
+ xwprintf(", %s", s);
else
ioctldecode(*ap);
ap++;
@@ -576,9 +576,9 @@
case SYS_ptrace :
if ((long)*ap >= 0 &&
*ap < (register_t)(sizeof(ptrace_ops) / sizeof(ptrace_ops[0])))
- wprintf("(%s", ptrace_ops[*ap]);
+ xwprintf("(%s", ptrace_ops[*ap]);
else
- wprintf("(%ld", (long)*ap);
+ xwprintf("(%ld", (long)*ap);
ap++;
argsize -= sizeof(register_t);
break;
@@ -594,7 +594,7 @@
argprint(", ", &ap, &argsize);
noargument:
- wprintf(")");
+ xwprintf(")");
}
void
@@ -625,24 +625,24 @@
indent(50);
if (error == EJUSTRETURN)
- wprintf(" JUSTRETURN");
+ xwprintf(" JUSTRETURN");
else if (error == ERESTART)
- wprintf(" RESTART");
+ xwprintf(" RESTART");
else if (error) {
- wprintf(" Err#%d", error);
+ xwprintf(" Err#%d", error);
if (error < MAXERRNOS && error >= -2)
- wprintf(" %s", errnos[error].name);
+ xwprintf(" %s", errnos[error].name);
} else
switch (ktr->ktr_code) {
case SYS_mremap:
case SYS_mmap:
- wprintf(" = %p", (void *)(intptr_t)ret);
+ xwprintf(" = %p", (void *)(intptr_t)ret);
break;
default:
- wprintf(" = %ld", (long)ret);
+ xwprintf(" = %ld", (long)ret);
if (kth->ktr_len > (int)offsetof(struct ktr_sysret,
ktr_retval_1) && ktr->ktr_retval_1 != 0)
- wprintf(", %ld", (long)ktr->ktr_retval_1);
+ xwprintf(", %ld", (long)ktr->ktr_retval_1);
break;
}
}
@@ -694,7 +694,7 @@
nameiprint(struct ktr_header *kth)
{
- wprintf("\"%.*s\"", kth->ktr_len, (char *)(kth + 1));
+ xwprintf("\"%.*s\"", kth->ktr_len, (char *)(kth + 1));
}
#ifdef notused
@@ -704,9 +704,9 @@
struct ktr_header *kth = &kte->kte_kth;
dumpheader(kth);
- wprintf("namei(");
+ xwprintf("namei(");
nameiprint(kth);
- wprintf(")");
+ xwprintf(")");
free(kte);
}
@@ -719,7 +719,7 @@
char *emul = (char *)(kth + 1);
dumpheader(kth);
- wprintf("emul(%s)", emul);
+ xwprintf("emul(%s)", emul);
setemul(emul, kth->ktr_pid, 1);
free(kte);
@@ -752,7 +752,7 @@
if (maxdata && datalen > maxdata)
datalen = maxdata;
newline();
- wprintf(" \"");
+ xwprintf(" \"");
for (; datalen > 0; datalen--, dp++) {
(void) vis(visbuf, *dp, VIS_NL|VIS_TAB|VIS_CSTYLE,
/* We put NUL at the end of buffer when reading */
@@ -761,11 +761,11 @@
w = strlen(visbuf);
if (width + w + 2 >= screenwidth)
break;
- wprintf("%s", visbuf);
+ xwprintf("%s", visbuf);
if (width + 2 >= screenwidth)
break;
}
- wprintf("\"");
+ xwprintf("\"");
}
#ifdef notused
@@ -776,7 +776,7 @@
struct ktr_genio *ktr = (struct ktr_genio *)(kth + 1);
dumpheader(kth);
- wprintf("genio fd %d %s",
+ xwprintf("genio fd %d %s",
ktr->ktr_fd, ktr->ktr_rw ? "write" : "read");
genioprint(kth);
@@ -791,11 +791,11 @@
struct ktr_psig *psig = (struct ktr_psig *)(kth + 1);
dumpheader(kth);
- wprintf("SIG%s ", sys_signame[psig->signo]);
+ xwprintf("SIG%s ", sys_signame[psig->signo]);
if (psig->action == SIG_DFL)
- wprintf("SIG_DFL");
+ xwprintf("SIG_DFL");
else {
- wprintf("caught handler=0x%lx mask=0x%lx code=0x%x",
+ xwprintf("caught handler=0x%lx mask=0x%lx code=0x%x",
(u_long)psig->action, (unsigned long)psig->mask.__bits[0],
psig->code);
}
@@ -810,7 +810,7 @@
struct ktr_csw *cs = (struct ktr_csw *)(kth + 1);
dumpheader(kth);
- wprintf("%s %s", cs->out ? "stop" : "resume",
+ xwprintf("%s %s", cs->out ? "stop" : "resume",
cs->user ? "user" : "kernel");
free(kte);
Home |
Main Index |
Thread Index |
Old Index