From owner-freebsd-hackers Mon Apr 17 00:08:16 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA09094 for hackers-outgoing; Mon, 17 Apr 1995 00:08:16 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id AAA09088 for ; Mon, 17 Apr 1995 00:08:06 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA26647; Mon, 17 Apr 1995 09:07:30 +0200 Received: by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id JAA19012; Mon, 17 Apr 1995 09:07:29 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id IAA04159; Mon, 17 Apr 1995 08:20:34 +0200 From: J Wunsch Message-Id: <199504170620.IAA04159@uriah.heep.sax.de> Subject: Re: aspfilter & stdin To: rpt@miles.sso.loral.com (Richard Toren) Date: Mon, 17 Apr 1995 08:20:33 +0200 (MET DST) Cc: hackers@FreeBSD.org In-Reply-To: from "Richard Toren" at Apr 16, 95 05:54:29 pm Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1305 Sender: hackers-owner@FreeBSD.org Precedence: bulk As Richard Toren wrote: > > Giving the following results: > # make > cc -s -O -o rewindstdin rewindstdin.c > # cat rewindstdin.c | (file -; ./rewindstdin ;file -) > standard input: c program text > standard input: empty ... > > ?? why the '< 0' of the return code?? Since you cannot rewind a pipe. Period. That's why i wrote ``i dunno how it could have ever worked for Andreas.'' LSEEK(2) UNIX Programmer's Manual LSEEK(2) NAME lseek - reposition read/write file offset ... Lseek() will fail and the file pointer will remain unchanged if: ... [ESPIPE] Fildes is associated with a pipe, socket, or FIFO. Btw., the usage of for the rewindstdin program is even more bogus. does buffering of its own, which is not sharable across processes. (The current position of an object descriptor however *is* sharable across multiple processes, provided they've got identical copies of the descriptors, by dup(2).) The bad news is that it's almost certain that apsfilter will have to be modified to cope with this. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)