The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5c43a86184a0722126a53d1cbb873058a1b214dc
commit 5c43a86184a0722126a53d1cbb873058a1b214dc Author: Konstantin Belousov <[email protected]> AuthorDate: 2026-09-28 22:09:03 +0000 Commit: Konstantin Belousov <[email protected]> CommitDate: 2026-12-04 19:23:06 +0000 fstat(1), fuser(1): teach about altroot (cherry picked from commit face51fd9c8213f6f4133b0e137fcf22e4d1ab76) --- usr.bin/fstat/fstat.1 | 5 ++++- usr.bin/fstat/fstat.c | 2 ++ usr.bin/fstat/fuser.1 | 5 ++++- usr.bin/fstat/fuser.c | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/usr.bin/fstat/fstat.1 b/usr.bin/fstat/fstat.1 index 4d6e32438a04..7a34a00ac18f 100644 --- a/usr.bin/fstat/fstat.1 +++ b/usr.bin/fstat/fstat.1 @@ -44,7 +44,8 @@ The .Nm utility identifies open files. A file is considered open by a process if it was explicitly opened, -is the working directory, root directory, jail root directory, +is the working directory, root directory, alternative root directory, +jail root directory, active executable text, or kernel trace file for that process. If no options are specified, .Nm @@ -122,6 +123,8 @@ jail root directory memory-mapped file .It Sy root root inode +.It Sy altr +alternative root inode .It Sy text executable text inode .It Sy tr diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index e93385a5b0f6..2eb41ab5d32e 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -271,6 +271,8 @@ print_file_info(struct procstat *procstat, struct filestat *fst, printf(" wd"); else if (fst->fs_uflags & PS_FST_UFLAG_RDIR) printf(" root"); + else if (fst->fs_uflags & PS_FST_UFLAG_ADIR) + printf(" altr"); else if (fst->fs_uflags & PS_FST_UFLAG_TRACE) printf(" tr"); else if (fst->fs_uflags & PS_FST_UFLAG_MMAP) diff --git a/usr.bin/fstat/fuser.1 b/usr.bin/fstat/fuser.1 index 5def7b36d606..ff92fc930550 100644 --- a/usr.bin/fstat/fuser.1 +++ b/usr.bin/fstat/fuser.1 @@ -43,7 +43,8 @@ more named files open. For block and character special devices, all processes using files on that device are listed. A file is considered open by a process if it was explicitly opened, -is the working directory, root directory, jail root directory, +is the working directory, root directory, alternative root directory, +jail root directory, active executable text, kernel trace file or the controlling terminal of the process. If @@ -83,6 +84,8 @@ The following symbols, written to stderr will indicate how files are used: .It Sy a The file is open as append only .Pq Dv O_APPEND No was specified . +.It Sy b +The file is the alternative root directory of the process. .It Sy c The file is the current workdir directory of the process. .It Sy d diff --git a/usr.bin/fstat/fuser.c b/usr.bin/fstat/fuser.c index c38a520d4ce3..bd316d736c20 100644 --- a/usr.bin/fstat/fuser.c +++ b/usr.bin/fstat/fuser.c @@ -73,6 +73,7 @@ static const struct { {PS_FST_UFLAG_RDIR, 'r'}, {PS_FST_UFLAG_CDIR, 'c'}, {PS_FST_UFLAG_JAIL, 'j'}, + {PS_FST_UFLAG_ADIR, 'b'}, {PS_FST_UFLAG_TRACE, 't'}, {PS_FST_UFLAG_TEXT, 'x'}, {PS_FST_UFLAG_MMAP, 'm'},
