summaryrefslogtreecommitdiffstats
path: root/libutil
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2011-05-12 10:11:39 +0000
committerStanislav Sedov <stas@FreeBSD.org>2011-05-12 10:11:39 +0000
commit794e7abcbcd363cf0ff2efa2363cc0571c184075 (patch)
tree413f0b5d76c5cc4eb1a3a6959d011d8ac650f00a /libutil
parent46916f48490b8ba7a2eb93a9020aeb9251cbcecb (diff)
downloadpw-darwin-794e7abcbcd363cf0ff2efa2363cc0571c184075.tar.gz
pw-darwin-794e7abcbcd363cf0ff2efa2363cc0571c184075.tar.zst
pw-darwin-794e7abcbcd363cf0ff2efa2363cc0571c184075.zip
- Commit work from libprocstat project. These patches add support for runtime
file and processes information retrieval from the running kernel via sysctl in the form of new library, libprocstat. The library also supports KVM backend for analyzing memory crash dumps. Both procstat(1) and fstat(1) utilities have been modified to take advantage of the library (as the bonus point the fstat(1) utility no longer need superuser privileges to operate), and the procstat(1) utility is now able to display information from memory dumps as well. The newly introduced fuser(1) utility also uses this library and able to operate via sysctl and kvm backends. The library is by no means complete (e.g. KVM backend is missing vnode name resolution routines, and there're no manpages for the library itself) so I plan to improve it further. I'm commiting it so it will get wider exposure and review. We won't be able to MFC this work as it relies on changes in HEAD, which was introduced some time ago, that break kernel ABI. OTOH we may be able to merge the library with KVM backend if we really need it there. Discussed with: rwatson
Diffstat (limited to 'libutil')
-rw-r--r--libutil/libutil.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libutil/libutil.h b/libutil/libutil.h
index f39e4f5..fc6d3bb 100644
--- a/libutil/libutil.h
+++ b/libutil/libutil.h
@@ -88,6 +88,7 @@ struct termios;
struct winsize;
struct in_addr;
struct kinfo_file;
+struct kinfo_proc;
struct kinfo_vmentry;
__BEGIN_DECLS
@@ -126,6 +127,10 @@ struct kinfo_file *
kinfo_getfile(pid_t _pid, int *_cntp);
struct kinfo_vmentry *
kinfo_getvmmap(pid_t _pid, int *_cntp);
+struct kinfo_proc *
+ kinfo_getallproc(int *_cntp);
+struct kinfo_proc *
+ kinfo_getproc(pid_t _pid);
#ifdef _STDIO_H_ /* avoid adding new includes */
char *fparseln(FILE *, size_t *, size_t *, const char[3], int);