Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2009 22:11:28 +0000
From:      Bruce Cran <bruce@cran.org.uk>
To:        Tobias Rehbein <tobias.rehbein@web.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: [perl] sysopen(CD, "/dev/cd0", O_RDONLY | O_NONBLOCK) fails
Message-ID:  <20090326221128.3a6d648f@gluon.draftnet>
In-Reply-To: <20090326212045.GB3134@sushi.pseudo.local>
References:  <20090326212045.GB3134@sushi.pseudo.local>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 26 Mar 2009 22:20:45 +0100
Tobias Rehbein <tobias.rehbein@web.de> 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."
> 
> /dev/cd0 is readable and writable for me. I rebooted multiple times
> and tried with and without atapicam. 
> 
>         sysopen(CD, "/dev/acd0", O_RDONLY | O_NONBLOCK)
> 
> fails either. So what's up here? Is sysopen a linuxism?
> 

sysopen certainly works on FreeBSD:

> perl
use POSIX;
sysopen(CD,"/dev/acd0", O_RDONLY|O_NONBLOCK) || perror("sysopen")
> 

and before I fixed the permissions:

> perl
use POSIX;
sysopen(CD,"/dev/acd0", O_RDONLY|O_NONBLOCK) || perror("sysopen")
sysopen: Permission denied
>

-- 
Bruce Cran



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