aboutsummaryrefslogtreecommitdiff
path: root/lib/libprocstat/libprocstat.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-04-01 18:22:48 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-04-01 18:22:48 +0000
commite506e182dda35a3ac977e9057552439dd24245f5 (patch)
treec2db61e497320454ff8abdab4b6faede73162985 /lib/libprocstat/libprocstat.h
parent87d94367b96bdad25d621c1d906750b9aa1502b9 (diff)
downloadsrc-e506e182dda35a3ac977e9057552439dd24245f5.tar.gz
src-e506e182dda35a3ac977e9057552439dd24245f5.zip
Export some more useful info about shared memory objects to userland
via procstat(1) and fstat(1): - Change shm file descriptors to track the pathname they are associated with and add a shm_path() method to copy the path out to a caller-supplied buffer. - Use the fo_stat() method of shared memory objects and shm_path() to export the path, mode, and size of a shared memory object via struct kinfo_file. - Add a struct shmstat to the libprocstat(3) interface along with a procstat_get_shm_info() to export the mode and size of a shared memory object. - Change procstat to always print out the path for a given object if it is valid. - Teach fstat about shared memory objects and to display their path, mode, and size. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=233760
Diffstat (limited to 'lib/libprocstat/libprocstat.h')
-rw-r--r--lib/libprocstat/libprocstat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h
index f1ca109afcbb..c00a179dae54 100644
--- a/lib/libprocstat/libprocstat.h
+++ b/lib/libprocstat/libprocstat.h
@@ -123,6 +123,10 @@ struct pipestat {
uint64_t addr;
uint64_t peer;
};
+struct shmstat {
+ uint64_t size;
+ uint16_t mode;
+};
struct sockstat {
uint64_t inp_ppcb;
uint64_t so_addr;
@@ -152,6 +156,8 @@ int procstat_get_pipe_info(struct procstat *procstat, struct filestat *fst,
struct pipestat *pipe, char *errbuf);
int procstat_get_pts_info(struct procstat *procstat, struct filestat *fst,
struct ptsstat *pts, char *errbuf);
+int procstat_get_shm_info(struct procstat *procstat, struct filestat *fst,
+ struct shmstat *shm, char *errbuf);
int procstat_get_socket_info(struct procstat *procstat, struct filestat *fst,
struct sockstat *sock, char *errbuf);
int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst,