git: 97d0086f9541 - stable/14 - truss: Add a decoder for inotify_add_watch_at(2)

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7353cb.457f6.a33b03f__25830.5835000769$1785943110$gmane$org@gitrepo.freebsd.org>
The branch stable/14 has been updated by markj:

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

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

    truss: Add a decoder for inotify_add_watch_at(2)
    
    MFC after:      3 months
    Sponsored by:   Klara, Inc.
    
    (cherry picked from commit 4d08e7815d6c71c620f19a8abdf0caa26f9c5c57)
---
 usr.bin/truss/syscall.h  | 1 +
 usr.bin/truss/syscalls.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h
index d79ef882cff0..47d973326dfb 100644
--- a/usr.bin/truss/syscall.h
+++ b/usr.bin/truss/syscall.h
@@ -99,6 +99,7 @@ enum Argtype {
 	Getfsstatmode,
 	Idtype,
 	Ioctl,
+	Inotifyflags,
 	Itimerwhich,
 	Kldsymcmd,
 	Kldunloadflags,
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index a6b6d4ec187e..7b299bd2e1ff 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -31,7 +31,6 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 /*
  * This file has routines used to print out system calls and their
  * arguments.
@@ -316,6 +315,9 @@ static const struct syscall_decode decoded_syscalls[] = {
 		    { Ptr | OUT, 3 }, { Ptr | OUT, 4 } } },
 	{ .name = "gettimeofday", .ret_type = 1, .nargs = 2,
 	  .args = { { Timeval | OUT, 0 }, { Ptr, 1 } } },
+	{ .name = "inotify_add_watch_at", .ret_type = 1, .nargs = 4,
+	  .args = { { Int, 0 }, { Atfd, 1 }, { Name | IN, 2 },
+	            { Inotifyflags, 3 } } },
 	{ .name = "ioctl", .ret_type = 1, .nargs = 3,
 	  .args = { { Int, 0 }, { Ioctl, 1 }, { Ptr, 2 } } },
 	{ .name = "kevent", .ret_type = 1, .nargs = 6,
@@ -2447,6 +2449,9 @@ print_arg(struct syscall_arg *sc, syscallarg_t *args, syscallarg_t *retval,
 		print_integer_arg(sysdecode_getfsstat_mode, fp,
 		    args[sc->offset]);
 		break;
+	case Inotifyflags:
+		print_mask_arg(sysdecode_inotifyflags, fp, args[sc->offset]);
+		break;
 	case Itimerwhich:
 		print_integer_arg(sysdecode_itimer, fp, args[sc->offset]);
 		break;
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.