[PARPORT] ppdev question

From: stef (svoltz@wanadoo.fr)
Date: Thu Mar 01 2001 - 10:01:03 EST

  • Next message: Tim Waugh: "Re: [PARPORT] ppdev question"


            I am trying to use ppdev to ensure that my printer and my scanner share
    correctly the parallel port. From the tests I done, it seems that ppdev lets you
    claim the port even if it is used by lp.

             For instance, the following program may be ran successfully when a printing
    is in progress, while I expected it to fail with 'tp: cannot claim port':

    int main (int argc, char *argv[])
      int fd;
      int compat = IEEE1284_MODE_COMPAT;

              return 1;

      fd = open (argv[1], O_RDONLY | O_NOCTTY);

      if (fd == -1)
          perror (argv[1]);
          return fd;

      if (ioctl (fd, PPCLAIM))
          fprintf (stderr, "tp: cannot claim port\n");
          close (fd);
          return 1;

      ioctl (fd, PPRELEASE);
      close (fd);

      return 0;

            I certainly misunderstood something, but what ?


    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --

    This archive was generated by hypermail 2b29 : Thu Mar 01 2001 - 10:00:13 EST