@@ -23,11 +23,16 @@ Run "cargo doc" and then open "./target/doc/libproc/index.html".
2323More documentation will be added over time.
2424
2525# API
26- At the moment these methods are implemented:
26+ At the moment these methods have been implemented:
27+
28+ ## Process / PID related
2729```
2830pub fn listpids(proc_types: ProcType) -> Result<Vec<u32>, String>
2931```
3032```
33+ pub fn pidinfo<T: PIDInfo>(pid : i32, arg: u64) -> Result<T, String> {
34+ ```
35+ ```
3136pub fn regionfilename(pid: i32, address: u64) -> Result<String, String>
3237```
3338```
@@ -39,7 +44,21 @@ pub fn libversion() -> Result<(i32, i32), String>
3944```
4045pub fn name(pid: i32) -> Result<String, String>
4146```
47+ ```
48+ pub fn listpidinfo<T: ListPIDInfo>(pid : i32, max_len: usize) -> Result<Vec<T::Item>, String>
49+ ```
50+
51+ ## File and FileDescriptor related
52+ ```
53+ pub fn pidfdinfo<T: PIDFDInfo>(pid : i32, fd: i32) -> Result<T, String>
54+ ```
55+
56+ ## PID Resource Usage related
57+ ```
58+ pub fn pidrusage<T: PIDRUsage>(pid : i32) -> Result<T, String>
59+ ```
4260
61+ ## kmsgbuf
4362I have also implemented this method - but the MAGIC_NUMBER returned is not correct,
4463and upon investigation it seems that Apple/Darwin/Mach have changed totally how dmessage works in
4564latest versions, moving away from using libproc to use kvm - with a total rewrite of dmesg.
@@ -59,10 +78,14 @@ pub fn kmsgbuf() -> Result<String, String>
5978Initially just for Mac OS X.
6079
6180# TODO
81+ See the [ list of issues] ( https://github.com/andrewdavidmackenzie/libproc-rs/issues ) .
82+ I put the "help wanted" label where I need help from others.
83+
6284- Complete the API on Mac OS X - figuring out all the Mac OS X / Darwin version mess....
6385- Add more documentation (including samples with documentation test)
6486- Add own custom error type and implement From::from to ease reporting of multiple error types in clients
65- - Once the API is complete then doing a Linux version with the same API would make sense.
87+ - Once the API is complete then doing a Linux version with the same API would make sense,
88+ starting with simpler or more similar methods, and then abstratcion over apple/unix/linux would be needed
6689
6790# LICENSE
6891This code is licensed under MIT license (see LICENCE).
0 commit comments