git: 7d914975a6ab - stable/14 - procstat: Add handling for inotify descriptors

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7353d7.45f23.17826409__49675.3497676522$1785943198$gmane$org@gitrepo.freebsd.org>
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d914975a6ab45c5e1b2a11a864b0bcb136b90ab

commit 7d914975a6ab45c5e1b2a11a864b0bcb136b90ab
Author:     Mark Johnston <[email protected]>
AuthorDate: 2025-06-09 20:11:08 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2026-08-05 15:15:15 +0000

    procstat: Add handling for inotify descriptors
    
    MFC after:      3 months
    Sponsored by:   Klara, Inc.
    
    (cherry picked from commit f56e0d4755c521b50bf313a85fd399c2b6a7a4bb)
---
 usr.bin/procstat/procstat.1       | 3 +++
 usr.bin/procstat/procstat_files.c | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1
index 4813f112a725..d27209e7a13b 100644
--- a/usr.bin/procstat/procstat.1
+++ b/usr.bin/procstat/procstat.1
@@ -377,6 +377,8 @@ eventfd
 fifo
 .It h
 shared memory
+.It i
+inotify descriptor
 .It k
 kqueue
 .It m
@@ -862,6 +864,7 @@ procstat: procstat_getprocs()
 .Xr sockstat 1 ,
 .Xr cap_enter 2 ,
 .Xr cap_rights_limit 2 ,
+.Xr inotify 2 ,
 .Xr mlock 2 ,
 .Xr mlockall 2 ,
 .Xr libprocstat 3 ,
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c
index fc1336f14c84..3810e084bc11 100644
--- a/usr.bin/procstat/procstat_files.c
+++ b/usr.bin/procstat/procstat_files.c
@@ -226,6 +226,10 @@ static struct cap_desc {
 	{ CAP_BINDAT,		"ba" },
 	{ CAP_CONNECTAT,	"ca" },
 
+	/* Inotify descriptor rights. */
+	{ CAP_INOTIFY_ADD,	"ina" },
+	{ CAP_INOTIFY_RM,	"inr" },
+
 	/* Aliases and defines that combine multiple rights. */
 	{ CAP_PREAD,		"prd" },
 	{ CAP_PWRITE,		"pwr" },
@@ -416,6 +420,11 @@ procstat_files(struct procstat *procstat, struct kinfo_proc *kipp)
 			xo_emit("{eq:fd_type/eventfd}");
 			break;
 
+		case PS_FST_TYPE_INOTIFY:
+			str = "i";
+			xo_emit("{eq:fd_type/inotify}");
+			break;
+
 		case PS_FST_TYPE_NONE:
 			str = "?";
 			xo_emit("{eq:fd_type/none}");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.