• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H03-May-2022-250

src/H03-May-2022-61,20455,266

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D01-Jan-197074 65

.cirrus.ymlH A D28-Jun-2019755 2826

.gitignoreH A D28-Jun-201927 54

CONTRIBUTING.mdH A D28-Jun-20192.9 KiB6751

Cargo.tomlH A D01-Jan-19701.4 KiB4440

Cargo.toml.orig-cargoH A D15-Jul-2019988 3631

LICENSE-APACHEH A D26-Feb-201910.6 KiB202169

LICENSE-MITH A D26-Feb-20191 KiB2622

README.mdH A D15-Jul-20193.7 KiB10674

build.rsH A D15-Jul-20192.9 KiB10679

rustfmt.tomlH A D28-Jun-201963 33

README.md

1[![Travis-CI Status]][Travis-CI] [![Appveyor Status]][Appveyor] [![Cirrus-CI Status]][Cirrus-CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License]
2
3libc - Raw FFI bindings to platforms' system libraries
4====
5
6`libc` provides all of the definitions necessary to easily interoperate with C
7code (or "C-like" code) on each of the platforms that Rust supports. This
8includes type definitions (e.g. `c_int`), constants (e.g. `EINVAL`) as well as
9function headers (e.g. `malloc`).
10
11This crate exports all underlying platform types, functions, and constants under
12the crate root, so all items are accessible as `libc::foo`. The types and values
13of all the exported APIs match the platform that libc is compiled for.
14
15More detailed information about the design of this library can be found in its
16[associated RFC][rfc].
17
18[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1291-promote-libc.md
19
20## Usage
21
22Add the following to your `Cargo.toml`:
23
24```toml
25[dependencies]
26libc = "0.2"
27```
28
29## Features
30
31* `std`: by default `libc` links to the standard library. Disable this
32  feature remove this dependency and be able to use `libc` in `#![no_std]`
33  crates.
34
35* `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`.
36  This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`.
37
38* **deprecated**: `use_std` is deprecated, and is equivalent to `std`.
39
40## Rust version support
41
42The minimum supported Rust toolchain version is **Rust 1.13.0** . APIs requiring
43newer Rust features are only available on newer Rust toolchains:
44
45| Feature              | Version |
46|----------------------|---------|
47| `union`              |  1.19.0 |
48| `const mem::size_of` |  1.24.0 |
49| `repr(align)`        |  1.25.0 |
50| `extra_traits`      |  1.25.0 |
51| `core::ffi::c_void`  |  1.30.0 |
52| `repr(packed(N))` |  1.33.0 |
53
54## Platform support
55
56[Platform-specific documentation (master branch)][docs.master].
57
58See
59[`ci/build.sh`](https://github.com/rust-lang/libc/blob/master/ci/build.sh)
60for the platforms on which `libc` is guaranteed to build for each Rust
61toolchain. The test-matrix at [Travis-CI], [Appveyor], and [Cirrus-CI] show the
62platforms in which `libc` tests are run.
63
64<div class="platform_docs"></div>
65
66## License
67
68This project is licensed under either of
69
70* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
71  ([LICENSE-APACHE](LICENSE-APACHE))
72
73* [MIT License](http://opensource.org/licenses/MIT)
74  ([LICENSE-MIT](LICENSE-MIT))
75
76at your option.
77
78## Contributing
79
80We welcome all people who want to contribute. Please see the [contributing
81instructions] for more information.
82
83[contributing instructions]: CONTRIBUTING.md
84
85Contributions in any form (issues, pull requests, etc.) to this project
86must adhere to Rust's [Code of Conduct].
87
88[Code of Conduct]: https://www.rust-lang.org/en-US/conduct.html
89
90Unless you explicitly state otherwise, any contribution intentionally submitted
91for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be
92dual licensed as above, without any additional terms or conditions.
93
94[Travis-CI]: https://travis-ci.com/rust-lang/libc
95[Travis-CI Status]: https://travis-ci.com/rust-lang/libc.svg?branch=master
96[Appveyor]: https://ci.appveyor.com/project/rust-lang-libs/libc
97[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true
98[Cirrus-CI]: https://cirrus-ci.com/github/rust-lang/libc
99[Cirrus-CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg
100[crates.io]: https://crates.io/crates/libc
101[Latest Version]: https://img.shields.io/crates/v/libc.svg
102[Documentation]: https://docs.rs/libc/badge.svg
103[docs.rs]: https://docs.rs/libc
104[License]: https://img.shields.io/crates/l/libc.svg
105[docs.master]: https://rust-lang.github.io/libc/#platform-specific-documentation
106