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; }
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...
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...
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.