From owner-freebsd-stable Sat Sep 2 9:59:21 2000 Delivered-To: freebsd-stable@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 2CCC537B43C for ; Sat, 2 Sep 2000 09:59:10 -0700 (PDT) Received: from magnesium.scientia.demon.co.uk ([192.168.91.34] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.16 #1) id 13VFzO-000BjN-00; Sat, 02 Sep 2000 17:17:54 +0100 Received: (from ben@localhost) by magnesium.scientia.demon.co.uk (8.9.3/8.9.3) id RAA43491; Sat, 2 Sep 2000 17:17:53 +0100 (BST) (envelope-from ben) Date: Sat, 2 Sep 2000 17:17:53 +0100 From: Ben Smithurst To: Fred Gilham Cc: freebsd-stable@FreeBSD.ORG Subject: Re: tail -f over NFS in -stable Message-ID: <20000902171753.A43451@magnesium.scientia.demon.co.uk> References: <200009011622.JAA29262@csla.csl.sri.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200009011622.JAA29262@csla.csl.sri.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Fred Gilham wrote: > In 4.1-stable tail -f over NFS polls rather than blocking. Yes, this is acknowledged in the kqueue() manual page. Try this patch, it seems to work for me so I might commit it if no-one objects. Index: forward.c =================================================================== RCS file: /usr/cvs/src/usr.bin/tail/forward.c,v retrieving revision 1.15 diff -u -r1.15 forward.c --- forward.c 2000/07/18 19:38:38 1.15 +++ forward.c 2000/09/02 16:16:40 @@ -40,7 +40,8 @@ static char sccsid[] = "@(#)forward.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ -#include +#include +#include #include #include #include @@ -96,6 +97,7 @@ int action = USE_SLEEP; struct kevent ev[2]; struct stat sb2; + struct statfs statfsbuf; switch(style) { case FBYTES: @@ -170,7 +172,10 @@ break; } - if (fflag) { + if (statfs(fname, &statfsbuf) != 0) + err(1, "statfs %s", fname); + + if (fflag && strcmp(statfsbuf.f_fstypename, "ufs") == 0) { kq = kqueue(); if (kq < 0) err(1, "kqueue"); -- Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D FreeBSD Documentation Project / To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message