diff --git a/lib/libsysdecode/sysdecode.3 b/lib/libsysdecode/sysdecode.3 index 41faca95e7e1..cce4878f2fb5 100644 --- a/lib/libsysdecode/sysdecode.3 +++ b/lib/libsysdecode/sysdecode.3 @@ -1,92 +1,90 @@ .\" .\" Copyright (c) 2015 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd April 26, 2018 .Dt SYSDECODE 3 .Os .Sh NAME .Nm sysdecode .Nd system argument decoding library .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Sh DESCRIPTION The .Nm library includes several functions that provide descriptive names of values associated with system calls. .Ss Supported ABIs Some functions in this library provide ABI-specific descriptions. The supported ABIs are named by the .Vt enum sysdecode_abi enumeration. .Pp .Bl -tag -width "Li SYSDECODE_ABI_CLOUDABI64" -compact .It Li SYSDECODE_ABI_FREEBSD Native FreeBSD binaries. Supported on all platforms. .It Li SYSDECODE_ABI_FREEBSD32 32-bit FreeBSD binaries. Supported on amd64 and powerpc64. .It Li SYSDECODE_ABI_LINUX Linux binaries of the same platform. Supported on amd64, i386, and arm64. .It Li SYSDECODE_ABI_LINUX32 32-bit Linux binaries. Supported on amd64. .It Li SYSDECODE_ABI_CLOUDABI32 32-bit CloudABI binaries. Supported on all platforms. .It Li SYSDECODE_ABI_CLOUDABI64 64-bit CloudABI binaries. Supported on all platforms. .It Li SYSDECODE_ABI_UNKNOWN A placeholder for use when the ABI is not known. .El .Sh SEE ALSO .Xr sysdecode_abi_to_freebsd_errno 3 , .Xr sysdecode_cap_rights 3 , .Xr sysdecode_cmsg_type 3 , .Xr sysdecode_enum 3 , .Xr sysdecode_fcntl_arg 3 , .Xr sysdecode_ioctlname 3 , .Xr sysdecode_kevent 3 , .Xr sysdecode_mask 3 , .Xr sysdecode_quotactl_cmd 3 , .Xr sysdecode_sctp_sinfo_flags 3 , .Xr sysdecode_sigcode 3 , .Xr sysdecode_socket_protocol 3 , .Xr sysdecode_sockopt_name 3 , .Xr sysdecode_syscallnames 3 , .Xr sysdecode_utrace 3 .Sh HISTORY The .Nm library first appeared in .Fx 11.0 . diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h index 47e37aeeed98..111cff4815c0 100644 --- a/lib/libsysdecode/sysdecode.h +++ b/lib/libsysdecode/sysdecode.h @@ -1,135 +1,139 @@ /*- * Copyright (c) 2015 John H. Baldwin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SYSDECODE_H__ #define __SYSDECODE_H__ +#include +#include +#include + enum sysdecode_abi { SYSDECODE_ABI_UNKNOWN = 0, SYSDECODE_ABI_FREEBSD, SYSDECODE_ABI_FREEBSD32, SYSDECODE_ABI_LINUX, SYSDECODE_ABI_LINUX32, SYSDECODE_ABI_CLOUDABI64, SYSDECODE_ABI_CLOUDABI32 }; int sysdecode_abi_to_freebsd_errno(enum sysdecode_abi _abi, int _error); bool sysdecode_access_mode(FILE *_fp, int _mode, int *_rem); const char *sysdecode_acltype(int _type); const char *sysdecode_atfd(int _fd); bool sysdecode_atflags(FILE *_fp, int _flags, int *_rem); bool sysdecode_cap_fcntlrights(FILE *_fp, uint32_t _rights, uint32_t *_rem); void sysdecode_cap_rights(FILE *_fp, cap_rights_t *_rightsp); bool sysdecode_close_range_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_cmsg_type(int _cmsg_level, int _cmsg_type); const char *sysdecode_extattrnamespace(int _namespace); const char *sysdecode_fadvice(int _advice); void sysdecode_fcntl_arg(FILE *_fp, int _cmd, uintptr_t _arg, int _base); bool sysdecode_fcntl_arg_p(int _cmd); const char *sysdecode_fcntl_cmd(int _cmd); 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); int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error); 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); const char *sysdecode_ipproto(int _protocol); void sysdecode_kevent_fflags(FILE *_fp, short _filter, int _fflags, int _base); const char *sysdecode_kevent_filter(int _filter); bool sysdecode_kevent_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_kldsym_cmd(int _cmd); const char *sysdecode_kldunload_flags(int _flags); const char *sysdecode_lio_listio_mode(int _mode); const char *sysdecode_madvice(int _advice); const char *sysdecode_minherit_inherit(int _inherit); const char *sysdecode_msgctl_cmd(int _cmd); 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); const char *sysdecode_nfssvc_flags(int _flags); bool sysdecode_open_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_pathconf_name(int _name); bool sysdecode_pipe2_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_prio_which(int _which); const char *sysdecode_procctl_cmd(int _cmd); const char *sysdecode_ptrace_request(int _request); bool sysdecode_quotactl_cmd(FILE *_fp, int _cmd); bool sysdecode_reboot_howto(FILE *_fp, int _howto, int *_rem); bool sysdecode_rfork_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); bool sysdecode_sctp_nxt_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_sctp_pr_policy(int _policy); bool sysdecode_sctp_rcv_flags(FILE *_fp, int _flags, int *_rem); void sysdecode_sctp_sinfo_flags(FILE *_fp, int _sinfo_flags); bool sysdecode_sctp_snd_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_shmat_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_shmctl_cmd(int _cmd); const char *sysdecode_shutdown_how(int _how); const char *sysdecode_sigbus_code(int _si_code); const char *sysdecode_sigchld_code(int _si_code); const char *sysdecode_sigcode(int _sig, int _si_code); const char *sysdecode_sigfpe_code(int _si_code); const char *sysdecode_sigill_code(int _si_code); const char *sysdecode_signal(int _sig); const char *sysdecode_sigprocmask_how(int _how); const char *sysdecode_sigsegv_code(int _si_code); const char *sysdecode_sigtrap_code(int _si_code); const char *sysdecode_sockaddr_family(int _sa_family); const char *sysdecode_socketdomain(int _domain); const char *sysdecode_socket_protocol(int _domain, int _protocol); bool sysdecode_socket_type(FILE *_fp, int _type, int *_rem); const char *sysdecode_sockopt_level(int _level); const char *sysdecode_sockopt_name(int _level, int _optname); const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); const char *sysdecode_sysarch_number(int _number); bool sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem); const char *sysdecode_umtx_op(int _op); bool sysdecode_umtx_op_flags(FILE *_fp, int op, int *_rem); bool sysdecode_umtx_rwlock_flags(FILE *_fp, u_long _flags, u_long *_rem); int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); bool sysdecode_vmprot(FILE *_fp, int _type, int *_rem); const char *sysdecode_vmresult(int _result); bool sysdecode_wait4_options(FILE *_fp, int _options, int *_rem); bool sysdecode_wait6_options(FILE *_fp, int _options, int *_rem); const char *sysdecode_whence(int _whence); bool sysdecode_shmflags(FILE *_fp, int _flags, int *_rem); #endif /* !__SYSDECODE_H__ */ diff --git a/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 b/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 index e5efefbdbe3f..9081ba30e810 100644 --- a/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 +++ b/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 @@ -1,96 +1,94 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd October 17, 2016 .Dt sysdecode_abi_to_freebsd_errno 3 .Os .Sh NAME .Nm sysdecode_abi_to_freebsd_errno , .Nm sysdecode_freebsd_to_abi_errno .Nd translate error numbers between process ABIs .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft int .Fn sysdecode_abi_to_freebsd_errno "enum sysdecode_abi abi" "int error" .Ft int .Fn sysdecode_freebsd_to_abi_errno "enum sysdecode_abi abi" "int error" .Sh DESCRIPTION The .Fn sysdecode_abi_to_freebsd_errno function returns the native .Xr errno 2 value that corresponds to the error indicated by .Fa error for the process ABI .Fa abi . If .Fa error does not identify a valid error for .Fa abi , .Dv INT_MAX is returned. .Pp The .Fn sysdecode_freebsd_to_abi_errno function the error value for the process ABI .Fa abi that corresponds to the native .Xr errno 2 value .Fa error . If .Fa error does not identify a valid .Xr errno 2 error, .Dv INT_MAX is returned. .Pp Note that the mappings between native .Xr errno 2 values and errors for other ABIs are not exhaustive. If a mapping does not exist, these functions return .Dv INT_MAX . In addition, multiple error values in one ABI may map to a single error in another ABI. .Sh RETURN VALUES These functions return an error value on success or .Dv INT_MAX if .Fa error is not valid. .Pp For the list of supported ABIs, see .Xr sysdecode 3 . .Sh SEE ALSO .Xr sysdecode 3 , .Xr sysdecode_syscallnames 3 diff --git a/lib/libsysdecode/sysdecode_cap_rights.3 b/lib/libsysdecode/sysdecode_cap_rights.3 index e165e3d43938..efc46b6375d3 100644 --- a/lib/libsysdecode/sysdecode_cap_rights.3 +++ b/lib/libsysdecode/sysdecode_cap_rights.3 @@ -1,71 +1,68 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd April 11, 2022 .Dt sysdecode_cap_rights 3 .Os .Sh NAME .Nm sysdecode_cap_rights .Nd output list of capability rights .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft void .Fn sysdecode_cap_rights "FILE *fp" "cap_rights_t *rightsp" .Sh DESCRIPTION The .Fn sysdecode_cap_rights function outputs a comma-separated list of capability rights at .Fa rightsp to the stream .Fa fp . .Pp Note that some capability rights are supersets of others; for example, .Dv CAP_PREAD is the union of .Dv CAP_READ and .Dv CAP_SEEK . .Fn sysdecode_cap_rights emits a minimal list of rights whose union is equal to .Fa *rightsp . For example, if both .Dv CAP_READ and .Dv CAP_SEEK are set in .Fa *rightsp , then .Fn sysdecode_cap_rights will include only .Dv CAP_PREAD in the output list. .Sh SEE ALSO .Xr sysdecode 3 diff --git a/lib/libsysdecode/sysdecode_cmsg_type.3 b/lib/libsysdecode/sysdecode_cmsg_type.3 index 945a4a8f837d..6774e2dcee50 100644 --- a/lib/libsysdecode/sysdecode_cmsg_type.3 +++ b/lib/libsysdecode/sysdecode_cmsg_type.3 @@ -1,54 +1,52 @@ .\" .\" Copyright (c) 2018 Michael Tuexen .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd January 15, 2018 .Dt sysdecode_cmsg_type 3 .Os .Sh NAME .Nm sysdecode_cmsg_type .Nd lookup name of cmsg type .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_cmsg_type "int cmsg_level" "int cmsg_type" .Sh DESCRIPTION The .Fn sysdecode_cmsg_type function returns a text description of the .Fa cmsg_type member of a .Vt struct cmsghdr . .Fn sysdecode_cmsg_type also takes the .Fa cmsg_level to uniquely identify the type. .Sh SEE ALSO .Xr sysdecode 3 diff --git a/lib/libsysdecode/sysdecode_enum.3 b/lib/libsysdecode/sysdecode_enum.3 index 722d82f27f29..2ea021b9933c 100644 --- a/lib/libsysdecode/sysdecode_enum.3 +++ b/lib/libsysdecode/sysdecode_enum.3 @@ -1,256 +1,254 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd January 14, 2018 .Dt sysdecode_enum 3 .Os .Sh NAME .Nm sysdecode_enum , .Nm sysdecode_acltype , .Nm sysdecode_atfd , .Nm sysdecode_extattrnamespace , .Nm sysdecode_fadvice , .Nm sysdecode_fcntl_cmd , .Nm sysdecode_getfsstat_mode , .Nm sysdecode_getrusage_who , .Nm sysdecode_idtype , .Nm sysdecode_ipproto , .Nm sysdecode_kldsym_cmd , .Nm sysdecode_kldunload_flags , .Nm sysdecode_lio_listio_mode , .Nm sysdecode_madvice , .Nm sysdecode_minherit_flags , .Nm sysdecode_msgctl_cmd , .Nm sysdecode_nfssvc_flags , .Nm sysdecode_pathconf_name , .Nm sysdecode_prio_which , .Nm sysdecode_procctl_cmd , .Nm sysdecode_ptrace_request , .Nm sysdecode_rlimit , .Nm sysdecode_rtprio_function , .Nm sysdecode_scheduler_policy , .Nm sysdecode_sctp_pr_policy , .Nm sysdecode_sctp_sinfo_flags , .Nm sysdecode_semctl_cmd , .Nm sysdecode_shmctl_cmd , .Nm sysdecode_shutdown_how , .Nm sysdecode_sigbus_code , .Nm sysdecode_sigchld_code , .Nm sysdecode_sigfpe_code , .Nm sysdecode_sigill_code , .Nm sysdecode_signal , .Nm sysdecode_sigprocmask_how , .Nm sysdecode_sigsegv_code , .Nm sysdecode_sigtrap_code , .Nm sysdecode_sockaddr_family , .Nm sysdecode_socketdomain , .Nm sysdecode_sockettype , .Nm sysdecode_sockopt_level , .Nm sysdecode_sysarch_number , .Nm sysdecode_umtx_op , .Nm sysdecode_vmresult , .Nm sysdecode_whence .Nd lookup name of various enumerated values .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_acltype "int type" .Ft const char * .Fn sysdecode_atfd "int fd" .Ft const char * .Fn sysdecode_extattrnamespace "int namespace" .Ft const char * .Fn sysdecode_fadvice "int advice" .Ft const char * .Fn sysdecode_fcntl_cmd "int cmd" .Ft const char * .Fn sysdecode_getfsstat_mode "int mode" .Ft const char * .Fn sysdecode_getrusage_who "int who" .Ft const char * .Fn sysdecode_idtype "int idtype" .Ft const char * .Fn sysdecode_ipproto "int protocol" .Ft const char * .Fn sysdecode_kldsym_cmd "int cmd" .Ft const char * .Fn sysdecode_kldunload_flags "int flags" .Ft const char * .Fn sysdecode_lio_listio_mode "int mode" .Ft const char * .Fn sysdecode_madvice "int advice" .Ft const char * .Fn sysdecode_minherit_flags "int inherit" .Ft const char * .Fn sysdecode_msgctl_cmd "int cmd" .Ft const char * .Fn sysdecode_nfssvc_flags "int flags" .Ft const char * .Fn sysdecode_pathconf_name "int name" .Ft const char * .Fn sysdecode_prio_which "int which" .Ft const char * .Fn sysdecode_procctl_cmd "int cmd" .Ft const char * .Fn sysdecode_ptrace_request "int request" .Ft const char * .Fn sysdecode_rlimit "int resource" .Ft const char * .Fn sysdecode_rtprio_function "int function" .Ft const char * .Fn sysdecode_scheduler_policy "int policy" .Ft const char * .Fn sysdecode_sctp_pr_policy "int policy" .Ft const char * .Fn sysdecode_semctl_cmd "int cmd" .Ft const char * .Fn sysdecode_shmctl_cmd "int cmd" .Ft const char * .Fn sysdecode_shutdown_how "int how" .Ft const char * .Fn sysdecode_sigbus_code "int si_code" .Ft const char * .Fn sysdecode_sigchld_code "int si_code" .Ft const char * .Fn sysdecode_sigfpe_code "int si_code" .Ft const char * .Fn sysdecode_sigill_code "int si_code" .Ft const char * .Fn sysdecode_signal "int sig" .Ft const char * .Fn sysdecode_sigprocmask_how "int how" .Ft const char * .Fn sysdecode_sigsegv_code "int si_code" .Ft const char * .Fn sysdecode_sigtrap_code "int si_code" .Ft const char * .Fn sysdecode_sockaddr_family "int sa_family" .Ft const char * .Fn sysdecode_socketdomain "int domain" .Ft const char * .Fn sysdecode_sockettype "int type" .Ft const char * .Fn sysdecode_sockopt_level "int level" .Ft const char * .Fn sysdecode_sysarch_number "int number" .Ft const char * .Fn sysdecode_umtx_op "int op" .Ft const char * .Fn sysdecode_vmresult "int result" .Ft const char * .Fn sysdecode_whence "int whence" .Sh DESCRIPTION The .Nm functions return a text description of an integer value. The text description matches the name of a C macro with the same value as the sole function argument. .Dv NULL is returned if there is no matching C macro name. .Pp Most of these functions decode an argument passed to a system call: .Bl -column "Fn sysdecode_extattrnamespace" "Xr sched_setscheduler 2" .It Sy Function Ta Sy System Call Ta Sy Argument .It Fn sysdecode_acltype Ta Xr acl_get_file 3 Ta Fa type .It Fn sysdecode_atfd Ta Xr openat 2 Ta Fa fd .It Fn sysdecode_extattrnamespace Ta Xr extattr_get_fd 2 Ta Fa attrnamespace .It Fn sysdecode_fadvice Ta Xr posix_fadvise 2 Ta Fa advice .It Fn sysdecode_fcntl_cmd Ta Xr fcntl 2 Ta Fa cmd .It Fn sysdecode_getfsstat_mode Ta Xr getfsstat 2 Ta Fa mode .It Fn sysdecode_idtype Ta .Xr procctl 2 , .Xr waitid 2 .Ta Fa idtype .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 .It Fn sysdecode_madvice Ta Xr madvise 2 Ta Fa advice .It Fn sysdecode_minherit_inherit Ta Xr minherit 2 Ta Fa inherit .It Fn sysdecode_msgctl_cmd Ta Xr msgctl 2 Ta Fa cmd .It Fn sysdecode_nfssvc_flags Ta Xr nfssvc 2 Ta Fa flags .It Fn sysdecode_pathconf_name Ta Xr pathconf 2 Ta Fa name .It Fn sysdecode_prio_which Ta Xr getpriority 2 Ta Fa which .It Fn sysdecode_procctl_cmd Ta Xr procctl 2 Ta Fa cmd .It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request .It Fn sysdecode_rlimit Ta Xr getrlimit 2 Ta Fa resource .It Fn sysdecode_rtprio_function Ta Xr rtprio 2 Ta Fa function .It Fn sysdecode_getrusage_who Ta Xr getrusage 2 Ta Fa who .It Fn sysdecode_scheduler_policy Ta Xr sched_setscheduler 2 Ta Fa policy .It Fn sysdecode_semctl_cmd Ta Xr semctl 2 Ta Fa cmd .It Fn sysdecode_shmctl_cmd Ta Xr shmctl 2 Ta Fa cmd .It Fn sysdecode_shutdown_how Ta Xr shutdown 2 Ta Fa how .It Fn sysdecode_sigprocmask_how Ta Xr sigprocmask 2 Ta Fa how .It Fn sysdecode_sockopt_level Ta Xr getsockopt 2 Ta Fa level .It Fn sysdecode_sysarch_number Ta Xr sysarch 2 Ta Fa number .It Fn sysdecode_umtx_op Ta Xr _umtx_op 2 Ta Fa op .It Fn sysdecode_whence Ta Xr lseek 2 Ta Fa whence .El .Pp These functions decode signal-specific signal codes stored in the .Fa si_code field of the .Vt siginfo_t object associated with an instance of signal: .Bl -column "Fn sysdecode_sigchld_code" .It Sy Function Ta Sy Signal .It Fn sysdecode_sigbus_code Ta Dv SIGBUS .It Fn sysdecode_sigchld_code Ta Dv SIGCHLD .It Fn sysdecode_sigfpe_code Ta Dv SIGFPE .It Fn sysdecode_sigill_code Ta Dv SIGILL .It Fn sysdecode_sigsegv_code Ta Dv SIGSEGV .It Fn sysdecode_sigtrap_code Ta Dv SIGTRAP .El .Pp Other functions decode the values described below: .Bl -tag -width "Fn sysdecode_sockaddr_family" .It Fn sysdecode_ipproto An IP protocol. .It Fn sysdecode_sctp_pr_policy A PR-SCTP policy. .It Fn sysdecode_signal A process signal. .It Fn sysdecode_sockaddr_family A socket address family. .It Fn sysdecode_socketdomain A socket domain. .It Fn sysdecode_vmresult The return value of a function in the virtual memory subsystem of the kernel indicating the status of the associated request. .El .Sh RETURN VALUES The .Nm functions return the name of a matching C macro or .Dv NULL if no matching C macro was found. .Sh SEE ALSO .Xr sysdecode 3 , .Xr sysdecode_mask 3 , .Xr sysdecode_sigcode 3 diff --git a/lib/libsysdecode/sysdecode_fcntl_arg.3 b/lib/libsysdecode/sysdecode_fcntl_arg.3 index a2fa360205fb..0fa7d6af9e17 100644 --- a/lib/libsysdecode/sysdecode_fcntl_arg.3 +++ b/lib/libsysdecode/sysdecode_fcntl_arg.3 @@ -1,121 +1,118 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd November 24, 2017 .Dt sysdecode_fcntl_arg 3 .Os .Sh NAME .Nm sysdecode_fcntl_arg , .Nm sysdecode_fcntl_arg_p .Nd output description of fcntl argument .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft void .Fn sysdecode_fcntl_arg "FILE *fp" "int cmd" "uintptr_t arg" "int base" .Ft bool .Fn sysdecode_fcntl_arg_p "int cmd" .Sh DESCRIPTION The .Fn sysdecode_fcntl_arg function outputs a text description of the optional .Fa arg argument to .Xr fcntl 2 to the stream .Fa fp . The type and format of .Fa arg are determined by .Fa cmd : .Bl -column ".Dv F_SETLKW" "Vt struct flock *" .It Sy Command Ta Fa arg Sy Type Ta Sy Output Format .It .It Dv F_SETFD Ta Vt int Ta .Dq FD_CLOEXEC or the value of .Fa arg in the indicated .Fa base .Pq one of 8, 10, or 16 . .It .It Dv F_SETFL Ta Vt int Ta File flags as output by .Xr sysdecode_fcntl_fileflags 3 with any unknown or remaining bits output in hexadecimal. .It .It Dv F_GETLK Ta Vt struct flock * Ta .It Dv F_SETLK Ta Vt struct flock * Ta .It Dv F_SETLKW Ta Vt struct flock * Ta The value of .Fa arg using the .Dq %p conversion specification. .It .It Others Ta Vt int Ta The value of .Fa arg in the indicated .Fa base .Pq one of 8, 10, or 16 . .El .Pp The .Fn sysdecode_fcntl_arg_p function can be used to determine if a .Xr fcntl 2 command uses the optional third argument to .Xr fcntl 2 . The function returns .Dv true if .Fa cmd accepts a third argument to .Xr fcntl 2 and .Dv false if it does not. .Sh RETURN VALUES The .Nm sysdecode_fcntl_arg_p function returns .Dv true if .Fa cmd accepts a third argument to .Xr fcntl 2 and .Dv false if it does not. .Sh SEE ALSO .Xr sysdecode 3 , .Xr sysdecode_fcntl_cmd 3 , .Xr sysdecode_fcntl_fileflags 3 diff --git a/lib/libsysdecode/sysdecode_ioctlname.3 b/lib/libsysdecode/sysdecode_ioctlname.3 index 93b6f43c92f2..40250a24f3ed 100644 --- a/lib/libsysdecode/sysdecode_ioctlname.3 +++ b/lib/libsysdecode/sysdecode_ioctlname.3 @@ -1,59 +1,57 @@ .\" .\" Copyright (c) 2015 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd October 17, 2016 .Dt sysdecode_ioctlname 3 .Os .Sh NAME .Nm sysdecode_ioctlname .Nd lookup name of device control command .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_ioctlname "unsigned long request" .Sh DESCRIPTION The .Fn sysdecode_ioctlname function returns the name of a device control request identified by .Fa request . A table of names is generated during the build of the .Nm sysdecode library from system headers that maps device control request values to the name of the corresponding C macro. .Sh RETURN VALUES The .Fn sysdecode_ioctlname function returns the name of a device control request if .Fa request is a known value; otherwise .Dv NULL . .Sh SEE ALSO .Xr sysdecode 3 diff --git a/lib/libsysdecode/sysdecode_kevent.3 b/lib/libsysdecode/sysdecode_kevent.3 index 4fbf2c0fded3..c3dc0ff5a28b 100644 --- a/lib/libsysdecode/sysdecode_kevent.3 +++ b/lib/libsysdecode/sysdecode_kevent.3 @@ -1,125 +1,122 @@ .\" .\" Copyright (c) 2017 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd November 24, 2017 .Dt sysdecode_kevent 3 .Os .Sh NAME .Nm sysdecode_kevent , .Nm sysdecode_kevent_fflags , .Nm sysdecode_kevent_filter , .Nm sysdecode_kevent_flags .Nd output description of kevent structure fields .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft void .Fn sysdecode_kevent_fflags "FILE *fp" "short filter" "int fflags" "int base" .Ft bool .Fn sysdecode_kevent_flags "FILE *fp" "int flags" "int *rem" .Ft const char * .Fn sysdecode_kevent_filter "int filter" .Sh DESCRIPTION These functions provide text descriptions of .Vt struct kevent fields. .Pp The .Fn sysdecode_kevent_fflags function outputs a text description of the .Fa fflags member of a .Vt struct kevent to the stream .Fa fp . For the .Dv EVFILT_READ , .Dv EVFILT_WRITE , .Dv EVFILT_VNODE , .Dv EVFILT_PROC , .Dv EVFILT_PROCDESC , .Dv EVFILT_TIMER , and .Dv EVFILT_USER filters, .Fn sysdecode_kevent_fflags outputs a bitmask of filter-specific .Dv NOTE_* flags as documented in .Xr kevent 2 . For other values of .Fa filter , the value of .Fa fflags is output in the indicated .Fa base .Pq one of 8, 10, or 16 . .Pp The .Fn sysdecode_kevent_filter function returns a text description of the .Fa filter member of a .Vt struct kevent . .Dv NULL is returned if the .Fa filter value is unknown. .Pp The .Fn sysdecode_kevent_flags function outputs a text description of the .Fa flags member of a .Vt struct kevent to the stream .Fa fp . This function uses the same calling convention and formatting as the other functions described in .Xr sysdecode_mask 3 . .Sh RETURN VALUES The .Nm sysdecode_kevent_filter function returns the name of a filter or .Dv NULL if the filter value is unknown. .Pp The .Nm sysdecode_kevent_flags function returns .Dv true if any flags in the .Fa flags field were decoded and .Dv false if no flags were decoded. .Sh SEE ALSO .Xr sysdecode 3 , .Xr sysdecode_enum 3 , .Xr sysdecode_mask 3 diff --git a/lib/libsysdecode/sysdecode_mask.3 b/lib/libsysdecode/sysdecode_mask.3 index 45464e333eb4..e602e8494f8e 100644 --- a/lib/libsysdecode/sysdecode_mask.3 +++ b/lib/libsysdecode/sysdecode_mask.3 @@ -1,245 +1,242 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd March 3, 2022 .Dt sysdecode_mask 3 .Os .Sh NAME .Nm sysdecode_mask , .Nm sysdecode_accessmode , .Nm sysdecode_atflags , .Nm sysdecode_capfcntlrights , .Nm sysdecode_close_range_flags , .Nm sysdecode_fcntl_fileflags , .Nm sysdecode_fileflags , .Nm sysdecode_filemode , .Nm sysdecode_flock_operation , .Nm sysdecode_mlockall_flags , .Nm sysdecode_mmap_flags , .Nm sysdecode_mmap_prot , .Nm sysdecode_mount_flags , .Nm sysdecode_msg_flags , .Nm sysdecode_msync_flags , .Nm sysdecode_open_flags , .Nm sysdecode_pipe2_flags , .Nm sysdecode_reboot_howto , .Nm sysdecode_rfork_flags , .Nm sysdecode_semget_flags , .Nm sysdecode_sendfile_flags , .Nm sysdecode_shmat_flags , .Nm sysdecode_sctp_nxt_flags , .Nm sysdecode_sctp_rcv_flags , .Nm sysdecode_sctp_snd_flags , .Nm sysdecode_socket_type , .Nm sysdecode_thr_create_flags , .Nm sysdecode_umtx_cvwait_flags , .Nm sysdecode_umtx_rwlock_flags , .Nm sysdecode_vmprot , .Nm sysdecode_wait4_options , .Nm sysdecode_wait6_options .Nd print name of various bitmask values .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft bool .Fn sysdecode_access_mode "FILE *fp" "int mode" "int *rem" .Ft bool .Fn sysdecode_atflags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_cap_fcntlrights "FILE *fp" "uint32_t rights" "uint32_t *rem" .Ft bool .Fn sysdecode_close_range_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_fcntl_fileflags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_fileflags "FILE *fp" "fflags_t flags" "fflags_t *rem" .Ft bool .Fn sysdecode_filemode "FILE *fp" "int mode" "int *rem" .Ft bool .Fn sysdecode_flock_operation "FILE *fp" "int operation" "int *rem" .Ft bool .Fn sysdecode_mlockall_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_mmap_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_mmap_prot "FILE *fp" "int prot" "int *rem" .Ft bool .Fn sysdecode_mount_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_msg_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_msync_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_open_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_pipe2_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_reboot_howto "FILE *fp" "int howto" "int *rem" .Ft bool .Fn sysdecode_rfork_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_sctp_nxt_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_sctp_rcv_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_sctp_snd_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_semget_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_sendfile_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_shmat_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_socket_type "FILE *fp" "int type" "int *rem" .Ft bool .Fn sysdecode_thr_create_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_umtx_cvwait_flags "FILE *fp" "u_long flags" "u_long *rem" .Ft bool .Fn sysdecode_umtx_rwlock_flags "FILE *fp" "u_long flags" "u_long *rem" .Ft bool .Fn sysdecode_vmprot "FILE *fp" "int type" "int *rem" .Ft bool .Fn sysdecode_wait4_options "FILE *fp" "int options" "int *rem" .Ft bool .Fn sysdecode_wait6_options "FILE *fp" "int options" "int *rem" .Sh DESCRIPTION The .Nm 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 .Sq | 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. .Pp Each function writes the text description to .Fa fp . The second argument should contain the integer value to be decoded. The .Fa rem argument is set to the value of any bits that were not decoded .Pq bit fields that do not have a corresponding C macro . .Fa rem may be set to .Dv NULL if the caller does not need this value. Each function returns .Dv true if any bit fields in the value were decoded and .Dv false if no bit fields were decoded. .Pp Most of these functions decode an argument passed to a system call: .Bl -column "Fn sysdecode_flock_operation" "Xr cap_fcntls_limit 2" .It Sy Function Ta Sy System Call Ta Sy Argument .It Fn sysdecode_access_mode Ta Xr access 2 Ta Fa mode .It Fn sysdecode_atflags Ta Xr chflagsat 2 , Xr fstatat 2 Ta Fa atflag , Fa flag .It Fn sysdecode_cap_fcntlrights Ta Xr cap_fcntls_limit 2 Ta Fa fcntlrights .It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags .It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode .It Fn sysdecode_flock_operation Ta Xr flock 2 Ta Fa operation .It Fn sysdecode_mlockall_flags Ta Xr mlockall 2 Ta Fa flags .It Fn sysdecode_mmap_flags Ta Xr mmap 2 Ta Fa flags .It Fn sysdecode_mmap_prot Ta Xr mmap 2 Ta Fa prot .It Fn sysdecode_mount_flags Ta Xr mount 2 Ta Fa flags .It Fn sysdecode_msg_flags Ta Xr recv 2 , Xr send 2 Ta Fa flags .It Fn sysdecode_msync_flags Ta Xr msync 2 Ta Fa flags .It Fn sysdecode_open_flags Ta Xr open 2 Ta Fa flags .It Fn sysdecode_pipe2_flags Ta Xr pipe2 Ta Fa flags .It Fn sysdecode_reboot_howto Ta Xr reboot 2 Ta Fa howto .It Fn sysdecode_rfork_flags Ta Xr rfork 2 Ta Fa flags .It Fn sysdecode_semget_flags Ta Xr semget 2 Ta Fa flags .It Fn sysdecode_sendfile_flags Ta Xr sendfile 2 Ta Fa flags .It Fn sysdecode_shmat_flags Ta Xr shmat 2 Ta Fa flags .It Fn sysdecode_socket_type Ta Xr socket 2 Ta Fa type .It Fn sysdecode_thr_create_flags Ta Xr thr_create 2 Ta Fa flags .It Fn sysdecode_wait4_options Ta Xr wait4 2 Ta Fa options .It Fn sysdecode_wait6_options Ta Xr wait6 2 Ta Fa options .El .Pp Other functions decode the values described below: .Bl -tag -width ".Fn sysdecode_umtx_cvwait_flags" .It Fn sysdecode_fcntl_fileflags The file flags used with the .Dv F_GETFL and .Dv F_SETFL .Xr fcntl 2 commands. .It Fn sysdecode_sctp_nxt_flags The .Fa nxt_flags member of a .Vt struct sctp_nxtinfo . .It Fn sysdecode_sctp_rcv_flags The .Fa rcv_flags member of a .Vt struct sctp_rcvinfo . .It Fn sysdecode_sctp_snd_flags The .Fa snd_flags member of a .Vt struct sctp_sndinfo . .It Fn sysdecode_umtx_cvwait_flags The .Fa val argument to .Xr _umtx_op 2 for .Dv UMTX_OP_CV_WAIT operations. .It Fn sysdecode_umtx_rwlock_flags The .Fa val argument to .Xr _umtx_op 2 for .Dv UMTX_OP_RW_RDLOCK operations. .It Fn sysdecode_vmprot The memory protection flags stored in .Vt vm_prot_t variables. .El .Sh RETURN VALUES The .Nm functions return .Dv true if any bit fields in the value were decoded and .Dv false if no bit fields were decoded. .Sh SEE ALSO .Xr sysdecode 3 , .Xr sysdecode_enum 3 diff --git a/lib/libsysdecode/sysdecode_quotactl_cmd.3 b/lib/libsysdecode/sysdecode_quotactl_cmd.3 index 3dc6669520e4..1e59632bf0b8 100644 --- a/lib/libsysdecode/sysdecode_quotactl_cmd.3 +++ b/lib/libsysdecode/sysdecode_quotactl_cmd.3 @@ -1,93 +1,90 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd November 24, 2017 .Dt sysdecode_quotactl_cmd 3 .Os .Sh NAME .Nm sysdecode_quotactl_cmd .Nd output name of quotactl command .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft bool .Fn sysdecode_quotactl_cmd "FILE *fp" "int cmd" .Sh DESCRIPTION The .Fn sysdecode_quotactl_cmd function outputs a text description of the .Fa cmd argument to .Xr quotactl 2 to the stream .Fa fp . The description is formatted as an invocation of the .Dv QCMD macro defined in the .In ufs/ufs/quota.h header. .Pp The function first computes the primary and secondary values used by .Dv QCMD to construct .Fa cmd . If the primary command value does not represent a known constant, .Fn sysdecode_quotactl_cmd does not generate any output and returns .Dv false . Otherwise, .Fn sysdecode_quotactl_cmd outputs text depicting an invocation of .Dv QCMD with the associated constants for the primary and secondary command values and returns .Dv true . If the secondary command values does not represent a known constant, its value is output as a hexadecimal integer. .Sh RETURN VALUES The .Nm sysdecode_quotactl_cmd function returns .Dv true if it outputs a description of .Fa cmd and .Dv false if it does not. .Sh EXAMPLES The statement .Pp .Dl sysdecode_quotatcl_cmd(stdout, QCMD(Q_GETQUOTA, USRQUOTA); .Pp outputs the text .Dq QCMD(Q_GETQUOTA, USRQUOTA) to standard output. .Sh SEE ALSO .Xr sysdecode 3 diff --git a/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 b/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 index 121d85c0e056..6275ef4b24db 100644 --- a/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 +++ b/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 @@ -1,55 +1,52 @@ .\" .\" Copyright (c) 2018 Michael Tuexen .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd January 14, 2018 .Dt sysdecode_sctp_sinfo_flags 3 .Os .Sh NAME .Nm sysdecode_sctp_sinfo_flags .Nd output textual description of the sinfo_flags field of struct sctp_sndrcvinfo .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft void .Fn sysdecode_sctp_sinfo_flags "FILE *fp" "int sinfo_flags" .Sh DESCRIPTION The .Fn sysdecode_sctp_sinfo_flags function outputs a textual description of the .Fa sinfo_flags member of a .Vt struct sctp_sndrcvinfo to the stream .Fa fp . In particular, the embedded PR-SCTP policies are handled. .Sh SEE ALSO .Xr sysdecode 3 .Xr sysdecode_sctp_pr_policy 3 diff --git a/lib/libsysdecode/sysdecode_sigcode.3 b/lib/libsysdecode/sysdecode_sigcode.3 index 79dc0a6efc5d..32edd98e72c4 100644 --- a/lib/libsysdecode/sysdecode_sigcode.3 +++ b/lib/libsysdecode/sysdecode_sigcode.3 @@ -1,82 +1,80 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd October 17, 2016 .Dt sysdecode_sigcode 3 .Os .Sh NAME .Nm sysdecode_sigcode .Nd lookup name of signal code .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_sigcode "int signal" "int si_code" .Sh DESCRIPTION The .Fn sysdecode_sigcode function returns a text description of the .Fa si_code field of the .Vt siginfo_t object associated with an instance of signal .Fa sig . The text description contains the name of the C macro whose value matches .Fa si_code . General purpose signal codes such as .Dv SI_USER are handled as well as signal-specific codes for .Dv SIGBUS , .Dv SIGCHLD , .Dv SIGFPE , .Dv SIGILL , .Dv SIGSEGV and .Dv SIGTRAP . If .Fa si_code does not represent a known signal code, .Fn sysdecode_sigcode returns .Dv NULL . .Sh RETURN VALUES The .Fn sysdecode_sigcode function returns a pointer to a signal code description or .Dv NULL if .Fa si_code is not a known signal code. .Sh SEE ALSO .Xr sysdecode_sigbus_code 3 , .Xr sysdecode_sigchld_code 3 , .Xr sysdecode_sigfpe_code 3 , .Xr sysdecode_sigill_code 3 , .Xr sysdecode_sigsegv_code 3 , .Xr sysdecode_sigtrap_code 3 diff --git a/lib/libsysdecode/sysdecode_socket_protocol.3 b/lib/libsysdecode/sysdecode_socket_protocol.3 index 266bdf3fd793..9a5e212b712a 100644 --- a/lib/libsysdecode/sysdecode_socket_protocol.3 +++ b/lib/libsysdecode/sysdecode_socket_protocol.3 @@ -1,53 +1,51 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd May 25, 2017 .Dt sysdecode_socket_protocol 3 .Os .Sh NAME .Nm sysdecode_socket_protocol .Nd lookup name of socket protocol .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_socket_protocol "int domain" "int protocol" .Sh DESCRIPTION The .Fn sysdecode_socket_protocol function returns a text description of the protocol passed in the .Fa protocol argument to .Xr socket 2 . .Fn sysdecode_socket_protocol takes the .Fa protocol as well as the .Fa domain to uniquely identify the protocol. diff --git a/lib/libsysdecode/sysdecode_sockopt_name.3 b/lib/libsysdecode/sysdecode_sockopt_name.3 index 4bd8ace8c0cb..083221943e73 100644 --- a/lib/libsysdecode/sysdecode_sockopt_name.3 +++ b/lib/libsysdecode/sysdecode_sockopt_name.3 @@ -1,60 +1,58 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd October 17, 2016 .Dt sysdecode_sockopt_name 3 .Os .Sh NAME .Nm sysdecode_sockopt_name .Nd lookup name of socket option .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_sockopt_name "int level" "int optname" .Sh DESCRIPTION The .Fn sysdecode_sockopt_name function returns a text description of the socket option name passed in the .Fa optname argument to .Xr getsockopt 2 . .Fn sysdecode_sockopt_name takes the socket option .Fa level as well as the option name to uniquely identify the option. .Sh SEE ALSO .Xr sysdecode_sockopt_level 3 .Sh BUGS Socket option levels and names are protocol-specific. Both .Fn sysdecode_sockopt_level and .Fn sysdecode_sockopt_name should possibly accept the protocol family as an additional argument. diff --git a/lib/libsysdecode/sysdecode_syscallnames.3 b/lib/libsysdecode/sysdecode_syscallnames.3 index ae1170737f36..4fed4af3502c 100644 --- a/lib/libsysdecode/sysdecode_syscallnames.3 +++ b/lib/libsysdecode/sysdecode_syscallnames.3 @@ -1,70 +1,68 @@ .\" .\" Copyright (c) 2016 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd October 17, 2016 .Dt sysdecode_syscallnames 3 .Os .Sh NAME .Nm sysdecode_syscallnames .Nd lookup name of system calls .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h .In sysdecode.h .Ft const char * .Fn sysdecode_syscallnames "enum sysdecode_abi abi" "unsigned int code" .Sh DESCRIPTION This function returns a pointer to the name of a system call identified by .Fa code for the process ABI .Fa abi . If .Fa code specifies an unknown system call or .Fa abi is an unsupported ABI, .Nm returns .Dv NULL . .Pp For the list of supported ABIs, see .Xr sysdecode 3 . .Sh RETURN VALUES The .Nm function returns a pointer to a string on success or .Dv NULL if either .Fa code or .Fa ABI is invalid . .Sh SEE ALSO .Xr sysdecode 3 , .Xr sysdecode_abi_to_freebsd_errno 3 diff --git a/lib/libsysdecode/sysdecode_utrace.3 b/lib/libsysdecode/sysdecode_utrace.3 index 507fd2164813..6e503187740b 100644 --- a/lib/libsysdecode/sysdecode_utrace.3 +++ b/lib/libsysdecode/sysdecode_utrace.3 @@ -1,76 +1,73 @@ .\" .\" Copyright (c) 2015 John Baldwin .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd November 24, 2017 .Dt sysdecode_utrace 3 .Os .Sh NAME .Nm sysdecode_utrace .Nd produce text description of a utrace record .Sh LIBRARY .Lb libsysdecode .Sh SYNOPSIS -.In sys/types.h -.In stdbool.h -.In stdio.h .In sysdecode.h .Ft int .Fn sysdecode_utrace "FILE *fp" "void *buf" "size_t len" "int decimal" .Sh DESCRIPTION The .Fn sysdecode_utrace function outputs a textual representation of a .Xr utrace 2 record identified by .Fa buf and .Fa len to the output stream .Fa fp . .Pp The function only outputs a representation for certain types of records. If a record is recognized, the function outputs the description and returns a non-zero value. If the record is not recognized, the function does not output anything and returns zero. The .Fn sysdecode_utrace function currently recognizes .Xr utrace 2 records generated by .Xr malloc 3 and .Xr rtld 1 . .Sh RETURN VALUES The .Fn sysdecode_utrace function returns a non-zero value if it recognizes a .Xr utrace 2 record; otherwise it returns zero. .Sh SEE ALSO .Xr utrace 2 , .Xr sysdecode 3