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

..03-May-2022-

src/H03-May-2022-55,35149,844

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

.cargo_vcs_info.jsonH A D01-Jan-197074 65

.cirrus.ymlH A D21-Feb-2019351 1513

.gitignoreH A D21-Feb-201927 54

CONTRIBUTING.mdH A D21-Feb-20192.9 KiB6751

Cargo.tomlH A D01-Jan-19701.4 KiB4339

Cargo.toml.orig-cargoH A D21-Feb-2019933 3429

LICENSE-APACHEH A D21-Feb-201910.6 KiB202169

LICENSE-MITH A D21-Feb-20191 KiB2622

README.mdH A D21-Feb-20193.7 KiB10473

build.rsH A D21-Feb-20191.9 KiB6646

rustfmt.tomlH A D21-Feb-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* `use_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## Rust version support
39
40The minimum supported Rust toolchain version is **Rust 1.13.0** . APIs requiring
41newer Rust features are only available on newer Rust toolchains:
42
43| Feature              | Version |
44|----------------------|---------|
45| `union`              |  1.19.0 |
46| `const mem::size_of` |  1.24.0 |
47| `repr(align)`        |  1.25.0 |
48| `extra_traits`      |  1.25.0 |
49| `core::ffi::c_void`  |  1.30.0 |
50| `repr(packed(N))` |  1.33.0 |
51
52## Platform support
53
54[Platform-specific documentation (master branch)][docs.master].
55
56See
57[`ci/build.sh`](https://github.com/rust-lang/libc/blob/master/libc-test/build.rs)
58for the platforms on which `libc` is guaranteed to build for each Rust
59toolchain. The test-matrix at [Travis-CI], [Appveyor], and [Cirrus-CI] show the
60platforms in which `libc` tests are run.
61
62<div class="platform_docs"></div>
63
64## License
65
66This project is licensed under either of
67
68* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
69  ([LICENSE-APACHE](LICENSE-APACHE))
70
71* [MIT License](http://opensource.org/licenses/MIT)
72  ([LICENSE-MIT](LICENSE-MIT))
73
74at your option.
75
76## Contributing
77
78We welcome all people who want to contribute. Please see the [contributing
79instructions] for more information.
80
81[contributing instructions]: CONTRIBUTING.md
82
83Contributions in any form (issues, pull requests, etc.) to this project
84must adhere to Rust's [Code of Conduct].
85
86[Code of Conduct]: https://www.rust-lang.org/en-US/conduct.html
87
88Unless you explicitly state otherwise, any contribution intentionally submitted
89for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be
90dual licensed as above, without any additional terms or conditions.
91
92[Travis-CI]: https://travis-ci.com/rust-lang/libc
93[Travis-CI Status]: https://travis-ci.com/rust-lang/libc.svg?branch=master
94[Appveyor]: https://ci.appveyor.com/project/rust-lang-libs/libc
95[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true
96[Cirrus-CI]: https://cirrus-ci.com/github/rust-lang/libc
97[Cirrus-CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg
98[crates.io]: https://crates.io/crates/libc
99[Latest Version]: https://img.shields.io/crates/v/libc.svg
100[Documentation]: https://docs.rs/libc/badge.svg
101[docs.rs]: https://docs.rs/libc
102[License]: https://img.shields.io/crates/l/libc.svg
103[docs.master]: https://rust-lang.github.io/libc/#platform-specific-documentation
104