From owner-freebsd-hackers Sun Apr 16 12:33:14 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id MAA12060 for hackers-outgoing; Sun, 16 Apr 1995 12:33:14 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id MAA12052 for ; Sun, 16 Apr 1995 12:33:10 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.11/8.6.9) id MAA07697; Sun, 16 Apr 1995 12:30:24 -0700 From: "Rodney W. Grimes" Message-Id: <199504161930.MAA07697@gndrsh.aac.dev.com> Subject: Re: aspfilter & stdin To: rpt@miles.sso.loral.com (Richard Toren) Date: Sun, 16 Apr 1995 12:30:23 -0700 (PDT) Cc: hackers@FreeBSD.org In-Reply-To: from "Richard Toren" at Apr 16, 95 12:37:44 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 979 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > 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 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