{"id":13648525,"url":"https://github.com/sunfishcode/c-ward","last_synced_at":"2025-04-14T04:57:32.653Z","repository":{"id":194151275,"uuid":"690124864","full_name":"sunfishcode/c-ward","owner":"sunfishcode","description":"An implementation of libc written in Rust","archived":false,"fork":false,"pushed_at":"2025-03-07T00:05:57.000Z","size":645,"stargazers_count":283,"open_issues_count":4,"forks_count":11,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-07T02:06:34.150Z","etag":null,"topics":["libc","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunfishcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2023-09-11T15:20:14.000Z","updated_at":"2025-04-05T00:00:17.000Z","dependencies_parsed_at":"2024-06-04T17:21:18.190Z","dependency_job_id":"e4f7258c-d7f6-44e5-8aae-adea2b754dc4","html_url":"https://github.com/sunfishcode/c-ward","commit_stats":{"total_commits":349,"total_committers":9,"mean_commits":38.77777777777778,"dds":"0.034383954154727836","last_synced_commit":"79ef7df43c9600ebf45daff755edc4b8a419f747"},"previous_names":["sunfishcode/c-ward"],"tags_count":202,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fc-ward","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fc-ward/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fc-ward/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fc-ward/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunfishcode","download_url":"https://codeload.github.com/sunfishcode/c-ward/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824655,"owners_count":21167344,"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":["libc","rust"],"created_at":"2024-08-02T01:04:19.520Z","updated_at":"2025-04-14T04:57:32.616Z","avatar_url":"https://github.com/sunfishcode.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003ec-ward\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eAn implementation of libc written in Rust\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/sunfishcode/c-ward/actions?query=workflow%3ACI\"\u003e\u003cimg src=\"https://github.com/sunfishcode/c-ward/workflows/CI/badge.svg\" alt=\"Github Actions CI Status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://bytecodealliance.zulipchat.com/#narrow/stream/206238-general\"\u003e\u003cimg src=\"https://img.shields.io/badge/zulip-join_chat-brightgreen.svg\" alt=\"zulip chat\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/c-gull\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/c-gull.svg\" alt=\"crates.io page\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/c-scape\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/c-scape.svg\" alt=\"crates.io page\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/c-gull\"\u003e\u003cimg src=\"https://docs.rs/c-gull/badge.svg\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/c-scape\"\u003e\u003cimg src=\"https://docs.rs/c-scape/badge.svg\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nc-ward is an implementation of the libc ABI written in Rust.\n\nIt consists of two crates:\n - [c-scape], which is `no_std`, and\n - [c-gull], which pulls in c-scape and additionally provides features\n   using `std`.\n\nIt is a goal of c-ward to be a C ABI layer on top of Rust-idomatic libraries,\nrather than to have significant implementation code of its own.\n\nIn theory c-ward could be extended to be ABI-compatible with different\nplatforms, however currently it is only known to be ABI-compatible with\n\\*-unknown-linux-gnu\\* platforms.\n\nThe primary way this is used is through [Mustang] and [Eyra], as their libc\nimplementations. It can also be used as a regular library in\n[\"coexist-with-libc\" mode].\n\n## Runtime requirements\n\nResolving users and DNS records requires the execution of `getent` which\nprints the entries on stdout. On a regular glibc system the `getent`\nbinary is provided by it and uses the NSS setup as usual.\nSimilar, a musl system also provides `getent` (but does not use NSS).\n\n## Similar crates\n\nAnother libc implementation is [relibc]. [tinyrlibc] is a very minimal set of\nlibc functions for bare-metal embedded platforms.\n\n## Where's the `#![no_builtins]`?\n\nNormally, a libc implementation would use `#[no_builtins]` to prevent compilers\nfrom noticing the bodies of libc functions implement the semantics of libc\nfunctions and replacing them with calls, which effectively makes them uselessly\nrecursive calls to themselves.\n\nHowever, `#[no_builtins]` is too pessimistic, because we don't need to disable\nall pattern matching, just these specific cases.\n\nSo instead, c-scape and c-gull are just careful to avoid open-coding functions\nwhich are known to get pattern-matched into builtins.\n\n[c-scape]: https://github.com/sunfishcode/c-ward/tree/main/c-scape#readme\n[c-gull]: https://github.com/sunfishcode/c-ward/tree/main/c-gull#readme\n[relibc]: https://gitlab.redox-os.org/redox-os/relibc/\n[tinyrlibc]: https://github.com/rust-embedded-community/tinyrlibc\n[Mustang]: https://github.com/sunfishcode/mustang#readme\n[Eyra]: https://github.com/sunfishcode/eyra#readme\n[\"coexist-with-libc\" mode]: https://github.com/sunfishcode/c-ward/blob/main/example-crates/libc-replacement#readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunfishcode%2Fc-ward","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunfishcode%2Fc-ward","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunfishcode%2Fc-ward/lists"}