[Linux-parport] Two processes, one parport
brent at fs2.com
Wed May 10 20:08:45 EDT 2006
I've scoured the lists and googled everywhere but came up
short-handed. I'm trying to use parport on RedHat 8 (Linux 2.4.20-8) in
two parallel processes. One process handles the data transfer, the
other probes the device for status information.
With just one process, everything works fine. When the second
process tries to read or write data, it always fails. The code PPCLAIMs
the file descriptor (fd) before each read/write and PPRELEASEs it
afterward. There is no problem with claiming or releasing each fd in
each process, but the second process always writes zero bytes and hangs
When /dev/parport0 is opened with O_NOBLOCK, the read no longer
hangs but simply returns with status=-1 and errno=EAGAIN (Resource
temporarily unavailable). Monitoring the PPRSTATUS value before each
read in the first process always shows 0xD6 (PARPORT_STATUS_BUSY set),
but in the second process it always shows 0x56 (neither BUSY or ERROR
What am I doing wrong, and how can I share the parport with both
MIPS Technologies, Inc.
First Silicon Solutions (FS2) Division
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Linux-parport