from the quill of [EMAIL PROTECTED] on scroll
<[EMAIL PROTECTED]>
> 
> Actually,  the 'dumbness' comes from the fact that there is
> no way to request status information using PCL,  so you might as
> well not ask for it.

I realize that.  The printer model "pcl" only includes PCL capabilities
and excludes PJL capabilities altogether.  I understand that.  What I am
asking is whether there is an effective method of testing for the
presence of any PJL at all if is so discovering (even if by trial and
error) what commands are supported.

> Actually, the child does not know what the parent did.

The child being ifhp and the parent being lpd right?

> The problem here is that LPRng did the open,  did a fork,
> dup'ed the open file descriptor to FD 1,  and then did an exev of
> the ifhp program.

Ahhh.  You answered my question.

> At this point all the ifhp has available is the whimpy fcntl() call
> to determine what facilities it can use.

OK.  But under what circumstances does lpd know to whether to open
read/write or write only?  Presumably lpd is making a choice somewhere,
somehow when it does the open.

> Now if anybody knows a way to find out the allowed operations
> (or if it was open READ/WRITE/ or APPEND) using some system calls,
> please tell me.  Even if they are not portable,  I will put them
> into the code base.

fcntl() will tell you what flags are set on an FD, including whether it
is O_WRONLY or not.  Here is a line from an strace of lpd on linux:

fcntl(3, F_GETFL)                 = 0x1 (flags O_WRONLY)

and if strace can determine that O_WRONLY so should lpd be able to.

But I am sure you know all of this, so I must be missing something
blindingly obvious.

b.


--
Brian J. Murrell                              InterLinx Support Services, Inc.
North Vancouver, B.C.                                             604 983 UNIX
        Platform and Brand Independent UNIX Support - R3.2 - R4 - BSD

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to