git: 9e2e70d55ff5 - stable/14 - libprocstat: Add handling for inotify descriptors

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src,gmane.os.freebsd.devel.stable.scm
Message-ID <[email protected]>
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=9e2e70d55ff555b2405f4da3e0136d1209a63005

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

    libprocstat: Add handling for inotify descriptors
    
    MFC after:      3 months
    Sponsored by:   Klara, Inc.
    
    (cherry picked from commit 79102e108099237b1d702e960706a739c7b071bd)
---
 lib/libprocstat/libprocstat.c | 5 +++++
 lib/libprocstat/libprocstat.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
index fa1c943bd931..11bea0b821a1 100644
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -627,6 +627,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmap
 			type = PS_FST_TYPE_EVENTFD;
 			data = file.f_data;
 			break;
+		case DTYPE_INOTIFY:
+			type = PS_FST_TYPE_INOTIFY;
+			data = file.f_data;
+			break;
 		default:
 			continue;
 		}
@@ -719,6 +723,7 @@ kinfo_type2fst(int kftype)
 		{ KF_TYPE_SOCKET, PS_FST_TYPE_SOCKET },
 		{ KF_TYPE_VNODE, PS_FST_TYPE_VNODE },
 		{ KF_TYPE_EVENTFD, PS_FST_TYPE_EVENTFD },
+		{ KF_TYPE_INOTIFY, PS_FST_TYPE_INOTIFY },
 		{ KF_TYPE_UNKNOWN, PS_FST_TYPE_UNKNOWN }
 	};
 #define NKFTYPES	(sizeof(kftypes2fst) / sizeof(*kftypes2fst))
diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h
index 3fb73114e9c4..39e971d9abaf 100644
--- a/lib/libprocstat/libprocstat.h
+++ b/lib/libprocstat/libprocstat.h
@@ -71,6 +71,7 @@
 #define	PS_FST_TYPE_PROCDESC	13
 #define	PS_FST_TYPE_DEV		14
 #define	PS_FST_TYPE_EVENTFD	15
+#define	PS_FST_TYPE_INOTIFY	16
 
 /*
  * Special descriptor numbers.
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.