*BSD News Article 39244


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans.net!pipex!uunet!news.tek.com!news!phils
From: phils@satori.tv.tek.com (Phil Staub)
Newsgroups: comp.os.386bsd.questions
Subject: Re: printcap filters
Date: 10 Dec 1994 09:51:19 GMT
Organization: Tektronix TV Products
Lines: 46
Message-ID: <PHILS.94Dec10015119@satori.tv.tek.com>
References: <RICK.94Nov24045024@vox.trystero.com> <D0DG9L.F35@latcs1.lat.oz.au>
	<PHILS.94Dec6101450@satori.tv.tek.com>
NNTP-Posting-Host: satori.tv.tek.com
In-reply-to: phils@satori.tv.tek.com's message of 06 Dec 1994 18:14:50 GMT


Sorry to follow up on my own article, but I believe I've tracked down
a problem and have a solution.

In article <PHILS.94Dec6101450@satori.tv.tek.com> phils@satori.tv.tek.com (Phil Staub) writes:
> 
> After much time (and head scratching) I think I've narrowed down the
> problem to the 'rewindstdin' program. apsfilter seems to need to
> rewind the input stream a couple of times in the process of figuring
> out what to do. Upon looking at the log file, I see several
> occurrences of 'file -'. This is followed by 'set -- standard input:
> ascii text' the first time, then 'set -- standard input: empty' after
> that. These sequences are interspersed with 'rewindstdin'.
> 
> Upon further investigation, I find that rewindstdin is a simple
> program which does an lseek(0,0L,0) to back up the input stream. This
> apparently doesn't work on 2.0. 

Now I know why. The second parameter to lseek() is an off_t, which is
declared in 1.1.5.1 as a long, and in 2.0 as a long long (to support
64bit file offsets).

Try adding 

	#include "unistd.h"

to the head of your rewindstdin.c file, and change 

	lseek(0,0L,0);
to 
	lseek(0,0,0);

(since unistd.h has a function prototype for lseek), then re-compile
and install, and I think you'll have better luck.

(BTW, I have notified the authors of apsfilter of this).

Phil



--
------------------------------------------------------------------------------
Phil Staub, phils@tv.tv.tek.com
Tektronix Television Division
(503) 627-6910