I would like it best if my "open" would fail. However I have tried calling
open with O_EXCL and it still opens when another process has claimed the
/dev/parportX. I have also tried calling ioctl with PPEXCL and it still
will not keep other processes from blocking when trying to get at it...
Bob, why O_NOCTTY, I thought that was for serial devices?
I am using kernel 2.4.2-2... I know, I know, get a more modern kernel,
right? :) Cannot do that.
----- Original Message -----
From: "Bob Tanner" <email@example.com>
To: "Tim Waugh" <firstname.lastname@example.org>
Sent: Friday, April 25, 2003 12:07 PM
Subject: Re: [PARPORT] ioctl(parport, PPCLAIM) hangs?
> On Friday 25 April 2003 07:13 am, Tim Waugh wrote:
> > On Thu, Apr 24, 2003 at 12:41:03PM -0500, Bob Tanner wrote:
> > > I switch the BIOS to EPP 1.9 mode, now the following code hangs.
> > >
> > > int parport = open("/dev/parport0", O_RDWR|O_NOCTTY);
> > > ioctl(parport, PPCLAIM); <-- hangs
> > >
> > > Why would the ioctl() hang when I try to claim the port?
> > Because some other driver has the port already and isn't letting it
> > go. It's also a badly-behaved driver, since if it isn't going to let
> > go of the port it ought to have asked for exclusive access in the
> > first place (in which case the open would have failed I think).
> > It might be the lp driver: in interrupt-driven mode it doesn't behave
> > nicely like it should.
> > Find out: /proc/sys/dev/parport/parport0/devices/active
> Ugh! Yep, a badly behaving user-space parport program. I've had a little
> "discussion" with the team member about learning to share. :-)
> Thanks for the advise.
> Bob Tanner <email@example.com> | Phone : (952)943-8700
> http://www.mn-linux.org, Minnesota, Linux | Fax : (952)943-8500
> Key fingerprint = AB15 0BDF BCDE 4369 5B42 1973 7CF1 A709 2CC1 B288
> -- To unsubscribe, send mail to: firstname.lastname@example.org --
> -- with the single word "unsubscribe" in the body of the message. --
-- To unsubscribe, send mail to: email@example.com --
-- with the single word "unsubscribe" in the body of the message. --
This archive was generated by hypermail 2b29 : Thu May 01 2003 - 20:21:41 EDT