Re: seng a character to printer port...
- From: Joe Pfeiffer <pfeiffer@xxxxxxxxxxx>
- Date: 22 Jul 2007 16:06:12 -0600
"google-rambo88" <rambo88@xxxxxxxxx> writes:
Very strange... even though I include all header files... related open()
function...
( #include <sys/types.h> ,#include <sys/stat.h>,#include <fcntl.h> )
I met " `O_DIRECT' undeclared (first use in this function) "
1. You aren't writing to a disk, so there's no reason to be
specifying direct disk access.
2. Regardless, you need to
#define _USE_GNU
before you do your #includes for that symbol to exist.
3. There's also no real reason to be using O_SYNC...
Why I can't write character to /dev/lp0?
1. You can get the system to tell you why things don't work by
calling perror() if a system call fails
2. You opened it RD_ONLY. Why do you expect to be able to write?
I 'd like to know How they are diffrect between /dev/lp0 and /dev.par0 and
/dev/parport0 ?
Take a look at the parport.txt and parport-lowlevel.txt files in the
kernel documentation. The short form is that printers are referred to
as lp.
Now... what are you really trying to accomplish? There's really no
reason anybody needs to send data straight to a printer unless they're
doing something *really* esoteric. It doesn't seem likely from you
questions that whatever you're doing really needs that direct access.
.
- References:
- seng a character to printer port...
- From: google-rambo88
- seng a character to printer port...
- Prev by Date: seng a character to printer port...
- Next by Date: Re: seng a character to printer port...
- Previous by thread: seng a character to printer port...
- Next by thread: Re: seng a character to printer port...
- Index(es):
Relevant Pages
|