aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/stat/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* mountpoint(1): new utility, implemented as a stat(1) hardlinkMaxim Sobolev2026-10-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | 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
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiomEnji Cooper2017-08-021-0/+1
| | | | Notes: svn path=/projects/make-check-sandbox/; revision=321911
* Write up some basic tests for readlink(1)Enji Cooper2017-06-111-0/+4
| | | | | | | | | | The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic). MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319834
* Fix an "unused variable" error that gets us all the way to WARNS=6Doug Barton2010-12-051-1/+0
| | | | Notes: svn path=/head/; revision=216206
* Let bsd.prog.mk set SRCS and MAN to their default values.Ruslan Ermilov2005-01-281-1/+0
| | | | Notes: svn path=/head/; revision=140941
* Remove unnecessary SRCS= where could be guessed directly by ourXin LI2005-01-271-1/+0
| | | | | | | | | bsd.*.mk infrasture. Obtained from: ru Notes: svn path=/head/; revision=140909
* A cooperative effort...Doug Barton2002-08-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=101773
* Virgin import of NetBSD's stat(1)Doug Barton2002-06-061-0/+8
Notes: svn path=/vendor/NetBSD/dist/; revision=97952