History log of /freebsd-current/usr.bin/tail/tail.c
Revision Date Author Comments
# b70e57be 29-Nov-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

tail: Clean up error messages.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D42842


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# e5d258c9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .c pattern

Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/


# cccdaf50 07-Jul-2023 Alfonso Gregory <gfunni234@gmail.com>

Mark usage function as __dead2 in programs where it does not return

In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735


# c2e561a3 03-Oct-2022 John Baldwin <jhb@FreeBSD.org>

tail: Fix misleading indentation in ARG() macro.

Reviewed by: imp, emaste
Reported by: GCC
Differential Revision: https://reviews.freebsd.org/D36810


# e599810d 08-Sep-2022 Mark Johnston <markj@FreeBSD.org>

tail: Initialize the stat buffer used when input is stdin

PR: 266284
Reported by: Jenkins via delphij
Fixes: 7e11889959a6 ("tail: Fix -f with stdin")
MFC after: 3 days


# 643ac419 12-Jul-2022 Xin LI <delphij@FreeBSD.org>

Improve usability of head(1) and tail(1):

- Consistently support -q (quiet) and -v (verbose)
- Allow specifying numbers with SI prefixes supported by expand_number(3)
- Remove 2^31 limit on lines for head(1)

MFC after: 2 weeks
Reviewed by: lwhsu, pauamma, gbe
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D35720


# 7e118899 08-Jul-2021 Mark Johnston <markj@FreeBSD.org>

tail: Fix -f with stdin

Based on a patch from swills@.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31113


# eee07d30 06-Dec-2019 Mark Johnston <markj@FreeBSD.org>

Fix tail -f in capability mode.

We were not adding CAP_EVENT to input file capabilities, so kevent()
always failed with ENOTCAPABLE. tail implements a fallback mode to
poll the file in this case, so the failure was not apparent.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22709


# 7ef518c0 05-Nov-2019 Mark Johnston <markj@FreeBSD.org>

fileargs_init() sets errno on failure.

Sponsored by: The FreeBSD Foundation


# c851fce6 09-Jun-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

tail: fix the checks if the file was rotated

The freopen(3) was replaced with fileargs_open(3) and fclose(3).
In the following function, we skip if the stream is standard in, so it is
safe to do so.
This also requires us to change the logic first to open the file and then
check its status. The stat(2) is disallowed in capability mode.

This commit unbrakes the -F option.
The bug was introduced in the r348708.

Reported by: pho
Tested by: pho


# 2fe0bee4 09-Jun-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

tail: style nits


# 9190144f 05-Jun-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

tail: fix style nit introduced in the r348708


# b4d2c338 05-Jun-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

tail: capsicumize

Submitted by: Nik Sultana <sultana@seas.upenn.edu>
Differential Revision: https://reviews.freebsd.org/D20393


# 53128fb4 10-Apr-2018 Kyle Evans <kevans@FreeBSD.org>

tail(1): Add some long options

Add --blocks, --bytes, and --lines long options for -b, -c, and -n
respectively. This improves tail(1)'s compatibility with its GNU counterpart
in a straightforward way.

Reviewed by: eadler (earlier version)
MFC after: 3 days


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 849d265d 09-Jun-2013 Jaakko Heinonen <jh@FreeBSD.org>

Print file names without stdio buffering to avoid mixing buffered and
unbuffered ouput.

PR: bin/176886
Reviewed by: mjg


# c7c497f1 06-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Add missing static keywords to tail(1)


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 22da50cf 05-Jun-2009 Brian Somers <brian@FreeBSD.org>

Change the behaviour of -F slightly; it now persists (forever) in
trying to open files rather than giving up when it encounters an
error. ENOENT errors are not reported.

As a result, files that are moved away then recreated are not at
risk of being 'lost' to tail. Files that are recreated and
temporarily have unreadable permissions will be shown when they
are fixed.

This behaviour is consistent with the GNU version of tail but
without the verbiage that goes with the GNU version.

This change also fixes error messages accompanying -f and -F.
They no longer report problems with (null)!

MFC after: 3 weeks


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# f8c2d2bd 02-Nov-2007 Philippe Charnier <charnier@FreeBSD.org>

initialize variables, WARNS=6 compliant


# 2982527d 30-Jun-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Simplify the formatting in the SYNOPSIS.
- Add the forgotten new option in usage().


# aa1d7ce7 29-Jun-2006 Florent Thoumie <flz@FreeBSD.org>

Add a -q option to suppress header lines when multiple files are specified.

Approved by: cperciva (mentor)
MFC after: 1 week


# e1d27f08 01-Jun-2005 Eivind Eklund <eivind@FreeBSD.org>

Back out revision 1.19 and 1.20 until I find mental clarity to deal with
issues bde pointed out.


# ffef99c3 26-May-2005 Eivind Eklund <eivind@FreeBSD.org>

Remove an errno reset that became unnecessary.

Noticed by: juli


# d21ccc03 26-May-2005 Eivind Eklund <eivind@FreeBSD.org>

We are past 4.4BSD - use our new-found stat flags for pipes and fifos.


# 15a55f79 04-Nov-2004 Paul Richards <paul@FreeBSD.org>

Add support for following more than one file i.e.
tail -f file1 file2


# f45a52b3 03-Nov-2004 Paul Richards <paul@FreeBSD.org>

Revert a WIP change that shouldn't have been in last commit.


# 4bba8e59 03-Nov-2004 Paul Richards <paul@FreeBSD.org>

Convert to ANSI style function definitions.


# d183dcb6 14-Jul-2002 Alfred Perlstein <alfred@FreeBSD.org>

WARNS=4, add


# 3f330d7d 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

remove __P


# 814e3a92 11-Dec-2001 Mark Murray <markm@FreeBSD.org>

WARNS=2 fixes, use __FBSDID().


# 8cd67784 02-Oct-2001 Bill Fenner <fenner@FreeBSD.org>

Allow "obsolete" (but commonly-used) command line style to be used
with -F, e.g. tail -1 -F /var/log/messages.

Submitted by: Maxim Konovalov <maxim@macomnet.ru>


# bd9dc975 01-Sep-2001 Andrey A. Chernov <ache@FreeBSD.org>

File positions are off_t nowdays, not long, so:
long -> off_t
strtol -> strtoll
fseek -> fseeko

NOTE: that fseek not works for >long offsets files per POSIX:

[EOVERFLOW] For fseek( ), the resulting file offset would be a value which
cannot be represented correctly in an object of type long.


# 1715c485 24-Jan-2001 Ruslan Ermilov <ru@FreeBSD.org>

Mention the -F in the usage().

PR: 24586
Submitted by: Cyrille Lefevre <clefevre@citeweb.net>


# 48a1ef22 03-Dec-2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Remove register keyword usage with prejudice.
Modern compilers are smarter when it comes to allocating register
usage.


# beed3992 02-Dec-2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Use a size_t instead of an int.


# 247e7cb1 02-Dec-2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Properly constify some static arrays.

Also #if out some sccsid's and add rcsid's.


# 9ef5c48b 04-Jul-1999 Bill Fumerola <billf@FreeBSD.org>

Clean up some ambiguous nested if/elses.


# eb1c9439 06-Apr-1998 Peter Wemm <peter@FreeBSD.org>

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.


# 1c8af878 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# c3fd5728 25-Aug-1996 Peter Wemm <peter@FreeBSD.org>

Dont forget to #include <err.h>


# ac551270 25-Aug-1996 Peter Wemm <peter@FreeBSD.org>

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.


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources