Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2009 19:46:55 +0000
From:      Bruce Cran <bruce@cran.org.uk>
To:        Vincent Hoffman <vince@unsane.co.uk>
Cc:        Rehbein <tobias.rehbein@web.de>, Tobias, freebsd-questions@freebsd.org
Subject:   Re: [perl] sysopen(CD, "/dev/cd0", O_RDONLY | O_NONBLOCK) fails
Message-ID:  <20090327194655.32d52f27@gluon.draftnet>
In-Reply-To: <49CCADF7.5040902@unsane.co.uk>
References:  <20090326212045.GB3134@sushi.pseudo.local> <200903271132.58872.mel.flynn%2Bfbsd.questions@mailing.thruhere.net> <49CCADF7.5040902@unsane.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Mar 2009 10:44:07 +0000
Vincent Hoffman <vince@unsane.co.uk> 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



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