Home
last modified time | relevance | path

Searched refs:libc (Results 1 - 25 of 357) sorted by relevance

12345678910>>...15

/third_party/rust/crates/nix/src/
H A Derrno.rs3 use libc::{c_int, c_void};
14 libc::__error() in errno_location()
20 libc::__errno() in errno_location()
27 libc::__errno_location() in errno_location()
31 libc::___errno() in errno_location()
35 libc::_errnop() in errno_location()
112 impl ErrnoSentinel for libc::sighandler_t {
114 libc::SIG_ERR in sentinel()
1125 EPERM = libc::EPERM,
1126 ENOENT = libc
[all...]
H A Dunistd.rs1 //! Safe wrappers around functions found in libc "unistd.h" header
26 use libc::{
264 /// write(libc::STDOUT_FILENO, "I'm a new child process\n".as_bytes()).ok();
265 /// unsafe { libc::_exit(0) };
294 let res = libc::fork(); in fork()
309 Pid(unsafe { libc::getpid() }) in getpid()
319 Pid(unsafe { libc::getppid() }) // no error handling, according to man page: "These functions are always successful." in getppid()
333 let res = unsafe { libc::setpgid(pid.into(), pgid.into()) }; in setpgid()
338 let res = unsafe { libc::getpgid(pid.unwrap_or(Pid(0)).into()) }; in getpgid()
346 Errno::result(unsafe { libc in setsid()
[all...]
H A Dtime.rs12 use libc::{self, clockid_t};
80 pub const CLOCK_BOOTTIME: ClockId = ClockId(libc::CLOCK_BOOTTIME);
89 ClockId(libc::CLOCK_BOOTTIME_ALARM);
90 pub const CLOCK_MONOTONIC: ClockId = ClockId(libc::CLOCK_MONOTONIC);
99 ClockId(libc::CLOCK_MONOTONIC_COARSE);
103 ClockId(libc::CLOCK_MONOTONIC_FAST);
107 ClockId(libc::CLOCK_MONOTONIC_PRECISE);
115 pub const CLOCK_MONOTONIC_RAW: ClockId = ClockId(libc::CLOCK_MONOTONIC_RAW);
129 ClockId(libc::CLOCK_PROCESS_CPUTIME_ID);
132 pub const CLOCK_PROF: ClockId = ClockId(libc
[all...]
H A Dmqueue.rs37 use libc::{self, c_char, mqd_t, size_t};
43 pub struct MQ_OFlag: libc::c_int {
68 mq_attr: libc::mq_attr,
72 // A safer wrapper around libc::mqd_t, which is a pointer on some platforms
88 pub type mq_attr_member_t = libc::c_long;
105 let mut attr = mem::MaybeUninit::<libc::mq_attr>::uninit(); in new()
152 libc::mq_open( in mq_open()
155 mode.bits() as libc::c_int, in mq_open()
156 &mq_attr.mq_attr as *const libc::mq_attr, in mq_open()
159 None => unsafe { libc in mq_open()
[all...]
H A Difaddrs.rs37 fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { in get_ifu_from_sockaddr()
41 fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { in get_ifu_from_sockaddr()
57 unsafe fn workaround_xnu_bug(info: &libc::ifaddrs) -> Option<SockaddrStorage> { in workaround_xnu_bug()
63 let mut dst_sock = mem::MaybeUninit::<libc::sockaddr_storage>::zeroed(); in workaround_xnu_bug()
72 // Initialize ss_len to sizeof(libc::sockaddr_storage). in workaround_xnu_bug()
74 u8::try_from(mem::size_of::<libc::sockaddr_storage>()).unwrap(); in workaround_xnu_bug()
78 &dst_sock as *const libc::sockaddr_storage as *const libc in workaround_xnu_bug()
[all...]
H A Dfcntl.rs2 use libc::{self, c_char, c_int, c_uint, size_t, ssize_t};
198 unsafe { libc::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } in open()
214 unsafe { libc::openat(dirfd, cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } in openat()
228 libc::renameat( in renameat()
266 libc::renameat2( in renameat2()
288 ) -> Result<libc::ssize_t> { in readlink_maybe_at()
294 Some(dirfd) => libc::readlinkat( in readlink_maybe_at()
300 None => libc::readlink( in readlink_maybe_at()
310 let mut v = Vec::with_capacity(libc::PATH_MAX as usize); in inner_readlink()
341 (libc in inner_readlink()
[all...]
H A Dsched.rs16 use libc::{self, c_int, c_void};
113 libc::clone( in clone()
131 let res = unsafe { libc::unshare(flags.bits()) }; in unshare()
140 let res = unsafe { libc::setns(fd, nstype.bits()) }; in setns()
170 /// This is a wrapper around `libc::cpu_set_t`.
175 cpu_set: libc::cpu_set_t,
177 cpu_set: libc::cpuset_t,
194 Ok(unsafe { libc::CPU_ISSET(field, &self.cpu_set) }) in is_set()
205 libc::CPU_SET(field, &mut self.cpu_set); in set()
218 libc in unset()
[all...]
H A Dpoll.rs7 /// This is a wrapper around `libc::pollfd`.
18 pollfd: libc::pollfd,
26 pollfd: libc::pollfd {
79 pub struct PollFlags: libc::c_short {
155 pub fn poll(fds: &mut [PollFd], timeout: libc::c_int) -> Result<libc::c_int> { in poll()
157 libc::poll( in poll()
158 fds.as_mut_ptr() as *mut libc::pollfd, in poll()
159 fds.len() as libc::nfds_t, in poll()
185 ) -> Result<libc in ppoll()
[all...]
/third_party/rust/crates/nix/src/sys/socket/
H A Dsockopt.rs7 use libc::{self, c_int, c_void, socklen_t};
36 /// (`libc::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`),
39 /// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`,
40 /// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`)
54 let res = libc::setsockopt( in set()
81 /// protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc
[all...]
H A Dmod.rs11 use libc::{
73 pub use libc::{cmsghdr, msghdr};
74 pub use libc::{sa_family_t, sockaddr, sockaddr_storage, sockaddr_un};
76 pub use libc::{sockaddr_in, sockaddr_in6};
80 pub use libc::{c_uint, CMSG_SPACE};
94 Stream = libc::SOCK_STREAM,
97 Datagram = libc::SOCK_DGRAM,
102 SeqPacket = libc::SOCK_SEQPACKET,
104 Raw = libc::SOCK_RAW,
108 Rdm = libc
[all...]
H A Daddr.rs41 /// Convert a std::net::Ipv4Addr into the libc form.
43 pub(crate) const fn ipv4addr_to_libc(addr: net::Ipv4Addr) -> libc::in_addr {
44 static_assertions::assert_eq_size!(net::Ipv4Addr, libc::in_addr);
52 /// Convert a std::net::Ipv6Addr into the libc form.
54 pub(crate) const fn ipv6addr_to_libc(addr: &net::Ipv6Addr) -> libc::in6_addr {
55 static_assertions::assert_eq_size!(net::Ipv6Addr, libc::in6_addr);
56 // Safe because both are Newtype wrappers around the same libc type
74 Unix = libc::AF_UNIX,
76 Inet = libc::AF_INET,
78 Inet6 = libc
[all...]
/third_party/rust/crates/nix/src/sys/ioctl/
H A Dmod.rs69 //! # use nix::{libc, Result};
71 //! # use nix::libc::c_int as c_int;
75 //! let res = libc::ioctl(fd, request_code_read!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, mem::size_of::<u8>()), data);
125 //! # use nix::libc::TCGETS as TCGETS;
127 //! # use nix::libc::termios as termios;
175 //! # use nix::{libc, Result};
177 //! # use nix::libc::c_int as c_int;
182 //! let res = libc::ioctl(fd,
211 //! # use nix::libc::c_int;
282 /// pub unsafe fn FUNCTION_NAME(fd: libc
[all...]
/third_party/rust/crates/nix/src/sys/
H A Dstatfs.rs30 pub type fsid_t = libc::__fsid_t;
34 pub type fsid_t = libc::fsid_t;
38 type type_of_statfs = libc::statfs64;
40 (fd: libc::c_int, buf: *mut type_of_statfs) -> libc::c_int
41 = libc::fstatfs64;
43 (path: *const libc::c_char, buf: *mut type_of_statfs) -> libc::c_int
44 = libc::statfs64;
46 type type_of_statfs = libc
[all...]
H A Daio.rs38 use libc::{c_void, off_t};
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
95 struct LibcAiocb(libc::aiocb);
126 let p: *mut libc::aiocb = &mut self.aiocb.0; in aio_return()
127 Errno::result(libc::aio_return(p)) in aio_return()
134 libc::aio_cancel(self.aiocb.0.aio_fildes, &mut self.aiocb.0) in cancel()
137 libc in cancel()
[all...]
H A Dsignal.rs23 // Currently there is only one definition of c_int in libc, as well as only one
25 // We would prefer to use the libc::c_int alias in the repr attribute. Unfortunately
404 type SaFlags_t = libc::c_ulong;
406 type SaFlags_t = libc::c_ulong;
408 type SaFlags_t = libc::c_int;
473 sigset: libc::sigset_t
481 let _ = unsafe { libc::sigfillset(sigset.as_mut_ptr()) }; in all()
490 let _ = unsafe { libc::sigemptyset(sigset.as_mut_ptr()) }; in empty()
498 unsafe { libc::sigaddset(&mut self.sigset as *mut libc in add()
[all...]
H A Dwait.rs7 use libc::{self, c_int};
149 libc::WIFEXITED(status) in exited()
153 libc::WEXITSTATUS(status) in exit_status()
157 libc::WIFSIGNALED(status) in signaled()
161 Signal::try_from(libc::WTERMSIG(status)) in term_signal()
165 libc::WCOREDUMP(status) in dumped_core()
169 libc::WIFSTOPPED(status) in stopped()
173 Signal::try_from(libc::WSTOPSIG(status)) in stop_signal()
182 libc::WSTOPSIG(status) == libc in syscall_stop()
[all...]
H A Dsendfile.rs7 use libc::{self, off_t};
35 let ret = unsafe { libc::sendfile(out_fd, in_fd, offset, count) }; in sendfile()
56 offset: Option<&mut libc::off64_t>, in sendfile64()
62 let ret = unsafe { libc::sendfile64(out_fd, in_fd, offset, count) }; in sendfile64()
75 libc::sf_hdtr,
90 libc::sf_hdtr {
94 .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec
100 .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec
114 use libc::c_int;
176 let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc in sendfile()
[all...]
H A Depoll.rs3 use libc::{self, c_int};
33 EpollCtlAdd = libc::EPOLL_CTL_ADD,
34 EpollCtlDel = libc::EPOLL_CTL_DEL,
35 EpollCtlMod = libc::EPOLL_CTL_MOD,
47 event: libc::epoll_event,
53 event: libc::epoll_event { in new()
75 let res = unsafe { libc::epoll_create(1024) }; in epoll_create()
82 let res = unsafe { libc::epoll_create1(flags.bits()) }; in epoll_create1()
103 libc::epoll_ctl(epfd, op as c_int, fd, &mut event.event) in epoll_ctl()
105 libc in epoll_ctl()
[all...]
/third_party/rust/crates/rustix/tests/process/
H A Did.rs7 assert_eq!(process::getuid().as_raw(), libc::getuid()); in test_getuid()
8 assert_eq!(process::getuid().is_root(), libc::getuid() == 0); in test_getuid()
16 assert_eq!(process::getgid().as_raw(), libc::getgid()); in test_getgid()
17 assert_eq!(process::getgid().is_root(), libc::getgid() == 0); in test_getgid()
25 assert_eq!(process::geteuid().as_raw(), libc::geteuid()); in test_geteuid()
26 assert_eq!(process::geteuid().is_root(), libc::geteuid() == 0); in test_geteuid()
34 assert_eq!(process::getegid().as_raw(), libc::getegid()); in test_getegid()
35 assert_eq!(process::getegid().is_root(), libc::getegid() == 0); in test_getegid()
44 process::getpid().as_raw_nonzero().get() as libc::pid_t, in test_getpid()
45 libc in test_getpid()
[all...]
/third_party/musl/scripts/
H A Druntest.sh2 cd /data/tests/libc-test/src
3 rm /data/tests/libc-test/REPORT
4 rm /data/tests/libc-test/FileList.txt
5 rm /data/tests/libc-test/SkipList.txt
6 touch /data/tests/libc-test/REPORT
7 touch /data/tests/libc-test/FileList.txt
8 touch /data/tests/libc-test/SkipList.txt
46 echo $skiped >> /data/tests/libc-test/SkipList.txt
91 echo $file >> /data/tests/libc-test/FileList.txt
92 ./runtest -w '' -t 30 $file >> /data/tests/libc
[all...]
/third_party/musl/src/env/
H A D__init_tls.c8 #include "libc.h"
40 if (!r) libc.can_do_threads = 1; in __init_tp()
44 td->locale = &libc.global_locale; in __init_tp()
49 libc.threaded = 0; in __init_tp()
60 libc.threaded = 1; in __init_tp()
82 dtv = (uintptr_t*)(mem + libc.tls_size) - (libc.tls_cnt + 1); in __copy_tls()
84 mem += -((uintptr_t)mem + sizeof(struct pthread)) & (libc.tls_align-1); in __copy_tls()
88 for (i=1, p=libc.tls_head; p; i++, p=p->next) { in __copy_tls()
97 mem += libc in __copy_tls()
[all...]
/third_party/musl/porting/liteos_a/user/src/env/
H A D__init_tls.c8 #include "libc.h"
38 if (!r) libc.can_do_threads = 1; in __init_tp()
39 libc.threaded = 0; in __init_tp()
43 td->locale = &libc.global_locale; in __init_tp()
58 libc.threaded = 1; in __init_tp()
79 dtv = (uintptr_t*)(mem + libc.tls_size) - (libc.tls_cnt + 1); in __copy_tls()
81 mem += -((uintptr_t)mem + sizeof(struct pthread)) & (libc.tls_align-1); in __copy_tls()
85 for (i=1, p=libc.tls_head; p; i++, p=p->next) { in __copy_tls()
92 mem += libc in __copy_tls()
[all...]
/third_party/rust/crates/rust-openssl/openssl-sys/src/handwritten/
H A Dobject.rs1 use libc::*;
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()
22 oid: *const libc::c_char, in OBJ_create()
23 sn: *const libc::c_char, in OBJ_create()
24 ln: *const libc::c_char, in OBJ_create()
27 pub fn OBJ_length(obj: *const ASN1_OBJECT) -> libc::size_t; in OBJ_length()
/third_party/musl/porting/linux/user/src/env/
H A D__init_tls.c8 #include "libc.h"
20 if (!r) libc.can_do_threads = 1; in __init_tp()
24 td->locale = &libc.global_locale; in __init_tp()
48 dtv = (uintptr_t*)(mem + libc.tls_size) - (libc.tls_cnt + 1); in __copy_tls()
50 mem += -((uintptr_t)mem + sizeof(struct pthread)) & (libc.tls_align-1); in __copy_tls()
54 for (i=1, p=libc.tls_head; p; i++, p=p->next) { in __copy_tls()
63 mem += libc.tls_size - sizeof(struct pthread); in __copy_tls()
64 mem -= (uintptr_t)mem & (libc.tls_align-1); in __copy_tls()
67 for (i=1, p=libc in __copy_tls()
[all...]
/third_party/rust/crates/rustix/tests/param/
H A Dauxv.rs14 assert_eq!(size, unsafe { libc::sysconf(libc::_SC_PAGESIZE) as usize }); in test_page_size()
21 assert_eq!(size, unsafe { libc::sysconf(libc::_SC_CLK_TCK) as u64 }); in test_clock_ticks_per_second()
30 weak!(fn getauxval(libc::c_ulong) -> libc::c_ulong); in test_linux_hwcap()
37 assert_eq!(_hwcap, unsafe { libc_getauxval(libc::AT_HWCAP) } as usize); in test_linux_hwcap()
39 assert_eq!(hwcap2, unsafe { libc_getauxval(libc::AT_HWCAP2) } as usize); in test_linux_hwcap()

Completed in 12 milliseconds

12345678910>>...15