Date: Thu, 24 May 2001 20:51:25 -0700 From: Doug Barton <DougB@DougBarton.net> To: Ben Smithurst <ben@FreeBSD.org> Cc: freebsd-current@FreeBSD.org Subject: Re: tail -f over NFS in -stable Message-ID: <3B0DD6BD.8E54A5E5@DougBarton.net> References: <200009011622.JAA29262@csla.csl.sri.com> <20000902171753.A43451@magnesium.scientia.demon.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
Blast from the past. This patch seemed reasonable to me at the time, but I notice you didn't commit it. Any reason why? The issue has just come up again on -questions. Doug Ben Smithurst wrote: > > 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 -- I need someone really bad. Are you really bad? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B0DD6BD.8E54A5E5>