From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 7 11:00:30 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1049237B408 for ; Mon, 7 Apr 2003 11:00:30 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2808243FB1 for ; Mon, 7 Apr 2003 11:00:28 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h37I0RUp041518 for ; Mon, 7 Apr 2003 11:00:27 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h37I0Rer041517; Mon, 7 Apr 2003 11:00:27 -0700 (PDT) Resent-Date: Mon, 7 Apr 2003 11:00:27 -0700 (PDT) Resent-Message-Id: <200304071800.h37I0Rer041517@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Heiner Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FBAE37B401 for ; Mon, 7 Apr 2003 10:54:41 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.net [213.165.65.60]) by mx1.FreeBSD.org (Postfix) with SMTP id 387F643F93 for ; Mon, 7 Apr 2003 10:54:40 -0700 (PDT) (envelope-from h.eichmann@gmx.de) Received: (qmail 16303 invoked by uid 65534); 7 Apr 2003 17:54:38 -0000 Received: from pD9EC39A6.dip.t-dialin.net (EHLO 192.168.254.43) (217.236.57.166) by mail.gmx.net (mp001-rz3) with SMTP; 07 Apr 2003 19:54:38 +0200 Message-Id: <200304071954.01722.h.eichmann@gmx.de> Date: Mon, 7 Apr 2003 18:54:01 +0100 From: Heiner To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/50687: ioctl(.., CDIOCCAPABILITY, ...) always reports "Inappropriate ioctl for device" on cd drives X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2003 18:00:30 -0000 >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 >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 #include #include #include #include #include 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