Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Apr 2003 18:54:01 +0100
From:      Heiner <h.eichmann@gmx.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/50687: ioctl(.., CDIOCCAPABILITY, ...) always reports "Inappropriate ioctl for device" on cd drives
Message-ID:  <200304071954.01722.h.eichmann@gmx.de>
Resent-Message-ID: <200304071800.h37I0Rer041517@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         50687
>Category:       kern
>Synopsis:       ioctl(.., CDIOCCAPABILITY, ...) always reports "Inappropriate
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 07 11:00:27 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Heiner Eichmann <h.eichmann@gmx.de>
>Release:        FreeBSD 4.8-RC2
>Organization:
Sirius Cybernetics Corp.
>Environment:
System: FreeBSD 4.8-RC #2: Thu Apr  3 11:05:05 CEST 2003
    root@7of9.unimatrix-zero.borg:/usr/obj/usr/src/sys/MYKERNEL i386
>Description:
A call of ioctl(.., CDIOCCAPABILITY, ...) on a cdrom or cd writer device 
(atapi or scsi) alwas returns errno == 25 (Inappropriate ioctl for device). 
>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;
}

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

>Release-Note:
>Audit-Trail:
>Unformatted:
 ioctl for device" on cd drives



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304071954.01722.h.eichmann>