Add support for the SIOCSHWTSTAMP ioctl, based on a patch
authortom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Wed, 11 Jul 2012 14:33:10 +0000 (14:33 +0000)
committertom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Wed, 11 Jul 2012 14:33:10 +0000 (14:33 +0000)
from Arseny Solokha. Fixes BZ#296792.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12730 a5019735-40e9-0310-863c-91ae7b9d1cf9

coregrind/m_syswrap/syswrap-linux.c
include/vki/vki-linux.h

index 24fcb805e47d2823ceaecee7b5ab47f3253298e6..edbd61c62bbb015003abb8f5b6b66005078439a5 100644 (file)
@@ -4489,6 +4489,13 @@ PRE(sys_ioctl)
                      (Addr)&((struct vki_ifreq *)ARG3)->ifr_map,
                      sizeof(((struct vki_ifreq *)ARG3)->ifr_map) );
       break;
+   case VKI_SIOCSHWTSTAMP:       /* Set hardware time stamping   */
+      PRE_MEM_RASCIIZ( "ioctl(SIOCSHWTSTAMP)",
+                     (Addr)((struct vki_ifreq *)ARG3)->vki_ifr_name );
+      PRE_MEM_READ( "ioctl(SIOCSHWTSTAMP)",
+                     (Addr)((struct vki_ifreq *)ARG3)->vki_ifr_data,
+                     sizeof(struct vki_hwtstamp_config) );
+      break;
    case VKI_SIOCSIFTXQLEN:       /* Set the tx queue length      */
       PRE_MEM_RASCIIZ( "ioctl(SIOCSIFTXQLEN)",
                      (Addr)((struct vki_ifreq *)ARG3)->vki_ifr_name );
@@ -5756,6 +5763,7 @@ POST(sys_ioctl)
                     
    case VKI_SIOCSIFFLAGS:        /* set flags                    */
    case VKI_SIOCSIFMAP:          /* Set device parameters        */
+   case VKI_SIOCSHWTSTAMP:       /* Set hardware time stamping   */
    case VKI_SIOCSIFTXQLEN:       /* Set the tx queue length      */
    case VKI_SIOCSIFDSTADDR:      /* set remote PA address        */
    case VKI_SIOCSIFBRDADDR:      /* set broadcast PA address     */
index 5df1b222d4f4263723896e5637531888a6685327..e90f1e63163c552a5a76ded12c0489376c501829 100644 (file)
@@ -1622,6 +1622,8 @@ typedef struct {
 #define VKI_SIOCGIFMAP         0x8970  /* Get device parameters        */
 #define VKI_SIOCSIFMAP         0x8971  /* Set device parameters        */
 
+#define VKI_SIOCSHWTSTAMP      0x89B0  /* Set hardware time stamping */
+
 //----------------------------------------------------------------------
 // From linux-2.6.8.1/include/linux/ppdev.h
 //----------------------------------------------------------------------
@@ -2978,6 +2980,16 @@ struct vki_hci_inquiry_req {
 #define VKI_KVM_S390_INITIAL_RESET    _VKI_IO(KVMIO,   0x97)
 #define VKI_KVM_NMI                   _VKI_IO(KVMIO,   0x9a)
 
+//----------------------------------------------------------------------
+// From linux-2.6/include/linux/net_stamp.h
+//----------------------------------------------------------------------
+
+struct vki_hwtstamp_config {
+       int flags;
+       int tx_type;
+       int rx_filter;
+};
+
 #endif // __VKI_LINUX_H
 
 /*--------------------------------------------------------------------*/