Commit Graph

25 Commits

Author SHA1 Message Date
jlemon
b3138232c0 Convert calls to match new kqueue API. 2000-07-18 19:38:38 +00:00
jlemon
53ac960e3d If the kevent() registration fails (probably due to the underlying
filesystem not being kq-aware), then fall back to using sleep.  This
allows tail to work with NFS filesystems again without chewing up CPU time.

When given the -F flag, resort to sleep/stat after the file was moved
or deleted.  This allows a window where the file being tailed does not
exist at all, which is typically the case during log rotation.  Switch
back to using kq (if possible) after the file is reopened.
2000-06-22 18:46:03 +00:00
jlemon
94fea207f0 Change <event.h> --> <sys/event.h> 2000-04-18 16:56:55 +00:00
jlemon
0c4b557463 Change tail to use kqueue/kevent to obtain a notification when
the file changes (when doing tail -{f|F}).
2000-04-16 19:04:49 +00:00
charnier
ed17e2d488 Add DIAGNOSTICS section name 2000-03-26 15:06:46 +00:00
peter
e4b04a2b21 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
nik
7e91e73b9f Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:24:20 +00:00
billf
251664b7db Clean up some ambiguous nested if/elses. 1999-07-04 17:26:16 +00:00
bde
0ea85390b1 Fixed printf format errors. 1998-07-06 21:01:54 +00:00
peter
f0f0c61425 Add a new -F flag which is a superset of -f. It will cause tail to
stat() the file being followed and do a close/reopen if the file has been
renamed and/or rotated.  This is damn useful for leaving running on files
in /var/log when newsyslog(8) rotates them.
1998-04-06 16:13:49 +00:00
ache
60fead44b1 Change select(0, NULL, ...) to usleep() 1997-12-12 11:47:28 +00:00
phk
919d4b98b6 Fix a misleading comment. Rename a variable to make more sense.
Pointed out by by:	 bde
1997-10-11 07:32:43 +00:00
phk
2fe1db4a20 Fix a comment.
Submitted by:		Mikael Karpberg <karpen@ocean.campus.luth.se>
1997-09-15 08:20:27 +00:00
phk
c083d9eff8 In these days, waiting one full second for more to appear is far too long.
Let's try 250ms.
1997-09-14 19:02:13 +00:00
charnier
a2df19625f Remove trailing \n in warn() string. 1997-08-13 06:46:57 +00:00
imp
cd84ece5fd compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
alex
ee019a53dc Sweep through the tree fixing mmap() usage:
- Use MAP_FAILED instead of the constant -1 to indicate
    failure (required by POSIX).
  - Removed flag arguments of '0' (required by POSIX).
  - Fixed code which expected an error return of 0.
  - Fixed code which thought any address with the high bit set
    was an error.
  - Check for failure where no checks were present.

Discussed with:	bde
1997-01-16 21:58:40 +00:00
adam
774b86ec49 complete err() changes, actually use warn() in most instances 1996-08-26 20:37:48 +00:00
peter
66ebc3e085 Dont forget to #include <err.h> 1996-08-25 21:14:19 +00:00
peter
bb7da15fa5 Argh! caught! *blush*.. This program was supplying it's own 'err' routine
which was slightly different to the libc one.  To save any more cunfusion,
use the libc one.
1996-08-25 21:12:01 +00:00
peter
e9abd98fe4 Fix some bogons:
- timeval in select loop was depending on not having the remaining time
  returned from select(), causing a busy spin on an implementation that
  does implement it.
- the err() usage was pretty bogus, some of the error messages had
  strerror attached manually and then reattached by err().
1996-08-25 21:03:50 +00:00
adam
e9c7931207 one file somehow slipped by me in the previous commit
tidy up
1996-07-30 15:44:30 +00:00
adam
37779029f5 when file can be opened for read but cannot be read from:
fail once (was twice) in forward case
fail once (was no times) in reverse case

this can happen when file is a directory on an NFS or procfs mount.
1996-07-30 13:11:43 +00:00
phk
13effa898e Another program depending on zero'ed malloc.
Submitted by:	Kai Vorma <vode@snakemail.hut.fi>
1995-10-10 10:03:48 +00:00
rgrimes
f9ab90d9d6 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00