{"id":15725407,"url":"https://github.com/andrewdavidmackenzie/libproc-rs","last_synced_at":"2025-04-06T14:12:49.729Z","repository":{"id":10479810,"uuid":"65892184","full_name":"andrewdavidmackenzie/libproc-rs","owner":"andrewdavidmackenzie","description":"A rust library for getting information about running processes for Mac and Linux","archived":false,"fork":false,"pushed_at":"2024-04-24T08:45:05.000Z","size":7331,"stargazers_count":51,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-21T06:16:36.191Z","etag":null,"topics":["darwin","dmesg","libproc-rs","pid","processes","rust","rust-wrapper"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewdavidmackenzie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"andrew","patreon":"andrewmackenzie"}},"created_at":"2016-08-17T08:56:28.000Z","updated_at":"2024-06-19T13:33:06.071Z","dependencies_parsed_at":"2024-03-12T12:51:39.492Z","dependency_job_id":"8914a61b-0db2-4b46-bae8-d44d613ec90b","html_url":"https://github.com/andrewdavidmackenzie/libproc-rs","commit_stats":{"total_commits":285,"total_committers":13,"mean_commits":"21.923076923076923","dds":"0.15438596491228074","last_synced_commit":"7919df0073f75e72b7d5d7efbf43c9d450dd5b10"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdavidmackenzie%2Flibproc-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdavidmackenzie%2Flibproc-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdavidmackenzie%2Flibproc-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdavidmackenzie%2Flibproc-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewdavidmackenzie","download_url":"https://codeload.github.com/andrewdavidmackenzie/libproc-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492565,"owners_count":20947545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["darwin","dmesg","libproc-rs","pid","processes","rust","rust-wrapper"],"created_at":"2024-10-03T22:20:50.017Z","updated_at":"2025-04-06T14:12:49.700Z","avatar_url":"https://github.com/andrewdavidmackenzie.png","language":"Rust","funding_links":["https://ko-fi.com/andrew","https://patreon.com/andrewmackenzie"],"categories":[],"sub_categories":[],"readme":"![Build Status](https://travis-ci.org/andrewdavidmackenzie/libproc-rs.svg?branch=master \"Mac OS X\")\n[![codecov](https://codecov.io/gh/andrewdavidmackenzie/libproc-rs/branch/master/graph/badge.svg)](https://codecov.io/gh/andrewdavidmackenzie/libproc-rs)\n\n# libproc-rs\nThis is a library for getting information about running processes for Mac OS X and Linux.\n\nAdd it to your project's `Cargo.toml`:\n```toml\nlibproc = \"0.14.4\"\n```\n\nAnd then use it in your code:\n```rust\nuse libproc::libproc::proc_pid;\n\nmatch proc_pid::pidpath(pid) {\n    Ok(path) =\u003e println!(\"PID {}: has path {}\", pid, path),\n    Err(err) =\u003e writeln!(\u0026mut std::io::stderr(), \"Error: {}\", err).unwrap()\n}\n```\n\nYou can find the latest published release on [crates.io](https://crates.io/crates/libproc)\n\nYou can find the browseable docs for the latest release on [docs.rs](https://docs.rs/libproc/latest/libproc/).\n\nNOTE: `master` branch (code and docs) can differ from those docs prior to a new release.\n\n# Minimum rust version\nThe minimum rust version required, by version:\n* libproc-rs: 0.14.6 --\u003e 1.74.1 \n* libproc-rs: 0.14.7 --\u003e 1.72.0\n\nThis is tested in CI and must pass.\n\n# Test Matrix\nThe Github Actions CI test `libproc-rs` on :\n\nrust versions:\n* `stable` (must pass)\n* `beta` (must pass)\n* `1.72.0` (currently the minimum rust version supported) (must pass)\n* `nightly` (allowed to fail) \n\non the following platforms:\n* `ubuntu-latest`\n* `macos-12` (Monterey) (Intel)\n* `macos-13` (Ventura) (Intel)\n* `macos-14` (Sonoma) (Arm64)\n\n# Examples\nTwo simple examples are included to show libproc-rs working.\n\n- `procinfo` that takes a PID as an optional argument (uses it's own pid if none supplied) and returns\n  information about the process on stdout\n- `dmesg` is a version of dmesg implemented in rust that uses libproc-rs.\n\nThese can be ran thus:\n`sudo cargo run --example procinfo` or \n`sudo cargo run --example dmesg`\n\n# Contributing\nYou are welcome to fork this repo and make a pull request, or write an issue.\n\n## Experiment in OSS funding\nI am exploring the ideas around Open Source Software funding from [RadWorks Foundation]([https://radworks.org/) via the [Drips Project](https://www.drips.network/)\n\nThis project is in Drips [here](https://www.drips.network/app/projects/github/andrewdavidmackenzie/libproc-rs)\n\n## Input Requested\n* Suggestions for API, module re-org and cross-platform abstractions are welcome.\n* How to do error reporting? Define own new Errors, or keep simple with Strings?\n* Would like Path/PathBuf returned when it makes sense instead of String?\n\n## TODO\nSee the [list of issues](https://github.com/andrewdavidmackenzie/libproc-rs/issues). \nI put the \"help wanted\" label where I need help from others.\n \n- Look at what similar methods could be implemented as a starting poon Linux\n- Complete the API on Mac OS X - figuring out all the Mac OS X / Darwin version mess....\n- Add more documentation (including samples with documentation test)\n- Add own custom error type and implement From::from to ease reporting of multiple error types in clients\n\n## Build and Test Locally\nIf you're feeling lucky today, start with `make` that will run `clippy`, `test` and will build docs also.\n\nIf you want to stay \"pure rust\" : `cargo test` will build and test as usual.\n\nHowever, as some functions need to be run as `root` to work, CI tests are run as `root`.\nSo, when developing in local it's best if you use `sudo cargo test`.\n\n[!NOTE] This can get you into permissions problems when switching back and for\nbetween using `cargo test` and `sudo cargo test`.\nTo fix that run `sudo cargo clean` and then build or test as you prefer.\n\nIn order to have tests pass when run as `root` or not, some tests need to check if they are `root`\nat run-time (using our own `am_root()` function is handy) and avoid failing if *not* run as `root`.\n\n### Using `act` to run GH Actions locally\nIf you develop on macos but want to ensure code builds and tests pass on linux while making changes,\nyou can use the [act](https://github.com/nektos/act) tool to run the Github Actions Workflows on\nthe test matrix.\n\nJust install `act` (`brew install act` on macOS) (previously install docker if you don't have it already,\nand make sure the daemon is running) then run `act push`. You can test a subset of the rust \nand os versions of the matrix with something like `act push --matrix os:ubuntu-latest`\n\n## Enter the matrix\nIf you want to test locally as much of the test matrix as possible (different OS and\nversions of rust), that you can use `make matrix`. On macos, if you have `act`\ninstalled, it will use it to run the linux part of the matrix.\n\n### Macos: clang detection and header file finding\nNewer versions of `bindgen` have improved the detection of `clang` and hence macos header files.\nIf you also have llvm/clang installed directly or via `brew` this may cause the build to fail saying it\ncannot find `libproc.h`. This can be fixed by setting `CLANG_PATH=\"/usr/bin/clang\"` so that `bindgen`\ndetects the Xcode version and hence can fidn the correct header files.\n\n# Other docs\n* [Reference docs](doc/References.md) used to build and document libproc-rs\n* Details on methods available in different [macOS versions](doc/MacosVersions.md)\n\n# LICENSE\nThis code is licensed under MIT license (see LICENCE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewdavidmackenzie%2Flibproc-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewdavidmackenzie%2Flibproc-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewdavidmackenzie%2Flibproc-rs/lists"}