git: 79102e108099 - main - libprocstat: Add handling for inotify descriptors

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 04 Jul 2025 14:56:06 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=79102e108099237b1d702e960706a739c7b071bd

commit 79102e108099237b1d702e960706a739c7b071bd
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-06-09 20:03:08 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-04 14:42:34 +0000

    libprocstat: Add handling for inotify descriptors
    
    MFC after:      3 months
    Sponsored by:   Klara, Inc.
---
 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 29f464ef6414..eb8137f6c76f 100644
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -625,6 +625,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;
 		}
@@ -717,6 +721,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 0e9a4214414c..548747f90171 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.