From owner-freebsd-hackers Sat Apr 29 10:25:42 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA29714 for hackers-outgoing; Sat, 29 Apr 1995 10:25:42 -0700 Received: from nanolon.gun.de (nanolon.gun.de [192.109.159.5]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAA29692 for ; Sat, 29 Apr 1995 10:25:37 -0700 Received: (from uucp@localhost) by nanolon.gun.de (8.6.8.1/8.6.6) with UUCP id TAA21343; Sat, 29 Apr 1995 19:24:44 +0200 Received: (from andreas@localhost) by knobel.GUN.de (8.6.9/8.6.9) id QAA02380 Sat, 29 Apr 1995 16:12:58 +0200 From: Andreas Klemm Message-Id: <199504291412.QAA02380@knobel.GUN.de> Subject: Re: aspfilter & stdin To: rgrimes@gndrsh.aac.dev.com (Rodney W. Grimes) Date: Sat, 29 Apr 1995 16:12:58 +0200 (MET DST) Cc: rpt@miles.sso.loral.com, hackers@FreeBSD.org In-Reply-To: <199504161930.MAA07697@gndrsh.aac.dev.com> from "Rodney W. Grimes" at Apr 16, 95 12:30:23 pm X-Mailer: ELM [version 2.4 PL24 PGP2] Content-Type: text Content-Length: 1429 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 :-(. Apsfilter 4.9 delta (newest one): #ifdef __FreeBSD__ #include #endif main() { #ifdef __FreeBSD__ return lseek(STDIN_FILENO, (off_t)0, SEEK_SET) < 0; #else return lseek(0,0L,0) < 0; #endif } Apsfilter worked ok for 1.1.5.1 and 2.0 that way. -- andreas@knobel.gun.de /\/\___ Wiechers & Partner Datentechnik GmbH Andreas Klemm ___/\/\/ - Support Unix - akl@wup.de - *** apsfilter - irgendwie clever *** ftp.informatik.rwth-aachen.de:/pub/Linux/local/packs/APSfilter/aps-49...:-)