Bug 302827 - [PATCH] add wrapper for CDROM_GET_CAPABILITY
Summary: [PATCH] add wrapper for CDROM_GET_CAPABILITY
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.7 SVN
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-01 12:16 UTC by nick black
Modified: 2012-07-11 12:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nick black 2012-07-01 12:16:07 UTC
Howdy! My growlight program (http://nick-black.com/dankwiki/index.php/Growlight) uses libblkid from util-linux, which calls the CDROM_GET_CAPABILITY ioctl(). I've added support for it in the attached, tested patch. Please apply. Thanks!

Reproducible: Always

Steps to Reproduce:
1. Run program using ioctl(CDROM_GET_CAPABILITY)
2.
3.
Actual Results:  
Unhandled ioctl()

Expected Results:  
Handled ioctl()

[skynet](0) $ svn diff
Index: coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-linux.c	(revision 12692)
+++ coregrind/m_syswrap/syswrap-linux.c	(working copy)
@@ -4211,6 +4211,8 @@
    case VKI_SCSI_IOCTL_DOORLOCK:
    case VKI_SCSI_IOCTL_DOORUNLOCK:
       
+   case VKI_CDROM_GET_CAPABILITY: /* 0x5331 */
+
    /* KVM ioctls that dont check for a numeric value as parameter */
    case VKI_KVM_S390_ENABLE_SIE:
    case VKI_KVM_S390_INITIAL_RESET:
@@ -5949,6 +5951,8 @@
       
    case VKI_CDROMPLAYMSF:
       break;
+   case VKI_CDROM_GET_CAPABILITY: /* 0x5331, overloads ioctl() return value */
+      break;
       /* The following two are probably bogus (should check args
 	 for readability).  JRS 20021117 */
    case VKI_CDROM_DRIVE_STATUS: /* 0x5326 */
Index: include/vki/vki-linux.h
===================================================================
--- include/vki/vki-linux.h	(revision 12692)
+++ include/vki/vki-linux.h	(working copy)
@@ -1813,6 +1813,7 @@
 #define VKI_CDROM_DRIVE_STATUS	0x5326  /* Get tray position, etc. */
 
 #define VKI_CDROM_SEND_PACKET	0x5393	/* send a packet to the drive */
+#define VKI_CDROM_GET_CAPABILITY	0x5331  /* get "capabilities" */
 
 struct vki_cdrom_msf0		
 {
[skynet](0) $ 

BTW, I'm actually running 3.8.0-SVN, which doesn't have an entry in your versions tracker.
Comment 1 Tom Hughes 2012-07-11 12:02:19 UTC
Committed as r12726.