From owner-freebsd-questions@FreeBSD.ORG Fri Mar 27 19:47:04 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 1B243106566C for ; Fri, 27 Mar 2009 19:47:04 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (brucec-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:c09::2]) by mx1.freebsd.org (Postfix) with ESMTP id C98928FC0C for ; Fri, 27 Mar 2009 19:47:03 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id DDC2B19017; Fri, 27 Mar 2009 19:47:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon X-Spam-Level: X-Spam-Status: No, score=-2.6 required=8.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 Received: from gluon.draftnet (unknown [IPv6:2a01:348:10f:0:240:f4ff:fe57:9871]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Fri, 27 Mar 2009 19:47:01 +0000 (GMT) Date: Fri, 27 Mar 2009 19:46:55 +0000 From: Bruce Cran To: Vincent Hoffman Message-ID: <20090327194655.32d52f27@gluon.draftnet> In-Reply-To: <49CCADF7.5040902@unsane.co.uk> References: <20090326212045.GB3134@sushi.pseudo.local> <200903271132.58872.mel.flynn+fbsd.questions@mailing.thruhere.net> <49CCADF7.5040902@unsane.co.uk> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Cc: Rehbein , Tobias, 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 19:47:04 -0000 On Fri, 27 Mar 2009 10:44:07 +0000 Vincent Hoffman wrote: > On 27/3/09 10:32, Mel Flynn wrote: > > On Thursday 26 March 2009 22:20:45 Tobias Rehbein wrote: > > =20 > >> 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." > >> =20 > > > > 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.=20 > By default for an ATA/ATAPI CDROM, you get an /dev/acd0 not a /dev/cd0 > in FreeBSD. >=20 > [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 ~]# >=20 > 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 >=20 > [root@seaurchin ~]# kldload atapicam > [root@seaurchin ~]# ls -la /dev/cd0 > crw-r----- 1 root operator 0, 113 Feb 6 12:11 /dev/cd0 >=20 > or just change the code to use /dev/acd0 >=20 =46rom the original message: "/dev/cd0 is readable and writable for me. I rebooted multiple times and tried with and without atapicam." So it sounds like the OP is aware of the different device nodes created with and without atapicam, has checked he has permission to access the appropriate device and has come across a problem with perl itself. --=20 Bruce Cran