]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add Jeremy Fitzhardinge's --weird-hacks=lax-ioctls patch, and add some docs.
authorJulian Seward <jseward@acm.org>
Sun, 13 Oct 2002 15:06:24 +0000 (15:06 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 13 Oct 2002 15:06:24 +0000 (15:06 +0000)
MERGE TO HEAD

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_1_0_BRANCH@1223

docs/manual.html
valgrind.in
vg_syscall_mem.c

index cd0bc88e9b8c4f5d5d014b2f14c8ba8465f10e7f..013059ec7f0b7202963c4f4161aec70f68b08d46 100644 (file)
@@ -670,8 +670,18 @@ follows:
           unexpectedly in the <code>write()</code> system call, you
           may find the <code>--trace-syscalls=yes
           --trace-sched=yes</code> flags useful.
+      <p>
+      <li><code>lax-ioctls</code> Reduce accuracy of ioctl checking.
+          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.  You can use this as a quick hack to workaround
+          unimplemented ioctls.  A better long-term solution is to
+          write a proper wrapper for the ioctl.  This is quite easy
+          - for details read
+          <code>README_MISSING_SYSCALL_OR_IOCTL</code> in the
+          source distribution.
       </ul>
-
       </li><p>
 </ul>
 
index b0082fb32eb2191d28c2619d8e987274692ca205..c4c84db2d30ebde1b1e9431b3414f2802d8cc1b6 100755 (executable)
@@ -145,7 +145,7 @@ if [ $# = 0 ] || [ z"$dousage" = z1 ]; then
    echo "    --D1=<size>,<assoc>,<line_size>  set D1 cache manually"
    echo "    --L2=<size>,<assoc>,<line_size>  set L2 cache manually"
    echo "    --weird-hacks=hack1,hack2,...  [no hacks selected]"
-   echo "         recognised hacks are: ioctl-VTIME truncate-writes"
+   echo "       recognised hacks are: ioctl-VTIME truncate-writes lax-ioctls"
    echo ""
    echo
    echo "  options for debugging Valgrind itself are:"
index 632ca5bcc085f2825afb0e7e863e6cdbdb59ba05..19203a15cb1026abcee56757505b56a2fbda13f2 100644 (file)
@@ -2334,7 +2334,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",
@@ -2345,6 +2355,9 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                   VG_(message)(Vg_UserMsg, 
                      "   See README_MISSING_SYSCALL_OR_IOCTL for guidance on"
                      " writing a proper wrapper." );
+                  VG_(message)(Vg_UserMsg, 
+                     "   Alternatively, suppress using flag: "
+                     "--weird-hacks=lax-ioctls");
                } else {
                   if ((dir & _IOC_WRITE) && size > 0)
                      must_be_readable(tst, "ioctl(generic)", arg3, size);