c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * CDDL HEADER START
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The contents of this file are subject to the terms of the
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Common Development and Distribution License (the "License").
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * You may not use this file except in compliance with the License.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * or http://www.opensolaris.org/os/licensing.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * See the License for the specific language governing permissions
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * and limitations under the License.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * When distributing Covered Code, include this CDDL HEADER in each
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * If applicable, add the following below this CDDL HEADER, with the
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * fields enclosed by brackets "[]" replaced with your own identifying
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * information: Portions Copyright [yyyy] [name of copyright owner]
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * CDDL HEADER END
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Use is subject to license terms.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore/*
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
f971a3462face662ae8ef220a18a98354d625d54Bryan Cantrill * Copyright (c) 2013, Joyent, Inc. All rights reserved.
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * String conversion routines the system structs found in
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Solaris core file note sections. These items are not
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * ELF constructs. However, elfdump contains code for decoding
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * them, and therefore requires formatting support.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include <stdio.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include <procfs.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include <sys/corectl.h>
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#include <sys/secflags.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include <string.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include <_conv.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include <corenote_msg.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_type(Word type, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg types[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_PRSTATUS, MSG_NT_PRFPREG,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_PRPSINFO, MSG_NT_PRXREG,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_PLATFORM, MSG_NT_AUXV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_GWINDOWS, MSG_NT_ASRS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_LDT, MSG_NT_PSTATUS,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami 0, 0,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_PSINFO, MSG_NT_PRCRED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_UTSNAME, MSG_NT_LWPSTATUS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_LWPSINFO, MSG_NT_PRPRIV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_NT_PRPRIVINFO, MSG_NT_CONTENT,
f971a3462face662ae8ef220a18a98354d625d54Bryan Cantrill MSG_NT_ZONENAME, MSG_NT_FDINFO,
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe MSG_NT_SPYMASTER, MSG_NT_SECFLAGS
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#if NT_NUM != NT_SECFLAGS
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "NT_NUM has grown. Update core note types[]"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_types = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(NT_PRSTATUS, types) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_types), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_auxv_type(Word type, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg types_0_22[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_NULL, MSG_AUXV_AT_IGNORE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_EXECFD, MSG_AUXV_AT_PHDR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_PHENT, MSG_AUXV_AT_PHNUM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_PAGESZ, MSG_AUXV_AT_BASE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_FLAGS, MSG_AUXV_AT_ENTRY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_NOTELF, MSG_AUXV_AT_UID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_EUID, MSG_AUXV_AT_GID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_EGID, MSG_AUXV_AT_PLATFORM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_HWCAP, MSG_AUXV_AT_CLKTCK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_FPUCW, MSG_AUXV_AT_DCACHEBSIZE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_ICACHEBSIZE, MSG_AUXV_AT_UCACHEBSIZE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_IGNOREPPC
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_types_0_22 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(0, types_0_22) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg types_2000_2011[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_UID, MSG_AUXV_AT_SUN_RUID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_GID, MSG_AUXV_AT_SUN_RGID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_LDELF, MSG_AUXV_AT_SUN_LDSHDR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_LDNAME, MSG_AUXV_AT_SUN_LPAGESZ,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_PLATFORM, MSG_AUXV_AT_SUN_HWCAP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_IFLUSH, MSG_AUXV_AT_SUN_CPU
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_types_2000_2011 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(2000, types_2000_2011) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6Robert Mustacchi static const Msg types_2014_2023[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_EXECNAME, MSG_AUXV_AT_SUN_MMU,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_LDDATA, MSG_AUXV_AT_SUN_AUXFLAGS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_EMULATOR, MSG_AUXV_AT_SUN_BRANDNAME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AT_SUN_BRAND_AUX1, MSG_AUXV_AT_SUN_BRAND_AUX2,
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe MSG_AUXV_AT_SUN_BRAND_AUX3, MSG_AUXV_AT_SUN_HWCAP2,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6Robert Mustacchi static const conv_ds_msg_t ds_types_2014_2023 = {
ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6Robert Mustacchi CONV_DS_MSG_INIT(2014, types_2014_2023) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_types_0_22), CONV_DS_ADDR(ds_types_2000_2011),
ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6Robert Mustacchi CONV_DS_ADDR(ds_types_2014_2023), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_signal(Word sig, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg sigarr[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGHUP, MSG_SIGINT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGQUIT, MSG_SIGILL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTRAP, MSG_SIGABRT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGEMT, MSG_SIGFPE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGKILL, MSG_SIGBUS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGSEGV, MSG_SIGSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPIPE, MSG_SIGALRM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTERM, MSG_SIGUSR1,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGUSR2, MSG_SIGCHLD,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPWR, MSG_SIGWINCH,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGURG, MSG_SIGPOLL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGSTOP, MSG_SIGTSTP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGCONT, MSG_SIGTTIN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTTOU, MSG_SIGVTALRM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPROF, MSG_SIGXCPU,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGXFSZ, MSG_SIGWAITING,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGLWP, MSG_SIGFREEZE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTHAW, MSG_SIGCANCEL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGLOST, MSG_SIGXRES,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGJVM1, MSG_SIGJVM2,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_sigarr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(SIGHUP, sigarr) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_sigarr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, sig, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_fault(Word flt, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg fltarr[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTILL, MSG_FLTPRIV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTBPT, MSG_FLTTRACE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTACCESS, MSG_FLTBOUNDS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTIOVF, MSG_FLTIZDIV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTFPE, MSG_FLTSTACK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTPAGE, MSG_FLTWATCH,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTCPCOVF
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_fltarr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(FLTILL, fltarr) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_fltarr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, flt, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg sysnumarr[] = {
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_EXIT, MSG_SYS_2,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_READ, MSG_SYS_WRITE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_OPEN, MSG_SYS_CLOSE,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_7, MSG_SYS_8,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LINK, MSG_SYS_UNLINK,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_11, MSG_SYS_CHDIR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIME, MSG_SYS_MKNOD,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CHMOD, MSG_SYS_CHOWN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_BRK, MSG_SYS_STAT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LSEEK, MSG_SYS_GETPID,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_MOUNT, MSG_SYS_22,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETUID, MSG_SYS_GETUID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STIME, MSG_SYS_PCSAMPLE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ALARM, MSG_SYS_FSTAT,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_PAUSE, MSG_SYS_30,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STTY, MSG_SYS_GTTY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCESS, MSG_SYS_NICE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STATFS, MSG_SYS_SYNC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_KILL, MSG_SYS_FSTATFS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PGRPSYS, MSG_SYS_UUCOPYSTR,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_41, MSG_SYS_PIPE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMES, MSG_SYS_PROFIL,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FACCESSAT, MSG_SYS_SETGID,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_GETGID, MSG_SYS_48,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MSGSYS, MSG_SYS_SYSI86,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCT, MSG_SYS_SHMSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SEMSYS, MSG_SYS_IOCTL,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_UADMIN, MSG_SYS_FCHOWNAT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UTSSYS, MSG_SYS_FDSYNC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_EXECVE, MSG_SYS_UMASK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CHROOT, MSG_SYS_FCNTL,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_ULIMIT, MSG_SYS_RENAMEAT,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_UNLINKAT, MSG_SYS_FSTATAT,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FSTATAT64, MSG_SYS_OPENAT,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_OPENAT64, MSG_SYS_TASKSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCTCTL, MSG_SYS_EXACCTSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETPAGESIZES, MSG_SYS_RCTLSYS,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_SIDSYS, MSG_SYS_76,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_PARK, MSG_SYS_SENDFILEV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RMDIR, MSG_SYS_MKDIR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETDENTS, MSG_SYS_PRIVSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UCREDSYS, MSG_SYS_SYSFS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETMSG, MSG_SYS_PUTMSG,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_87, MSG_SYS_LSTAT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYMLINK, MSG_SYS_READLINK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETGROUPS, MSG_SYS_GETGROUPS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FCHMOD, MSG_SYS_FCHOWN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGPROCMASK, MSG_SYS_SIGSUSPEND,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGALTSTACK, MSG_SYS_SIGACTION,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGPENDING, MSG_SYS_CONTEXT,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_101, MSG_SYS_102,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STATVFS, MSG_SYS_FSTATVFS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETLOADAVG, MSG_SYS_NFSSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_WAITID, MSG_SYS_SIGSENDSYS,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_HRTSYS, MSG_SYS_UTIMESYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGRESEND, MSG_SYS_PRIOCNTLSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PATHCONF, MSG_SYS_MINCORE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MMAP, MSG_SYS_MPROTECT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MUNMAP, MSG_SYS_FPATHCONF,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_VFORK, MSG_SYS_FCHDIR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_READV, MSG_SYS_WRITEV,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_123, MSG_SYS_124,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_125, MSG_SYS_126,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_MMAPOBJ, MSG_SYS_SETRLIMIT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETRLIMIT, MSG_SYS_LCHOWN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MEMCNTL, MSG_SYS_GETPMSG,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PUTPMSG, MSG_SYS_RENAME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UNAME, MSG_SYS_SETEGID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYSCONFIG, MSG_SYS_ADJTIME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYSTEMINFO, MSG_SYS_SHAREFS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETEUID, MSG_SYS_FORKSYS,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_143, MSG_SYS_SIGTIMEDWAIT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_INFO, MSG_SYS_YIELD,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_147, MSG_SYS_LWP_SEMA_POST,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SEMA_TRYWAIT, MSG_SYS_LWP_DETACH,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CORECTL, MSG_SYS_MODCTL,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FCHROOT, MSG_SYS_154,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_VHANGUP, MSG_SYS_GETTIMEOFDAY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETITIMER, MSG_SYS_SETITIMER,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_CREATE, MSG_SYS_LWP_EXIT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SUSPEND, MSG_SYS_LWP_CONTINUE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_KILL, MSG_SYS_LWP_SELF,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SIGMASK, MSG_SYS_LWP_PRIVATE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_WAIT, MSG_SYS_LWP_MUTEX_WAKEUP,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_169, MSG_SYS_LWP_COND_WAIT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_COND_SIGNAL, MSG_SYS_LWP_COND_BROADCAST,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PREAD, MSG_SYS_PWRITE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LLSEEK, MSG_SYS_INST_SYNC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_BRAND, MSG_SYS_KAIO,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CPC, MSG_SYS_LGRPSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RUSAGESYS, MSG_SYS_PORT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_POLLSYS, MSG_SYS_LABELSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACL, MSG_SYS_AUDITSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PROCESSOR_BIND, MSG_SYS_PROCESSOR_INFO,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_P_ONLINE, MSG_SYS_SIGQUEUE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLOCK_GETTIME, MSG_SYS_CLOCK_SETTIME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLOCK_GETRES, MSG_SYS_TIMER_CREATE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_DELETE, MSG_SYS_TIMER_SETTIME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_GETTIME, MSG_SYS_TIMER_GETOVERRUN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NANOSLEEP, MSG_SYS_FACL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_DOOR, MSG_SYS_SETREUID,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETREGID, MSG_SYS_INSTALL_UTRAP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGNOTIFY, MSG_SYS_SCHEDCTL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PSET, MSG_SYS_SPARC_UTRAP_INSTALL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RESOLVEPATH, MSG_SYS_LWP_MUTEX_TIMEDLOCK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SEMA_TIMEDWAIT, MSG_SYS_LWP_RWLOCK_SYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETDENTS64, MSG_SYS_MMAP64,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STAT64, MSG_SYS_LSTAT64,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTAT64, MSG_SYS_STATVFS64,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTATVFS64, MSG_SYS_SETRLIMIT64,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETRLIMIT64, MSG_SYS_PREAD64,
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_PWRITE64, MSG_SYS_224,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_OPEN64, MSG_SYS_RPCSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ZONE, MSG_SYS_AUTOFSSYS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETCWD, MSG_SYS_SO_SOCKET,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SO_SOCKETPAIR, MSG_SYS_BIND,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LISTEN, MSG_SYS_ACCEPT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CONNECT, MSG_SYS_SHUTDOWN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RECV, MSG_SYS_RECVFROM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RECVMSG, MSG_SYS_SEND,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SENDMSG, MSG_SYS_SENDTO,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETPEERNAME, MSG_SYS_GETSOCKNAME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETSOCKOPT, MSG_SYS_SETSOCKOPT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SOCKCONFIG, MSG_SYS_NTP_GETTIME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NTP_ADJTIME, MSG_SYS_LWP_MUTEX_UNLOCK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_MUTEX_TRYLOCK, MSG_SYS_LWP_MUTEX_REGISTER,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLADM, MSG_SYS_UUCOPY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UMOUNT2
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_sysnumarr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, sysnumarr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_sysnumarr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab int use_num = 0;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Range check, and handle the unused values in the middle
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * of the range. Although the missing values have strings,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * we still prefer to format them, because those strings are
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * decimal, and the default behavior, unless the CONV_FMT_DECIMAL
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * flag is set, is to display such things in hex.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (sysnum) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case 0:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 2:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 7:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 8:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 11:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 22:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 30:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 41:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 48:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 76:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 87:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 101:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 102:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 123:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 124:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 125:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 126:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 143:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 147:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 154:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 169:
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner case 224:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab use_num = 1;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab default:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab use_num = (sysnum > SYS_umount2);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (use_num)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_invalid_val(inv_buf, sysnum, fmt_flags));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, sysnum, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_errno(int errno_val, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg errarr_1_74[74] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EPERM, MSG_ERRNO_ENOENT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ESRCH, MSG_ERRNO_EINTR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EIO, MSG_ERRNO_ENXIO,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_E2BIG, MSG_ERRNO_ENOEXEC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EBADF, MSG_ERRNO_ECHILD,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EAGAIN, MSG_ERRNO_ENOMEM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EACCES, MSG_ERRNO_EFAULT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTBLK, MSG_ERRNO_EBUSY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EEXIST, MSG_ERRNO_EXDEV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENODEV, MSG_ERRNO_ENOTDIR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EISDIR, MSG_ERRNO_EINVAL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENFILE, MSG_ERRNO_EMFILE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTTY, MSG_ERRNO_ETXTBSY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EFBIG, MSG_ERRNO_ENOSPC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ESPIPE, MSG_ERRNO_EROFS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EMLINK, MSG_ERRNO_EPIPE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EDOM, MSG_ERRNO_ERANGE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOMSG, MSG_ERRNO_EIDRM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ECHRNG, MSG_ERRNO_EL2NSYNC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EL3HLT, MSG_ERRNO_EL3RST,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ELNRNG, MSG_ERRNO_EUNATCH,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOCSI, MSG_ERRNO_EL2HLT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EDEADLK, MSG_ERRNO_ENOLCK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ECANCELED, MSG_ERRNO_ENOTSUP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EDQUOT, MSG_ERRNO_EBADE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EBADR, MSG_ERRNO_EXFULL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOANO, MSG_ERRNO_EBADRQC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EBADSLT, MSG_ERRNO_EDEADLOCK,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EBFONT, MSG_ERRNO_EOWNERDEAD,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTRECOVERABLE, MSG_ERRNO_ENOSTR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENODATA, MSG_ERRNO_ETIME,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOSR, MSG_ERRNO_ENONET,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOPKG, MSG_ERRNO_EREMOTE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOLINK, MSG_ERRNO_EADV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ESRMNT, MSG_ERRNO_ECOMM,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EPROTO, MSG_ERRNO_ELOCKUNMAPPED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTACTIVE, MSG_ERRNO_EMULTIHOP
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_errarr_1_74 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, errarr_1_74) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg errarr_77_99[23] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EBADMSG, MSG_ERRNO_ENAMETOOLONG,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EOVERFLOW, MSG_ERRNO_ENOTUNIQ,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EBADFD, MSG_ERRNO_EREMCHG,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ELIBACC, MSG_ERRNO_ELIBBAD,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ELIBSCN, MSG_ERRNO_ELIBMAX,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ELIBEXEC, MSG_ERRNO_EILSEQ,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOSYS, MSG_ERRNO_ELOOP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ERESTART, MSG_ERRNO_ESTRPIPE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTEMPTY, MSG_ERRNO_EUSERS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTSOCK, MSG_ERRNO_EDESTADDRREQ,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EMSGSIZE, MSG_ERRNO_EPROTOTYPE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOPROTOOPT
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_errarr_77_99 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(77, errarr_77_99) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg errarr_120_134[15] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EPROTONOSUPPORT, MSG_ERRNO_ESOCKTNOSUPPORT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EOPNOTSUPP, MSG_ERRNO_EPFNOSUPPORT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EAFNOSUPPORT, MSG_ERRNO_EADDRINUSE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EADDRNOTAVAIL, MSG_ERRNO_ENETDOWN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENETUNREACH, MSG_ERRNO_ENETRESET,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ECONNABORTED, MSG_ERRNO_ECONNRESET,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOBUFS, MSG_ERRNO_EISCONN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ENOTCONN
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_errarr_120_134 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(120, errarr_120_134) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg errarr_143_151[9] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ESHUTDOWN, MSG_ERRNO_ETOOMANYREFS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ETIMEDOUT, MSG_ERRNO_ECONNREFUSED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EHOSTDOWN, MSG_ERRNO_EHOSTUNREACH,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_EALREADY, MSG_ERRNO_EINPROGRESS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ERRNO_ESTALE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_errarr_143_151 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(143, errarr_143_151) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_errarr_1_74),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_errarr_77_99), CONV_DS_ADDR(ds_errarr_120_134),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_errarr_143_151), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, errno_val, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_pr_dmodel(Word dmodel, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg models[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_MODEL_UNKNOWN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_MODEL_ILP32,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_MODEL_LP64
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_models = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(PR_MODEL_UNKNOWN, models) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_models), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, dmodel, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_pr_why(short why, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg why_arr[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_REQUESTED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_SIGNALLED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_SYSENTRY,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_SYSEXIT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_JOBCONTROL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_FAULTED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_SUSPENDED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_WHY_CHECKPOINT
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_why_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, why_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_why_arr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, why, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_pr_what(short why, short what, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The meaning of pr_what depends on the corresponding
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * value of pr_why, as discussed in the proc(4) manpage.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (why) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PR_SIGNALLED:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PR_JOBCONTROL:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_cnote_signal(what, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PR_SYSENTRY:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PR_SYSEXIT:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_cnote_syscall(what, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PR_FAULTED:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_cnote_fault(what, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_invalid_val(inv_buf, what, fmt_flags));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Return the name of the general purpose register indexed by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * regno in the pr_reg array of lwpstatus_t (<sys/procfs.h>).
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_pr_regname(Half mach, int regno, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg sparc_gen_reg[32] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_G0, MSG_REG_SPARC_G1,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_G2, MSG_REG_SPARC_G3,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_G4, MSG_REG_SPARC_G5,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_G6, MSG_REG_SPARC_G7,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_O0, MSG_REG_SPARC_O1,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_O2, MSG_REG_SPARC_O3,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_O4, MSG_REG_SPARC_O5,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_O6, MSG_REG_SPARC_O7,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_L0, MSG_REG_SPARC_L1,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_L2, MSG_REG_SPARC_L3,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_L4, MSG_REG_SPARC_L5,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_L6, MSG_REG_SPARC_L7,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_I0, MSG_REG_SPARC_I1,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_I2, MSG_REG_SPARC_I3,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_I4, MSG_REG_SPARC_I5,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_I6, MSG_REG_SPARC_I7
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_sparc_gen_reg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(0, sparc_gen_reg) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg sparc_32_37_reg[6] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_PSR, MSG_REG_SPARC_PC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_nPC, MSG_REG_SPARC_Y,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_WIM, MSG_REG_SPARC_TBR
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_sparc_32_37_reg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(32, sparc_32_37_reg) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg sparcv9_32_37_reg[6] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_CCR, MSG_REG_SPARC_PC,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_nPC, MSG_REG_SPARC_Y,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_SPARC_ASI, MSG_REG_SPARC_FPRS
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_sparcv9_32_37_reg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(32, sparcv9_32_37_reg) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg amd64_reg[28] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_R15, MSG_REG_AMD64_R14,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_R13, MSG_REG_AMD64_R12,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_R11, MSG_REG_AMD64_R10,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_R9, MSG_REG_AMD64_R8,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_RDI, MSG_REG_AMD64_RSI,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_RBP, MSG_REG_AMD64_RBX,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_RDX, MSG_REG_AMD64_RCX,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_RAX, MSG_REG_AMD64_TRAPNO,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_ERR, MSG_REG_AMD64_RIP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_CS, MSG_REG_AMD64_RFL,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_RSP, MSG_REG_AMD64_SS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_FS, MSG_REG_AMD64_GS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_ES, MSG_REG_AMD64_DS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_AMD64_FSBASE, MSG_REG_AMD64_GSBASE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_amd64_reg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(0, amd64_reg) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg i86_reg[19] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_REG_I86_GS, MSG_REG_I86_FS,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_REG_I86_ES, MSG_REG_I86_DS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_EDI, MSG_REG_I86_ESI,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_EBP, MSG_REG_I86_ESP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_EBX, MSG_REG_I86_EDX,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_ECX, MSG_REG_I86_EAX,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_TRAPNO, MSG_REG_I86_ERR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_EIP, MSG_REG_I86_CS,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_EFL, MSG_REG_I86_UESP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_REG_I86_SS
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_i86_reg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(0, i86_reg) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_sparc[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_sparc_gen_reg),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_sparc_32_37_reg),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_sparcv9[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_sparc_gen_reg),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_sparcv9_32_37_reg),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_amd64[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_amd64_reg), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_i86[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_i86_reg), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami const conv_ds_t **ds;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (mach) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_386:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds = ds_i86;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_AMD64:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds = ds_amd64;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_SPARC:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_SPARC32PLUS:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds = ds_sparc;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_SPARCV9:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds = ds_sparcv9;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami default:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_invalid_val(inv_buf, regno, fmt_flags));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, mach, regno, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_pr_stype(Word stype, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg types[] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SOBJ_NONE, MSG_SOBJ_MUTEX,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SOBJ_RWLOCK, MSG_SOBJ_CV,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SOBJ_SEMA, MSG_SOBJ_USER,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SOBJ_USER_PI, MSG_SOBJ_SHUTTLE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_types = { CONV_DS_MSG_INIT(0, types) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_types), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, stype, ds, fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_priv(int priv, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab const char *fmt;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The PRIV_ constants defined in <sys/priv.h> are unusual
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * in that they are negative values. The libconv code is all
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * built around the Word type, which is unsigned. Rather than
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * modify libconv for this one case, we simply handle
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * these constants differently that the usual approach,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * and stay away from conv_invalid_val() and conv_map_ds().
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (priv) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PRIV_ALL:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PRIV_ALL));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PRIV_MULTIPLE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PRIV_MULTIPLE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PRIV_NONE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PRIV_NONE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PRIV_ALLZONE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PRIV_ALLZONE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PRIV_GLOBAL:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PRIV_GLOBAL));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab fmt = (fmt_flags & CONV_FMT_DECIMAL) ?
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ORIG(MSG_FMT_INT) : MSG_ORIG(MSG_FMT_HEXINT);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, priv);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (inv_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_psetid(int id, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab const char *fmt;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The PS_ constants defined in <sys/pset.h> are unusual
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * in that they are negative values. The libconv code is all
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * built around the Word type, which is unsigned. Rather than
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * modify libconv for this one case, we simply handle
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * these constants differently that the usual approach,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * and stay away from conv_invalid_val() and conv_map_ds().
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (id) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PS_NONE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PS_NONE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PS_QUERY:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PS_QUERY));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PS_MYID:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PS_MYID));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PS_SOFT:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PS_SOFT));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PS_HARD:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PS_HARD));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case PS_QUERY_TYPE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_PS_QUERY_TYPE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab fmt = (fmt_flags & CONV_FMT_DECIMAL) ?
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ORIG(MSG_FMT_INT) : MSG_ORIG(MSG_FMT_HEXINT);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, id);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (inv_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Return a string describing the si_code field of
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * the siginfo_t struct.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The meaning of si_code is dependent on both the target
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * machine (mach) as well as the signal (sig).
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_si_code(Half mach, int sig, int si_code,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_fmt_flags_t fmt_flags, Conv_inv_buf_t *inv_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* Values of si_code for user generated signals */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg user_arr[6] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_USER, MSG_SI_LWP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_QUEUE, MSG_SI_TIMER,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_ASYNCIO, MSG_SI_MESGQ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_user_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(0, user_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_user_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_user_arr), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Architecture dependent system generated signals. All
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * versions of Solaris use the same set of these values.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg trap_arr[6] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_TRAP_BRKPT, MSG_SI_TRAP_TRACE,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_TRAP_RWATCH, MSG_SI_TRAP_WWATCH,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_TRAP_XWATCH, MSG_SI_TRAP_DTRACE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_trap_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, trap_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_trap_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_trap_arr), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg cld_arr[6] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_CLD_EXITED, MSG_SI_CLD_KILLED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_CLD_DUMPED, MSG_SI_CLD_TRAPPED,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_CLD_STOPPED, MSG_SI_CLD_CONTINUED
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_cld_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, cld_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_cld_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_cld_arr), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg poll_arr[6] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_POLL_IN, MSG_SI_POLL_OUT,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_POLL_MSG, MSG_SI_POLL_ERR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_POLL_PRI, MSG_SI_POLL_HUP
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_poll_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, poll_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_poll_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_poll_arr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Architecture dependent system generated signals.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * These items (ILL, EMT, FPE, SEGV, BUS) are platform
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * dependent. Some architectures have extra codes.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The same name may have a different integer value.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Multiple arrays are used when they differ, and one
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * array when all the architectures agree.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* ILL */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg ill_arr[8] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_ILL_ILLOPC, MSG_SI_ILL_ILLOPN,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_ILL_ILLADR, MSG_SI_ILL_ILLTRP,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_ILL_PRVOPC, MSG_SI_ILL_PRVREG,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_ILL_COPROC, MSG_SI_ILL_BADSTK
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_ill_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, ill_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_ill_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_ill_arr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* EMT */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg emt_arr_sparc[2] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_EMT_TAGOVF, MSG_SI_EMT_CPCOVF
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_emt_arr_sparc = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, emt_arr_sparc) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_emt_arr_sparc[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_emt_arr_sparc), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg emt_arr_x86[1] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_EMT_CPCOVF
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_emt_arr_x86 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, emt_arr_x86) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_emt_arr_x86[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_emt_arr_x86), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* FPE */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg fpe_arr_sparc[8] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_INTDIV, MSG_SI_FPE_INTOVF,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTDIV, MSG_SI_FPE_FLTOVF,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTUND, MSG_SI_FPE_FLTRES,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTINV, MSG_SI_FPE_FLTSUB
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_fpe_arr_sparc = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, fpe_arr_sparc) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_fpe_arr_sparc[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_fpe_arr_sparc), NULL };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg fpe_arr_x86[9] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_INTDIV, MSG_SI_FPE_INTOVF,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTDIV, MSG_SI_FPE_FLTOVF,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTUND, MSG_SI_FPE_FLTRES,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTINV, MSG_SI_FPE_FLTSUB,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_FPE_FLTDEN
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_fpe_arr_x86 = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, fpe_arr_x86) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_fpe_arr_x86[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_fpe_arr_x86), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* SEGV */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg segv_arr[2] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_SEGV_MAPERR, MSG_SI_SEGV_ACCERR
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_segv_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, segv_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_segv_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_segv_arr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* BUS */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static const Msg bus_arr[3] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_BUS_ADRALN, MSG_SI_BUS_ADRERR,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SI_BUS_OBJERR
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_msg_t ds_msg_bus_arr = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(1, bus_arr) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_ds_t *ds_bus_arr[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_ADDR(ds_msg_bus_arr), NULL };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab enum { ARCH_NONE, ARCH_X86, ARCH_SPARC } arch;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* Handle the si_code values that do not depend on the signal */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (si_code) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SI_NOINFO:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_SI_NOINFO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SI_DTRACE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_SI_DTRACE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SI_RCTL:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_SI_RCTL));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab default:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* User generated signal codes are <= 0 */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (si_code <= 0) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab int ndx = -si_code;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * If no signal was delivered, and si_code is
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * 0, return "0" rather than "SI_USER".
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if ((si_code == 0) && (sig == 0))
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami if (ndx >= ARRAY_NELTS(user_arr)) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab const char *fmt;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab fmt = (fmt_flags & CONV_FMT_DECIMAL) ?
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ORIG(MSG_FMT_INT) :
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ORIG(MSG_FMT_HEXINT);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (void) snprintf(inv_buf->buf,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab sizeof (inv_buf->buf), fmt, si_code);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (inv_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, ndx,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_user_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * If we didn't return above, then this is a
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * system generated signal, and the meaning of si_code
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * depends on the signal that was delivered, and possibly
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * on the target architecture.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (mach) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_386:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_AMD64:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab arch = ARCH_X86;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_SPARC:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_SPARC32PLUS:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case EM_SPARCV9:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab arch = ARCH_X86;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab default:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab arch = ARCH_NONE;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (sig) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGTRAP:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_trap_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGCLD:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_cld_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGPOLL:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_poll_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGILL:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_ill_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGEMT:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (arch) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case ARCH_SPARC:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_emt_arr_sparc, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case ARCH_X86:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_emt_arr_x86, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGFPE:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab switch (arch) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case ARCH_SPARC:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_fpe_arr_sparc, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case ARCH_X86:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_fpe_arr_x86, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGSEGV:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_segv_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab case SIGBUS:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami ds_bus_arr, fmt_flags, inv_buf));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* If not recognized, format as a number */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_invalid_val(inv_buf, si_code, fmt_flags));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define AUXAFFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AF_SUN_SETUGID_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AF_SUN_HWCAPVERIFY_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_AUXV_AF_SUN_NOPLM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_auxv_af_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * AUXAFFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_auxv_af(). However, Conv_cnote_auxv_af_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_AUXV_AF_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of AUXAFFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_AUXV_AF_BUFSIZE != AUXAFFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE AUXAFFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_AUXV_AF_BUFSIZE does not match AUXAFFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_auxv_af(Word flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_auxv_af_buf_t *cnote_auxv_af_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { AF_SUN_SETUGID, MSG_AUXV_AF_SUN_SETUGID },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { AF_SUN_HWCAPVERIFY, MSG_AUXV_AF_SUN_HWCAPVERIFY },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { AF_SUN_NOPLM, MSG_AUXV_AF_SUN_NOPLM },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_auxv_af_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_auxv_af_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_auxv_af_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define CCFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_STACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_HEAP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_SHFILE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_SHANON_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_TEXT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_DATA_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_RODATA_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_ANON_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_SHM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_ISM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_DISM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_CTF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_CC_CONTENT_SYMTAB_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_cc_content_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * CCFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_cc_content(). However, Conv_cnote_cc_content_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_CC_CONTENT_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of CCFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_CC_CONTENT_BUFSIZE != CCFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE CCFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_CC_CONTENT_BUFSIZE does not match CCFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_cc_content(Lword flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_cc_content_buf_t *cnote_cc_content_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Note: core_content_t is a 64-bit integer value, but our
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_expn_field() logic is all built around 32-bit
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Word values. This will probably need changing someday,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * but for now, we make do with the 32-bit engine. This works
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * because the number of bits actually assigned in
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * the core_content_t data type (<sys/corectl.h>) bits within
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * 32-bits.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * The downside is that any bits set in the upper half of
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * the flags will be ignored. At the time of this writing,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that can only occur via core file corruption, which presumably
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * would be evident in other ways.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_STACK, MSG_CC_CONTENT_STACK },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_HEAP, MSG_CC_CONTENT_HEAP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_SHFILE, MSG_CC_CONTENT_SHFILE },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_SHANON, MSG_CC_CONTENT_SHANON },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_TEXT, MSG_CC_CONTENT_TEXT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_DATA, MSG_CC_CONTENT_DATA },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_RODATA, MSG_CC_CONTENT_RODATA },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_ANON, MSG_CC_CONTENT_ANON },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_SHM, MSG_CC_CONTENT_SHM },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_ISM, MSG_CC_CONTENT_ISM },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_DISM, MSG_CC_CONTENT_DISM },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_CTF, MSG_CC_CONTENT_CTF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { (Word) CC_CONTENT_SYMTAB, MSG_CC_CONTENT_SYMTAB },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_cc_content_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_cc_content_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_cc_content_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define PRFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_STOPPED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ISTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_DSTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_STEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ASLEEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_PCINVAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ASLWP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_AGENT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_DETACH_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_DAEMON_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_IDLE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ISSYS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_VFORKP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ORPHAN_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_NOSIGCHLD_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_WAITPID_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_FORK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_RLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_KLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ASYNC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_MSACCT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_BPTADJ_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_PTRACE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_MSFORK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_pr_flags_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * PRFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_pr_flags(). However, Conv_cnote_pr_flags_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_PR_FLAGS_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of PRFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_PR_FLAGS_BUFSIZE != PRFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE PRFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_PR_FLAGS_BUFSIZE does not match PRFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_pr_flags(int flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_pr_flags_buf_t *cnote_pr_flags_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_STOPPED, MSG_PR_FLAGS_STOPPED },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_ISTOP, MSG_PR_FLAGS_ISTOP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_DSTOP, MSG_PR_FLAGS_DSTOP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_STEP, MSG_PR_FLAGS_STEP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_ASLEEP, MSG_PR_FLAGS_ASLEEP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_PCINVAL, MSG_PR_FLAGS_PCINVAL },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_ASLWP, MSG_PR_FLAGS_ASLWP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_AGENT, MSG_PR_FLAGS_AGENT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_DETACH, MSG_PR_FLAGS_DETACH },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_DAEMON, MSG_PR_FLAGS_DAEMON },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_IDLE, MSG_PR_FLAGS_IDLE },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_ISSYS, MSG_PR_FLAGS_ISSYS },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_VFORKP, MSG_PR_FLAGS_VFORKP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_ORPHAN, MSG_PR_FLAGS_ORPHAN },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_NOSIGCHLD, MSG_PR_FLAGS_NOSIGCHLD },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_WAITPID, MSG_PR_FLAGS_WAITPID },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_FORK, MSG_PR_FLAGS_FORK },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_RLC, MSG_PR_FLAGS_RLC },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_KLC, MSG_PR_FLAGS_KLC },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_ASYNC, MSG_PR_FLAGS_ASYNC },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_MSACCT, MSG_PR_FLAGS_MSACCT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_BPTADJ, MSG_PR_FLAGS_BPTADJ },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_PTRACE, MSG_PR_FLAGS_PTRACE },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { PR_MSFORK, MSG_PR_FLAGS_MSFORK },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_pr_flags_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_pr_flags_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_pr_flags_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define OLDPRFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_STOPPED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ISTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_DSTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ASLEEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_FORK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_RLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_PTRACE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_PCINVAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ISSYS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_STEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_KLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ASYNC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_PCOMPAT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_MSACCT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_BPTADJ_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PR_FLAGS_ASLWP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_old_pr_flags_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * OLDPRFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_old_pr_flags(). However, Conv_cnote_old_pr_flags_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of OLDPRFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE != OLDPRFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE OLDPRFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE does not match OLDPRFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_old_pr_flags(int flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_old_pr_flags_buf_t *cnote_old_pr_flags_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * <sys/old_procfs.h> defines names for many of these flags
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that are also defined in <sys/procfs.h>, but with different
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * values. To avoid confusion, we don't include <sys/old_procfs.h>,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * and specify the values directly.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0001, MSG_PR_FLAGS_STOPPED },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0002, MSG_PR_FLAGS_ISTOP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0004, MSG_PR_FLAGS_DSTOP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0008, MSG_PR_FLAGS_ASLEEP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0010, MSG_PR_FLAGS_FORK },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0020, MSG_PR_FLAGS_RLC },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0040, MSG_PR_FLAGS_PTRACE },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0080, MSG_PR_FLAGS_PCINVAL },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0100, MSG_PR_FLAGS_ISSYS },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0200, MSG_PR_FLAGS_STEP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0400, MSG_PR_FLAGS_KLC },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0800, MSG_PR_FLAGS_ASYNC },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x1000, MSG_PR_FLAGS_PCOMPAT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x2000, MSG_PR_FLAGS_MSACCT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x4000, MSG_PR_FLAGS_BPTADJ },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x8000, MSG_PR_FLAGS_ASLWP },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_old_pr_flags_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_old_pr_flags_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_old_pr_flags_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define PROCFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PROC_FLAG_SSYS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_PROC_FLAG_SMSACCT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_proc_flag_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * PROCFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_proc_flag(). However, Conv_cnote_proc_flag_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_PROC_FLAG_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of PROCFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_PROC_FLAG_BUFSIZE != PROCFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE PROCFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_PROC_FLAG_BUFSIZE does not match PROCFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_proc_flag(int flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_proc_flag_buf_t *cnote_proc_flag_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Most of the proc flags are implementation dependant, and can
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * change between releases. As such, we do not attempt to translate
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * them to symbolic form, but simply report them in hex form.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * However, SMSACCT and SSYS are special, and their bit values
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * are maintained between releases so they can be used in the
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * psinfo_t.p_flag field. We therefore translate these items.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * See <system/proc.h>
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Note: We don't want to include <sys/proc.h> in this file, because
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * it redefines 'struct list', which we have defined in sgs.h. As
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * SMSACCT and SSYS are stable public values, we simply use
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * their numeric value.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_PROC_FLAG_SSYS },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_PROC_FLAG_SMSACCT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_proc_flag_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_proc_flag_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_proc_flag_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define SAFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_ONSTACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_RESETHAND_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_RESTART_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_SIGINFO_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_NODEFER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_NOCLDWAIT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SA_NOCLDSTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_sa_flags_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * SAFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_sa_flags(). However, Conv_cnote_sa_flags_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_SA_FLAGS_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of SAFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_SA_FLAGS_BUFSIZE != SAFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE SAFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_SA_FLAGS_BUFSIZE does not match SAFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_sa_flags(int flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_sa_flags_buf_t *cnote_sa_flags_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_ONSTACK, MSG_SA_ONSTACK },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_RESETHAND, MSG_SA_RESETHAND },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_RESTART, MSG_SA_RESTART },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_SIGINFO, MSG_SA_SIGINFO },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_NODEFER, MSG_SA_NODEFER },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_NOCLDWAIT, MSG_SA_NOCLDWAIT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SA_NOCLDSTOP, MSG_SA_NOCLDSTOP },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_sa_flags_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_sa_flags_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_sa_flags_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define SSFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SS_ONSTACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SS_DISABLE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_ss_flags_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * SSFLGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_ss_flags(). However, Conv_cnote_ss_flags_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_SS_FLAGS_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of SSFLGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_SS_FLAGS_BUFSIZE != SSFLGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE SSFLGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_SS_FLAGS_BUFSIZE does not match SSFLGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_ss_flags(int flags, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_cnote_ss_flags_buf_t *cnote_ss_flags_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SS_ONSTACK, MSG_SS_ONSTACK },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SS_DISABLE, MSG_SS_DISABLE },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab static CONV_EXPN_FIELD_ARG conv_arg = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami NULL, sizeof (cnote_ss_flags_buf->buf) };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (flags == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = cnote_ss_flags_buf->buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = flags;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) conv_expn_field(&conv_arg, vda, fmt_flags);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *)cnote_ss_flags_buf->buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Solaris has a variety of types that use bitmasks to represent
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * sets of things like signals (sigset_t), faults (fltset_t), and
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * system calls (sysset_t). These types use arrays of unsigned 32-bit
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * integers to represent the set. These are public types that
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * cannot be changed, so they are generously oversized to allow
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * for future growth. Hence, there are usually unused bits.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_bitmaskset() generalizes the process of displaying these items.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abtypedef struct {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami const Val_desc *vdp; /* NULL, or bitmask description */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab uint32_t unused_bits; /* Mask of undefined bits */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab} conv_bitmaskset_desc_t;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * entry:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * n_mask - # of 32-bit masks that make up this bitmask type.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * maskarr - Array of n_mask 32-bit mask values
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * bitmask_descarr - Array of n_mask bitmask_desc_t descriptors,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * one for each mask, specifying the bitmask names, and
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * a mask of the bits that are not defined by the system.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * fmt_flags - CONV_FMT_* values, used to specify formatting details.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_buf - Buffer to receive formatted results
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_buf_size - Size of conv_buf, including room for NULL termination
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abstatic const char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_bitmaskset(uint32_t *maskarr, int n_mask,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami const conv_bitmaskset_desc_t *bitmask_descarr, Conv_fmt_flags_t fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab char *conv_buf, size_t conv_buf_size)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_EXPN_FIELD_ARG conv_arg;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab int i, need_sep = 0;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* If every bit of every mask is 0, return 0 as the result */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab for (i = 0; i < n_mask; i++)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (maskarr[i] != 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab break;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (i == n_mask)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (MSG_ORIG(MSG_GBL_ZERO));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * At least one bit is non-zero. Move through the masks
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * and process each one.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (void) memset(&conv_arg, 0, sizeof (conv_arg));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.bufsize = conv_buf_size;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf = conv_buf;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if ((fmt_flags & CONV_FMT_NOBKT) == 0) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf++ = '[';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf++ = ' ';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.bufsize -= 2;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_expn_field() orders its output with the most significant
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * bits on the left. To preserve this ordering across the
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * subwords or our "virtual bitmask", we need to process
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * the sub-words in the same order, from most significant down
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * to least significant. Since unassigned bits tend to be at
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * the MSB end of the word, we process the unused bits first.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * One implication of this is that the caller should not use
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * the unassigned bits for "abandoned" bits in the middle of
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * a used range, but should instead define the string for
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that bit as being the string representation of that decimal
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * value (i.e. "65"). That will cause the bit to be properly
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * sorted among the named bits to either side of it.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab for (i = 0; i < n_mask; i++) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab size_t n;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab uint32_t mask, unused_bits;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab const int bits_per_mask = sizeof (mask) * 8;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab mask = maskarr[i];
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab unused_bits = mask & bitmask_descarr[i].unused_bits;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab mask &= ~unused_bits;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (mask != 0) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.oflags = conv_arg.rflags = mask;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (need_sep) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf++ = ' ';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.bufsize--;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab need_sep = 1;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (void) conv_expn_field(&conv_arg,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami bitmask_descarr[i].vdp, fmt_flags | CONV_FMT_NOBKT);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab n = strlen(conv_arg.buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.bufsize -= n;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf += n;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (unused_bits != 0) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab uint32_t bit = 0x00000001;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab int j;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab for (j = 1; j <= bits_per_mask; j++, bit *= 2) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if ((unused_bits & bit) == 0)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab continue;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (need_sep) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf++ = ' ';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.bufsize--;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab need_sep = 1;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab n = snprintf(conv_arg.buf, conv_arg.bufsize,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_ORIG(MSG_FMT_WORD),
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab EC_WORD(j + (bits_per_mask * i)));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.buf += n;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab conv_arg.bufsize -= n;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if ((fmt_flags & CONV_FMT_NOBKT) == 0) {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf++ = ' ';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf++ = ']';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *conv_arg.buf = '\0';
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return ((const char *) conv_buf);
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define SIGSET_FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sigset_t [0] - Signals [1 - 32] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGHUP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGINT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGQUIT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGILL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTRAP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGABRT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGEMT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGFPE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGKILL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGBUS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGSEGV_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGSYS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPIPE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGALRM_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTERM_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGUSR1_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGUSR2_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGCHLD_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPWR_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGWINCH_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGURG_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPOLL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGSTOP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTSTP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGCONT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTTIN_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTTOU_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGVTALRM_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGPROF_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGXCPU_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGXFSZ_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGWAITING_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * sigset_t [1] - Signals [33 - 64] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 24 unused bits, each of which needs two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters plus a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGLWP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGFREEZE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGTHAW_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGCANCEL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGLOST_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGXRES_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGJVM1_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SIGJVM2_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (24 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * sigset_t [2] - Signals [65 - 96] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 32 unused bits, each of which needs two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters plus a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * sigset_t [2] - Signals [97 - 128] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 32 unused bits. Three of these need two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters, and 29 need 3. Each one needs a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (3 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (29 * (3 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_sigset_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * SIGSET_FLAGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_sigset(). However, Conv_cnote_sigset_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_SIGSET_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of SIGSET_FLAGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_SIGSET_BUFSIZE != SIGSET_FLAGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE SIGSET_FLAGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_SIGSET_BUFSIZE does not match SIGSET_FLAGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_sigset(uint32_t *maskarr, int n_mask,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_fmt_flags_t fmt_flags, Conv_cnote_sigset_buf_t *cnote_sigset_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define N_MASK 4
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda0[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SIGHUP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SIGINT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SIGQUIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SIGILL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SIGTRAP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SIGABRT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SIGEMT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SIGFPE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SIGKILL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SIGBUS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SIGSEGV_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SIGSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SIGPIPE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SIGALRM_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SIGTERM_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SIGUSR1_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SIGUSR2_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SIGCHLD_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SIGPWR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SIGWINCH_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SIGURG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SIGPOLL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SIGSTOP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SIGTSTP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SIGCONT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SIGTTIN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SIGTTOU_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SIGVTALRM_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SIGPROF_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SIGXCPU_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SIGXFSZ_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x80000000, MSG_SIGWAITING_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda1[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SIGLWP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SIGFREEZE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SIGTHAW_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SIGCANCEL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SIGLOST_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SIGXRES_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SIGJVM1_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SIGJVM2_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda0, 0 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda1, 0xffffff00 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (n_mask > N_MASK)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab n_mask = N_MASK;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab cnote_sigset_buf->buf, CONV_CNOTE_SIGSET_BUFSIZE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#undef N_MASK
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define FLTSET_FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * fltset_t[0] - Faults [1 - 32] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 19 unused bits, each of which needs two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters plus a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTILL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTPRIV_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTBPT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTTRACE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTACCESS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTBOUNDS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTIOVF_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTIZDIV_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTFPE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTSTACK_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTPAGE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTWATCH_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_FLTCPCOVF_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (19 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * fltset_t [1] - Faults [33 - 64] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 32 unused bits, each of which needs two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters plus a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * fltset_t [2] - Faults [65 - 96] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 32 unused bits, each of which needs two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters plus a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * fltset_t [3] - Faults [97 - 128] \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * There are 32 unused bits. Three of these need two \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * characters, and 29 need 3. Each one needs a separator. \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (3 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (29 * (3 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_fltset_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * FLTSET_FLAGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_fltset(). However, Conv_cnote_fltset_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_FLTSET_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of FLTSET_FLAGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_FLTSET_BUFSIZE != FLTSET_FLAGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE FLTSET_FLAGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_FLTSET_BUFSIZE does not match FLTSET_FLAGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_fltset(uint32_t *maskarr, int n_mask,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_fmt_flags_t fmt_flags, Conv_cnote_fltset_buf_t *cnote_fltset_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define N_MASK 4
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda0[] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_FLTILL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_FLTPRIV_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_FLTBPT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_FLTTRACE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_FLTACCESS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_FLTBOUNDS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_FLTIOVF_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_FLTIZDIV_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_FLTFPE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_FLTSTACK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_FLTPAGE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_FLTWATCH_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_FLTCPCOVF_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda0, 0xffffe000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (n_mask > N_MASK)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab n_mask = N_MASK;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab cnote_fltset_buf->buf, CONV_CNOTE_FLTSET_BUFSIZE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#undef N_MASK
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define SYSSET_FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (512 * CONV_EXPN_FIELD_DEF_SEP_SIZE) + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[0] - System Calls [1 - 32] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_EXIT_ALT_SIZE /* 1 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_2_SIZE /* 2 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_READ_ALT_SIZE /* 3 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_WRITE_ALT_SIZE /* 4 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_OPEN_ALT_SIZE /* 5 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLOSE_ALT_SIZE /* 6 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_7_SIZE /* 7 (unused) */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_8_SIZE /* 8 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LINK_ALT_SIZE /* 9 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UNLINK_ALT_SIZE /* 10 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_11_SIZE /* 11 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CHDIR_ALT_SIZE /* 12 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIME_ALT_SIZE /* 13 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MKNOD_ALT_SIZE /* 14 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CHMOD_ALT_SIZE /* 15 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CHOWN_ALT_SIZE /* 16 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_BRK_ALT_SIZE /* 17 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STAT_ALT_SIZE /* 18 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LSEEK_ALT_SIZE /* 19 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETPID_ALT_SIZE /* 20 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MOUNT_ALT_SIZE /* 21 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_22_SIZE /* 22 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETUID_ALT_SIZE /* 23 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETUID_ALT_SIZE /* 24 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STIME_ALT_SIZE /* 25 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PCSAMPLE_ALT_SIZE /* 26 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ALARM_ALT_SIZE /* 27 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTAT_ALT_SIZE /* 28 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PAUSE_ALT_SIZE /* 29 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_30_SIZE /* 30 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STTY_ALT_SIZE /* 31 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GTTY_ALT_SIZE /* 32 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[1] - System Calls [33 - 64] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCESS_ALT_SIZE /* 33 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NICE_ALT_SIZE /* 34 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STATFS_ALT_SIZE /* 35 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYNC_ALT_SIZE /* 36 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_KILL_ALT_SIZE /* 37 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTATFS_ALT_SIZE /* 38 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PGRPSYS_ALT_SIZE /* 39 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UUCOPYSTR_ALT_SIZE /* 40 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_41_SIZE /* 41 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PIPE_ALT_SIZE /* 42 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMES_ALT_SIZE /* 43 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PROFIL_ALT_SIZE /* 44 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FACCESSAT_ALT_SIZE /* 45 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETGID_ALT_SIZE /* 46 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETGID_ALT_SIZE /* 47 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_48_SIZE /* 48 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MSGSYS_ALT_SIZE /* 49 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYSI86_ALT_SIZE /* 50 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCT_ALT_SIZE /* 51 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SHMSYS_ALT_SIZE /* 52 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SEMSYS_ALT_SIZE /* 53 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_IOCTL_ALT_SIZE /* 54 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UADMIN_ALT_SIZE /* 55 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FCHOWNAT_ALT_SIZE /* 56 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UTSSYS_ALT_SIZE /* 57 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FDSYNC_ALT_SIZE /* 58 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_EXECVE_ALT_SIZE /* 59 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UMASK_ALT_SIZE /* 60 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CHROOT_ALT_SIZE /* 61 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FCNTL_ALT_SIZE /* 62 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ULIMIT_ALT_SIZE /* 63 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_RENAMEAT_ALT_SIZE /* 64 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[2] - System Calls [65 - 96] */ \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_UNLINKAT_ALT_SIZE /* 65 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FSTATAT_ALT_SIZE /* 66 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_FSTATAT64_ALT_SIZE /* 67 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_OPENAT_ALT_SIZE /* 68 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_OPENAT64_ALT_SIZE /* 69 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TASKSYS_ALT_SIZE /* 70 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCTCTL_ALT_SIZE /* 71 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_EXACCTSYS_ALT_SIZE /* 72 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETPAGESIZES_ALT_SIZE /* 73 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RCTLSYS_ALT_SIZE /* 74 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIDSYS_ALT_SIZE /* 75 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_76_SIZE /* 76 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_PARK_ALT_SIZE /* 77 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SENDFILEV_ALT_SIZE /* 78 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RMDIR_ALT_SIZE /* 79 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MKDIR_ALT_SIZE /* 80 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETDENTS_ALT_SIZE /* 81 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PRIVSYS_ALT_SIZE /* 82 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UCREDSYS_ALT_SIZE /* 83 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYSFS_ALT_SIZE /* 84 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETMSG_ALT_SIZE /* 85 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PUTMSG_ALT_SIZE /* 86 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_87_SIZE /* 87 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LSTAT_ALT_SIZE /* 88 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYMLINK_ALT_SIZE /* 89 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_READLINK_ALT_SIZE /* 90 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETGROUPS_ALT_SIZE /* 91 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETGROUPS_ALT_SIZE /* 92 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FCHMOD_ALT_SIZE /* 93 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FCHOWN_ALT_SIZE /* 94 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGPROCMASK_ALT_SIZE /* 95 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGSUSPEND_ALT_SIZE /* 96 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[3] - System Calls [97 - 128] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGALTSTACK_ALT_SIZE /* 97 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGACTION_ALT_SIZE /* 98 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGPENDING_ALT_SIZE /* 99 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CONTEXT_ALT_SIZE /* 100 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_101_SIZE /* 101 (unused) */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_102_SIZE /* 102 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STATVFS_ALT_SIZE /* 103 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTATVFS_ALT_SIZE /* 104 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETLOADAVG_ALT_SIZE /* 105 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NFSSYS_ALT_SIZE /* 106 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_WAITID_ALT_SIZE /* 107 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGSENDSYS_ALT_SIZE /* 108 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_HRTSYS_ALT_SIZE /* 109 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_UTIMESYS_ALT_SIZE /* 110 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGRESEND_ALT_SIZE /* 111 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PRIOCNTLSYS_ALT_SIZE /* 112 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PATHCONF_ALT_SIZE /* 113 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MINCORE_ALT_SIZE /* 114 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MMAP_ALT_SIZE /* 115 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MPROTECT_ALT_SIZE /* 116 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MUNMAP_ALT_SIZE /* 117 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FPATHCONF_ALT_SIZE /* 118 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_VFORK_ALT_SIZE /* 119 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FCHDIR_ALT_SIZE /* 120 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_READV_ALT_SIZE /* 121 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_WRITEV_ALT_SIZE /* 122 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_123_SIZE /* 123 (unused) */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_124_SIZE /* 124 (unused) */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_125_SIZE /* 125 (unused) */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_126_SIZE /* 126 (unused) */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_MMAPOBJ_ALT_SIZE /* 127 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETRLIMIT_ALT_SIZE /* 128 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[4] - System Calls [129 - 160] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETRLIMIT_ALT_SIZE /* 129 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LCHOWN_ALT_SIZE /* 130 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MEMCNTL_ALT_SIZE /* 131 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETPMSG_ALT_SIZE /* 132 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PUTPMSG_ALT_SIZE /* 133 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RENAME_ALT_SIZE /* 134 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UNAME_ALT_SIZE /* 135 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETEGID_ALT_SIZE /* 136 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYSCONFIG_ALT_SIZE /* 137 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ADJTIME_ALT_SIZE /* 138 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SYSTEMINFO_ALT_SIZE /* 139 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SHAREFS_ALT_SIZE /* 140 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETEUID_ALT_SIZE /* 141 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FORKSYS_ALT_SIZE /* 142 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_143_SIZE /* 143 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGTIMEDWAIT_ALT_SIZE /* 144 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_INFO_ALT_SIZE /* 145 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_YIELD_ALT_SIZE /* 146 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_147_SIZE /* 147 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SEMA_POST_ALT_SIZE /* 148 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SEMA_TRYWAIT_ALT_SIZE /* 149 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_DETACH_ALT_SIZE /* 150 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CORECTL_ALT_SIZE /* 151 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MODCTL_ALT_SIZE /* 152 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FCHROOT_ALT_SIZE /* 153 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_154_SIZE /* 154 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_VHANGUP_ALT_SIZE /* 155 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETTIMEOFDAY_ALT_SIZE /* 156 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETITIMER_ALT_SIZE /* 157 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETITIMER_ALT_SIZE /* 158 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_CREATE_ALT_SIZE /* 159 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_EXIT_ALT_SIZE /* 160 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[5] - System Calls [161 - 192] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SUSPEND_ALT_SIZE /* 161 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_CONTINUE_ALT_SIZE /* 162 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_KILL_ALT_SIZE /* 163 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SELF_ALT_SIZE /* 164 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SIGMASK_ALT_SIZE /* 165 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_PRIVATE_ALT_SIZE /* 166 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_WAIT_ALT_SIZE /* 167 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_MUTEX_WAKEUP_ALT_SIZE /* 168 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_169_SIZE /* 169 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_COND_WAIT_ALT_SIZE /* 170 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_COND_SIGNAL_ALT_SIZE /* 171 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_COND_BROADCAST_ALT_SIZE /* 172 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PREAD_ALT_SIZE /* 173 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PWRITE_ALT_SIZE /* 174 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LLSEEK_ALT_SIZE /* 175 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_INST_SYNC_ALT_SIZE /* 176 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_BRAND_ALT_SIZE /* 177 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_KAIO_ALT_SIZE /* 178 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CPC_ALT_SIZE /* 179 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LGRPSYS_ALT_SIZE /* 180 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RUSAGESYS_ALT_SIZE /* 181 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PORT_ALT_SIZE /* 182 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_POLLSYS_ALT_SIZE /* 183 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LABELSYS_ALT_SIZE /* 184 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACL_ALT_SIZE /* 185 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_AUDITSYS_ALT_SIZE /* 186 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PROCESSOR_BIND_ALT_SIZE /* 187 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PROCESSOR_INFO_ALT_SIZE /* 188 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_P_ONLINE_ALT_SIZE /* 189 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGQUEUE_ALT_SIZE /* 190 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLOCK_GETTIME_ALT_SIZE /* 191 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLOCK_SETTIME_ALT_SIZE /* 192 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[6] - System Calls [193 - 224] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLOCK_GETRES_ALT_SIZE /* 193 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_CREATE_ALT_SIZE /* 194 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_DELETE_ALT_SIZE /* 195 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_SETTIME_ALT_SIZE /* 196 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_GETTIME_ALT_SIZE /* 197 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_TIMER_GETOVERRUN_ALT_SIZE /* 198 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NANOSLEEP_ALT_SIZE /* 199 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FACL_ALT_SIZE /* 200 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_DOOR_ALT_SIZE /* 201 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETREUID_ALT_SIZE /* 202 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETREGID_ALT_SIZE /* 203 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_INSTALL_UTRAP_ALT_SIZE /* 204 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SIGNOTIFY_ALT_SIZE /* 205 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SCHEDCTL_ALT_SIZE /* 206 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PSET_ALT_SIZE /* 207 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SPARC_UTRAP_INSTALL_ALT_SIZE /* 208 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RESOLVEPATH_ALT_SIZE /* 209 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_MUTEX_TIMEDLOCK_ALT_SIZE /* 210 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_SEMA_TIMEDWAIT_ALT_SIZE /* 211 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_RWLOCK_SYS_ALT_SIZE /* 212 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETDENTS64_ALT_SIZE /* 213 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_MMAP64_ALT_SIZE /* 214 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STAT64_ALT_SIZE /* 215 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LSTAT64_ALT_SIZE /* 216 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTAT64_ALT_SIZE /* 217 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_STATVFS64_ALT_SIZE /* 218 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_FSTATVFS64_ALT_SIZE /* 219 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETRLIMIT64_ALT_SIZE /* 220 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETRLIMIT64_ALT_SIZE /* 221 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PREAD64_ALT_SIZE /* 222 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_PWRITE64_ALT_SIZE /* 223 */ + \
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner MSG_SYS_224_SIZE /* 224 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[7] - System Calls [225 - 256] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_OPEN64_ALT_SIZE /* 225 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RPCSYS_ALT_SIZE /* 226 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ZONE_ALT_SIZE /* 227 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_AUTOFSSYS_ALT_SIZE /* 228 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETCWD_ALT_SIZE /* 229 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SO_SOCKET_ALT_SIZE /* 230 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SO_SOCKETPAIR_ALT_SIZE /* 231 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_BIND_ALT_SIZE /* 232 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LISTEN_ALT_SIZE /* 233 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_ACCEPT_ALT_SIZE /* 234 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CONNECT_ALT_SIZE /* 235 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SHUTDOWN_ALT_SIZE /* 236 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RECV_ALT_SIZE /* 237 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RECVFROM_ALT_SIZE /* 238 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_RECVMSG_ALT_SIZE /* 239 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SEND_ALT_SIZE /* 240 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SENDMSG_ALT_SIZE /* 241 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SENDTO_ALT_SIZE /* 242 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETPEERNAME_ALT_SIZE /* 243 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETSOCKNAME_ALT_SIZE /* 244 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_GETSOCKOPT_ALT_SIZE /* 245 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SETSOCKOPT_ALT_SIZE /* 246 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_SOCKCONFIG_ALT_SIZE /* 247 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NTP_GETTIME_ALT_SIZE /* 248 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_NTP_ADJTIME_ALT_SIZE /* 249 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_MUTEX_UNLOCK_ALT_SIZE /* 250 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_MUTEX_TRYLOCK_ALT_SIZE /* 251 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_LWP_MUTEX_REGISTER_ALT_SIZE /* 252 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_CLADM_ALT_SIZE /* 253 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UUCOPY_ALT_SIZE /* 254 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab MSG_SYS_UMOUNT2_ALT_SIZE /* 255 */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab 3 /* 256 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[8] - System Calls [257 - 288] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 257 - 288 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[9] - System Calls [289 - 320] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 289 - 320 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[10] - System Calls [321 - 352] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 321 - 352 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[11] - System Calls [353 - 384] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 353 - 384 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[12] - System Calls [385 - 416] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 385 - 416 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[13] - System Calls [417 - 448] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 417 - 448 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[14] - System Calls [449 - 480] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 449 - 480 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* sysset_t[15] - System Calls [481 - 512] */ \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab (32 * 3) /* 481 - 512 (unused) */ + \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab \
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab/*
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * Ensure that Conv_cnote_sysset_buf_t is large enough:
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * SYSSET_FLAGSZ is the real minimum size of the buffer required by
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * conv_cnote_sysset(). However, Conv_cnote_sysset_buf_t
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * uses CONV_CNOTE_SYSSET_BUFSIZE to set the buffer size. We do
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * things this way because the definition of SYSSET_FLAGSZ uses information
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that is not available in the environment of other programs
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab * that include the conv.h header file.
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#if (CONV_CNOTE_SYSSET_BUFSIZE != SYSSET_FLAGSZ) && !defined(__lint)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define REPORT_BUFSIZE SYSSET_FLAGSZ
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#include "report_bufsize.h"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#error "CONV_CNOTE_SYSSET_BUFSIZE does not match SYSSET_FLAGSZ"
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#endif
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconst char *
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87abconv_cnote_sysset(uint32_t *maskarr, int n_mask,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab Conv_fmt_flags_t fmt_flags, Conv_cnote_sysset_buf_t *cnote_sysset_buf)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab{
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#define N_MASK 16
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda0[] = { /* System Calls [1 - 32] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_EXIT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000002, MSG_SYS_2 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_READ_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_WRITE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SYS_OPEN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_CLOSE_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000040, MSG_SYS_7 },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000080, MSG_SYS_8 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SYS_LINK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_UNLINK_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000400, MSG_SYS_11 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_CHDIR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_TIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_MKNOD_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_CHMOD_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_CHOWN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_BRK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_STAT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_LSEEK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_GETPID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_MOUNT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00200000, MSG_SYS_22 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_SETUID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_GETUID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_STIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SYS_PCSAMPLE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_ALARM_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_FSTAT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_PAUSE_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x20000000, MSG_SYS_30 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_STTY_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x80000000, MSG_SYS_GTTY_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda1[] = { /* System Calls [33 - 64] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_ACCESS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SYS_NICE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_STATFS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_SYNC_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SYS_KILL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_FSTATFS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_PGRPSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_UUCOPYSTR_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000100, MSG_SYS_41 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_PIPE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_TIMES_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_PROFIL_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00001000, MSG_SYS_FACCESSAT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_SETGID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_GETGID_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00008000, MSG_SYS_48 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_MSGSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_SYSI86_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_ACCT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_SHMSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_SEMSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_IOCTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_UADMIN_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00800000, MSG_SYS_FCHOWNAT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_UTSSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x0200000, MSG_SYS_FDSYNC_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_EXECVE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_UMASK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_CHROOT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SYS_FCNTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_ULIMIT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x80000000, MSG_SYS_RENAMEAT_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda2[] = { /* System Calls [65 - 96] */
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000001, MSG_SYS_UNLINKAT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000002, MSG_SYS_FSTATAT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000004, MSG_SYS_FSTATAT64_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000008, MSG_SYS_OPENAT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000010, MSG_SYS_OPENAT64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_TASKSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_ACCTCTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_EXACCTSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SYS_GETPAGESIZES_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_RCTLSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_SIDSYS_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000800, MSG_SYS_76 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_LWP_PARK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_SENDFILEV_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_RMDIR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_MKDIR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_GETDENTS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_PRIVSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_UCREDSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_SYSFS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_GETMSG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_PUTMSG_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00400000, MSG_SYS_87 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_LSTAT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_SYMLINK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SYS_READLINK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_SETGROUPS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_GETGROUPS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_FCHMOD_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SYS_FCHOWN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_SIGPROCMASK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x80000000, MSG_SYS_SIGSUSPEND_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda3[] = { /* System Calls [97 - 128] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_SIGALTSTACK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SYS_SIGACTION_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_SIGPENDING_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_CONTEXT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000010, MSG_SYS_101 },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000020, MSG_SYS_102 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_STATVFS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_FSTATVFS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SYS_GETLOADAVG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_NFSSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_WAITID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_SIGSENDSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_HRTSYS_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00002000, MSG_SYS_UTIMESYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_SIGRESEND_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_PRIOCNTLSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_PATHCONF_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_MINCORE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_MMAP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_MPROTECT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_MUNMAP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_FPATHCONF_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_VFORK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_FCHDIR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_READV_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SYS_WRITEV_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x04000000, MSG_SYS_123 },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x08000000, MSG_SYS_124 },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x10000000, MSG_SYS_125 },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x20000000, MSG_SYS_126 },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x40000000, MSG_SYS_MMAPOBJ_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x80000000, MSG_SYS_SETRLIMIT_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda4[] = { /* System Calls [129 - 160] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_GETRLIMIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SYS_LCHOWN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_MEMCNTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_GETPMSG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SYS_PUTPMSG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_RENAME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_UNAME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_SETEGID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SYS_SYSCONFIG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_ADJTIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_SYSTEMINFO_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_SHAREFS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_SETEUID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_FORKSYS_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00004000, MSG_SYS_143 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_SIGTIMEDWAIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_LWP_INFO_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_YIELD_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00040000, MSG_SYS_147 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_LWP_SEMA_POST_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_LWP_SEMA_TRYWAIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_LWP_DETACH_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_CORECTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_MODCTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_FCHROOT_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x02000000, MSG_SYS_154 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_VHANGUP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_GETTIMEOFDAY_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_GETITIMER_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SYS_SETITIMER_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_LWP_CREATE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x80000000, MSG_SYS_LWP_EXIT_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda5[] = { /* System Calls [161 - 192] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_LWP_SUSPEND_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SYS_LWP_CONTINUE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_LWP_KILL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_LWP_SELF_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SYS_LWP_SIGMASK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_LWP_PRIVATE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_LWP_WAIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_LWP_MUTEX_WAKEUP_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x00000100, MSG_SYS_169 },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_LWP_COND_WAIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_LWP_COND_SIGNAL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_LWP_COND_BROADCAST_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_PREAD_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_PWRITE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_LLSEEK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_INST_SYNC_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_BRAND_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_KAIO_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_CPC_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_LGRPSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_RUSAGESYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_PORT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_POLLSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_LABELSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_ACL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SYS_AUDITSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_PROCESSOR_BIND_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_PROCESSOR_INFO_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_P_ONLINE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SYS_SIGQUEUE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_CLOCK_GETTIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x80000000, MSG_SYS_CLOCK_SETTIME_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda6[] = { /* System Calls [193 - 224] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_CLOCK_GETRES_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SYS_TIMER_CREATE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_TIMER_DELETE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_TIMER_SETTIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SYS_TIMER_GETTIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_TIMER_GETOVERRUN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_NANOSLEEP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_FACL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SYS_DOOR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_SETREUID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_SETREGID_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_INSTALL_UTRAP_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_SIGNOTIFY_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_SCHEDCTL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_PSET_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_SPARC_UTRAP_INSTALL_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_RESOLVEPATH_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_LWP_MUTEX_TIMEDLOCK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_LWP_SEMA_TIMEDWAIT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_LWP_RWLOCK_SYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_GETDENTS64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_MMAP64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_STAT64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_LSTAT64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_FSTAT64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SYS_STATVFS64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_FSTATVFS64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_SETRLIMIT64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_GETRLIMIT64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SYS_PREAD64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_PWRITE64_ALT },
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner { 0x80000000, MSG_SYS_224 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const Val_desc vda7[] = { /* System Calls [225 - 256] */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000001, MSG_SYS_OPEN64_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000002, MSG_SYS_RPCSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000004, MSG_SYS_ZONE_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000008, MSG_SYS_AUTOFSSYS_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000010, MSG_SYS_GETCWD_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000020, MSG_SYS_SO_SOCKET_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000040, MSG_SYS_SO_SOCKETPAIR_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000080, MSG_SYS_BIND_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000100, MSG_SYS_LISTEN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000200, MSG_SYS_ACCEPT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000400, MSG_SYS_CONNECT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00000800, MSG_SYS_SHUTDOWN_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00001000, MSG_SYS_RECV_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00002000, MSG_SYS_RECVFROM_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00004000, MSG_SYS_RECVMSG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00008000, MSG_SYS_SEND_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00010000, MSG_SYS_SENDMSG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00020000, MSG_SYS_SENDTO_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00040000, MSG_SYS_GETPEERNAME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00080000, MSG_SYS_GETSOCKNAME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00100000, MSG_SYS_GETSOCKOPT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00200000, MSG_SYS_SETSOCKOPT_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00400000, MSG_SYS_SOCKCONFIG_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x00800000, MSG_SYS_NTP_GETTIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x01000000, MSG_SYS_NTP_ADJTIME_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x02000000, MSG_SYS_LWP_MUTEX_UNLOCK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x04000000, MSG_SYS_LWP_MUTEX_TRYLOCK_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x08000000, MSG_SYS_LWP_MUTEX_REGISTER_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x10000000, MSG_SYS_CLADM_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x20000000, MSG_SYS_UUCOPY_ALT },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0x40000000, MSG_SYS_UMOUNT2_ALT },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab /* 256 (unused) */
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { 0, 0 }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = {
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda0, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda1, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda2, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda3, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda4, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda5, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda6, 0x00000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { vda7, 0x80000000 },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff },
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab { NULL, 0xffffffff }
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab };
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab if (n_mask > N_MASK)
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab n_mask = N_MASK;
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags,
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab cnote_sysset_buf->buf, CONV_CNOTE_SYSSET_BUFSIZE));
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab#undef N_MASK
c6c9aed4d309e3d11be652b85e3bf8bb72f20c87ab}
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amoreconst char *
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amoreconv_cnote_fileflags(uint32_t fileflags, Conv_fmt_flags_t fmt_flags,
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore char *buf, size_t bufsize)
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore{
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore CONV_EXPN_FIELD_ARG arg = { 0 };
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore Val_desc vda[] = {
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0001, MSG_PR_O_WRONLY },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0002, MSG_PR_O_RDONLY },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x200000, MSG_PR_O_SEARCH },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x400000, MSG_PR_O_EXEC },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0004, MSG_PR_O_NDELAY },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0008, MSG_PR_O_APPEND },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0010, MSG_PR_O_SYNC },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0040, MSG_PR_O_DSYNC },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0080, MSG_PR_O_NONBLOCK },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0100, MSG_PR_O_CREAT },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0200, MSG_PR_O_TRUNC },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0400, MSG_PR_O_EXCL },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x0800, MSG_PR_O_NOCTTY },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x4000, MSG_PR_O_XATTR },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x8000, MSG_PR_O_RSYNC },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x2000, MSG_PR_O_LARGEFILE },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x20000, MSG_PR_O_NOFOLLOW },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x40000, MSG_PR_O_NOLINKS },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0, NULL },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore };
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.oflags = arg.rflags = fileflags;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.buf = buf;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.bufsize = bufsize;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore switch (fileflags & (0x600003)) {
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0: /* RDONLY */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore vda[0].v_msg = MSG_PR_O_RDONLY;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.oflags |= 1;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.rflags |= 1;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 1: /* WRONLY */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 2: /* RDWR */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x200000: /* SEARCH */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x400000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore /* In isolate, treat these as normal bits */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore default:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore /* More than one bit set in this group, emit numerically */
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.oflags &= ~(fileflags & 0x600003);
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore }
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore if (fileflags == 0)
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore return (MSG_ORIG(MSG_GBL_ZERO));
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore (void) conv_expn_field(&arg, vda, fmt_flags);
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore return (buf);
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore}
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amoreconst char *
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amoreconv_cnote_filemode(uint32_t mode, Conv_fmt_flags_t fmt_flags,
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore char *buf, size_t bufsize)
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore{
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore CONV_EXPN_FIELD_ARG arg = { 0 };
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore Msg s;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore Val_desc vda[] = {
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x1000, MSG_S_IFIFO },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x800, MSG_S_ISUID },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x400, MSG_S_ISGID },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0x200, MSG_S_ISVTX },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0400, MSG_S_IRUSR },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0200, MSG_S_IWUSR },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0100, MSG_S_IXUSR },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0040, MSG_S_IRGRP },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0020, MSG_S_IWGRP },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0010, MSG_S_IXGRP },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0004, MSG_S_IROTH },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0002, MSG_S_IWOTH },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0001, MSG_S_IXOTH },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore { 0, NULL },
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore };
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.oflags = arg.rflags = mode & ~(0xf000);
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.buf = buf;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.bufsize = bufsize;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore switch (mode & (0xf000)) {
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x1000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFIFO;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x2000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFCHR;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x4000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFDIR;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x5000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFNAM;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x6000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFBLK;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0x8000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFREG;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0xA000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFLNK;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0xc000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFSOCK;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0xd000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFDOOR;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore case 0xe000:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = MSG_S_IFPORT;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore default:
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore s = NULL;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore break;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore }
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore if (s) {
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.oflags |= 0x1000;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.rflags |= 0x1000;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore vda[0].v_msg = s;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore } else {
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore arg.rflags = mode;
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore }
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore if (mode == 0)
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore return (MSG_ORIG(MSG_GBL_ZERO));
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore (void) conv_expn_field(&arg, vda, fmt_flags);
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore return (buf);
34bdffbf3e3c188027e767e631f717b10159316dGarrett D'Amore}
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#define PROCSECFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe MSG_ASLR_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe MSG_FORBIDNULLMAP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe MSG_NOEXECSTACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe/*
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * Ensure that Conv_cnote_pr_secflags_buf_t is large enough:
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe *
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * PROCSECFLGSZ is the real minimum size of the buffer required by
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * conv_prsecflags(). However, Conv_cnote_pr_secflags_buf_t uses
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * CONV_CNOTE_PSECFLAGS_FLAG_BUFSIZE to set the buffer size. We do things this
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * way because the definition of PROCSECFLGSZ uses information that is not
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * available in the environment of other programs that include the conv.h
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * header file.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe */
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#if (CONV_PRSECFLAGS_BUFSIZE != PROCSECFLGSZ) && !defined(__lint)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#define REPORT_BUFSIZE PROCSECFLGSZ
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#include "report_bufsize.h"
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#error "CONV_PRSECFLAGS_BUFSIZE does not match PROCSECFLGSZ"
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe#endif
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Loweconst char *
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Loweconv_prsecflags(secflagset_t flags, Conv_fmt_flags_t fmt_flags,
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe Conv_secflags_buf_t *secflags_buf)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe{
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe /*
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe * The values are initialized later, based on position in this array
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe */
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe static Val_desc vda[] = {
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe { 0, MSG_ASLR },
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe { 0, MSG_FORBIDNULLMAP },
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe { 0, MSG_NOEXECSTACK },
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe { 0, 0 }
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe };
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe static CONV_EXPN_FIELD_ARG conv_arg = {
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe NULL, sizeof (secflags_buf->buf)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe };
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe int i;
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe for (i = 0; vda[i].v_msg != 0; i++)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe vda[i].v_val = secflag_to_bit(i);
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe if (flags == 0)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe return (MSG_ORIG(MSG_GBL_ZERO));
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe conv_arg.buf = secflags_buf->buf;
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe conv_arg.oflags = conv_arg.rflags = flags;
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe (void) conv_expn_field(&conv_arg, vda, fmt_flags);
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe return ((const char *)secflags_buf->buf);
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe}