From owner-freebsd-questions@FreeBSD.ORG Fri Mar 27 10:44:11 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F0B1106564A for ; Fri, 27 Mar 2009 10:44:11 +0000 (UTC) (envelope-from vince@unsane.co.uk) Received: from unsane.co.uk (unsane-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:110::2]) by mx1.freebsd.org (Postfix) with ESMTP id 674BE8FC0C for ; Fri, 27 Mar 2009 10:44:10 +0000 (UTC) (envelope-from vince@unsane.co.uk) Received: from vhoffman.lon.namesco.net (150.117-84-212.staticip.namesco.net [212.84.117.150]) (authenticated bits=0) by unsane.co.uk (8.14.3/8.14.0) with ESMTP id n2RAkEct067543 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 27 Mar 2009 10:46:15 GMT (envelope-from vince@unsane.co.uk) Message-ID: <49CCADF7.5040902@unsane.co.uk> Date: Fri, 27 Mar 2009 10:44:07 +0000 From: Vincent Hoffman User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1b3pre) Gecko/20081204 Thunderbird/3.0b1 MIME-Version: 1.0 To: Mel Flynn References: <20090326212045.GB3134@sushi.pseudo.local> <200903271132.58872.mel.flynn+fbsd.questions@mailing.thruhere.net> In-Reply-To: <200903271132.58872.mel.flynn+fbsd.questions@mailing.thruhere.net> X-Enigmail-Version: 0.96a Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: 7bit Cc: Tobias Rehbein , freebsd-questions@freebsd.org Subject: Re: [perl] sysopen(CD, "/dev/cd0", O_RDONLY | O_NONBLOCK) fails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2009 10:44:11 -0000 On 27/3/09 10:32, Mel Flynn wrote: > On Thursday 26 March 2009 22:20:45 Tobias Rehbein wrote: > >> Hi all. >> >> I have a perl script which seems to work fine under Linux but fails on >> FreeBSD. The Problem is the line: >> >> sysopen(CD, "/dev/cd0", O_RDONLY | O_NONBLOCK) >> >> After this line the following evaluates to true: >> >> $! eq "No such file or directory." >> > > If you're running this in a jail, then cd0 is hidden by devfs, hence the > ENOENT. You will need to provide a jail specific ruleset, or override > devfsrules_jail from /etc/defaults/devfs.rules in /etc/devfs.rules so it > applies to all jails without modification to /etc/rc.conf. > By default for an ATA/ATAPI CDROM, you get an /dev/acd0 not a /dev/cd0 in FreeBSD. [root@seaurchin ~]# ls -la /dev/cd0 ls: /dev/cd0: No such file or directory [root@seaurchin ~]# ls -la /dev/acd0 crw-r----- 1 root operator 0, 74 Feb 6 12:11 /dev/acd0 [root@seaurchin ~]# To have a /dev/cd0 either use a scsi CDROM or kldload atapicam which allows ATAPI devices to be accessed via the cam subsytem and will create a /dev/cd0 node [root@seaurchin ~]# kldload atapicam [root@seaurchin ~]# ls -la /dev/cd0 crw-r----- 1 root operator 0, 113 Feb 6 12:11 /dev/cd0 or just change the code to use /dev/acd0 Vince