Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 191 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion process/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ atty.workspace = true
errno = "0.3"
dirs = "5.0"

[dev-dependencies]
tokio = { version = "1.39", features = ["net", "macros", "rt"]}

[build-dependencies]
bindgen = { version = "0.70.0", features = ["runtime"] }

[[bin]]
name = "fuser"
path = "./fuser.rs"

[[bin]]
name = "env"
path = "./env.rs"
Expand All @@ -38,4 +48,3 @@ path = "./renice.rs"
[[bin]]
name = "xargs"
path = "./xargs.rs"

27 changes: 27 additions & 0 deletions process/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#[cfg(target_os = "macos")]
fn main() {
use std::env;
use std::path::Path;

let bindings = bindgen::builder()
.header_contents("libproc_rs.h", "#include <libproc.h>")
.layout_tests(false)
.clang_args(&[
"-x",
"c++",
"-I",
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/",
])
.generate()
.expect("Failed to build libproc bindings");

let output_path = Path::new(&env::var("OUT_DIR").expect("OUT_DIR env var was not defined"))
.join("osx_libproc_bindings.rs");

bindings
.write_to_file(output_path)
.expect("Failed to write libproc bindings");
}

#[cfg(target_os = "linux")]
fn main() {}
Loading