]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added SIOCOUTQ ioctl, thanks to Lennert Buytenhek <buytenh@gnu.org>.
authorNicholas Nethercote <njn@valgrind.org>
Thu, 12 Jun 2003 14:27:58 +0000 (14:27 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Thu, 12 Jun 2003 14:27:58 +0000 (14:27 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1681

coregrind/vg_syscalls.c

index 287e7b268aa53d82dddfc53ba1f3514c43fa0325..99143ba317aea2c7cb6505b15f94b2ae022f9d79 100644 (file)
@@ -2055,7 +2055,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                                             arg3, sizeof(int) );
                KERNEL_DO_SYSCALL(tid,res);
                break;
-            case FIONREAD:
+            case FIONREAD:                /* identical to SIOCINQ */
                SYSCALL_TRACK( pre_mem_write, tst, "ioctl(FIONREAD)", 
                                              arg3, sizeof(int) );
                KERNEL_DO_SYSCALL(tid,res);
@@ -2197,6 +2197,17 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                if (!VG_(is_kerror)(res) && res == 0)
                   VG_TRACK( post_mem_write,arg3, sizeof(struct timeval));
                break;
+            /* SIOCOUTQ is an ioctl that, when called on a socket, returns
+               the number of bytes currently in that socket's send buffer.
+               It writes this value as an int to the memory location
+               indicated by the third argument of ioctl(2). */
+            case SIOCOUTQ:
+               SYSCALL_TRACK( pre_mem_write,tst, "ioctl(SIOCOUTQ)", arg3, 
+                                sizeof(int));
+               KERNEL_DO_SYSCALL(tid,res);
+               if (!VG_(is_kerror)(res) && res == 0)
+                  VG_TRACK( post_mem_write,arg3, sizeof(int));
+               break;
             case SIOCGRARP:           /* get RARP table entry         */
             case SIOCGARP:            /* get ARP table entry          */
                SYSCALL_TRACK( pre_mem_write,tst, "ioctl(SIOCGARP)", arg3,