From owner-freebsd-hackers Sat Apr 29 10:34:46 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA00138 for hackers-outgoing; Sat, 29 Apr 1995 10:34:46 -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 KAA00108 for ; Sat, 29 Apr 1995 10:34:26 -0700 Received: (from uucp@localhost) by nanolon.gun.de (8.6.8.1/8.6.6) with UUCP id TAA21365; Sat, 29 Apr 1995 19:24:53 +0200 Received: (from andreas@localhost) by knobel.GUN.de (8.6.9/8.6.9) id QAA02416 Sat, 29 Apr 1995 16:21:20 +0200 From: Andreas Klemm Message-Id: <199504291421.QAA02416@knobel.GUN.de> Subject: Re: aspfilter & stdin To: joerg_wunsch@uriah.heep.sax.de Date: Sat, 29 Apr 1995 16:21:19 +0200 (MET DST) Cc: ache@astral.msk.su, rpt@miles.sso.loral.com, wwanders@sci.kun.nl, freebsd-hackers@FreeBSD.org In-Reply-To: <199504170714.JAA04550@uriah.heep.sax.de> from "J Wunsch" at Apr 17, 95 09:14:40 am X-Mailer: ELM [version 2.4 PL24 PGP2] Content-Type: text Content-Length: 1191 Sender: hackers-owner@FreeBSD.org Precedence: bulk > As Andrey A. Chernov, Black Mage wrote: > > >#include > > > > >main() > > >{ > > > rewind(stdin); > > > return(0); > > >} > > > > Yet one: > > fpurge(stdin); > > Won't help. You didn't notice the ``main()'' above? > > Boy, he tries to rewind a pipe from a separate _process_! This is > impossible. I got this from someone to eliminate the need for a tmp file, when printing dvi files using dvips. It worked for Linux Slackware like charm, as well as for FreeBSD 1.1.5.1. FreeBSD 2.0 introduces something new, which made this necessary: #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 } Then it worked well for someone who gave me the fix. If 2.0.5 introduces new inconsistances for rewindstdin, then I'd like to get a fix from a kind person... -- 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...:-)