From owner-svn-src-all@freebsd.org Wed Feb 19 14:52:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59B4023CC13; Wed, 19 Feb 2020 14:52:34 +0000 (UTC) (envelope-from kevans@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48N10d5cmgz3KvB; Wed, 19 Feb 2020 14:52:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88A87A6A9; Wed, 19 Feb 2020 14:52:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01JEqXZX004066; Wed, 19 Feb 2020 14:52:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01JEqXeM004064; Wed, 19 Feb 2020 14:52:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002191452.01JEqXeM004064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 19 Feb 2020 14:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358115 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 358115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2020 14:52:34 -0000 Author: kevans Date: Wed Feb 19 14:52:32 2020 New Revision: 358115 URL: https://svnweb.freebsd.org/changeset/base/358115 Log: libsysdecode: grab shmflags from sys/mman.h, add decode method Any SHM_* flag here is (and likely will continue to be) a shmflag that may be passed to shm_open2(), with exception to SHM_ANON. This is a prereq to adding appropriate support to truss/kdump. Reviewed by: kaktus (slightly earlier version) Differential Revision: https://reviews.freebsd.org/D23733 Modified: head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.h Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Wed Feb 19 14:51:39 2020 (r358114) +++ head/lib/libsysdecode/flags.c Wed Feb 19 14:52:32 2020 (r358115) @@ -1277,3 +1277,10 @@ sysdecode_sctp_sinfo_flags(FILE *fp, int sinfo_flags) } } } + +bool +sysdecode_shmflags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_0(fp, shmflags, flags, rem)); +} Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Wed Feb 19 14:51:39 2020 (r358114) +++ head/lib/libsysdecode/mktables Wed Feb 19 14:52:32 2020 (r358115) @@ -165,6 +165,7 @@ if [ -e "${include_dir}/x86/sysarch.h" ]; then 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" # Generate a .depend file for our output file if [ -n "$output_file" ]; then Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Wed Feb 19 14:51:39 2020 (r358114) +++ head/lib/libsysdecode/sysdecode.h Wed Feb 19 14:52:32 2020 (r358115) @@ -128,5 +128,6 @@ 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__ */