Bug 50687

Summary: ioctl(.., CDIOCCAPABILITY, ...) always reports "Inappropriate
Product: Base System Reporter: Heiner <h.eichmann>
Component: kernAssignee: John-Mark Gurney <jmg>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Heiner 2003-04-07 19:00:27 UTC
A call of ioctl(.., CDIOCCAPABILITY, ...) on a cdrom or cd writer device 
(atapi or scsi) alwas returns errno == 25 (Inappropriate ioctl for device).

Fix: 

If I understand it correctly, cdioctl() in src/sys/cam/scsi/scsi_cd.c should 
handle this ioctl call, but I can not find the CDIOCCAPABILITY case. It 
should either be fixed or the corresponding entry in cd(4) should be removed.
How-To-Repeat: #include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/cdio.h>
#include <sys/cdrio.h>
#include <sys/ioctl.h>

int main(int argc, char *argv [])
{
	int fd = open ("/dev/acd0c", O_RDONLY | O_NONBLOCK);
	struct ioc_capability cap; 
	int ret;
	cap.play_function = 0; cap.routing_function = 0; cap.special_function = 0;
	ret=ioctl(fd, CDIOCCAPABILITY, &cap);
	printf("fd: %d, ret: %d, errno: %d: %s\n", fd, ret, errno, strerror(errno));
	close(fd);
	return 0;
}
Comment 1 John-Mark Gurney freebsd_committer freebsd_triage 2010-02-20 08:10:59 UTC
State Changed
From-To: open->analyzed

I'm going to look at removing this and CDIOCPITCH...  It looks like 
matcd was the only one that implemented these and matcd died around 
the 4.x/5.x time frame... 


Comment 2 John-Mark Gurney freebsd_committer freebsd_triage 2010-02-20 08:10:59 UTC
Responsible Changed
From-To: freebsd-bugs->jmg

I'm going to look at removing this and CDIOCPITCH...  It looks like 
matcd was the only one that implemented these and matcd died around 
the 4.x/5.x time frame...
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:46:49 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.