The NetBSD Project

CVS log for src/usr.bin/stat/stat.c

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / stat

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.53 / (download) - annotate - [select for diffs], Thu Mar 14 21:17:54 2024 UTC (4 days, 7 hours ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.52: +7 -7 lines
Diff to previous 1.52 (colored)

stat: don't allow numeric formatting flags on strings

Calling snprintf with "%+s" invokes undefined behavior.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Mar 14 19:38:56 2024 UTC (4 days, 8 hours ago) by kre
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)


While the change in 1.51 certainly retained binary compat with
what was in 1.50 (while silencing LINT) - it was clearly not the
correct change to make.   The code used !FLAG_POUND where it
clearly meant ~FLAG_POUND ... the former is 0, so &= 0 could
be replaced by =0 changing nothing.   But that's not what it
should have been doing, other flags should not have been
removed here, just FLAG_POUND.

This problem seems to have existed since support for %#s
was first added in 2011, which kind of suggests how rarely
that format, particularly with other flags (like %#-s)
has ever been used (with no other flags, the bug would not
be noticed).

Revision 1.51 / (download) - annotate - [select for diffs], Thu Mar 14 00:07:20 2024 UTC (5 days, 4 hours ago) by rillig
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

stat: fix lint warning about constant argument to '!'

No binary change.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jan 29 22:01:58 2024 UTC (7 weeks ago) by christos
Branch: MAIN
CVS Tags: triaxx-drm
Changes since 1.49: +7 -5 lines
Diff to previous 1.49 (colored)

fix tools build

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jan 29 21:55:24 2024 UTC (7 weeks ago) by christos
Branch: MAIN
Changes since 1.48: +8 -4 lines
Diff to previous 1.48 (colored)

PR/57891: Ricardo Branco: add symbolic flags printing (from FreeBSD)

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jun 22 18:20:30 2022 UTC (20 months, 3 weeks ago) by kre
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.47: +11 -10 lines
Diff to previous 1.47 (colored)

Some corrections to stat to make it more reasonable, and comply with
the man page, in particular, in one of the EXAMPLES it is claimed:

     This example produces output very similar to that from find ... -ls
     (except that find(1) displays the time in a different format, and find(1)
     sometimes adds one or more spaces after the comma in ãà×Îajor,minorãàfor
     device nodes):

and then uses %9Z in the format, but conveniently does not use a
device file to demonstrate.

If it had, the result would have been:

   8033      0 brw-r-----    1 root              operator                  4,       51 Jun  8 02:44:45 2022 /dev/sd3

Note the spaces which were claimed to exist (sometimes) in find(1) output
but not with stat.   Oops.

Omitting those spaces seems like a good idea, so does using the same
field width for the result in both cases, rather than producing 9 chars
in the ordinary file case, and 19 (2 * 9 + 1) in the device case (for %9Z).

Now we will get:

   8033      0 brw-r-----    1 root              operator             4,51   Jun  8 02:44:45 2022 /dev/sd3

While here, also make the file number (%@) when reading stdin be 0, it is
not the 1st file in the arg list.

Some (very minor) KNF applied at the same time.

In stat.1 make these changes explicit.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Aug 27 18:11:07 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.46: +5 -5 lines
Diff to previous 1.46 (colored)

stat: fix undefined behavior when calling ctype functions

lint says: warning: argument to 'function from <ctype.h>' must be cast
to 'unsigned char', not to 'unsigned int' [342]

Revision 1.46 / (download) - annotate - [select for diffs], Mon Sep 7 00:46:38 2020 UTC (3 years, 6 months ago) by mrg
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.45: +4 -2 lines
Diff to previous 1.45 (colored)

avoid a GCC stringop truncate warning.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Oct 4 11:12:16 2019 UTC (4 years, 5 months ago) by mrg
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, is-mlppp-base, is-mlppp
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

adjust fallthru comment.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Feb 4 08:07:33 2019 UTC (5 years, 1 month ago) by mrg
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

avoid a potential buffer truncation.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Sep 21 22:53:19 2017 UTC (6 years, 5 months ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat
Branch point for: phil-wifi
Changes since 1.42: +52 -17 lines
Diff to previous 1.42 (colored)

Handle the new %f (as an addition to the strftime format - -t arg)
correctly, in particular %%f does not contain the %f format, and like
all strftime conversions, %f can occur more than once (not that it is
likely to happen, but just in case...)

Revision 1.42 / (download) - annotate - [select for diffs], Thu Sep 21 18:50:08 2017 UTC (6 years, 5 months ago) by kre
Branch: MAIN
Changes since 1.41: +7 -3 lines
Diff to previous 1.41 (colored)


KNF, and since this gets compiled as a tool, avoid C99 declarations.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Sep 20 17:45:25 2017 UTC (6 years, 5 months ago) by kre
Branch: MAIN
Changes since 1.40: +3 -4 lines
Diff to previous 1.40 (colored)

Set the default time format for linux mode (-x) in the correct place,
so it only applies to -x (in particular, not to -s) and only if another
time format has not been explicitly selected (earlier in the arg list).

With luck, this will make lots of tests, which depended upon "stat -s"
actually generating correct sh assignment statements, go back to working again.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Sep 20 01:23:37 2017 UTC (6 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.39: +7 -5 lines
Diff to previous 1.39 (colored)

- add the sticky bits to mode
- fix linux Birth for the havenots
code review via email from @@@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Sep 19 21:45:28 2017 UTC (6 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.38: +45 -16 lines
Diff to previous 1.38 (colored)

- if st_dev/st_rdev == NODEV print -1 instead of unsigned
- update to the latest linux stat(1) format for -x (kind of)
- add the ability to display nanoseconds, like linux does
- change u_intX_t -> uintX_t

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jan 3 13:28:41 2013 UTC (11 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, agc-symver-base, agc-symver
Changes since 1.37: +7 -5 lines
Diff to previous 1.37 (colored)

Unset HAVE_DEVNAME for tools build.
config only checks for the symbol in libc, we need the correct prototype.
Which is excluded even on NetBSD (_NETBSD_SOURCE isn't defined in stdlib.h).

Revision 1.37 / (download) - annotate - [select for diffs], Sun Dec 2 21:13:07 2012 UTC (11 years, 3 months ago) by erh
Branch: MAIN
CVS Tags: yamt-pagecache-base7
Changes since 1.36: +6 -4 lines
Diff to previous 1.36 (colored)

Honor the -t option to set the time format when running stat -s.
Document the format used by -s on the man page.

Revision 1.36 / (download) - annotate - [select for diffs], Thu Sep 22 20:23:56 2011 UTC (12 years, 5 months ago) by apb
Branch: MAIN
CVS Tags: yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.35: +33 -6 lines
Diff to previous 1.35 (colored)

Use vis(3) encoding when a string format is modified by the '#' flag.
Also bump copyright years.

Revision 1.35 / (download) - annotate - [select for diffs], Tue Sep 6 18:31:22 2011 UTC (12 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.34: +10 -10 lines
Diff to previous 1.34 (colored)

static + __dead

Revision 1.34 / (download) - annotate - [select for diffs], Wed Feb 16 23:08:29 2011 UTC (13 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.33: +27 -13 lines
Diff to previous 1.33 (colored)

Add verbose mode for readlink.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jan 15 22:54:10 2011 UTC (13 years, 2 months ago) by njoly
Branch: MAIN
Branch point for: bouyer-quota2
Changes since 1.32: +6 -2 lines
Diff to previous 1.32 (colored)

Do not crash if a date cannot be represented (localtime returning
NULL), use the Epoch value instead.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Dec 16 05:42:14 2010 UTC (13 years, 3 months ago) by dholland
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored)

Don't pass unused argument. From Doug Barton.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Dec 16 05:30:16 2010 UTC (13 years, 3 months ago) by dholland
Branch: MAIN
Changes since 1.30: +8 -8 lines
Diff to previous 1.30 (colored)

Use strlcpy, not strncpy, when the desired semantics are strlcpy's
rather than strncpy's.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Nov 25 04:33:30 2010 UTC (13 years, 3 months ago) by dholland
Branch: MAIN
Changes since 1.29: +5 -2 lines
Diff to previous 1.29 (colored)

Improve previous with comments.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Nov 24 22:57:53 2010 UTC (13 years, 3 months ago) by dholland
Branch: MAIN
Changes since 1.28: +8 -8 lines
Diff to previous 1.28 (colored)

Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it
successfully prints mtimes after 2038.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Apr 13 23:02:36 2009 UTC (14 years, 11 months ago) by lukem
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.27: +27 -26 lines
Diff to previous 1.27 (colored)

Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)

Revision 1.27 / (download) - annotate - [select for diffs], Fri May 16 17:58:33 2008 UTC (15 years, 10 months ago) by atatat
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, hpcarm-cleanup-nbase
Branch point for: jym-xensuspend
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable.  This fixes the missing " -> " in front of the real
path (when you use %SR).

Also, the ?: needs another space.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:15 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
Branch point for: wrstuden-revivesa
Changes since 1.25: +2 -9 lines
Diff to previous 1.25 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.25 / (download) - annotate - [select for diffs], Sat Feb 9 09:18:07 2008 UTC (16 years, 1 month ago) by mlelstv
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base
Branch point for: yamt-pf42
Changes since 1.24: +13 -8 lines
Diff to previous 1.24 (colored)

Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Oct 7 10:41:50 2006 UTC (17 years, 5 months ago) by elad
Branch: MAIN
CVS Tags: wrstuden-fixsa-base-1, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: wrstuden-fixsa, netbsd-4, matt-armv6
Changes since 1.23: +25 -4 lines
Diff to previous 1.23 (colored)

PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jun 23 03:13:24 2005 UTC (18 years, 9 months ago) by atatat
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.22: +29 -4 lines
Diff to previous 1.22 (colored)

Bend the 'L', 'M', and 'H' modifiers to work on the size, whereby it
is rounded to the nearest kilobyte, megabyte, or gigabyte.
Implemented at lukem's request since some things can't deal with
overly large numbers when files are really large.

Have to do something like humanize_number(3), but that interface isn't
really what I'm looking for.  I think.  More examination required.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Apr 22 03:36:48 2005 UTC (18 years, 11 months ago) by atatat
Branch: MAIN
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

Fix a trivial truncation case, and eliminate a corner case that might
print a nul character.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Jan 13 00:53:14 2005 UTC (19 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.20: +5 -2 lines
Diff to previous 1.20 (colored)

Now that tools/compat provides a check, make sure st_birthtimensec exists
before using it

Revision 1.20 / (download) - annotate - [select for diffs], Fri Dec 31 03:24:31 2004 UTC (19 years, 2 months ago) by atatat
Branch: MAIN
Changes since 1.19: +37 -6 lines
Diff to previous 1.19 (colored)

Add "dirname"- and "basename"-like functionality to stat(1) by way of
the "high" and "low" selectors on the filename.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jun 20 22:20:16 2004 UTC (19 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.18: +8 -4 lines
Diff to previous 1.18 (colored)

Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 28 04:48:31 2004 UTC (19 years, 9 months ago) by atatat
Branch: MAIN
Changes since 1.17: +14 -4 lines
Diff to previous 1.17 (colored)

If using stat (the -L flag) and it fails, fall back to lstat().  It
may be the case that we're examining a broken symlink, and anything is
better than nothing.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Oct 29 04:25:46 2003 UTC (20 years, 4 months ago) by atatat
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.16: +5 -2 lines
Diff to previous 1.16 (colored)

Take the time to set gottime so that you don't have to waste time
trying to figure out why the time isn't the time you expected all the
time.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Oct 27 00:16:21 2003 UTC (20 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.15: +5 -5 lines
Diff to previous 1.15 (colored)

be consistent using #if HAVE_STRUCT_STAT_ST_xxx  (versus #ifdef)

Revision 1.15 / (download) - annotate - [select for diffs], Mon Oct 27 00:12:43 2003 UTC (20 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.14: +9 -7 lines
Diff to previous 1.14 (colored)

Overhaul how `build.sh tools' are used:

    *	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).

Revision 1.14 / (download) - annotate - [select for diffs], Sun Oct 26 20:43:13 2003 UTC (20 years, 4 months ago) by chs
Branch: MAIN
Changes since 1.13: +35 -20 lines
Diff to previous 1.13 (colored)

fix for systems which don't have st_*timespec.  PR 23214.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jul 25 03:21:17 2003 UTC (20 years, 7 months ago) by atatat
Branch: MAIN
Changes since 1.12: +61 -11 lines
Diff to previous 1.12 (colored)

More properly host-tool-ify stat

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jul 23 07:23:23 2003 UTC (20 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.11: +7 -5 lines
Diff to previous 1.11 (colored)

* don't compile in support for st_birth #ifdef HOSTPROG
* remove %B (birth) from default format strings, since %B isn't available
  #ifdef HOSTPROG, and it's not standard enough to be fussed about anyway

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jul 20 14:12:13 2003 UTC (20 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.10: +11 -3 lines
Diff to previous 1.10 (colored)

first attempt at making this a HOSTPROG

Revision 1.10 / (download) - annotate - [select for diffs], Thu May 8 13:05:38 2003 UTC (20 years, 10 months ago) by atatat
Branch: MAIN
Changes since 1.9: +12 -5 lines
Diff to previous 1.9 (colored)

Add %B to print the st_birthtime of an inode (adjusting the "raw"
format and "shell" format appropriately), and rename the st_*timespec
fields in the shell-style output to be st_*time, since that's what
they really are.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Oct 19 20:33:19 2002 UTC (21 years, 5 months ago) by provos
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

use readlink with bufsize - 1; approved thorpej.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Aug 13 20:15:06 2002 UTC (21 years, 7 months ago) by atatat
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Use limits.h instead of sys/syslimits.h since it's more potrable.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Aug 13 14:05:41 2002 UTC (21 years, 7 months ago) by atatat
Branch: MAIN
Changes since 1.6: +7 -8 lines
Diff to previous 1.6 (colored)

Style sync with FreeBSD.  Changes via Doug Barton <DougB@FreeBSD.org>.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jul 9 21:25:00 2002 UTC (21 years, 8 months ago) by atatat
Branch: MAIN
Changes since 1.5: +9 -9 lines
Diff to previous 1.5 (colored)

Header reorganization makes a shorter list.  From Doug Barton <DougB@FreeBSD.org>

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jul 9 17:22:26 2002 UTC (21 years, 8 months ago) by atatat
Branch: MAIN
Changes since 1.4: +61 -52 lines
Diff to previous 1.4 (colored)

The bitwise or-ing together of letters is almost *guaranteed* to do
the wrong thing, as in this case.  I should read the preprocessor
output more often.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jul 8 18:48:42 2002 UTC (21 years, 8 months ago) by atatat
Branch: MAIN
Changes since 1.3: +58 -37 lines
Diff to previous 1.3 (colored)

A new command line option, -q, suppresses *stat(2) failure messages.
Output is now done via stdio, instead of with my stupid homegrown
buffering (I don't even know why I did it that way in the first
place).  Also, from Johan Karlsson <johan@freebsd.org>, eliminate a
spurious newline if no output was generated, and link stat(1) to
readlink(1) for similarity to OpenBSD.

Revision 1.3 / (download) - annotate - [select for diffs], Fri May 31 16:45:16 2002 UTC (21 years, 9 months ago) by atatat
Branch: MAIN
Changes since 1.2: +4 -2 lines
Diff to previous 1.2 (colored)

When asked for the string representation of a device that isn't
found by devname(3), don't report a "bad format"...just use "???"
instead.

Revision 1.2 / (download) - annotate - [select for diffs], Thu May 9 17:52:03 2002 UTC (21 years, 10 months ago) by atatat
Branch: MAIN
CVS Tags: netbsd-1-6-base
Branch point for: netbsd-1-6
Changes since 1.1: +54 -33 lines
Diff to previous 1.1 (colored)

Add a simple format that translates to the current file number, fix an
off by one error, and #define a bunch more things to make it clearer.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Apr 27 16:37:19 2002 UTC (21 years, 10 months ago) by atatat
Branch: MAIN

Add a stat(1) program to /usr/bin.  It provides a simple formatting
interface, with reasonable defaults, to the information provided by
stat(2) so that scripts can use the data therein much more easily.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>