From nobody Mon Mar 18 15:53:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tyzsc1Z0fz5Dyd7; Mon, 18 Mar 2024 15:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tyzsb5mNLz4ccS; Mon, 18 Mar 2024 15:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710777203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BjornkipEQhW2wRL6Jn1tHMxLwGZq/Xo1PytZEcGoQ0=; b=oSYWFdEOmTTI0aXS7fDPJJSMMy/l50OI6+iE2KrW1A1tgbovwOrcgMNf2KLwKH/nbGGbzu QCJlZbltyJq2JOT2+0+xHy3Z2ZARJMDVz7zRW+K3yc2lpPQGP9F97dBkuJp83JuQUb/xfR 448OxAIUCFASUlDrFKQx36kQhEptgh20nGOQ5dkIixbV7rmZ+djQxmfrNXGtMHwQIpIQfI 17LwabAbQC5sqZR6lkjwXr9XnFrq0OznKuGkj7feOS0QCS+U4S3/K6e14yBxvs6TuupHYx Vu33h/zC8+0rkfkyNSIyjkZ+LTQChcFWzTMbZGWDtew7wbSqu5WIli2QI4iOWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710777203; a=rsa-sha256; cv=none; b=Z0XZF58B+aPkMeD0fR4VZHkjlO8cYhPkB9kn14v/5OWDTKAJz3Uo0S6QL70lONUn5qOzf+ jMU44OW8ZroJWS6yQflYa5+S0KuY5Fimz5lBEZnSr7dfaLwwS/EkOQVged0aNuVigXevGn 2isVBPId2/vCnGFi4Y7FzBhWdnPpJQAEmT0Mu1RQdGrya2gMLVCx0cwcw3Dfz0ipF6qfk9 cOSCWZilQ+JJbw+5QkKK4uW5n3wcGKvi1Yjxu3b+WO9FglJTCy5x290A9cyxeBUnziVbW2 XVU7FVqd1yaed6VV/NU0YcGaZVUjIGDXYWs/RxrW57J6eRhmvYmH41WtO66RQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710777203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BjornkipEQhW2wRL6Jn1tHMxLwGZq/Xo1PytZEcGoQ0=; b=cKfdHnUeSAzujmQw03fmAwnWPNqicCkxaiiLzcmYDVLu7nhs7FWgKNeMqzwSS7HPVRg6R3 FVqqvOWtJUkHJiD8MfO2nX81bk5WR6zoTPcOd1OZUjv+3P8MRwojmBj9de+4ukOQjMDgS+ Px18srAeSz5TmywAFYDJetyyjEHL/IYYDqWzT4TQUozi4UgdHwEImkMVS3iyZiYuOk03Jw XncK1hD3C/CRJ6xS4DFj3ozrwJ5pgeRL4fShLAGJuBTl0VnhCVg/FX+k7kJRsCXXZnWnl8 Uv8POfI37aPJzRajkoU6Q/9ZRp9v5NuDQgnfj60t2pfuVVeXlVhRh8qMfWA3Pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tyzsb2hpQzT9L; Mon, 18 Mar 2024 15:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42IFrN0R001399; Mon, 18 Mar 2024 15:53:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42IFrNAl001396; Mon, 18 Mar 2024 15:53:23 GMT (envelope-from git) Date: Mon, 18 Mar 2024 15:53:23 GMT Message-Id: <202403181553.42IFrNAl001396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: efb74e16ddc0 - stable/14 - libsysdecode: add a decoder for pollfd events List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efb74e16ddc0ba0864abc9b7f284e17f72d40e78 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=efb74e16ddc0ba0864abc9b7f284e17f72d40e78 commit efb74e16ddc0ba0864abc9b7f284e17f72d40e78 Author: Kyle Evans AuthorDate: 2024-03-05 04:14:06 +0000 Commit: Kyle Evans CommitDate: 2024-03-18 15:52:58 +0000 libsysdecode: add a decoder for pollfd events We'll use this in another change to read pollfd arrays coming from a successful poll(2) operation. Reviewed by: bapt, jhb (cherry picked from commit bd23e71f91ceec5dfdffc28bbd0020849fdd20b4) --- lib/libsysdecode/Makefile | 1 + lib/libsysdecode/flags.c | 8 ++++++++ lib/libsysdecode/mktables | 1 + lib/libsysdecode/sysdecode.h | 1 + lib/libsysdecode/sysdecode_mask.3 | 12 +++++++++++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/libsysdecode/Makefile b/lib/libsysdecode/Makefile index e1d6c7e02ff0..504701ee99a2 100644 --- a/lib/libsysdecode/Makefile +++ b/lib/libsysdecode/Makefile @@ -93,6 +93,7 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ sysdecode_mask.3 sysdecode_msync_flags.3 \ sysdecode_mask.3 sysdecode_open_flags.3 \ sysdecode_mask.3 sysdecode_pipe2_flags.3 \ + sysdecode_mask.3 sysdecode_pollfd_events.3 \ sysdecode_mask.3 sysdecode_reboot_howto.3 \ sysdecode_mask.3 sysdecode_rfork_flags.3 \ sysdecode_mask.3 sysdecode_semget_flags.3 \ diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c index 33c778c391ee..32829d35dbe0 100644 --- a/lib/libsysdecode/flags.c +++ b/lib/libsysdecode/flags.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -565,6 +566,13 @@ sysdecode_pipe2_flags(FILE *fp, int flags, int *rem) return (print_mask_0(fp, pipe2flags, flags, rem)); } +bool +sysdecode_pollfd_events(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, pollfdevents, flags, rem)); +} + const char * sysdecode_prio_which(int which) { diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index bf0dc34511d3..beb18e97f898 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -114,6 +114,7 @@ gen_table "mountflags" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/ gen_table "msyncflags" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/nfssvc.h" gen_table "pathconfname" "_PC_[A-Z4_]+[[:space:]]+[0-9]+" "sys/unistd.h" +gen_table "pollfdevents" "POLL[A-Z]+[[:space:]]+" "sys/poll.h" gen_table "prio" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" gen_table "procctlcmd" "PROC_[A-Z_]+[[:space:]]+[0-9]" "sys/procctl.h" "PROC_TRACE_CTL_" gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h index 4c091bb14343..8dc0bbea6f0d 100644 --- a/lib/libsysdecode/sysdecode.h +++ b/lib/libsysdecode/sysdecode.h @@ -83,6 +83,7 @@ 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); +bool sysdecode_pollfd_events(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); diff --git a/lib/libsysdecode/sysdecode_mask.3 b/lib/libsysdecode/sysdecode_mask.3 index 171a086a5079..efcab331fe29 100644 --- a/lib/libsysdecode/sysdecode_mask.3 +++ b/lib/libsysdecode/sysdecode_mask.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 3, 2022 +.Dd February 29, 2024 .Dt sysdecode_mask 3 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm sysdecode_msync_flags , .Nm sysdecode_open_flags , .Nm sysdecode_pipe2_flags , +.Nm sysdecode_pollfd_events , .Nm sysdecode_reboot_howto , .Nm sysdecode_rfork_flags , .Nm sysdecode_semget_flags , @@ -96,6 +97,8 @@ .Ft bool .Fn sysdecode_pipe2_flags "FILE *fp" "int flags" "int *rem" .Ft bool +.Fn sysdecode_pollfd_events "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" @@ -191,6 +194,13 @@ and .Dv F_SETFL .Xr fcntl 2 commands. +.It Fn sysdecode_pollfd_events +The +.Fa events +and +.Fa revents +members of a +.Vt struct pollfd . .It Fn sysdecode_sctp_nxt_flags The .Fa nxt_flags