Rust libc

From wikinotes
Revision as of 08:14, 9 February 2023 by Will (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

libc bindings

Documentation

crates.io https://crates.io/crates/libc
github https://github.com/rust-lang/libc

Install

# Cargo.toml

[dependencies]
libc = "0.2"

Usage

extern crate libc;

fn stdin_is_tty() -> bool {
    unsafe { libc::isatty(0) != 0 }
}