{"id":37042347,"url":"https://github.com/getargv/getargv.cs","last_synced_at":"2026-01-14T04:59:46.131Z","repository":{"id":158260362,"uuid":"633501851","full_name":"getargv/getargv.cs","owner":"getargv","description":"C# bindings for libgetargv","archived":false,"fork":false,"pushed_at":"2025-10-03T19:27:52.000Z","size":251,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T21:30:29.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://getargv.github.io/getargv.cs/Getargv.xml","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getargv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-27T16:29:41.000Z","updated_at":"2025-10-03T19:27:55.000Z","dependencies_parsed_at":"2025-09-23T13:32:13.695Z","dependency_job_id":null,"html_url":"https://github.com/getargv/getargv.cs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/getargv/getargv.cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getargv%2Fgetargv.cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getargv%2Fgetargv.cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getargv%2Fgetargv.cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getargv%2Fgetargv.cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getargv","download_url":"https://codeload.github.com/getargv/getargv.cs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getargv%2Fgetargv.cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28410040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T04:59:45.555Z","updated_at":"2026-01-14T04:59:46.115Z","avatar_url":"https://github.com/getargv.png","language":"C#","funding_links":["https://github.com/sponsors/CamJN"],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\u003cimg src=\"logo.svg\" width=\"200\" alt=\"getargv\"\u003e\u003c/h1\u003e\n\n[![.NET](https://github.com/getargv/getargv.cs/actions/workflows/dotnet.yml/badge.svg)](https://github.com/getargv/getargv.cs/actions/workflows/dotnet.yml)\n\n`libgetargv` is a library that allows you to get the arguments that were passed to another running process on macOS. It is intended to provide roughly the same functionality as reading from `/proc/\u003cpid\u003e/cmdline` on Linux. On macOS this is done by parsing the output of the `KERN_PROCARGS2` sysctl, which is \u003cabbr title=\"always, in my observation\"\u003every often\u003c/abbr\u003e implemented [incorrectly](https://getargv.narzt.cam/hallofshame.html), due to the overlooked possibility of leading empty arguments passed to the target process. This package is the C# bindings for the `libgetargv` library.\n\n## Permissions\n\n`libgetargv` can only see processes running as the same user by default, so be sure your process runs as the desired user (`setuid`, [`launchd.plist`](x-man-page://launchd.plist), [`sudo`](x-man-page://sudo)) or can [elevate privileges](https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html); n.b. elevating privileges safely is [extremely complicated](https://developer.apple.com/forums/thread/708765), and will be a target of privilege escalation attacks on macOS so be extremely careful if you go this route, better to defer to the user to elevate privileges for you as needed.\n\n## System Requirements\n\nmacOS is required as this is a macOS specific `sysctl`, even BSD does not implement it. Your system must support `sysctl` and `KERN_PROCARGS2`, which probably means macOS [10.3](https://github.com/CamJN/xnu/blob/b52f6498893f78b034e2e00b86a3e146c3720649/bsd/sys/sysctl.h#L332) or later, though I haven't tested versions older than 10.7. You'll also need a non-ancient clang (c99 is required) or you'll have to override the compiler flags with `CC`, `EXTRA_CPPFLAGS`, and `EXTRA_CFLAGS`.\n\n## Building `getargv.cs`\n\nTo make `getargv.cs`:\n\n - Install `libgetargv` to your system (see below).\n - Clone this repo and run `dotnet build` or\n - Add a `\u003cPackageReference\u003e` entry to the `\u003cItemGroup\u003e` property in your `.csproj` file: `\u003cPackageReference Include=\"Getargv\" Version=\"0.1.1\" /\u003e`\n\n## Installing `libgetargv`\n\nTo get access to `libgetargv`, sign up for an appropriate [sponsorship tier](https://github.com/sponsors/CamJN).\n\nClone the `libgetargv` repo: `git clone https://github.com/getargv/getargv.git`.\n\nRunning `make install_dylib`, installs the library to the `/usr/local/` prefix by default; you can change the install location with the `PREFIX` `make` variable: `make PREFIX=/opt install_dylib`.\n\nI'm working on building binary artifacts to install without compilation, using `pkg` installers, however even once that's done, depending on your system, it may still be necessary to compile from source; eg. if you have built your own xnu kernel with a custom `PID_MAX` value.\n\n## Building `libgetargv`\nI've built `libgetargv` on each version of macOS from 10.7 on using only the \u003cabbr title=\"Command Line Tools\"\u003eCLT\u003c/abbr\u003e package, not the full Xcode install. If you need to override variables, do so inside the `make` command, eg: `make EXTRA_CPPFLAGS=-DMACRO EXTRA_CFLAGS=-std=c17 dylib`. Since c# did not exist when 10.6 was current, that should not be a concern for this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetargv%2Fgetargv.cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetargv%2Fgetargv.cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetargv%2Fgetargv.cs/lists"}