summaryrefslogtreecommitdiffstats
path: root/lib/libprocstat/libprocstat.3
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-05-03 21:11:57 +0000
committerjhb <jhb@FreeBSD.org>2013-05-03 21:11:57 +0000
commit679fa5ed4e91b1d9e2002d8da43d9c31056fe7a4 (patch)
tree4b4ec8c6d14c8986e2139b96edf75a870d996980 /lib/libprocstat/libprocstat.3
parent66bb8e0f75e5284e0b64916ea8295efb5ca1fff6 (diff)
downloadFreeBSD-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.3')
-rw-r--r--lib/libprocstat/libprocstat.314
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libprocstat/libprocstat.3 b/lib/libprocstat/libprocstat.3
index 3312427..e82c30a 100644
--- a/lib/libprocstat/libprocstat.3
+++ b/lib/libprocstat/libprocstat.3
@@ -53,6 +53,7 @@
.Nm procstat_freevmmap ,
.Nm procstat_get_pipe_info ,
.Nm procstat_get_pts_info ,
+.Nm procstat_get_sem_info ,
.Nm procstat_get_shm_info ,
.Nm procstat_get_socket_info ,
.Nm procstat_get_vnode_info
@@ -115,6 +116,13 @@
.Fa "char *errbuf"
.Fc
.Ft int
+.Fo procstat_get_sem_info
+.Fa "struct procstat *procstat"
+.Fa "struct filestat *fst"
+.Fa "struct semstat *sem"
+.Fa "char *errbuf"
+.Fc
+.Ft int
.Fo procstat_get_shm_info
.Fa "struct procstat *procstat"
.Fa "struct filestat *fst"
@@ -463,12 +471,13 @@ function call.
The
.Fn procstat_get_pipe_info ,
.Fn procstat_get_pts_info ,
+.Fn procstat_get_sem_info ,
.Fn procstat_get_shm_info ,
.Fn procstat_get_socket_info
and
.Fn procstat_get_vnode_info
functions are used to retrieve information about pipes, pseudo-terminals,
-shared memory objects,
+semaphores, shared memory objects,
sockets, and vnodes, respectively.
Each of them have a similar interface API.
The
@@ -505,6 +514,8 @@ argument indicates an actual error message in case of failure.
.Nm procstat_get_pipe_info
.It Li PS_FST_TYPE_PTS
.Nm procstat_get_pts_info
+.It Li PS_FST_TYPE_SEM
+.Nm procstat_get_sem_info
.It Li PS_FST_TYPE_SHM
.Nm procstat_get_shm_info
.El
@@ -517,6 +528,7 @@ argument indicates an actual error message in case of failure.
.Xr elf 3 ,
.Xr kvm 3 ,
.Xr queue 3 ,
+.Xr sem_open 3 ,
.Xr sysctl 3 ,
.Xr pts 4 ,
.Xr core 5 ,
OpenPOWER on IntegriCloud