On Fri, 27 Mar 2009 10:44:07 +0000
Vincent Hoffman <vi...@unsane.co.uk> wrote:

> 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.
> 
> [r...@seaurchin ~]# ls -la /dev/cd0
> ls: /dev/cd0: No such file or directory
> [r...@seaurchin ~]# ls -la /dev/acd0
> crw-r-----  1 root  operator    0,  74 Feb  6 12:11 /dev/acd0
> [r...@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
> 
> [r...@seaurchin ~]# kldload atapicam
> [r...@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
> 

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

-- 
Bruce Cran
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to