git: e478560ba476 - stable/14 - libsysdecode: Add support for decoding inotify syscall flags

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7353ca.457f2.3c9fc2d0__12179.5693923318$1785943101$gmane$org@gitrepo.freebsd.org>
The branch stable/14 has been updated by markj:

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

commit e478560ba476ea780e2500bafe546e0c36e72065
Author:     Mark Johnston <[email protected]>
AuthorDate: 2025-07-03 19:52:31 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2026-08-05 15:15:15 +0000

    libsysdecode: Add support for decoding inotify syscall flags
    
    MFC after:      3 months
    Sponsored by:   Klara, Inc.
    
    (cherry picked from commit b79bd43f9ab3bf0dfd4744dee406782f0329134a)
---
 lib/libsysdecode/Makefile    | 1 +
 lib/libsysdecode/flags.c     | 9 ++++++++-
 lib/libsysdecode/mktables    | 1 +
 lib/libsysdecode/sysdecode.h | 1 +
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/libsysdecode/Makefile b/lib/libsysdecode/Makefile
index 504701ee99a2..73762ef7e6e0 100644
--- a/lib/libsysdecode/Makefile
+++ b/lib/libsysdecode/Makefile
@@ -85,6 +85,7 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \
 	sysdecode_mask.3 sysdecode_fileflags.3 \
 	sysdecode_mask.3 sysdecode_filemode.3 \
 	sysdecode_mask.3 sysdecode_flock_operation.3 \
+	sysdecode_mask.3 sysdecode_inotifyflags.3 \
 	sysdecode_mask.3 sysdecode_mlockall_flags.3 \
 	sysdecode_mask.3 sysdecode_mmap_flags.3 \
 	sysdecode_mask.3 sysdecode_mmap_prot.3 \
diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c
index 018dfef5f5c2..0aace2433e7f 100644
--- a/lib/libsysdecode/flags.c
+++ b/lib/libsysdecode/flags.c
@@ -23,7 +23,6 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 #define L2CAP_SOCKET_CHECKED
 
 #include <sys/types.h>
@@ -31,6 +30,7 @@
 #include <sys/capsicum.h>
 #include <sys/event.h>
 #include <sys/extattr.h>
+#include <sys/inotify.h>
 #include <sys/linker.h>
 #include <sys/mman.h>
 #include <sys/mount.h>
@@ -351,6 +351,13 @@ sysdecode_getrusage_who(int who)
 	return (lookup_value(rusage, who));
 }
 
+bool
+sysdecode_inotifyflags(FILE *fp, int flag, int *rem)
+{
+
+	return (print_mask_int(fp, inotifyflags, flag, rem));
+}
+
 static struct name_table kevent_user_ffctrl[] = {
 	X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY)
 	XEND
diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables
index 599e41808f2f..d99c2c04f1e5 100644
--- a/lib/libsysdecode/mktables
+++ b/lib/libsysdecode/mktables
@@ -98,6 +98,7 @@ gen_table "extattrns"       "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/
 gen_table "fadvisebehav"    "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+"          "sys/fcntl.h"
 gen_table "openflags"       "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+"           "sys/fcntl.h"	"O_RDONLY|O_RDWR|O_WRONLY"
 gen_table "flockops"        "LOCK_[A-Z]+[[:space:]]+0x[0-9]+"              "sys/fcntl.h"
+gen_table "inotifyflags"    "IN_[A-Z_]+[[:space:]]+0x[0-9]+"               "sys/inotify.h"      "IN_CLOEXEC|IN_NONBLOCK"
 gen_table "kldsymcmd"       "KLDSYM_[A-Z]+[[:space:]]+[0-9]+"              "sys/linker.h"
 gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+"       "sys/linker.h"
 gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+"              "aio.h"
diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h
index 8dc0bbea6f0d..c95d7f71379b 100644
--- a/lib/libsysdecode/sysdecode.h
+++ b/lib/libsysdecode/sysdecode.h
@@ -61,6 +61,7 @@ const char *sysdecode_getfsstat_mode(int _mode);
 const char *sysdecode_getrusage_who(int _who);
 const char *sysdecode_idtype(int _idtype);
 const char *sysdecode_ioctlname(unsigned long _val);
+bool	sysdecode_inotifyflags(FILE *_fp, int _flags, int *_rem);
 const char *sysdecode_ipproto(int _protocol);
 void	sysdecode_kevent_fflags(FILE *_fp, short _filter, int _fflags,
 	    int _base);
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.