You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-92Lines changed: 48 additions & 92 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,13 @@
4
4
# libproc-rs
5
5
This is a library for getting information about running processes for Mac OS X and Linux.
6
6
7
-
# Using it
7
+
Add it to your project's `Cargo.toml`:
8
+
```toml
9
+
libproc = "0.14.4"
8
10
```
9
-
extern crate libproc;
11
+
12
+
And then use it in your code:
13
+
```rust
10
14
uselibproc::libproc::proc_pid;
11
15
12
16
matchproc_pid::pidpath(pid) {
@@ -15,66 +19,13 @@ match proc_pid::pidpath(pid) {
15
19
}
16
20
```
17
21
18
-
# Experiment in OSS funding
19
-
I am exploring the ideas around Open Source Software funding from [RadWorks Foundation]([https://radworks.org/) via the [Drips Project](https://www.drips.network/)
20
-
21
-
This project is in Drips [here](https://www.drips.network/app/projects/github/andrewdavidmackenzie/libproc-rs)
You can find the browseable docs for the latest release on [docs.rs](https://docs.rs/libproc/latest/libproc/).
71
25
72
-
## Kernel Message Buffer - kmsgbuf
73
-
```
74
-
pub fn kmsgbuf() -> Result<String, String>
75
-
```
26
+
NOTE: `master` branch (code and docs) can differ from those docs prior to a new release.
76
27
77
-
# Rust Versions
28
+
# Rust Channels Tested
78
29
The Github Actions CI matrix tests for rust `stable`, `beta` and `nightly` on all platforms
79
30
80
31
# Platforms
@@ -108,45 +59,22 @@ Two simple examples are included to show libproc-rs working.
108
59
109
60
These can be ran thus:
110
61
`sudo cargo run --example procinfo` or
111
-
`sudo cargo run --example dmesg`
112
-
113
-
# Build and Test Locally
114
-
`cargo test` should build and test as usual for rust projects.
62
+
`sudo cargo run --example dmesg`
115
63
116
-
However, as some functions need to be run as `root` to work, CI tests are run as `root`.
117
-
So, when developing in local it's best if you use `sudo cargo test`.
118
-
119
-
NOTE: This can get you into permissions problems when switching back and for
120
-
between using `cargo test` and `sudo cargo test`.
121
-
To fix that run `sudo cargo clean` and then build or test as you prefer.
122
-
123
-
In order to have tests pass when run as `root` or not, some tests need to check if they are `root`
124
-
at run-time (using our own `am_root()` function is handy) and avoid failing if *not* run as `root`.
125
-
126
-
## Using "act" to run GH Actions CI workflows locally
127
-
If you develop on macos but want to ensure code builds and tests pass on linux while making changes,
128
-
you can use the [act](https://github.com/nektos/act) tool to run the Github Actions Workflows on
129
-
the test matrix.
130
-
131
-
Just install "act" (`brew install act`) (previously install docker if you don't have it already,
132
-
and make sure the daemon is running) then run `act` at the command line
64
+
# Contributing
65
+
You are welcome to fork this repo and make a pull request, or write an issue.
133
66
134
-
## Macos: clang detection and header file finding
135
-
Newer versions of `bindgen` have improved the detection of `clang` and hence macos header files.
136
-
If you also have llvm/clang installed directly or via `brew` this may cause the build to fail saying it
137
-
cannot find `libproc.h`. This can be fixed by setting `CLANG_PATH="/usr/bin/clang"` so that `bindgen`
138
-
detects the Xcode version and hence can fidn the correct header files.
67
+
## Experiment in OSS funding
68
+
I am exploring the ideas around Open Source Software funding from [RadWorks Foundation]([https://radworks.org/) via the [Drips Project](https://www.drips.network/)
139
69
140
-
# CI Testing
141
-
Continuous Integration testing has been moved from travis-ci to GitHub Actions. For details see the
0 commit comments