Bug 50687 - ioctl(.., CDIOCCAPABILITY, ...) always reports "Inappropriate
Summary: ioctl(.., CDIOCCAPABILITY, ...) always reports "Inappropriate
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: John-Mark Gurney
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-07 19:00 UTC by Heiner
Modified: 2018-05-28 19:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 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 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.