summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2011-10-21 11:08:25 +0000
committerdes <des@FreeBSD.org>2011-10-21 11:08:25 +0000
commit6c6abb3ddc0d7b2572a91949e5eaf448f0a392af (patch)
tree762720b203c8a69ddb88af3b29c52f2a2c9d5302 /usr.bin/truss
parent28e8dea25892d12660b01d59590e5a8e70ae3880 (diff)
downloadFreeBSD-src-6c6abb3ddc0d7b2572a91949e5eaf448f0a392af.zip
FreeBSD-src-6c6abb3ddc0d7b2572a91949e5eaf448f0a392af.tar.gz
It turns out that truss also used kdump's mkioctls script, and expected
ioctlname() to return a pointer to the name rather than print it. This did not show up in testing because truss had its own prototype for ioctlname(), so it would build fine and run fine as long as the program being traced did not issue an ioctl. Teach mkioctls to generate different versions of ioctlname() based on its first command-line argument. Pointed out by: Garrett Cooper <yanegomi@gmail.com>
Diffstat (limited to 'usr.bin/truss')
-rw-r--r--usr.bin/truss/Makefile3
-rw-r--r--usr.bin/truss/extern.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/truss/Makefile b/usr.bin/truss/Makefile
index f80ac03..31f08d4 100644
--- a/usr.bin/truss/Makefile
+++ b/usr.bin/truss/Makefile
@@ -23,7 +23,8 @@ syscalls.h: syscalls.master
${.CURDIR}/i386.conf
ioctl.c: ${.CURDIR}/../kdump/mkioctls
- sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
+ env MACHINE=${MACHINE} \
+ /bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}/usr/include > ${.TARGET}
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= i386-linux.c linux_syscalls.h
diff --git a/usr.bin/truss/extern.h b/usr.bin/truss/extern.h
index e3ffc4f..a56a01e 100644
--- a/usr.bin/truss/extern.h
+++ b/usr.bin/truss/extern.h
@@ -35,7 +35,7 @@ extern int setup_and_wait(char **);
extern int start_tracing(int);
extern void restore_proc(int);
extern void waitevent(struct trussinfo *);
-extern const char *ioctlname(register_t val);
+extern const char *ioctlname(unsigned long val);
extern char *strsig(int sig);
#ifdef __amd64__
extern void amd64_syscall_entry(struct trussinfo *, int);
OpenPOWER on IntegriCloud