From: Julian Seward Date: Sun, 20 Oct 2002 18:11:49 +0000 (+0000) Subject: merge (in effect, and without docs) revs: X-Git-Tag: svn/VALGRIND_1_9_4~203 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2174b135aa6dcd97013a98cc1ac431a1a3786bf;p=thirdparty%2Fvalgrind.git merge (in effect, and without docs) revs: valgrind.in 1.17.2.3 vg_syscall_mem.c 1.58.2.12 Add Jeremy Fitzhardinge's --weird-hacks=lax-ioctls patch, and add some docs. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1244 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index de238bbf40..23843ac6f4 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -630,7 +630,7 @@ static void usage ( void ) " --suppressions= suppress errors described in\n" " suppressions file \n" " --weird-hacks=hack1,hack2,... [no hacks selected]\n" -" recognised hacks are: ioctl-VTIME truncate-writes\n" +" recognised hacks are: ioctl-VTIME truncate-writes lax-ioctls\n" "\n" " %s skin user options:\n"; diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index f5dcf5306e..7d1a48fe05 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -2311,7 +2311,17 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) default: { UInt dir = _IOC_DIR(arg2); UInt size = _IOC_SIZE(arg2); - if (/* size == 0 || */ dir == _IOC_NONE) { + if (VG_(strstr)(VG_(clo_weird_hacks), "lax-ioctls") != NULL) { + /* + * Be very lax about ioctl handling; the only + * assumption is that the size is correct. Doesn't + * require the full buffer to be initialized when + * writing. Without this, using some device + * drivers with a large number of strange ioctl + * commands becomes very tiresome. + */ + } + else if (/* size == 0 || */ dir == _IOC_NONE) { VG_(message)(Vg_UserMsg, "Warning: noted but unhandled ioctl 0x%x" " with no size/direction hints",