Date: Wed, 6 Oct 1999 13:26:13 +0300 From: Ruslan Ermilov <ru@ucb.crimea.ua> To: Brian Somers <brian@Awfulhak.org> Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: misc/14150: /usr/binlast does not accept input from stdin nor does it process .gz files Message-ID: <19991006132613.C82096@relay.ucb.crimea.ua> In-Reply-To: <199910060943.KAA00971@hak.lan.Awfulhak.org>; from Brian Somers on Wed, Oct 06, 1999 at 10:43:55AM %2B0100 References: <199910060730.AAA33069@freefall.freebsd.org> <199910060943.KAA00971@hak.lan.Awfulhak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 06, 1999 at 10:43:55AM +0100, Brian Somers wrote: > [.....] > > > So, why is this a problem? After all, there is the -f option, right? > > > > > Right :-) > > > > `/usr/bin/last -f /dev/stdin < wtmp-format-file' will do the trick. > > Well, no. last(1) tries to seek and fails. > Only if it deals with pipe/socket/FIFO; my example will work. Anyway, it is nonsense, since it is equivalent to just: # /usr/bin/last -f wtmp-format-file As for the problem, last(1) processes wtmp file in reverse order and it uses lseek(2) for that. Lseek(2) will fail with ESPIPE if used with pipe, socket or fifo. Changing last(1) to not use lseek(2) would require an almost complete rework of last(1) and will impact on performace. -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991006132613.C82096>