man.bsd.lv manual page server

Manual Page Search Parameters

sysdecode_mask(3) Library Functions Manual sysdecode_mask(3)

sysdecode_mask, sysdecode_accessmode, sysdecode_atflags, sysdecode_capfcntlrights, sysdecode_fcntl_fileflags, sysdecode_fileflags, sysdecode_filemode, sysdecode_flock_operation, sysdecode_mlockall_flags, sysdecode_mmap_flags, sysdecode_mmap_prot, sysdecode_mount_flags, sysdecode_msg_flags, sysdecode_msync_flags, sysdecode_open_flags, sysdecode_pipe2_flags, sysdecode_reboot_howto, sysdecode_rfork_flags, sysdecode_semget_flags, sysdecode_sendfile_flags, sysdecode_shmat_flags, sysdecode_sctp_nxt_flags, sysdecode_sctp_rcv_flags, sysdecode_sctp_snd_flags, sysdecode_socket_type, sysdecode_thr_create_flags, sysdecode_umtx_cvwait_flags, sysdecode_umtx_rwlock_flags, sysdecode_vmprot, sysdecode_wait4_options, sysdecode_wait6_optionsprint name of various bitmask values

library “libsysdecode”

#include <sys/types.h>
#include <stdbool.h>
#include <stdio.h>
#include <sysdecode.h>

bool
sysdecode_access_mode(FILE *fp, int mode, int *rem);

bool
sysdecode_atflags(FILE *fp, int flags, int *rem);

bool
sysdecode_cap_fcntlrights(FILE *fp, uint32_t rights, uint32_t *rem);

bool
sysdecode_fcntl_fileflags(FILE *fp, int flags, int *rem);

bool
sysdecode_fileflags(FILE *fp, fflags_t flags, fflags_t *rem);

bool
sysdecode_filemode(FILE *fp, int mode, int *rem);

bool
sysdecode_flock_operation(FILE *fp, int operation, int *rem);

bool
sysdecode_mlockall_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_mmap_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_mmap_prot(FILE *fp, int prot, int *rem);

bool
sysdecode_mount_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_msg_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_msync_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_open_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_pipe2_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_reboot_howto(FILE *fp, int howto, int *rem);

bool
sysdecode_rfork_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_sctp_nxt_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_sctp_rcv_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_sctp_snd_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_semget_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_sendfile_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_shmat_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_socket_type(FILE *fp, int type, int *rem);

bool
sysdecode_thr_create_flags(FILE *fp, int flags, int *rem);

bool
sysdecode_umtx_cvwait_flags(FILE *fp, u_long flags, u_long *rem);

bool
sysdecode_umtx_rwlock_flags(FILE *fp, u_long flags, u_long *rem);

bool
sysdecode_vmprot(FILE *fp, int type, int *rem);

bool
sysdecode_wait4_options(FILE *fp, int options, int *rem);

bool
sysdecode_wait6_options(FILE *fp, int options, int *rem);

The sysdecode_mask functions are used to generate a text description of an integer value built from a mask of bitfields. The text description lists the C macros for field values joined by pipe ‘|’ characters matching the format used in C source code. Most of the values decoded by these functions are passed as arguments to system calls, though some of these values are used internally in the kernel.

Each function writes the text description to fp. The second argument should contain the integer value to be decoded. The rem argument is set to the value of any bits that were not decoded (bit fields that do not have a corresponding C macro). rem may be set to NULL if the caller does not need this value. Each function returns true if any bit fields in the value were decoded and false if no bit fields were decoded.

Most of these functions decode an argument passed to a system call:

() access(2) mode
() chflagsat(2), fstatat(2) atflag, flag
() cap_fcntls_limit(2) fcntlrights
() chflags(2) flags
() chmod(2), open(2) mode
() flock(2) operation
() mlockall(2) flags
() mmap(2) flags
() mmap(2) prot
() mount(2) flags
() recv(2), send(2) flags
() msync(2) flags
() open(2) flags
() pipe2 flags
() reboot(2) howto
() rfork(2) flags
() semget(2) flags
() sendfile(2) flags
() shmat(2) flags
() socket(2) type
() thr_create(2) flags
() wait4(2) options
() wait6(2) options

Other functions decode the values described below:

()
The file flags used with the F_GETFL and F_SETFL fcntl(2) commands.
()
The nxt_flags member of a struct sctp_nxtinfo.
()
The rcv_flags member of a struct sctp_rcvinfo.
()
The snd_flags member of a struct sctp_sndinfo.
()
The val argument to _umtx_op(2) for UMTX_OP_CV_WAIT operations.
()
The val argument to _umtx_op(2) for UMTX_OP_RW_RDLOCK operations.
()
The memory protection flags stored in vm_prot_t variables.

The sysdecode_mask functions return true if any bit fields in the value were decoded and false if no bit fields were decoded.

sysdecode(3), sysdecode_enum(3)

January 16, 2018 FreeBSD-13.0