Home
last modified time | relevance | path

Searched +full:use +full:- +full:libc (Results 1 – 25 of 972) sorted by relevance

12345678910>>...39

/third_party/rust/crates/nix/src/sys/socket/
Dsockopt.rs2 use super::{GetSockOpt, SetSockOpt};
3 use crate::errno::Errno;
4 use crate::sys::time::TimeVal;
5 use crate::Result;
6 use cfg_if::cfg_if;
7 use libc::{self, c_int, c_void, socklen_t};
8 use std::ffi::{OsStr, OsString};
9 use std::{
14 use std::os::unix::ffi::OsStrExt;
15 use std::os::unix::io::RawFd;
[all …]
Daddr.rs15 pub use self::datalink::LinkAddr;
17 pub use self::vsock::VsockAddr;
18 use super::sa_family_t;
19 use crate::errno::Errno;
21 use crate::sys::socket::addr::alg::AlgAddr;
23 use crate::sys::socket::addr::netlink::NetlinkAddr;
28 use crate::sys::socket::addr::sys_control::SysControlAddr;
29 use crate::{NixPath, Result};
30 use cfg_if::cfg_if;
31 use memoffset::offset_of;
[all …]
Dmod.rs3 //! [Further reading](https://man7.org/linux/man-pages/man7/socket.7.html)
6 use crate::sys::time::TimeSpec;
8 use crate::sys::time::TimeVal;
9 use crate::{errno::Errno, Result};
10 use cfg_if::cfg_if;
11 use libc::{
15 use std::convert::{TryFrom, TryInto};
16 use std::io::{IoSlice, IoSliceMut};
18 use std::net;
19 use std::os::unix::io::RawFd;
[all …]
/third_party/rust/crates/nix/
DCONVENTIONS.md3 In order to achieve our goal of wrapping [libc][libc] code in idiomatic rust
16 [kacl]: https://github.com/olivierlacan/keep-a-changelog/tree/18adb5f5be7a898d046f6a4acb93e39dcf40c…
18 ## libc constants, functions and structs
20 We do not define integer constants ourselves, but use or reexport them from the
21 [libc crate][libc].
23 We use the functions exported from [libc][libc] instead of writing our own
26 We use the `struct` definitions from [libc][libc] internally instead of writing
27 our own. If we want to add methods to a libc type, we use the newtype pattern.
31 pub struct SigSet(libc::sigset_t);
38 When creating newtypes, we use Rust's `CamelCase` type naming convention.
[all …]
/third_party/rust/crates/nix/src/
Dfcntl.rs1 use crate::errno::Errno;
2 use libc::{self, c_char, c_int, c_uint, size_t, ssize_t};
3 use std::ffi::OsString;
5 use std::os::raw;
6 use std::os::unix::ffi::OsStringExt;
7 use std::os::unix::io::RawFd;
10 use crate::{sys::stat::Mode, NixPath, Result};
12 use std::ptr; // For splice and copy_file_range
24 pub use self::posix_fadvise::{posix_fadvise, PosixFadviseAdvice};
50 /// Use alternate I/O semantics.
[all …]
Derrno.rs1 use crate::Result;
2 use cfg_if::cfg_if;
3 use libc::{c_int, c_void};
4 use std::convert::TryFrom;
5 use std::{error, fmt, io};
7 pub use self::consts::*;
13 unsafe fn errno_location() -> *mut c_int {
14 libc::__error()
19 unsafe fn errno_location() -> *mut c_int {
20 libc::__errno()
[all …]
Difaddrs.rs6 use cfg_if::cfg_if;
8 use std::convert::TryFrom;
9 use std::ffi;
10 use std::iter::Iterator;
11 use std::mem;
12 use std::option::Option;
14 use crate::net::if_::*;
15 use crate::sys::socket::{SockaddrLike, SockaddrStorage};
16 use crate::{Errno, Result};
31 /// Point-to-point destination address
[all …]
Dunistd.rs1 //! Safe wrappers around functions found in libc "unistd.h" header
3 use crate::errno::{self, Errno};
6 use crate::fcntl::{at_rawfd, AtFlags};
8 use crate::fcntl::{fcntl, FcntlArg::F_SETFD, FdFlag, OFlag};
20 use crate::sys::stat::FileFlag;
22 use crate::sys::stat::Mode;
23 use crate::{Error, NixPath, Result};
25 use cfg_if::cfg_if;
26 use libc::{
30 use std::convert::Infallible;
[all …]
Dtime.rs1 use crate::sys::time::TimeSpec;
10 use crate::unistd::Pid;
11 use crate::{Errno, Result};
12 use libc::{self, clockid_t};
13 use std::mem::MaybeUninit;
24 pub const fn from_raw(clk_id: clockid_t) -> Self { in from_raw()
30 /// Returns `ClockId` of a `pid` CPU-time clock
39 pub fn pid_cpu_clock_id(pid: Pid) -> Result<Self> {
47 pub fn res(self) -> Result<TimeSpec> { in res()
52 pub fn now(self) -> Result<TimeSpec> { in now()
[all …]
Ddir.rs3 use crate::errno::Errno;
4 use crate::fcntl::{self, OFlag};
5 use crate::sys;
6 use crate::{Error, NixPath, Result};
7 use cfg_if::cfg_if;
8 use std::ffi;
9 use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd};
10 use std::ptr;
13 use libc::{dirent64 as dirent, readdir64_r as readdir_r};
16 use libc::{dirent, readdir_r};
[all …]
Dmqueue.rs7 //! # use std::ffi::CString;
8 //! # use nix::mqueue::*;
9 //! use nix::sys::stat::Mode;
31 //! [Further reading and details on the C API](https://man7.org/linux/man-pages/man7/mq_overview.7.…
33 use crate::errno::Errno;
34 use crate::Result;
36 use crate::sys::stat::Mode;
37 use libc::{self, c_char, mqd_t, size_t};
38 use std::ffi::CStr;
39 use std::mem;
[all …]
/third_party/rust/crates/nix/src/sys/ioctl/
Dmod.rs3 //! This library is pretty low-level and messy. `ioctl` is not fun.
8 //! The `ioctl` syscall is the grab-bag syscall on POSIX systems. Don't want to add a new
15 //! * Provide read/write access to out-of-band data related to a device such as configuration
17 //! * Provide a mechanism for performing full-duplex data transfers (for instance, xfer on SPI
29 //! Historically `ioctl` numbers were arbitrary hard-coded values. In Linux (before 2.6) and some
30 //! unices this has changed to a more-ordered system where the ioctl numbers are partitioned into
32 …`Documentation/ioctl/ioctl-number.rst`](https://elixir.bootlin.com/linux/latest/source/Documentati…
40 //! preferring to use the 4 components above to generate the final ioctl identifier. Because of
41 //! how old `ioctl`s are, however, there are many hard-coded `ioctl` identifiers. These are
54 //! macro, we know it's a `read` ioctl and can use the `ioctl_read!` macro as follows:
[all …]
/third_party/rust/crates/rustix/
DCargo.toml8 description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls"
10 license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
14 categories = ["os::unix-apis", "date-and-time", "filesystem", "network-programming"]
16 rust-version = "1.48"
18 [build-dependencies]
23 itoa = { version = "1.0.1", default-features = false, optional = true }
24 io-lifetimes = { version = "1.0.0", default-features = false, features = ["close"], optional = true…
26 # Special dependencies used in rustc-dep-of-std mode.
27 core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
28 alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
[all …]
/third_party/rust/crates/rustix/tests/
Dbackends.rs1 use std::process::Command;
6 // ensure that the use-default crate uses it. in test_backends()
11 "test-crates/use-default", in test_backends()
15 "linux-raw-sys" in test_backends()
17 "use-default does not depend on linux-raw-sys" in test_backends()
22 // ensure that the use-rustix-auxv crate uses it, and does not use libc. in test_backends()
25 // TODO: Re-enable this test once io-lifetimes can depend on Rust 1.63 in test_backends()
26 // and always use std, so it can drop its libc dependency. in test_backends()
30 "test-crates/use-rustix-auxv", in test_backends()
34 "libc" in test_backends()
[all …]
/third_party/rust/crates/rustix/src/backend/linux_raw/param/
Dlibc_auxv.rs1 //! Linux auxv support, using libc.
5 //! This uses raw pointers to locate and read the kernel-provided auxv array.
9 use super::super::c;
10 use super::super::elf::*;
12 use crate::ffi::CStr;
14 use core::slice;
18 pub(crate) fn page_size() -> usize { in page_size()
19 unsafe { libc::sysconf(libc::_SC_PAGESIZE) as usize } in page_size()
24 pub(crate) fn clock_ticks_per_second() -> u64 { in clock_ticks_per_second()
25 unsafe { libc::getauxval(libc::AT_CLKTCK) as u64 } in clock_ticks_per_second()
[all …]
/third_party/rust/crates/nix/src/sys/
Dsignal.rs2 // See https://www.rust-lang.org/policies/licenses.
6 use crate::errno::Errno;
7 use crate::{Error, Result};
8 use cfg_if::cfg_if;
9 use std::fmt;
10 use std::mem;
12 use std::os::unix::io::RawFd;
13 use std::ptr;
14 use std::str::FromStr;
18 pub use self::sigevent::*;
[all …]
Dstatfs.rs1 //! Get filesystem statistics, non-portably
5 use std::ffi::CStr;
6 use std::fmt::{self, Debug};
7 use std::mem;
8 use std::os::unix::io::AsRawFd;
10 use cfg_if::cfg_if;
22 use crate::mount::MntFlags;
24 use crate::sys::statvfs::FsFlags;
25 use crate::{errno::Errno, NixPath, Result};
30 pub type fsid_t = libc::__fsid_t;
[all …]
Duio.rs3 use crate::errno::Errno;
4 use crate::Result;
5 use libc::{self, c_int, c_void, off_t, size_t};
6 use std::io::{IoSlice, IoSliceMut};
7 use std::marker::PhantomData;
8 use std::os::unix::io::RawFd;
10 /// Low-level vectored write to a raw file descriptor
13 pub fn writev(fd: RawFd, iov: &[IoSlice<'_>]) -> Result<usize> { in writev()
22 libc::writev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) in writev() constant
28 /// Low-level vectored read from a raw file descriptor
[all …]
Depoll.rs1 use crate::errno::Errno;
2 use crate::Result;
3 use libc::{self, c_int};
4 use std::mem;
5 use std::os::unix::io::RawFd;
6 use std::ptr;
33 EpollCtlAdd = libc::EPOLL_CTL_ADD,
34 EpollCtlDel = libc::EPOLL_CTL_DEL,
35 EpollCtlMod = libc::EPOLL_CTL_MOD,
47 event: libc::epoll_event,
[all …]
Dwait.rs2 use crate::errno::Errno;
3 use crate::sys::signal::Signal;
4 use crate::unistd::Pid;
5 use crate::Result;
6 use cfg_if::cfg_if;
7 use libc::{self, c_int};
8 use std::convert::TryFrom;
13 use std::os::unix::io::RawFd;
84 /// Note that there are two Linux-specific enum variants, `PtraceEvent`
105 /// currently-defined events use `SIGTRAP` as the signal; the third
[all …]
Daio.rs4 //! The POSIX AIO interface is used for asynchronous I/O on files and disk-like
27 use std::io::{IoSlice, IoSliceMut};
28 use std::{
38 use libc::{c_void, off_t};
39 use pin_utils::unsafe_pinned;
41 use crate::{
85 AioCanceled = libc::AIO_CANCELED,
88 AioNotCanceled = libc::AIO_NOTCANCELED,
90 AioAllDone = libc::AIO_ALLDONE,
93 /// Newtype that adds Send and Sync to libc::aiocb, which contains raw pointers
[all …]
/third_party/rust/crates/rustix/src/backend/libc/
Dmod.rs1 //! The libc backend.
3 //! On most platforms, this uses the `libc` crate to make system calls. On
4 //! Windows, this uses the Winsock2 API in `windows-sys`, which can be adapted
5 //! to have a very `libc`-like interface.
8 // calls. For now, set this to allow for the libc backend.
10 // Lots of libc types vary between platforms, so we often need a `.into()` on
26 pub(crate) use super::c::c_int as LibcFd;
27 pub use crate::io::fd::*;
31 pub use super::io_lifetimes::*;
36 pub use io_lifetimes::*;
[all …]
/third_party/rust/crates/libc/
DREADME.md1 # libc - Raw FFI bindings to platforms' system libraries
5 `libc` provides all of the definitions necessary to easily interoperate with C
6 code (or "C-like" code) on each of the platforms that Rust supports. This
11 the crate root, so all items are accessible as `libc::foo`. The types and values
12 of all the exported APIs match the platform that libc is compiled for.
17 [rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md
23 For v0.2, please submit PRs to the `libc-0.2` branch instead.
26 See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
34 libc = "0.2"
39 * `std`: by default `libc` links to the standard library. Disable this
[all …]
/third_party/skia/buildtools/third_party/libc++/
DBUILD.gn2 # Use of this source code is governed by a BSD-style license that can be
9 # Used by libc++ and libc++abi.
11 cflags = [ "-fstrict-aliasing" ]
14 # libc++ wants to redefine the macros WIN32_LEAN_AND_MEAN and _CRT_RAND_S in
16 "-Wno-macro-redefined",
18 # We want to use a uniform C++ version across all of chromium, but
19 # upstream libc++ requires C++17 so we have to make an exception here.
20 "-std:c++17",
24 "-fPIC",
25 "-std=c++17",
[all …]
/third_party/rust/crates/rust-openssl/openssl-sys/src/handwritten/
Dobject.rs1 use libc::*;
3 use super::super::*;
6 pub fn OBJ_nid2ln(nid: c_int) -> *const c_char; in OBJ_nid2ln()
7 pub fn OBJ_nid2sn(nid: c_int) -> *const c_char; in OBJ_nid2sn()
8 pub fn OBJ_nid2obj(n: c_int) -> *mut ASN1_OBJECT; in OBJ_nid2obj()
9 pub fn OBJ_obj2nid(o: *const ASN1_OBJECT) -> c_int; in OBJ_obj2nid()
15 ) -> c_int; in OBJ_obj2txt()
18 -> c_int; in OBJ_find_sigid_algs()
19 pub fn OBJ_sn2nid(sn: *const libc::c_char) -> libc::c_int; in OBJ_sn2nid()
20 pub fn OBJ_txt2obj(s: *const libc::c_char, no_name: libc::c_int) -> *mut ASN1_OBJECT; in OBJ_txt2obj()
[all …]

12345678910>>...39