Add support for private futexes (whatever they might be).  Patch from
Eric Dumazet.  Fixes #146781.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7169 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 88b160c..0d8c90a 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -844,21 +844,25 @@
    PRINT("sys_futex ( %p, %d, %d, %p, %p )", ARG1,ARG2,ARG3,ARG4,ARG5);
    switch(ARG2) {
    case VKI_FUTEX_CMP_REQUEUE:
+   case VKI_FUTEX_CMP_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
       PRE_REG_READ6(long, "futex", 
                     vki_u32 *, futex, int, op, int, val,
                     struct timespec *, utime, vki_u32 *, uaddr2, int, val3);
       break;
    case VKI_FUTEX_REQUEUE:
+   case VKI_FUTEX_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
       PRE_REG_READ5(long, "futex", 
                     vki_u32 *, futex, int, op, int, val,
                     struct timespec *, utime, vki_u32 *, uaddr2);
       break;
    case VKI_FUTEX_WAIT:
+   case VKI_FUTEX_WAIT | VKI_FUTEX_PRIVATE_FLAG:
       PRE_REG_READ4(long, "futex", 
                     vki_u32 *, futex, int, op, int, val,
                     struct timespec *, utime);
       break;
    case VKI_FUTEX_WAKE:
+   case VKI_FUTEX_WAKE | VKI_FUTEX_PRIVATE_FLAG:
    case VKI_FUTEX_FD:
       PRE_REG_READ3(long, "futex", 
                     vki_u32 *, futex, int, op, int, val);
@@ -874,16 +878,20 @@
 
    switch(ARG2) {
    case VKI_FUTEX_WAIT:
+   case VKI_FUTEX_WAIT | VKI_FUTEX_PRIVATE_FLAG:
       if (ARG4 != 0)
 	 PRE_MEM_READ( "futex(timeout)", ARG4, sizeof(struct vki_timespec) );
       break;
 
    case VKI_FUTEX_REQUEUE:
+   case VKI_FUTEX_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
    case VKI_FUTEX_CMP_REQUEUE:
+   case VKI_FUTEX_CMP_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
       PRE_MEM_READ( "futex(futex2)", ARG5, sizeof(Int) );
       break;
 
    case VKI_FUTEX_WAKE:
+   case VKI_FUTEX_WAKE | VKI_FUTEX_PRIVATE_FLAG:
    case VKI_FUTEX_FD:
       /* no additional pointers */
       break;
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
index 1f95bd5..086b250 100644
--- a/include/vki/vki-linux.h
+++ b/include/vki/vki-linux.h
@@ -1151,6 +1151,7 @@
 #define VKI_FUTEX_FD (2)
 #define VKI_FUTEX_REQUEUE (3)
 #define VKI_FUTEX_CMP_REQUEUE (4)
+#define VKI_FUTEX_PRIVATE_FLAG (128)
 
 struct vki_robust_list {
 	struct vki_robust_list __user *next;