Author: jhb
Date: Sun Mar 19 00:36:29 2017
New Revision: 315525
URL: https://svnweb.freebsd.org/changeset/base/315525

Log:
  Improve decoding of last arguments to ioctl() and sendto().
  
  Decode the last argument to ioctl() as a pointer rather than an int.
  Eventually this could use 'int' for the _IOWINT() case and pointers for
  all others.
  
  The last argument to sendto() is a socklen_t value, not a pointer.

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c       Sun Mar 19 00:31:21 2017        
(r315524)
+++ head/usr.bin/truss/syscalls.c       Sun Mar 19 00:36:29 2017        
(r315525)
@@ -177,7 +177,7 @@ static struct syscall decoded_syscalls[]
        { .name = "gettimeofday", .ret_type = 1, .nargs = 2,
          .args = { { Timeval | OUT, 0 }, { Ptr, 1 } } },
        { .name = "ioctl", .ret_type = 1, .nargs = 3,
-         .args = { { Int, 0 }, { Ioctl, 1 }, { Hex, 2 } } },
+         .args = { { Int, 0 }, { Ioctl, 1 }, { Ptr, 2 } } },
        { .name = "kevent", .ret_type = 1, .nargs = 6,
          .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 },
                    { Int, 4 }, { Timespec, 5 } } },
@@ -288,7 +288,7 @@ static struct syscall decoded_syscalls[]
                    { Timeval, 4 } } },
        { .name = "sendto", .ret_type = 1, .nargs = 6,
          .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { Hex, 3 },
-                   { Sockaddr | IN, 4 }, { Ptr | IN, 5 } } },
+                   { Sockaddr | IN, 4 }, { Int | IN, 5 } } },
        { .name = "setitimer", .ret_type = 1, .nargs = 3,
          .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } },
        { .name = "setrlimit", .ret_type = 1, .nargs = 2,
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to