This is something that I had known for years but never had a chance to try out. Recently I had to write a program to control parallel ports. I decided to do with iopl and in/outb. However, they did not work for me. Then I tried this. Just open the file, seek till where your parallel port is, write the data! It worked like a charm. Below is a small code snippet to do it.
int main(int argc, char *argv)
unsigned char data=0xaa;
if ( fd1 < 0 ) return fd1;
You will have to change 0x378 to your parallel port base address. Also data is at offset 0, status is at offset 1 and control is at offset 2.