Programming Question - Is it possible to keep parport from issuing EBUSY?
I have an application program that writes a log to a parallel printer.
Specifically, the program spawns a program with a pipe and then writes to that pipe. The program at the other end of the pipe does the printing.
However, I can have several of these programs running at once. Until recently all were using the same program for printing. This worked just fine for decades. (Yes, the program is older than Linux.)
But if I write a new program (in GTK) that also tries to write to the printer (directly, not via the pipe), the second instance gets an EBUSY signal.
While I can see a value to this when people are printing long reports, using spoolers and such, it's not helping me.
(I believe) write is an interruptible system call. The amount of data sent is 81 characters or less.
Pretty much, it's in my way.
However, I'm not trying to whine. I'm trying to find out if there's a way to tell the driver (or whatever it is) just open a second instance.
If not, I have a couple ideas of how to get around this. One is to simply open the printer (waiting until no EBUSY if needed), write, close the printer...repeat.
|