History log of /src/usr.bin/stat/stat.c (Results 1 – 25 of 159)
Revision Date Author Comments
# 1a7a067d 16-Sep-2025 Dag-Erling Smørgrav <des@FreeBSD.org>

stat: Add option to list holes

Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://revi

stat: Add option to list holes

Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D52481

show more ...


# 49eeca74 07-Jan-2024 LO WEN-CHIEN <s111062113@m111.nthu.edu.tw>

stat(1): Fix grammar error in stat.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1014


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

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BS

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 37399d5b 29-Jan-2023 Jamie Landeg-Jones <jamie@catflap.org>

usr.bin/stat: Fix error message formatting.

PR: bin/261657
MFC after: 3 days


# 050e4bca 28-Jan-2023 Alexander Naumochkin <alexander.naumochkin@gmail.com>

stat(1): Do not pass S_IFBLK to devname unconditionally

PR: 269190
Reviewed by: kib
MFC after: 1 week


# 20f8331a 30-Oct-2021 Stefan Eßer <se@FreeBSD.org>

usr.bin/stat: honour locale for "-t %+"

The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was alwa

usr.bin/stat: honour locale for "-t %+"

The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was always that of date for the
POSIX locale.

The fix suggested by the reporter leads to output that matches the
documentation.

Reported by: Jamie Landeg-Jones <jamie@catflap.org>
MFC after: 3 days

show more ...


# 7648bc9f 13-May-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @347527

Sponsored by: The FreeBSD Foundation


# f35f34b1 01-May-2019 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add 'Birth' to 'stat -x' output. Current Linux stat(1)
also includes that.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org

Add 'Birth' to 'stat -x' output. Current Linux stat(1)
also includes that.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20130

show more ...


# e0cee12e 11-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r336870 through r337615.


# 1a7a067d 16-Sep-2025 Dag-Erling Smørgrav <des@FreeBSD.org>

stat: Add option to list holes

Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://revi

stat: Add option to list holes

Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D52481

show more ...


# 49eeca74 07-Jan-2024 LO WEN-CHIEN <s111062113@m111.nthu.edu.tw>

stat(1): Fix grammar error in stat.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1014


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

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BS

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 37399d5b 29-Jan-2023 Jamie Landeg-Jones <jamie@catflap.org>

usr.bin/stat: Fix error message formatting.

PR: bin/261657
MFC after: 3 days


# 050e4bca 28-Jan-2023 Alexander Naumochkin <alexander.naumochkin@gmail.com>

stat(1): Do not pass S_IFBLK to devname unconditionally

PR: 269190
Reviewed by: kib
MFC after: 1 week


# 20f8331a 30-Oct-2021 Stefan Eßer <se@FreeBSD.org>

usr.bin/stat: honour locale for "-t %+"

The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was alwa

usr.bin/stat: honour locale for "-t %+"

The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was always that of date for the
POSIX locale.

The fix suggested by the reporter leads to output that matches the
documentation.

Reported by: Jamie Landeg-Jones <jamie@catflap.org>
MFC after: 3 days

show more ...


# 7648bc9f 13-May-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @347527

Sponsored by: The FreeBSD Foundation


# f35f34b1 01-May-2019 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add 'Birth' to 'stat -x' output. Current Linux stat(1)
also includes that.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org

Add 'Birth' to 'stat -x' output. Current Linux stat(1)
also includes that.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20130

show more ...


# e0cee12e 11-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r336870 through r337615.


# 14b841d4 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

MFH @ r337607, in preparation for boarding


# a04ed761 11-Aug-2018 Conrad Meyer <cem@FreeBSD.org>

stat(1): cache id->name resolution

When invoked on a large list of files, it is most common for a small number of
uids/gids to own most of the results.

Like ls(1), use pwcache(3) to avoid repeatedl

stat(1): cache id->name resolution

When invoked on a large list of files, it is most common for a small number of
uids/gids to own most of the results.

Like ls(1), use pwcache(3) to avoid repeatedly looking up the same IDs.

Example microbenchmark and non-scientific results:

$ time (find /usr/src -type f -print0 | xargs -0 stat >/dev/null)

BEFORE:
3.62s user 5.23s system 102% cpu 8.655 total
3.47s user 5.38s system 102% cpu 8.647 total

AFTER:
1.23s user 1.81s system 108% cpu 2.810 total
1.43s user 1.54s system 107% cpu 2.754 total

Does this microbenchmark have any real-world significance? Until a use case
is demonstrated otherwise, I doubt it. Ordinarily I would be resistant to
optimizing pointless microbenchmarks in base utilities (e.g., recent totally
gratuitous changes to yes(1)). However, the pwcache(3) APIs actually
simplify stat(1) logic ever so slightly compared to the raw APIs they wrap,
so I think this is at worst harmless.

PR: 230491
Reported by: Thomas Hurst <tom AT hur.st>
Discussed with: gad@

show more ...


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.

show more ...


# 5d49c30c 26-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use MIN() instead of MAX() as the previous syntax was wrote in a weird and
confused way: "prec > 9 ? 9 : prec".

Submitted by: pfg, ngie and luke <luke.tw@gmail.com>
MFC after: 2 weeks.


# cadc2836 22-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use macro MAX() from sys/param.h.

MFC after: 2 weeks.


1234567