Date: Sat, 2 Sep 2000 17:17:53 +0100 From: Ben Smithurst <ben@FreeBSD.org> To: Fred Gilham <gilham@snapdragon.csl.sri.com> Cc: freebsd-stable@FreeBSD.ORG Subject: Re: tail -f over NFS in -stable Message-ID: <20000902171753.A43451@magnesium.scientia.demon.co.uk> In-Reply-To: <200009011622.JAA29262@csla.csl.sri.com> References: <200009011622.JAA29262@csla.csl.sri.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/types.h> +#include <sys/param.h> +#include <sys/mount.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/mman.h> @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000902171753.A43451>