From 34bdffbf3e3c188027e767e631f717b10159316d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 2 Nov 2012 09:48:42 -0700 Subject: 3294 pfiles postmortem support Reviewed by: Robert Mustacchi Reviewed by: Richard Lowe Approved by: Eric Schrock --- usr/src/uts/common/sys/procfs.h | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'usr/src/uts/common/sys/procfs.h') diff --git a/usr/src/uts/common/sys/procfs.h b/usr/src/uts/common/sys/procfs.h index b320836182..0c4a48fcdd 100644 --- a/usr/src/uts/common/sys/procfs.h +++ b/usr/src/uts/common/sys/procfs.h @@ -23,12 +23,13 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #ifndef _SYS_PROCFS_H #define _SYS_PROCFS_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -61,6 +62,8 @@ extern "C" { #include #include #include +#include +#include #if !defined(_LP64) && _FILE_OFFSET_BITS == 64 #error "Cannot use procfs in the large file compilation environment" @@ -491,6 +494,38 @@ typedef struct prasmap { #define PG_MODIFIED 0x01 /* page modified since last read */ #define PG_HWMAPPED 0x04 /* page is present and mapped */ +/* + * Open files. Only in core files (for now). Note that we'd like to use + * the stat or stat64 structure, but both of these structures are unfortunately + * not consistent between 32 and 64 bit modes. To keep our lives simpler, we + * just define our own structure with types that are not sensitive to this + * difference. Also, it turns out that pfiles omits a lot of info from the + * struct stat (e.g. times, device sizes, etc.) so we don't bother adding those + * here. + */ +typedef struct prfdinfo { + int pr_fd; + mode_t pr_mode; + + uid_t pr_uid; + gid_t pr_gid; + + major_t pr_major; /* think stat.st_dev */ + minor_t pr_minor; + + major_t pr_rmajor; /* think stat.st_rdev */ + minor_t pr_rminor; + + ino64_t pr_ino; + off64_t pr_offset; + off64_t pr_size; + + int pr_fileflags; /* fcntl(F_GETXFL), etc */ + int pr_fdflags; /* fcntl(F_GETFD), etc. */ + + char pr_path[MAXPATHLEN]; +} prfdinfo_t; + /* * Header for /proc//lstatus /proc//lpsinfo /proc//lusage */ -- cgit v1.2.3