25 *
26 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
27 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
28 * Copyright (c) 2018, Joyent, Inc.
29 * Copyright 2016 RackTop Systems.
30 */
31
32 #ifndef _CONV_H
33 #define _CONV_H
34
35 /*
36 * Global include file for conversion library.
37 */
38
39 #include <stdlib.h>
40 #include <libelf.h>
41 #include <dlfcn.h>
42 #include <libld.h>
43 #include <sgs.h>
44 #include <sgsmsg.h>
45
46 #ifndef NATIVE_BUILD
47 #include <sys/secflags.h>
48 #endif
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 /*
55 * Configuration features available - maintained here (instead of debug.h)
56 * to save libconv from having to include debug.h which results in numerous
57 * "declared but not used or defined" lint errors.
58 */
59 #define CONF_EDLIBPATH 0x000100 /* ELF default library path */
60 #define CONF_ESLIBPATH 0x000200 /* ELF secure library path */
61 #define CONF_ADLIBPATH 0x000400 /* AOUT default library path */
62 #define CONF_ASLIBPATH 0x000800 /* AOUT secure library path */
63 #define CONF_DIRCFG 0x001000 /* directory configuration available */
64 #define CONF_OBJALT 0x002000 /* object alternatives available */
65 #define CONF_MEMRESV 0x004000 /* memory reservation required */
66 #define CONF_ENVS 0x008000 /* environment variables available */
67 #define CONF_FLTR 0x010000 /* filter information available */
68 #define CONF_FEATMSK 0xffff00
314 #define CONV_CNOTE_PR_FLAGS_BUFSIZE 254
315 typedef union {
316 Conv_inv_buf_t inv_buf;
317 char buf[CONV_CNOTE_PR_FLAGS_BUFSIZE];
318 } Conv_cnote_pr_flags_buf_t;
319
320 /* conv_cnote_old_pr_flags() */
321 #define CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE 174
322 typedef union {
323 Conv_inv_buf_t inv_buf;
324 char buf[CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE];
325 } Conv_cnote_old_pr_flags_buf_t;
326
327 /* conv_cnote_proc_flag() */
328 #define CONV_CNOTE_PROC_FLAG_BUFSIZE 39
329 typedef union {
330 Conv_inv_buf_t inv_buf;
331 char buf[CONV_CNOTE_PROC_FLAG_BUFSIZE];
332 } Conv_cnote_proc_flag_buf_t;
333
334 #ifndef NATIVE_BUILD
335 /* conv_prsecflags() */
336 #define CONV_PRSECFLAGS_BUFSIZE 57
337 typedef union {
338 Conv_inv_buf_t inv_buf;
339 char buf[CONV_PRSECFLAGS_BUFSIZE];
340 } Conv_secflags_buf_t;
341 #endif
342
343 /* conv_cnote_sigset() */
344 #define CONV_CNOTE_SIGSET_BUFSIZE 639
345 typedef union {
346 Conv_inv_buf_t inv_buf;
347 char buf[CONV_CNOTE_SIGSET_BUFSIZE];
348 } Conv_cnote_sigset_buf_t;
349
350 /* conv_cnote_fltset() */
351 #define CONV_CNOTE_FLTSET_BUFSIZE 511
352 typedef union {
353 Conv_inv_buf_t inv_buf;
354 char buf[CONV_CNOTE_FLTSET_BUFSIZE];
355 } Conv_cnote_fltset_buf_t;
356
357 /* conv_cnote_sysset() */
358 #define CONV_CNOTE_SYSSET_BUFSIZE 3195
359 typedef union {
360 Conv_inv_buf_t inv_buf;
361 char buf[CONV_CNOTE_SYSSET_BUFSIZE];
819 extern const char *conv_cnote_fltset(uint32_t *, int,
820 Conv_fmt_flags_t, Conv_cnote_fltset_buf_t *);
821 extern const char *conv_cnote_old_pr_flags(int, Conv_fmt_flags_t,
822 Conv_cnote_old_pr_flags_buf_t *);
823 extern const char *conv_cnote_pr_dmodel(Word, Conv_fmt_flags_t,
824 Conv_inv_buf_t *);
825 extern const char *conv_cnote_pr_flags(int, Conv_fmt_flags_t,
826 Conv_cnote_pr_flags_buf_t *);
827 extern const char *conv_cnote_proc_flag(int, Conv_fmt_flags_t,
828 Conv_cnote_proc_flag_buf_t *);
829 extern const char *conv_cnote_pr_regname(Half, int, Conv_fmt_flags_t,
830 Conv_inv_buf_t *inv_buf);
831 extern const char *conv_cnote_pr_stype(Word, Conv_fmt_flags_t,
832 Conv_inv_buf_t *);
833 extern const char *conv_cnote_pr_what(short, short, Conv_fmt_flags_t,
834 Conv_inv_buf_t *);
835 extern const char *conv_cnote_pr_why(short, Conv_fmt_flags_t,
836 Conv_inv_buf_t *);
837 extern const char *conv_cnote_priv(int, Conv_fmt_flags_t,
838 Conv_inv_buf_t *);
839 #ifndef NATIVE_BUILD
840 extern const char *conv_prsecflags(secflagset_t, Conv_fmt_flags_t,
841 Conv_secflags_buf_t *);
842 #endif
843 extern const char *conv_cnote_psetid(int, Conv_fmt_flags_t,
844 Conv_inv_buf_t *);
845 extern const char *conv_cnote_sa_flags(int, Conv_fmt_flags_t,
846 Conv_cnote_sa_flags_buf_t *);
847 extern const char *conv_cnote_signal(Word, Conv_fmt_flags_t,
848 Conv_inv_buf_t *);
849 extern const char *conv_cnote_si_code(Half, int, int, Conv_fmt_flags_t,
850 Conv_inv_buf_t *);
851 extern const char *conv_cnote_sigset(uint32_t *, int,
852 Conv_fmt_flags_t, Conv_cnote_sigset_buf_t *);
853 extern const char *conv_cnote_ss_flags(int, Conv_fmt_flags_t,
854 Conv_cnote_ss_flags_buf_t *);
855 extern const char *conv_cnote_syscall(Word, Conv_fmt_flags_t,
856 Conv_inv_buf_t *);
857 extern const char *conv_cnote_sysset(uint32_t *, int,
858 Conv_fmt_flags_t, Conv_cnote_sysset_buf_t *);
859 extern const char *conv_cnote_fileflags(uint32_t, Conv_fmt_flags_t,
860 char *, size_t);
861 extern const char *conv_cnote_filemode(uint32_t, Conv_fmt_flags_t,
862 char *, size_t);
|
25 *
26 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
27 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
28 * Copyright (c) 2018, Joyent, Inc.
29 * Copyright 2016 RackTop Systems.
30 */
31
32 #ifndef _CONV_H
33 #define _CONV_H
34
35 /*
36 * Global include file for conversion library.
37 */
38
39 #include <stdlib.h>
40 #include <libelf.h>
41 #include <dlfcn.h>
42 #include <libld.h>
43 #include <sgs.h>
44 #include <sgsmsg.h>
45 #include <sys/secflags.h>
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 /*
52 * Configuration features available - maintained here (instead of debug.h)
53 * to save libconv from having to include debug.h which results in numerous
54 * "declared but not used or defined" lint errors.
55 */
56 #define CONF_EDLIBPATH 0x000100 /* ELF default library path */
57 #define CONF_ESLIBPATH 0x000200 /* ELF secure library path */
58 #define CONF_ADLIBPATH 0x000400 /* AOUT default library path */
59 #define CONF_ASLIBPATH 0x000800 /* AOUT secure library path */
60 #define CONF_DIRCFG 0x001000 /* directory configuration available */
61 #define CONF_OBJALT 0x002000 /* object alternatives available */
62 #define CONF_MEMRESV 0x004000 /* memory reservation required */
63 #define CONF_ENVS 0x008000 /* environment variables available */
64 #define CONF_FLTR 0x010000 /* filter information available */
65 #define CONF_FEATMSK 0xffff00
311 #define CONV_CNOTE_PR_FLAGS_BUFSIZE 254
312 typedef union {
313 Conv_inv_buf_t inv_buf;
314 char buf[CONV_CNOTE_PR_FLAGS_BUFSIZE];
315 } Conv_cnote_pr_flags_buf_t;
316
317 /* conv_cnote_old_pr_flags() */
318 #define CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE 174
319 typedef union {
320 Conv_inv_buf_t inv_buf;
321 char buf[CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE];
322 } Conv_cnote_old_pr_flags_buf_t;
323
324 /* conv_cnote_proc_flag() */
325 #define CONV_CNOTE_PROC_FLAG_BUFSIZE 39
326 typedef union {
327 Conv_inv_buf_t inv_buf;
328 char buf[CONV_CNOTE_PROC_FLAG_BUFSIZE];
329 } Conv_cnote_proc_flag_buf_t;
330
331 /* conv_prsecflags() */
332 #define CONV_PRSECFLAGS_BUFSIZE 57
333 typedef union {
334 Conv_inv_buf_t inv_buf;
335 char buf[CONV_PRSECFLAGS_BUFSIZE];
336 } Conv_secflags_buf_t;
337
338 /* conv_cnote_sigset() */
339 #define CONV_CNOTE_SIGSET_BUFSIZE 639
340 typedef union {
341 Conv_inv_buf_t inv_buf;
342 char buf[CONV_CNOTE_SIGSET_BUFSIZE];
343 } Conv_cnote_sigset_buf_t;
344
345 /* conv_cnote_fltset() */
346 #define CONV_CNOTE_FLTSET_BUFSIZE 511
347 typedef union {
348 Conv_inv_buf_t inv_buf;
349 char buf[CONV_CNOTE_FLTSET_BUFSIZE];
350 } Conv_cnote_fltset_buf_t;
351
352 /* conv_cnote_sysset() */
353 #define CONV_CNOTE_SYSSET_BUFSIZE 3195
354 typedef union {
355 Conv_inv_buf_t inv_buf;
356 char buf[CONV_CNOTE_SYSSET_BUFSIZE];
814 extern const char *conv_cnote_fltset(uint32_t *, int,
815 Conv_fmt_flags_t, Conv_cnote_fltset_buf_t *);
816 extern const char *conv_cnote_old_pr_flags(int, Conv_fmt_flags_t,
817 Conv_cnote_old_pr_flags_buf_t *);
818 extern const char *conv_cnote_pr_dmodel(Word, Conv_fmt_flags_t,
819 Conv_inv_buf_t *);
820 extern const char *conv_cnote_pr_flags(int, Conv_fmt_flags_t,
821 Conv_cnote_pr_flags_buf_t *);
822 extern const char *conv_cnote_proc_flag(int, Conv_fmt_flags_t,
823 Conv_cnote_proc_flag_buf_t *);
824 extern const char *conv_cnote_pr_regname(Half, int, Conv_fmt_flags_t,
825 Conv_inv_buf_t *inv_buf);
826 extern const char *conv_cnote_pr_stype(Word, Conv_fmt_flags_t,
827 Conv_inv_buf_t *);
828 extern const char *conv_cnote_pr_what(short, short, Conv_fmt_flags_t,
829 Conv_inv_buf_t *);
830 extern const char *conv_cnote_pr_why(short, Conv_fmt_flags_t,
831 Conv_inv_buf_t *);
832 extern const char *conv_cnote_priv(int, Conv_fmt_flags_t,
833 Conv_inv_buf_t *);
834 extern const char *conv_prsecflags(secflagset_t, Conv_fmt_flags_t,
835 Conv_secflags_buf_t *);
836 extern const char *conv_cnote_psetid(int, Conv_fmt_flags_t,
837 Conv_inv_buf_t *);
838 extern const char *conv_cnote_sa_flags(int, Conv_fmt_flags_t,
839 Conv_cnote_sa_flags_buf_t *);
840 extern const char *conv_cnote_signal(Word, Conv_fmt_flags_t,
841 Conv_inv_buf_t *);
842 extern const char *conv_cnote_si_code(Half, int, int, Conv_fmt_flags_t,
843 Conv_inv_buf_t *);
844 extern const char *conv_cnote_sigset(uint32_t *, int,
845 Conv_fmt_flags_t, Conv_cnote_sigset_buf_t *);
846 extern const char *conv_cnote_ss_flags(int, Conv_fmt_flags_t,
847 Conv_cnote_ss_flags_buf_t *);
848 extern const char *conv_cnote_syscall(Word, Conv_fmt_flags_t,
849 Conv_inv_buf_t *);
850 extern const char *conv_cnote_sysset(uint32_t *, int,
851 Conv_fmt_flags_t, Conv_cnote_sysset_buf_t *);
852 extern const char *conv_cnote_fileflags(uint32_t, Conv_fmt_flags_t,
853 char *, size_t);
854 extern const char *conv_cnote_filemode(uint32_t, Conv_fmt_flags_t,
855 char *, size_t);
|