diff options
author | jhb <jhb@FreeBSD.org> | 2013-05-03 21:11:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-05-03 21:11:57 +0000 |
commit | 679fa5ed4e91b1d9e2002d8da43d9c31056fe7a4 (patch) | |
tree | 4b4ec8c6d14c8986e2139b96edf75a870d996980 /lib/libprocstat/libprocstat.h | |
parent | 66bb8e0f75e5284e0b64916ea8295efb5ca1fff6 (diff) | |
download | FreeBSD-src-679fa5ed4e91b1d9e2002d8da43d9c31056fe7a4.zip FreeBSD-src-679fa5ed4e91b1d9e2002d8da43d9c31056fe7a4.tar.gz |
Similar to 233760 and 236717, export some more useful info about the
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
with and add a ksem_info() method to copy the path out to a
caller-supplied buffer.
- Use the fo_stat() method of shared memory objects and ksem_info() to
export the path, mode, and value of a semaphore via struct kinfo_file.
- Add a struct semstat to the libprocstat(3) interface along with a
procstat_get_sem_info() to export the mode and value of a semaphore.
- Teach fstat about semaphores and to display their path, mode, and value.
MFC after: 2 weeks
Diffstat (limited to 'lib/libprocstat/libprocstat.h')
-rw-r--r-- | lib/libprocstat/libprocstat.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h index 2c2662d..65a5eb9 100644 --- a/lib/libprocstat/libprocstat.h +++ b/lib/libprocstat/libprocstat.h @@ -133,6 +133,10 @@ struct pipestat { uint64_t addr; uint64_t peer; }; +struct semstat { + uint32_t value; + uint16_t mode; +}; struct shmstat { uint64_t size; uint16_t mode; @@ -177,6 +181,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_sem_info(struct procstat *procstat, struct filestat *fst, + struct semstat *sem, 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, |