History log of /freebsd/usr.bin/stat/Makefile (Results 1 – 10 of 10)
Revision Date Author Comments
# 43b0384b 01-Oct-2026 Maxim Sobolev <sobomax@FreeBSD.org>

mountpoint(1): new utility, implemented as a stat(1) hardlink

Add mountpoint(1), a simple utility to tell whether the file pointed
to by the argument is a mount point. It prints whether it is, unle

mountpoint(1): new utility, implemented as a stat(1) hardlink

Add mountpoint(1), a simple utility to tell whether the file pointed
to by the argument is a mount point. It prints whether it is, unless
-q is given, and exits 0 if it is, 1 if it is not, and 2 on error.

The answer comes from the kernel with a single stat(2): the root vnode
of a mounted file system is reported with SFBSD_MNTPOINT in
st_bsdflags. Unlike comparing realpath(3) of the argument with that
of statfs(2)'s f_mntonname, this works for arbitrarily deep
hierarchies, and after chroot(2) or inside a jail. A chroot or jail
root is reported as a mount point only if it is one.

The argument does not have to be a directory: file systems such as
nullfs(5) can be mounted over regular files and sockets, and stat(2)
reports those mount points as well.

Since all that is needed is one stat(2) call, make mountpoint a
hardlink to stat(1), the same way readlink(1) is, and document it in
stat.1.

Add ATF tests, including chroot(8) and jail(8) roots that are and are
not mount points, nullfs roots, file systems mounted inside the root,
both from the host and from within the jail, and a nullfs mount of a
file over a file.

Suggested by: kib
Differential revision: https://reviews.freebsd.org/D59906
Sponsored by: Sippy Software, Inc.
MFC after: 2 weeks

show more ...


# e9ac4169 15-Jul-2024 Warner Losh <imp@FreeBSD.org>

Remove residual blank line at start of Makefile

This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix


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

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 8c099357 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiom


# 21860bf9 11-Jun-2017 Enji Cooper <ngie@FreeBSD.org>

Write up some basic tests for readlink(1)

The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic).

MFC after: 1 month
Sponsored by: Dell EMC Isilon


# d7233fd6 05-Dec-2010 Doug Barton <dougb@FreeBSD.org>

Fix an "unused variable" error that gets us all the way to WARNS=6


# 254dd166 28-Jan-2005 Ruslan Ermilov <ru@FreeBSD.org>

Let bsd.prog.mk set SRCS and MAN to their default values.


# c49d3c9b 27-Jan-2005 Xin LI <delphij@FreeBSD.org>

Remove unnecessary SRCS= where could be guessed directly by our
bsd.*.mk infrasture.

Obtained from: ru


# 5b812a14 13-Aug-2002 Doug Barton <dougb@FreeBSD.org>

A cooperative effort...

1. Update the code to the latest from NetBSD, which includes:
* A new command line option to suppress stat(2) errors
* Output is now done via stdio
* Fixes for bitwise OR'ing

A cooperative effort...

1. Update the code to the latest from NetBSD, which includes:
* A new command line option to suppress stat(2) errors
* Output is now done via stdio
* Fixes for bitwise OR'ing of letters

2. Andrew from NetBSD merged in our own Johan's readlink patches.

3. Andrew also merged in some brucifications.

I made some small contributions to the header cleanup, and tried
to generally improve the overall style(9)'ishness. I also documented
the new -q option and added the *LINKS to the Makefile.

All responsibility for mistakes in merging the contributions
from the above is mine.

Obtained from: Andrew Brown <atatat@NetBSD.org>, bde, johan

show more ...


# 06b6d7d8 06-Jun-2002 Doug Barton <dougb@FreeBSD.org>

Virgin import of NetBSD's stat(1)