Skip to content

Commit 3437b90

Browse files
Minor docs fixes, small API change and bump version number to 0.9.0
1 parent b36d9bc commit 3437b90

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libproc"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
description = "A library to get information about running processes - for Mac OS X and Linux"
55
authors = ["Andrew Mackenzie <[email protected]>"]
66
repository = "https://github.com/andrewdavidmackenzie/libproc-rs"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ At the moment these methods have been implemented:
3030
pub fn listpids(proc_types: ProcType) -> Result<Vec<u32>, String> (macos) (linux)
3131
```
3232
```
33+
pub fn listpidspath(proc_types: ProcType, path: &str) -> Result<Vec<u32>, String> (macos) (linux)
34+
```
35+
```
3336
pub fn pidinfo<T: PIDInfo>(pid : i32, arg: u64) -> Result<T, String> (macos)
3437
```
3538
```

src/libproc/proc_pid.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ extern {
143143
fn proc_libversion(major: *mut c_int, minor: *mut c_int) -> c_int;
144144
fn proc_pidpath(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int;
145145
fn proc_regionfilename(pid: c_int, address: u64, buffer: *mut c_void, buffersize: u32) -> c_int;
146-
147146
}
148147

149148
/// Returns the PIDs of the active processes that match the ProcType passed in
@@ -211,7 +210,7 @@ pub fn listpids(proc_types: ProcType) -> Result<Vec<u32>, String> {
211210
}
212211
}
213212

214-
// proc_listpidspath
213+
// listpidspath
215214
// Search through the current processes looking for open file references which match
216215
// a specified path or volume.
217216
//
@@ -229,7 +228,7 @@ pub fn listpids(proc_types: ProcType) -> Result<Vec<u32>, String> {
229228
// @result the number of bytes of data returned in the provided buffer;
230229
// -1 if an error was encountered;
231230
#[cfg(target_os = "macos")]
232-
pub fn listpidspath(proc_types: ProcType, path: String) -> Result<Vec<u32>, String> {
231+
pub fn listpidspath(proc_types: ProcType, path: &str) -> Result<Vec<u32>, String> {
233232
let buffer_size = unsafe {
234233
proc_listpidspath(proc_types as u32, 0, path.as_ptr() as * const c_char, 0, ptr::null_mut(), 0)
235234
};
@@ -745,7 +744,7 @@ mod test {
745744
#[test]
746745
#[cfg(target_os = "macos")]
747746
fn listpidspath_test() {
748-
let pids = super::listpidspath(ProcType::ProcAllPIDS, "/".into()).unwrap();
747+
let pids = super::listpidspath(ProcType::ProcAllPIDS, "/").unwrap();
749748
assert!(pids.len() > 1);
750749
}
751750
}

0 commit comments

Comments
 (0)