From owner-freebsd-hackers Tue May 2 8:47:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from elisa.utopianet.net (elisa.utopianet.net [212.210.231.2]) by hub.freebsd.org (Postfix) with ESMTP id 411CA37BE5B for ; Tue, 2 May 2000 08:46:52 -0700 (PDT) (envelope-from l.iania@sintesi.net) Received: from lorenzo (giorgia.sintesi.net [212.210.231.9]) by elisa.utopianet.net (8.9.1a/8.9.1) with SMTP id RAA17492 for ; Tue, 2 May 2000 17:46:37 +0200 (CEST) Message-ID: <047901bfb44d$f0173f00$0500000a@sintesi.intr> Reply-To: "Lorenzo Iania" From: "Lorenzo Iania" To: Subject: Re: lpr: order of print requests Date: Tue, 2 May 2000 17:49:01 +0200 Organization: S.IN.TE.S.I. Srl MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0476_01BFB45E.B33B59C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. ------=_NextPart_000_0476_01BFB45E.B33B59C0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Konrad Heuer wrote =20 > Hmm, I've never seen such a strange behaviour. Lpd should do FIFO. = Could > you give some more infos about your environment (os release, input = filter > program, printer type)? Yes, I think it's a very strange behaviour. In effect in the file /usr/src/usr.sbin/lpr/common_source/common.c there = is: ..... /* * Scan the current directory and make a list of daemon files sorted by * creation time. * Return the number of entries and a pointer to the list. */ int getq(pp, namelist) const struct printer *pp; struct queue *(*namelist[]); { ..... However I had the problem in more than one installation of the os from = 2.2.7 to 3.4. The printers are used in a very simple way, ... lp|local line printer:\ :sh:sf:mx#0:\ = :lp=3D/dev/lpt0:sd=3D/usr/spool/output/lpd:lf=3D/var/log/lpd-errs: .... but the order is wrong. The problem occur when the number of consecutive = requests grows, i. e. when I have to print requests from 1 to 100 (from = tha same process), the first 40 are in the right order, then are printed = those from 50 to 100 in the right order and at last those from 41 to 49. All I do is simply open a pipe by a call to=20 fp=3Dpopen("lpr -Plp","a"); fprintf(fp,XXXXX); .... . .. . fclose(fp); The contents are almost the same for each request, simply characters; I = don't use any input filter. The printer is always a character printer = like IBM, EPSON ... So I don't understand why this happens. Any suggestions?? ------=_NextPart_000_0476_01BFB45E.B33B59C0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Konrad Heuer wrote
          &nbs= p;            = ;       =20
> Hmm, I've never seen such a = strange behaviour.=20 Lpd should do FIFO. Could
> you give some more infos about your=20 environment (os release, input filter
> program, printer=20 type)?
Yes, I think it's a very strange=20 behaviour.
In effect in the file=20 /usr/src/usr.sbin/lpr/common_source/common.c there is:
 
.....
/*
 * Scan the current = directory and make a=20 list of daemon files sorted by
 * creation time.
 * = Return the=20 number of entries and a pointer to the = list.
 */
int
getq(pp,=20 namelist)
        const struct = printer=20 *pp;
        struct queue=20 *(*namelist[]);
{
.....
 
However I had the problem in more than = one=20 installation of the os from 2.2.7 to 3.4.
The printers are used in a very simple=20 way,
 
...
lp|local line=20 printer:\
       =20 :sh:sf:mx#0:\
       =20 :lp=3D/dev/lpt0:sd=3D/usr/spool/output/lpd:lf=3D/var/log/lpd-errs:
...= .
 
but the order is wrong. The problem = occur when the=20 number of consecutive requests grows, i. e. when I have to print = requests from 1=20 to 100 (from tha same process), the first 40 are in the right order, = then are=20 printed those from 50 to 100 in the right order and at last those from = 41 to=20 49.
All I do is simply open a pipe by a = call to=20
 
fp=3Dpopen("lpr = -Plp","a");
fprintf(fp,XXXXX);
....
.
..
.
fclose(fp);
 
The contents are almost the same for = each request,=20 simply characters; I don't use any input filter. The printer is = always a=20 character printer like IBM, EPSON ...
 
So I don't understand why this=20 happens.
 
Any suggestions??
 
 
 
 
 

 
------=_NextPart_000_0476_01BFB45E.B33B59C0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message