libsysdecode: Decode setitimer, getitimer which argument

Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35230
MFC after:		2 weeks
This commit is contained in:
Dmitry Chagin 2022-06-22 14:17:10 +03:00
parent 3606a213bf
commit 2fc3a51db1
4 changed files with 17 additions and 1 deletions

View File

@ -1195,3 +1195,10 @@ sysdecode_shmflags(FILE *fp, int flags, int *rem)
return (print_mask_0(fp, shmflags, flags, rem));
}
const char *
sysdecode_itimer(int which)
{
return (lookup_value(itimerwhich, which));
}

View File

@ -168,6 +168,7 @@ else
gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h"
fi
gen_table "shmflags" "SHM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/mman.h" "SHM_ANON"
gen_table "itimerwhich" "ITIMER_[A-Z]+[[:space:]]+[0-9]+" "sys/time.h"
# Generate a .depend file for our output file
if [ -n "$output_file" ]; then

View File

@ -66,6 +66,7 @@ const char *sysdecode_ioctlname(unsigned long _val);
const char *sysdecode_ipproto(int _protocol);
void sysdecode_kevent_fflags(FILE *_fp, short _filter, int _fflags,
int _base);
const char *sysdecode_itimer(int _which);
const char *sysdecode_kevent_filter(int _filter);
bool sysdecode_kevent_flags(FILE *_fp, int _flags, int *_rem);
const char *sysdecode_kldsym_cmd(int _cmd);

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 14, 2018
.Dd June 22, 2022
.Dt sysdecode_enum 3
.Os
.Sh NAME
@ -38,6 +38,7 @@
.Nm sysdecode_getrusage_who ,
.Nm sysdecode_idtype ,
.Nm sysdecode_ipproto ,
.Nm sysdecode_itimer ,
.Nm sysdecode_kldsym_cmd ,
.Nm sysdecode_kldunload_flags ,
.Nm sysdecode_lio_listio_mode ,
@ -97,6 +98,8 @@
.Ft const char *
.Fn sysdecode_ipproto "int protocol"
.Ft const char *
.Fn sysdecode_itimer "int which"
.Ft const char *
.Fn sysdecode_kldsym_cmd "int cmd"
.Ft const char *
.Fn sysdecode_kldunload_flags "int flags"
@ -186,6 +189,10 @@ Most of these functions decode an argument passed to a system call:
.Xr procctl 2 ,
.Xr waitid 2
.Ta Fa idtype
.It Fn sysdecode_itimer Ta
.Xr getitimer 2 ,
.Xr setitimer 2
.Ta Fa which
.It Fn sysdecode_kldsym_cmd Ta Xr kldsym 2 Ta Fa cmd
.It Fn sysdecode_kldunload_flags Ta Xr kldunloadf 2 Ta Fa flags
.It Fn sysdecode_lio_listio_mode Ta Xr lio_listio 2 Ta Fa mode