User space - Printer not responding - someone please help !!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all,

           with my high spirits of witing a parrallel
port (printer module) dying  ... i tried something
like this ;-) .just to get the printer showing some
movement to my code ..

#include<linux/parport.h>
...
....
....


main()
{
  int fd,wrote,res;

  fd = open("/dev/parport0",O_RDWR);
  if(fd < 0) { 
     ....
  
  }

  res = ioctl(fd,PPCLAIM);
  
  if(res < 0) {
     .....
   }


   wrote = write(fd,"abcdef\n",7);
   printf("\n Wrote %d bytes to printer !\n",wrote);
}

result :
wrote 7 bytes to printer ! 
         
Printer isn't responding ! i can see the parport and
related (dep)  modules being loaded after i do a lsmod
after running this programme.
i.e i didnt exit the above code i had given a 
while(1); at the end .
can someone throw some *bright* light on this :-)

The printer is working fine and it is connected
properly - coz i tried printing from Windows and it is
working fine. 

thanks for your time.

cheers,
Amith

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux