History log of /freebsd/usr.bin/stat/tests/Makefile (Results 1 – 5 of 5)
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/


# 64a82bcd 12-Jun-2017 Enji Cooper <ngie@FreeBSD.org>

Add initial tests for stat(1)

Testcases for -H, -L, and -f haven't been implemented yet, in part due
to additional complexity needed to validate the features:
* -H and -f will require an external "h

Add initial tests for stat(1)

Testcases for -H, -L, and -f haven't been implemented yet, in part due
to additional complexity needed to validate the features:
* -H and -f will require an external "helper" program to display/modify
the state/permissions for a given path.
* -L is being covered partially via the -n testcase today.

MFC after: 1 month

show more ...


# 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