509 * Layout description of prdinfo_t, from <sys/procfs.h>.
510 */
511 typedef struct {
512 sl_field_t sizeof_struct;
513 sl_field_t pr_fd;
514 sl_field_t pr_mode;
515 sl_field_t pr_uid;
516 sl_field_t pr_gid;
517 sl_field_t pr_major;
518 sl_field_t pr_minor;
519 sl_field_t pr_rmajor;
520 sl_field_t pr_rminor;
521 sl_field_t pr_ino;
522 sl_field_t pr_offset;
523 sl_field_t pr_size;
524 sl_field_t pr_fileflags;
525 sl_field_t pr_fdflags;
526 sl_field_t pr_path;
527 } sl_prfdinfo_layout_t;
528
529 /*
530 * This type collects all of the layout definitions for
531 * a given architecture.
532 */
533 typedef struct {
534 const sl_auxv_layout_t *auxv; /* auxv_t */
535 const sl_fltset_layout_t *fltset; /* fltset_t */
536 const sl_lwpsinfo_layout_t *lwpsinfo; /* lwpsinfo_t */
537 const sl_lwpstatus_layout_t *lwpstatus; /* lwpstatus_t */
538 const sl_prcred_layout_t *prcred; /* prcred_t */
539 const sl_priv_impl_info_layout_t *priv_impl_info; /* priv_impl_info_t */
540 const sl_prpriv_layout_t *prpriv; /* prpriv_t */
541 const sl_psinfo_layout_t *psinfo; /* psinfo_t */
542 const sl_pstatus_layout_t *pstatus; /* pstatus_t */
543 const sl_prgregset_layout_t *prgregset; /* prgregset_t */
544 const sl_prpsinfo_layout_t *prpsinfo; /* prpsinfo_t */
545 const sl_prstatus_layout_t *prstatus; /* prstatus_t */
546 const sl_sigaction_layout_t *sigaction; /* struct sigaction */
547 const sl_siginfo_layout_t *siginfo; /* siginfo_t */
548 const sl_sigset_layout_t *sigset; /* sigset_t */
549 const sl_stack_layout_t *stack; /* stack_t */
550 const sl_sysset_layout_t *sysset; /* sysset_t */
551 const sl_timestruc_layout_t *timestruc; /* timestruc_t */
552 const sl_utsname_layout_t *utsname; /* struct utsname */
553 const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */
554 } sl_arch_layout_t;
555
556
557
558 extern void sl_extract_num_field(const char *data, int do_swap,
559 const sl_field_t *fdesc, sl_data_t *field_data);
560 extern Word sl_extract_as_word(const char *data, int do_swap,
561 const sl_field_t *fdesc);
562 extern Lword sl_extract_as_lword(const char *data, int do_swap,
563 const sl_field_t *fdesc);
564 extern Sword sl_extract_as_sword(const char *data, int do_swap,
565 const sl_field_t *fdesc);
566 extern const char *sl_fmt_num(const char *data, int do_swap,
567 const sl_field_t *fdesc, sl_fmt_num_t fmt_type,
568 sl_fmtbuf_t buf);
569
570
571 extern const sl_arch_layout_t *sl_mach(Half);
572 extern const sl_arch_layout_t *struct_layout_i386(void);
573 extern const sl_arch_layout_t *struct_layout_amd64(void);
|
509 * Layout description of prdinfo_t, from <sys/procfs.h>.
510 */
511 typedef struct {
512 sl_field_t sizeof_struct;
513 sl_field_t pr_fd;
514 sl_field_t pr_mode;
515 sl_field_t pr_uid;
516 sl_field_t pr_gid;
517 sl_field_t pr_major;
518 sl_field_t pr_minor;
519 sl_field_t pr_rmajor;
520 sl_field_t pr_rminor;
521 sl_field_t pr_ino;
522 sl_field_t pr_offset;
523 sl_field_t pr_size;
524 sl_field_t pr_fileflags;
525 sl_field_t pr_fdflags;
526 sl_field_t pr_path;
527 } sl_prfdinfo_layout_t;
528
529 typedef struct {
530 sl_field_t sizeof_struct;
531 sl_field_t pr_version;
532 sl_field_t pr_effective;
533 sl_field_t pr_inherit;
534 sl_field_t pr_lower;
535 sl_field_t pr_upper;
536 } sl_prsecflags_layout_t;
537
538 /*
539 * This type collects all of the layout definitions for
540 * a given architecture.
541 */
542 typedef struct {
543 const sl_auxv_layout_t *auxv; /* auxv_t */
544 const sl_fltset_layout_t *fltset; /* fltset_t */
545 const sl_lwpsinfo_layout_t *lwpsinfo; /* lwpsinfo_t */
546 const sl_lwpstatus_layout_t *lwpstatus; /* lwpstatus_t */
547 const sl_prcred_layout_t *prcred; /* prcred_t */
548 const sl_priv_impl_info_layout_t *priv_impl_info; /* priv_impl_info_t */
549 const sl_prpriv_layout_t *prpriv; /* prpriv_t */
550 const sl_psinfo_layout_t *psinfo; /* psinfo_t */
551 const sl_pstatus_layout_t *pstatus; /* pstatus_t */
552 const sl_prgregset_layout_t *prgregset; /* prgregset_t */
553 const sl_prpsinfo_layout_t *prpsinfo; /* prpsinfo_t */
554 const sl_prstatus_layout_t *prstatus; /* prstatus_t */
555 const sl_sigaction_layout_t *sigaction; /* struct sigaction */
556 const sl_siginfo_layout_t *siginfo; /* siginfo_t */
557 const sl_sigset_layout_t *sigset; /* sigset_t */
558 const sl_stack_layout_t *stack; /* stack_t */
559 const sl_sysset_layout_t *sysset; /* sysset_t */
560 const sl_timestruc_layout_t *timestruc; /* timestruc_t */
561 const sl_utsname_layout_t *utsname; /* struct utsname */
562 const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */
563 const sl_prsecflags_layout_t *prsecflags; /* prsecflags_t */
564 } sl_arch_layout_t;
565
566
567
568 extern void sl_extract_num_field(const char *data, int do_swap,
569 const sl_field_t *fdesc, sl_data_t *field_data);
570 extern Word sl_extract_as_word(const char *data, int do_swap,
571 const sl_field_t *fdesc);
572 extern Lword sl_extract_as_lword(const char *data, int do_swap,
573 const sl_field_t *fdesc);
574 extern Sword sl_extract_as_sword(const char *data, int do_swap,
575 const sl_field_t *fdesc);
576 extern const char *sl_fmt_num(const char *data, int do_swap,
577 const sl_field_t *fdesc, sl_fmt_num_t fmt_type,
578 sl_fmtbuf_t buf);
579
580
581 extern const sl_arch_layout_t *sl_mach(Half);
582 extern const sl_arch_layout_t *struct_layout_i386(void);
583 extern const sl_arch_layout_t *struct_layout_amd64(void);
|