libsysdecode: Add support for decoding inotify syscall flags

MFC after:	3 months
Sponsored by:	Klara, Inc.
This commit is contained in:
Mark Johnston 2025-07-03 19:52:31 +00:00
parent bc4430dc20
commit b79bd43f9a
4 changed files with 11 additions and 1 deletions

View file

@ -84,6 +84,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 \

View file

@ -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

View file

@ -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"

View file

@ -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);