]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Solaris ioctl: Add wrapper for I_FLUSH.
authorIvo Raisr <ivosh@ivosh.net>
Mon, 16 May 2016 11:38:29 +0000 (11:38 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Mon, 16 May 2016 11:38:29 +0000 (11:38 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15878

coregrind/m_syswrap/syswrap-solaris.c
include/vki/vki-solaris.h
memcheck/tests/solaris/scalar_ioctl.c
memcheck/tests/solaris/scalar_ioctl.stderr.exp

index c8781a125d02a6640477a45cba9a3945b6dd2acd..f30bd9cd4839878fe2403168735c3de1418747be 100644 (file)
@@ -3114,6 +3114,8 @@ PRE(sys_ioctl)
    case VKI_I_PUSH:
       PRE_MEM_RASCIIZ("ioctl(I_PUSH)", ARG3);
       break;
+   case VKI_I_FLUSH:
+      break;
    case VKI_I_STR:
       {
          PRE_MEM_READ("ioctl(I_STR)", ARG3, sizeof(struct vki_strioctl));
@@ -3378,6 +3380,8 @@ POST(sys_ioctl)
    /* STREAMS */
    case VKI_I_PUSH:
       break;
+   case VKI_I_FLUSH:
+      break;
    case VKI_I_STR:
       {
          struct vki_strioctl *p = (struct vki_strioctl *) ARG3;
index 9568036562bd7cf634909848c46b923fcb32ff16..7004b702f726149cdaa813b548034f1a412e4bc5 100644 (file)
@@ -1178,6 +1178,7 @@ typedef struct sigaction vki_sigaction_fromK_t;
 #include <sys/stropts.h>
 #define VKI_I_CANPUT I_CANPUT
 #define VKI_I_FIND I_FIND
+#define VKI_I_FLUSH I_FLUSH
 #define VKI_I_PEEK I_PEEK
 #define VKI_I_PUSH I_PUSH
 #define VKI_I_STR I_STR
index a8c056ec90604b13ded22243142d11f62bb567ce..abd45fc03e93a0104ab1e96cbe9c0cd969789e15 100644 (file)
@@ -158,6 +158,13 @@ static void sys_ioctl_I_PUSH(void)
    SY(SYS_ioctl, x0 - 1, x0 + I_PUSH, x0 + 1); FAIL;
 }
 
+__attribute__((noinline))
+static void sys_ioctl_I_FLUSH(void)
+{
+   GO(SYS_ioctl, "(I_FLUSH) 3s 0m");
+   SY(SYS_ioctl, x0 - 1, x0 + I_FLUSH, x0 + FLUSHR); FAIL;
+}
+
 __attribute__((noinline))
 static void sys_ioctl_I_STR(void)
 {
@@ -481,6 +488,7 @@ int main(void)
 
    /* STREAMS */
    sys_ioctl_I_PUSH();
+   sys_ioctl_I_FLUSH();
    sys_ioctl_I_STR();
    sys_ioctl_I_STR_2();
    sys_ioctl_I_FIND();
index 3add9606328963e65143634f9d867f935256e199..c3593b8364f35970a94c945298dc0c4417acf423 100644 (file)
@@ -292,6 +292,18 @@ Syscall param ioctl(I_PUSH) points to unaddressable byte(s)
    ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
+---------------------------------------------------------
+ 54:               SYS_ioctl (I_FLUSH) 3s 0m
+---------------------------------------------------------
+Syscall param ioctl(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(request) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(arg) contains uninitialised byte(s)
+   ...
+
 ---------------------------------------------------------
  54:               SYS_ioctl (I_STR) 3s 1m
 ---------------------------------------------------------
@@ -390,6 +402,9 @@ Syscall param ioctl(I_PEEK, strpeek->flags) points to unaddressable byte(s)
 Syscall param ioctl(fd) contains uninitialised byte(s)
    ...
 
+
+More than 100 errors detected.  Subsequent errors
+will still be recorded, but in less detail than before.
 Syscall param ioctl(request) contains uninitialised byte(s)
    ...
 
@@ -400,9 +415,6 @@ Syscall param ioctl(I_PEEK, strpeek->ctlbuf.maxlen) points to uninitialised byte
    ...
  Address 0x........ is on thread 1's stack
 
-
-More than 100 errors detected.  Subsequent errors
-will still be recorded, but in less detail than before.
 Syscall param ioctl(I_PEEK, strpeek->ctlbuf.buf) points to uninitialised byte(s)
    ...
  Address 0x........ is on thread 1's stack