Add support for the HDIO_GET_IDENTITY ioctl based on patch
from Jim McDonald <jim@mcdee.net>.

CCMAIL: 83340-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2425 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c
index 0e33c42..d6037bf 100644
--- a/coregrind/vg_syscalls.c
+++ b/coregrind/vg_syscalls.c
@@ -3325,6 +3325,12 @@
       break;
 #           endif /* BLKGETSIZE */
 
+      /* Hard disks */
+   case HDIO_GET_IDENTITY: /* 0x030d */
+      SYSCALL_TRACK( pre_mem_write,tid, "ioctl(HDIO_GET_IDENTITY)", arg3,
+                     sizeof(struct hd_driveid) );
+      break;
+
       /* CD ROM stuff (??)  */
    case CDROM_GET_MCN:
       SYSCALL_TRACK( pre_mem_read,tid, "ioctl(CDROM_GET_MCN)", arg3,
@@ -3780,6 +3786,12 @@
       break;
 #           endif /* BLKGETSIZE */
 
+      /* Hard disks */
+   case HDIO_GET_IDENTITY: /* 0x030d */
+      if (res == 0)
+	 VG_TRACK( post_mem_write,arg3, sizeof(struct hd_driveid));
+      break;
+
       /* CD ROM stuff (??)  */
    case CDROMSUBCHNL:
       if (res == 0)
diff --git a/coregrind/vg_unsafe.h b/coregrind/vg_unsafe.h
index 3944a29..6bcc8ab 100644
--- a/coregrind/vg_unsafe.h
+++ b/coregrind/vg_unsafe.h
@@ -63,6 +63,7 @@
 #include <linux/cdrom.h>  /* for cd-rom ioctls */
 #include <signal.h>       /* for siginfo_t */
 #include <linux/timex.h>  /* for adjtimex */
+#include <linux/hdreg.h>  /* for hard drive ioctls */
 #ifdef HAVE_LINUX_FB_H
 #include <linux/fb.h>     /* for fb_* structs */
 #endif