{"id":15019144,"url":"https://github.com/mahkoh/uapi","last_synced_at":"2025-10-24T05:30:29.141Z","repository":{"id":40757664,"uuid":"267389129","full_name":"mahkoh/uapi","owner":"mahkoh","description":"Unix API","archived":false,"fork":false,"pushed_at":"2024-03-12T11:38:04.000Z","size":226,"stargazers_count":27,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T23:41:20.341Z","etag":null,"topics":["ffi","freebsd","linux","macos","openbsd","rust","unix"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mahkoh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T17:53:48.000Z","updated_at":"2024-10-29T19:25:14.000Z","dependencies_parsed_at":"2022-07-29T09:08:57.812Z","dependency_job_id":null,"html_url":"https://github.com/mahkoh/uapi","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahkoh%2Fuapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahkoh%2Fuapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahkoh%2Fuapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahkoh%2Fuapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahkoh","download_url":"https://codeload.github.com/mahkoh/uapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237915423,"owners_count":19386724,"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":["ffi","freebsd","linux","macos","openbsd","rust","unix"],"created_at":"2024-09-24T19:53:03.577Z","updated_at":"2025-10-24T05:30:28.779Z","avatar_url":"https://github.com/mahkoh.png","language":"Rust","readme":"# Unix API\n\n[![crates.io](https://img.shields.io/crates/v/uapi.svg)](http://crates.io/crates/uapi)\n[![docs.rs](https://docs.rs/uapi/badge.svg)](http://docs.rs/uapi)\n\nThis crate contains safe wrappers around Unix APIs.\n\n## Supported Targets\n\nA target is supported if and only if the crate is tested against it via CI.\n\nThe following targets are supported:\n\n- x86_64-unknown-linux-gnu (glibc \u003e= 2.23)\n- x86_64-unknown-linux-musl (musl \u003e= 1.1.19)\n- x86_64-unknown-freebsd (12)\n- x86_64-unknown-openbsd (6.7)\n- x86_64-apple-darwin (10.15)\n\nThis crate contains little architecture-specific code. Therefore, other\narchitectures (arm, aarch64, etc.) will probably also work.\n\n## Future changes\n\nThis crate fully supports reading into uninitialized buffers but the API will\nmost likely change when the same functionality becomes stable in libstd.\n\n## Comparison with other crates\n\n### libc\n\nThis crate builds on the libc crate and uses its declarations of the raw OS APIs\nif possible. This crate considers itself to be the next step up from libc: It\nsafely wraps the raw OS functions but does little beyond that. Integer\nparameters are still integer parameters, functions operating on sockets accept\nthe socket file descriptor as a raw integer, there is no socket wrapper type,\netc.\n\nAt the same time, this crate provides the necessary tools to make it as easy to\nuse from Rust as the raw APIs are to use from C. For example, all of the\nfollowing just work:\n\n```rust\nopen(\"./file\", c::O_RDWR, 0);\nopen(b\"./file\", c::O_RDWR, 0);\nopen(CStr::from_ptr(p), c::O_RDWR, 0);\nopen(Path::new(\"./file\"), c::O_RDWR, 0);\n```\n\nSee the crate documentation for more details.\n\n### nix\n\n- **nix** uses a nested module structure. **uapi** exports all APIs in the crate\n  root.\n- **nix** I/O works on `[u8]`. **uapi** I/O works on `[MaybeUninit\u003cu8\u003e]`.\n- **nix** uses enums and bitflags for integer/flag parameters. **uapi** uses\n  plain integers.\n- **nix** uses methods declared on wrapper types to expose APIs. **uapi** uses\n  free functions unless doing so would be unsafe.\n- **nix** uses enums for the values produced and consumed by certain generic OS\n  APIs (e.g. control messages.) **uapi** uses generic functions that do not\n  restrict the types that can be used.\n\n## License\n\nThis project is licensed under either of\n\n- Apache License, Version 2.0\n- MIT License\n\nat your option.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahkoh%2Fuapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahkoh%2Fuapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahkoh%2Fuapi/lists"}