Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Apr 1995 12:30:23 -0700 (PDT)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        rpt@miles.sso.loral.com (Richard Toren)
Cc:        hackers@FreeBSD.org
Subject:   Re: aspfilter & stdin
Message-ID:  <199504161930.MAA07697@gndrsh.aac.dev.com>
In-Reply-To: <Pine.SUN.3.91.950416123406.11024A-100000@miles> from "Richard Toren" at Apr 16, 95 12:37:44 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Gentlemen,
>   For the last three days I have been trying to make 'apsfilter' work
> on my 2.0R system. I have learned a lot, but have hit a final sticking
> point.
> 
>   'apsfilter' is started by the lpd. It tries to determine the type of 
>   file that is being printed. Unfortunately, it uses `file -` to determine
>   the type of file. A companion program is supplied called 'rewindstdin'.
>     
>     main()
>     {
>      return lseek(0,0L,0) < 0;
>     }

Is that the sole content of the file?  No #includes??  If so try this
program:

#include <unistd.h>
int
main()
{
	return (lseek(0,0L,0) < 0);
}

The problem could be that without including unistd.h the arg types to
the lseek call are wrong (FreeBSD uses a 64Bit offset).  Thus the third
argument to lseek was trash, and that is the whence argument :-(.


-- 
Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
Accurate Automation Company                   Custom computers for FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504161930.MAA07697>