🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

libc

Package Overview
Dependencies
Maintainers
0
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libc - cargo Package Compare versions

Comparing version
1.0.0-alpha.2
to
1.0.0-alpha.3
+73
src/new/linux_uapi/linux/can/error.rs
//! Header: `linux/can/error.h`
pub use crate::linux::can::*;
pub const CAN_ERR_DLC: c_int = 8;
pub const CAN_ERR_TX_TIMEOUT: c_uint = 0x00000001;
pub const CAN_ERR_LOSTARB: c_uint = 0x00000002;
pub const CAN_ERR_CRTL: c_uint = 0x00000004;
pub const CAN_ERR_PROT: c_uint = 0x00000008;
pub const CAN_ERR_TRX: c_uint = 0x00000010;
pub const CAN_ERR_ACK: c_uint = 0x00000020;
pub const CAN_ERR_BUSOFF: c_uint = 0x00000040;
pub const CAN_ERR_BUSERROR: c_uint = 0x00000080;
pub const CAN_ERR_RESTARTED: c_uint = 0x00000100;
pub const CAN_ERR_CNT: c_uint = 0x00000200;
pub const CAN_ERR_LOSTARB_UNSPEC: c_int = 0x00;
pub const CAN_ERR_CRTL_UNSPEC: c_int = 0x00;
pub const CAN_ERR_CRTL_RX_OVERFLOW: c_int = 0x01;
pub const CAN_ERR_CRTL_TX_OVERFLOW: c_int = 0x02;
pub const CAN_ERR_CRTL_RX_WARNING: c_int = 0x04;
pub const CAN_ERR_CRTL_TX_WARNING: c_int = 0x08;
pub const CAN_ERR_CRTL_RX_PASSIVE: c_int = 0x10;
pub const CAN_ERR_CRTL_TX_PASSIVE: c_int = 0x20;
pub const CAN_ERR_CRTL_ACTIVE: c_int = 0x40;
pub const CAN_ERR_PROT_UNSPEC: c_int = 0x00;
pub const CAN_ERR_PROT_BIT: c_int = 0x01;
pub const CAN_ERR_PROT_FORM: c_int = 0x02;
pub const CAN_ERR_PROT_STUFF: c_int = 0x04;
pub const CAN_ERR_PROT_BIT0: c_int = 0x08;
pub const CAN_ERR_PROT_BIT1: c_int = 0x10;
pub const CAN_ERR_PROT_OVERLOAD: c_int = 0x20;
pub const CAN_ERR_PROT_ACTIVE: c_int = 0x40;
pub const CAN_ERR_PROT_TX: c_int = 0x80;
pub const CAN_ERR_PROT_LOC_UNSPEC: c_int = 0x00;
pub const CAN_ERR_PROT_LOC_SOF: c_int = 0x03;
pub const CAN_ERR_PROT_LOC_ID28_21: c_int = 0x02;
pub const CAN_ERR_PROT_LOC_ID20_18: c_int = 0x06;
pub const CAN_ERR_PROT_LOC_SRTR: c_int = 0x04;
pub const CAN_ERR_PROT_LOC_IDE: c_int = 0x05;
pub const CAN_ERR_PROT_LOC_ID17_13: c_int = 0x07;
pub const CAN_ERR_PROT_LOC_ID12_05: c_int = 0x0F;
pub const CAN_ERR_PROT_LOC_ID04_00: c_int = 0x0E;
pub const CAN_ERR_PROT_LOC_RTR: c_int = 0x0C;
pub const CAN_ERR_PROT_LOC_RES1: c_int = 0x0D;
pub const CAN_ERR_PROT_LOC_RES0: c_int = 0x09;
pub const CAN_ERR_PROT_LOC_DLC: c_int = 0x0B;
pub const CAN_ERR_PROT_LOC_DATA: c_int = 0x0A;
pub const CAN_ERR_PROT_LOC_CRC_SEQ: c_int = 0x08;
pub const CAN_ERR_PROT_LOC_CRC_DEL: c_int = 0x18;
pub const CAN_ERR_PROT_LOC_ACK: c_int = 0x19;
pub const CAN_ERR_PROT_LOC_ACK_DEL: c_int = 0x1B;
pub const CAN_ERR_PROT_LOC_EOF: c_int = 0x1A;
pub const CAN_ERR_PROT_LOC_INTERM: c_int = 0x12;
pub const CAN_ERR_TRX_UNSPEC: c_int = 0x00;
pub const CAN_ERR_TRX_CANH_NO_WIRE: c_int = 0x04;
pub const CAN_ERR_TRX_CANH_SHORT_TO_BAT: c_int = 0x05;
pub const CAN_ERR_TRX_CANH_SHORT_TO_VCC: c_int = 0x06;
pub const CAN_ERR_TRX_CANH_SHORT_TO_GND: c_int = 0x07;
pub const CAN_ERR_TRX_CANL_NO_WIRE: c_int = 0x40;
pub const CAN_ERR_TRX_CANL_SHORT_TO_BAT: c_int = 0x50;
pub const CAN_ERR_TRX_CANL_SHORT_TO_VCC: c_int = 0x60;
pub const CAN_ERR_TRX_CANL_SHORT_TO_GND: c_int = 0x70;
pub const CAN_ERR_TRX_CANL_SHORT_TO_CANH: c_int = 0x80;
pub const CAN_ERROR_WARNING_THRESHOLD: c_int = 96;
pub const CAN_ERROR_PASSIVE_THRESHOLD: c_int = 128;
pub const CAN_BUS_OFF_THRESHOLD: c_int = 256;
use crate::bpf_insn;
pub const BPF_LD: u16 = 0x00;
pub const BPF_LDX: u16 = 0x01;
pub const BPF_ST: u16 = 0x02;
pub const BPF_STX: u16 = 0x03;
pub const BPF_ALU: u16 = 0x04;
pub const BPF_JMP: u16 = 0x05;
pub const BPF_RET: u16 = 0x06;
pub const BPF_MISC: u16 = 0x07;
pub const BPF_W: u16 = 0x00;
pub const BPF_H: u16 = 0x08;
pub const BPF_B: u16 = 0x10;
pub const BPF_IMM: u16 = 0x00;
pub const BPF_ABS: u16 = 0x20;
pub const BPF_IND: u16 = 0x40;
pub const BPF_MEM: u16 = 0x60;
pub const BPF_LEN: u16 = 0x80;
pub const BPF_MSH: u16 = 0xa0;
pub const BPF_ADD: u16 = 0x00;
pub const BPF_SUB: u16 = 0x10;
pub const BPF_MUL: u16 = 0x20;
pub const BPF_DIV: u16 = 0x30;
pub const BPF_OR: u16 = 0x40;
pub const BPF_AND: u16 = 0x50;
pub const BPF_LSH: u16 = 0x60;
pub const BPF_RSH: u16 = 0x70;
pub const BPF_NEG: u16 = 0x80;
pub const BPF_MOD: u16 = 0x90;
pub const BPF_XOR: u16 = 0xa0;
pub const BPF_JA: u16 = 0x00;
pub const BPF_JEQ: u16 = 0x10;
pub const BPF_JGT: u16 = 0x20;
pub const BPF_JGE: u16 = 0x30;
pub const BPF_JSET: u16 = 0x40;
pub const BPF_K: u16 = 0x00;
pub const BPF_X: u16 = 0x08;
pub const BPF_A: u16 = 0x10;
pub const BPF_TAX: u16 = 0x00;
pub const BPF_TXA: u16 = 0x80;
f! {
pub fn BPF_CLASS(code: u32) -> u32 {
code & 0x07
}
pub fn BPF_SIZE(code: u32) -> u32 {
code & 0x18
}
pub fn BPF_MODE(code: u32) -> u32 {
code & 0xe0
}
pub fn BPF_OP(code: u32) -> u32 {
code & 0xf0
}
pub fn BPF_SRC(code: u32) -> u32 {
code & 0x08
}
pub fn BPF_RVAL(code: u32) -> u32 {
code & 0x18
}
pub fn BPF_MISCOP(code: u32) -> u32 {
code & 0xf8
}
pub fn BPF_STMT(code: u16, k: u32) -> bpf_insn {
bpf_insn {
code,
jt: 0,
jf: 0,
k,
}
}
pub fn BPF_JUMP(code: u16, k: u32, jt: u8, jf: u8) -> bpf_insn {
bpf_insn { code, jt, jf, k }
}
}
use crate::prelude::*;
s_no_extra_traits! {
pub union __c_anonymous_ifr_ifru {
pub ifru_addr: crate::sockaddr,
pub ifru_dstaddr: crate::sockaddr,
pub ifru_broadaddr: crate::sockaddr,
pub ifru_buffer: ifreq_buffer,
pub ifru_flags: [c_short; 2],
pub ifru_index: c_short,
pub ifru_jid: c_int,
pub ifru_metric: c_int,
pub ifru_mtu: c_int,
pub ifru_phys: c_int,
pub ifru_media: c_int,
pub ifru_data: *mut c_char,
pub ifru_cap: [c_int; 2],
pub ifru_fib: c_uint,
pub ifru_vlan_pcp: c_uchar,
}
pub struct ifreq {
/// if name, e.g. "en0"
pub ifr_name: [c_char; crate::IFNAMSIZ],
pub ifr_ifru: __c_anonymous_ifr_ifru,
}
pub struct ifreq_buffer {
pub length: size_t,
pub buffer: *mut c_void,
}
}
//! Header: `dlfcn.h`
//!
//! Dynamic linking functions and constants from Hexagon toolchain.
use crate::prelude::*;
// Values for dlopen `mode`
pub const RTLD_LAZY: c_int = 1;
pub const RTLD_NOW: c_int = 2;
pub const RTLD_GLOBAL: c_int = 0x100;
pub const RTLD_LOCAL: c_int = 0x200;
// Compatibility constant
pub const DL_LAZY: c_int = RTLD_LAZY;
// Special handles
pub const RTLD_NEXT: *mut c_void = -1isize as *mut c_void;
pub const RTLD_DEFAULT: *mut c_void = -2isize as *mut c_void;
pub const RTLD_SELF: *mut c_void = -3isize as *mut c_void;
extern "C" {
pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void;
pub fn dlclose(handle: *mut c_void) -> c_int;
pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void;
pub fn dlerror() -> *mut c_char;
}
//! Header: `sys/mman.h`
//!
//! Memory mapping functions and constants from Hexagon toolchain.
use super::super::*;
use crate::prelude::*;
// Memory protection constants
pub const PROT_NONE: c_int = 0x00;
pub const PROT_READ: c_int = 0x01;
pub const PROT_WRITE: c_int = 0x02;
pub const PROT_EXEC: c_int = 0x04;
// Memory mapping constants
pub const MAP_SHARED: c_int = 0x0001;
pub const MAP_PRIVATE: c_int = 0x0002;
pub const MAP_FIXED: c_int = 0x0010;
pub const MAP_ANON: c_int = 0x1000;
pub const MAP_ANONYMOUS: c_int = MAP_ANON;
pub const MAP_FILE: c_int = 0x0000;
pub const MAP_RENAME: c_int = 0x0020;
pub const MAP_NORESERVE: c_int = 0x0040;
pub const MAP_INHERIT: c_int = 0x0080;
pub const MAP_HASSEMAPHORE: c_int = 0x0200;
pub const MAP_TRYFIXED: c_int = 0x0400;
pub const MAP_WIRED: c_int = 0x0800;
pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
// Memory sync constants
pub const MS_ASYNC: c_int = 0x01;
pub const MS_INVALIDATE: c_int = 0x02;
pub const MS_SYNC: c_int = 0x04;
// Memory lock constants
pub const MCL_CURRENT: c_int = 0x01;
pub const MCL_FUTURE: c_int = 0x02;
extern "C" {
pub fn mmap(
addr: *mut c_void,
len: size_t,
prot: c_int,
flags: c_int,
fd: c_int,
offset: off_t,
) -> *mut c_void;
pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
pub fn mlock(addr: *const c_void, len: size_t) -> c_int;
pub fn munlock(addr: *const c_void, len: size_t) -> c_int;
pub fn mlockall(flags: c_int) -> c_int;
pub fn munlockall() -> c_int;
pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int;
}
//! Header: `sys/sched.h`
//!
//! QuRT scheduling parameters and functions.
use crate::prelude::*;
// Scheduling policies (from QuRT sys/sched.h)
pub const SCHED_FIFO: c_int = 0;
pub const SCHED_RR: c_int = 1;
pub const SCHED_SPORADIC: c_int = 2;
pub const SCHED_OTHER: c_int = 3;
s! {
pub struct sched_param {
pub unimplemented: *mut c_void,
pub sched_priority: c_int,
}
}
extern "C" {
pub fn sched_yield() -> c_int;
pub fn sched_get_priority_max(policy: c_int) -> c_int;
pub fn sched_get_priority_min(policy: c_int) -> c_int;
}
+1
-1
{
"git": {
"sha1": "ca7a33dc4e49ccc3ce13151a0d8246dcf2967a77"
"sha1": "d29bc7f8d04baf321b5346e817b35eab9220dfde"
},
"path_in_vcs": ""
}

@@ -7,3 +7,3 @@ # This file is automatically @generated by Cargo.

name = "libc"
version = "1.0.0-alpha.2"
version = "1.0.0-alpha.3"
dependencies = [

@@ -10,0 +10,0 @@ "rustc-std-workspace-core",

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "libc"
version = "1.0.0-alpha.2"
version = "1.0.0-alpha.3"
authors = ["The Rust Project Developers"]

@@ -19,0 +19,0 @@ build = "build.rs"

@@ -138,5 +138,7 @@ /// A macro for defining #[cfg] if-else statements.

/// Implement `Clone` and `Copy` for a struct, as well as `Debug`, `Eq`, `Hash`, and
/// `PartialEq` if the `extra_traits` feature is enabled.
/// Implement `Clone`, `Copy`, and `Debug` for one or more structs, as well as `PartialEq`, `Eq`,
/// and `Hash` if the `extra_traits` feature is enabled.
///
/// Also mark the type with `repr(C)`.
///
/// Use [`s_no_extra_traits`] for structs where the `extra_traits` feature does not

@@ -157,49 +159,48 @@ /// make sense, and for unions.

(it: $(#[$attr:meta])* $pub:vis struct $i:ident { $($field:tt)* }) => (
__item! {
#[repr(C)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(Eq, Hash, PartialEq)
)]
#[allow(deprecated)]
$(#[$attr])*
$pub struct $i { $($field)* }
}
#[repr(C)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(PartialEq, Eq, Hash)
)]
#[allow(deprecated)]
$(#[$attr])*
$pub struct $i { $($field)* }
);
}
/// Implement `Clone` and `Copy` for a tuple struct, as well as `Debug`, `Eq`, `Hash`,
/// and `PartialEq` if the `extra_traits` feature is enabled.
/// Implement `Clone`, `Copy`, and `Debug` for a tuple struct, as well as `PartialEq`, `Eq`,
/// and `Hash` if the `extra_traits` feature is enabled.
///
/// This is the same as [`s`] but works for tuple structs.
/// Unlike `s!`, this does *not* mark the type with `repr(C)`. Users should provide their own
/// `repr` attribute via `$attr` as necessary.
macro_rules! s_paren {
($(
$(#[$attr:meta])*
pub struct $i:ident ( $($field:tt)* );
$pub:vis struct $i:ident ( $($field:tt)* );
)*) => ($(
__item! {
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(Eq, Hash, PartialEq)
)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
$(#[$attr])*
pub struct $i ( $($field)* );
}
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(PartialEq, Eq, Hash)
)]
$(#[$attr])*
$pub struct $i ( $($field)* );
)*);
}
/// Implement `Clone`, `Copy`, and `Debug` since those can be derived, but exclude `PartialEq`,
/// Implement `Clone`, `Copy`, and `Debug` for one or more structs/unions, but exclude `PartialEq`,
/// `Eq`, and `Hash`.
///
/// Most items will prefer to use [`s`].
/// Also mark the type with `repr(C)`.
///
/// Most structs will prefer to use [`s`].
macro_rules! s_no_extra_traits {

@@ -214,8 +215,9 @@ ($(

(it: $(#[$attr:meta])* $pub:vis union $i:ident { $($field:tt)* }) => (
__item! {
#[repr(C)]
#[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)]
$(#[$attr])*
$pub union $i { $($field)* }
}
#[repr(C)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
)]
$(#[$attr])*
$pub union $i { $($field)* }

@@ -230,12 +232,10 @@ impl ::core::fmt::Debug for $i {

(it: $(#[$attr:meta])* $pub:vis struct $i:ident { $($field:tt)* }) => (
__item! {
#[repr(C)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
$(#[$attr])*
$pub struct $i { $($field)* }
}
#[repr(C)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
$(#[$attr])*
$pub struct $i { $($field)* }
);

@@ -267,22 +267,2 @@ }

/// Implement `Clone` and `Copy` for an enum, as well as `Debug`, `Eq`, `Hash`, and
/// `PartialEq` if the `extra_traits` feature is enabled.
// FIXME(#4419): Replace all uses of `e!` with `c_enum!`
macro_rules! e {
($(
$(#[$attr:meta])*
pub enum $i:ident { $($field:tt)* }
)*) => ($(
__item! {
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
)]
#[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)]
$(#[$attr])*
pub enum $i { $($field)* }
}
)*);
}
/// Represent a C enum as Rust constants and a type.

@@ -411,8 +391,2 @@ ///

macro_rules! __item {
($i:item) => {
$i
};
}
/// Polyfill for std's `offset_of`.

@@ -419,0 +393,0 @@ // FIXME(msrv): stabilized in std in 1.77

//! Header: `uapi/linux/can.h`
pub(crate) mod bcm;
pub(crate) mod error;
pub(crate) mod j1939;

@@ -5,0 +6,0 @@ pub(crate) mod raw;

@@ -106,4 +106,4 @@ //! This module contains the future directory structure. If possible, new definitions should

} else if #[cfg(target_os = "qurt")] {
mod qurt;
pub(crate) use qurt::*;
pub mod qurt;
pub use qurt::*;
} else if #[cfg(target_os = "redox")] {

@@ -114,3 +114,3 @@ mod redox;

mod rtems;
pub(crate) use rtems::*;
// pub(crate) use rtems::*;
} else if #[cfg(target_os = "solaris")] {

@@ -182,2 +182,3 @@ mod solaris;

pub use linux::can::bcm::*;
pub use linux::can::error::*;
pub use linux::can::j1939::*;

@@ -209,2 +210,5 @@ pub use linux::can::raw::*;

pub use sys::ipc::*;
} else if #[cfg(target_os = "nto")] {
pub use net::bpf::*;
pub use net::if_::*;
}

@@ -211,0 +215,0 @@ }

@@ -5,1 +5,6 @@ //! QNX Neutrino libc.

pub(crate) mod unistd;
pub(crate) mod net {
pub(crate) mod bpf;
pub(crate) mod if_;
}

@@ -24,2 +24,5 @@ //! Header: `fcntl.h`

pub const O_DSYNC: c_int = 0x1000;
pub const O_DIRECTORY: c_int = 0x10000;
pub const O_NOFOLLOW: c_int = 0x20000;
pub const O_CLOEXEC: c_int = 0x80000;

@@ -35,2 +38,3 @@ // fcntl() commands

pub const F_SETLKW: c_int = 7;
pub const F_DUPFD_CLOEXEC: c_int = 1030;

@@ -48,5 +52,4 @@ // File descriptor flags

pub fn open(pathname: *const c_char, flags: c_int, ...) -> c_int;
pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int;
pub fn creat(pathname: *const c_char, mode: mode_t) -> c_int;
pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int;
}

@@ -9,3 +9,3 @@ //! QuRT (Qualcomm Real-Time OS) bindings

// Basic C types for QRT
// Basic C types for QuRT
pub type intptr_t = isize;

@@ -15,3 +15,3 @@ pub type uintptr_t = usize;

pub type size_t = uintptr_t;
pub type ssize_t = intptr_t;
pub type ssize_t = c_int;

@@ -24,3 +24,3 @@ // Process and system types

// Time types
pub type time_t = c_longlong;
pub type time_t = c_long;
pub type suseconds_t = c_long;

@@ -32,4 +32,4 @@ pub type useconds_t = c_ulong;

// File system types
pub type dev_t = c_ulong;
pub type ino_t = c_ulong;
pub type dev_t = c_ulonglong;
pub type ino_t = c_ulonglong;
pub type mode_t = c_uint;

@@ -90,3 +90,16 @@ pub type nlink_t = c_uint;

// Division result types
// Wide character type (hexagon-specific)
pub type wchar_t = u32;
// Error type (compatible with std expectations)
pub type errno_t = c_int;
// Resource limit type (for compatibility, not fully supported on QuRT)
pub type rlim_t = c_ulong;
// Terminal types (for compatibility, not fully supported on QuRT)
pub type speed_t = c_uint;
pub type tcflag_t = c_uint;
// Division result types and structures
s! {

@@ -113,8 +126,4 @@ pub struct div_t {

pub st_nlink: nlink_t,
pub st_uid: uid_t,
pub st_gid: gid_t,
pub st_rdev: dev_t,
pub st_size: off_t,
pub st_blksize: blksize_t,
pub st_blocks: blkcnt_t,
pub st_atime: time_t,

@@ -152,9 +161,193 @@ pub st_mtime: time_t,

pub struct sigevent {
pub sigev_notify: c_int,
pub sigev_signo: c_int,
pub sigev_value: c_int,
pub struct dirent {
pub d_ino: c_long,
pub d_name: [c_char; 255],
}
pub struct DIR {
pub index: c_int,
pub entry: dirent,
}
// Terminal I/O structure (for compatibility, limited support on QuRT)
pub struct termios {
pub c_iflag: tcflag_t,
pub c_oflag: tcflag_t,
pub c_cflag: tcflag_t,
pub c_lflag: tcflag_t,
pub c_cc: [c_uchar; 32],
pub c_ispeed: speed_t,
pub c_ospeed: speed_t,
}
// Resource limit structures (for compatibility, limited support on QuRT)
pub struct rlimit {
pub rlim_cur: rlim_t,
pub rlim_max: rlim_t,
}
pub struct rusage {
pub ru_utime: timeval,
pub ru_stime: timeval,
pub ru_maxrss: c_long,
pub ru_ixrss: c_long,
pub ru_idrss: c_long,
pub ru_isrss: c_long,
pub ru_minflt: c_long,
pub ru_majflt: c_long,
pub ru_nswap: c_long,
pub ru_inblock: c_long,
pub ru_oublock: c_long,
pub ru_msgsnd: c_long,
pub ru_msgrcv: c_long,
pub ru_nsignals: c_long,
pub ru_nvcsw: c_long,
pub ru_nivcsw: c_long,
}
// File lock structure (for compatibility)
pub struct flock {
pub l_type: c_short,
pub l_whence: c_short,
pub l_start: off_t,
pub l_len: off_t,
pub l_pid: pid_t,
}
}
// Additional pthread constants
pub const PTHREAD_NAME_LEN: c_int = 16;
pub const PTHREAD_MAX_THREADS: c_uint = 512;
pub const PTHREAD_MIN_STACKSIZE: c_int = 512;
pub const PTHREAD_MAX_STACKSIZE: c_int = 1048576;
pub const PTHREAD_DEFAULT_STACKSIZE: c_int = 16384;
pub const PTHREAD_DEFAULT_PRIORITY: c_int = 1;
pub const PTHREAD_SPINLOCK_UNLOCKED: c_int = 0;
pub const PTHREAD_SPINLOCK_LOCKED: c_int = 1;
// Additional time constants
pub const TIME_CONV_SCLK_FREQ: c_int = 19200000;
pub const CLOCK_MONOTONIC_RAW: clockid_t = 4;
pub const CLOCK_REALTIME_COARSE: clockid_t = 5;
pub const CLOCK_MONOTONIC_COARSE: clockid_t = 6;
pub const CLOCK_BOOTTIME: clockid_t = 7;
// Stdio constants
pub const L_tmpnam: c_uint = 260;
pub const TMP_MAX: c_uint = 25;
pub const FOPEN_MAX: c_uint = 20;
// Error constants
pub const EOK: c_int = 0;
// Semaphore constants
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
// Page size constants (hexagon-specific)
pub const PAGESIZE: size_t = 4096;
pub const PAGE_SIZE: size_t = 4096;
// Directory entry types (hexagon-specific)
pub const DT_UNKNOWN: c_uchar = 0;
pub const DT_FIFO: c_uchar = 1;
pub const DT_CHR: c_uchar = 2;
pub const DT_DIR: c_uchar = 4;
pub const DT_BLK: c_uchar = 6;
pub const DT_REG: c_uchar = 8;
pub const DT_LNK: c_uchar = 10;
pub const DT_SOCK: c_uchar = 12;
// Directory functions (dirent.h)
extern "C" {
pub fn opendir(name: *const c_char) -> *mut DIR;
pub fn readdir(dirp: *mut DIR) -> *mut dirent;
pub fn closedir(dirp: *const DIR) -> c_int;
pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int;
}
// Additional pthread functions
extern "C" {
pub fn pthread_attr_getstack(
attr: *const pthread_attr_t,
stackaddr: *mut *mut c_void,
stacksize: *mut size_t,
) -> c_int;
pub fn pthread_attr_setstack(
attr: *mut pthread_attr_t,
stackaddr: *mut c_void,
stacksize: size_t,
) -> c_int;
}
// Additional time functions
extern "C" {
pub fn clock_getcpuclockid(pid: pid_t, clock_id: *mut clockid_t) -> c_int;
}
// POSIX semaphore functions
extern "C" {
pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t;
pub fn sem_close(sem: *mut sem_t) -> c_int;
pub fn sem_unlink(name: *const c_char) -> c_int;
}
// Additional stdlib functions
extern "C" {
pub fn aligned_alloc(alignment: size_t, size: size_t) -> *mut c_void;
}
// String functions (string.h)
extern "C" {
pub fn strlen(s: *const c_char) -> size_t;
pub fn strcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncpy(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
pub fn strcat(dest: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncat(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
pub fn strcmp(s1: *const c_char, s2: *const c_char) -> c_int;
pub fn strncmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
pub fn strcoll(s1: *const c_char, s2: *const c_char) -> c_int;
pub fn strxfrm(dest: *mut c_char, src: *const c_char, n: size_t) -> size_t;
pub fn strchr(s: *const c_char, c: c_int) -> *mut c_char;
pub fn strrchr(s: *const c_char, c: c_int) -> *mut c_char;
pub fn strspn(s: *const c_char, accept: *const c_char) -> size_t;
pub fn strcspn(s: *const c_char, reject: *const c_char) -> size_t;
pub fn strpbrk(s: *const c_char, accept: *const c_char) -> *mut c_char;
pub fn strstr(haystack: *const c_char, needle: *const c_char) -> *mut c_char;
pub fn strtok(s: *mut c_char, delim: *const c_char) -> *mut c_char;
pub fn strerror(errnum: c_int) -> *mut c_char;
pub fn memchr(s: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn memcmp(s1: *const c_void, s2: *const c_void, n: size_t) -> c_int;
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memset(s: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
}
// Additional unistd functions
extern "C" {
pub fn fork() -> pid_t;
pub fn execve(
filename: *const c_char,
argv: *const *const c_char,
envp: *const *const c_char,
) -> c_int;
}
// Character classification functions (ctype.h)
extern "C" {
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
pub fn iscntrl(c: c_int) -> c_int;
pub fn isdigit(c: c_int) -> c_int;
pub fn isgraph(c: c_int) -> c_int;
pub fn islower(c: c_int) -> c_int;
pub fn isprint(c: c_int) -> c_int;
pub fn ispunct(c: c_int) -> c_int;
pub fn isspace(c: c_int) -> c_int;
pub fn isupper(c: c_int) -> c_int;
pub fn isxdigit(c: c_int) -> c_int;
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
}
pub(crate) mod dlfcn;
pub(crate) mod errno;

@@ -171,1 +364,18 @@ pub(crate) mod fcntl;

pub(crate) mod unistd;
// Re-export public items from submodules
pub use dlfcn::*;
pub use errno::*;
pub use fcntl::*;
pub use limits::*;
pub use pthread::*;
pub use semaphore::*;
pub use signal::*;
pub use stdio::*;
pub use stdlib::*;
pub use sys::mman::*;
pub use sys::sched::*;
pub use sys::stat::*;
pub use sys::types::*;
pub use time::*;
pub use unistd::*;

@@ -7,19 +7,2 @@ //! Header: `pthread.h`

use crate::prelude::*;
use crate::{
cpu_set_t,
pthread_attr_t,
pthread_barrier_t,
pthread_barrierattr_t,
pthread_cond_t,
pthread_condattr_t,
pthread_key_t,
pthread_mutex_t,
pthread_mutexattr_t,
pthread_once_t,
pthread_rwlock_t,
pthread_rwlockattr_t,
pthread_spinlock_t,
pthread_t,
timespec,
};

@@ -45,7 +28,2 @@ // Thread creation attributes

// Scheduling policies
pub const SCHED_OTHER: c_int = 0;
pub const SCHED_FIFO: c_int = 1;
pub const SCHED_RR: c_int = 2;
// Initializer constants

@@ -122,2 +100,3 @@ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0xFFFFFFFF;

pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> c_int;
pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, clock_id: clockid_t) -> c_int;

@@ -124,0 +103,0 @@ // Thread-local storage

@@ -44,9 +44,50 @@ //! Header: `signal.h`

// Signal mask operations
pub const SIG_BLOCK: c_int = 0;
pub const SIG_UNBLOCK: c_int = 1;
pub const SIG_SETMASK: c_int = 2;
// Signal mask operations (QuRT uses different values than Linux)
pub const SIG_BLOCK: c_int = 1;
pub const SIG_UNBLOCK: c_int = 2;
pub const SIG_SETMASK: c_int = 3;
// QuRT-specific signal constants
pub const POSIX_MSG: c_int = 7;
pub const POSIX_NOTIF: c_int = 8;
pub const SIGRTMIN: c_int = 10;
pub const SIGRTMAX: c_int = 32;
// Notification types (from QuRT signal.h)
pub const SIGEV_NONE: c_int = 0;
pub const SIGEV_SIGNAL: c_int = 1;
pub const SIGEV_THREAD: c_int = 2;
pub const SA_SIGINFO: c_int = 1;
pub type sighandler_t = size_t;
// Signal structures based on QuRT SDK headers
s! {
pub struct sigval {
pub sival_int: c_int,
pub sival_ptr: *mut c_void,
}
pub struct sigevent {
pub sigev_notify: c_int,
pub sigev_signo: c_int,
pub sigev_value: sigval,
pub sigev_notify_function: Option<extern "C" fn(sigval)>,
pub sigev_notify_attributes: *mut pthread_attr_t,
}
pub struct siginfo_t {
pub si_signo: c_int,
pub si_code: c_int,
pub si_value: sigval,
}
pub struct sigaction {
pub sa_handler: Option<extern "C" fn(c_int)>,
pub sa_mask: sigset_t,
pub sa_flags: c_int,
pub sa_sigaction: Option<extern "C" fn(c_int, *mut siginfo_t, *mut c_void)>,
}
}
extern "C" {

@@ -68,2 +109,11 @@ pub fn signal(sig: c_int, handler: sighandler_t) -> sighandler_t;

pub fn sigsuspend(mask: *const sigset_t) -> c_int;
// QuRT-specific signal functions
pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int;
pub fn _sigaction(sig: c_int, act: *const sigaction, oact: *mut sigaction) -> c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const timespec,
) -> c_int;
}

@@ -6,7 +6,2 @@ //! Header: `stdio.h`

// File position constants
pub const SEEK_SET: c_int = 0;
pub const SEEK_CUR: c_int = 1;
pub const SEEK_END: c_int = 2;
// Buffer size

@@ -13,0 +8,0 @@ pub const BUFSIZ: c_uint = 1024;

//! System headers (`sys/*`)
pub(crate) mod mman;
pub(crate) mod sched;
pub(crate) mod stat;
pub(crate) mod types;

@@ -36,8 +36,2 @@ //! Header: `sys/stat.h`

pub fn fstat(fd: c_int, statbuf: *mut stat) -> c_int;
pub fn lstat(pathname: *const c_char, statbuf: *mut stat) -> c_int;
pub fn chmod(pathname: *const c_char, mode: mode_t) -> c_int;
pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
pub fn mkdir(pathname: *const c_char, mode: mode_t) -> c_int;
pub fn mkfifo(pathname: *const c_char, mode: mode_t) -> c_int;
pub fn umask(mask: mode_t) -> mode_t;
}

@@ -9,11 +9,8 @@ //! Header: `time.h`

pub const CLOCK_MONOTONIC: clockid_t = 1;
pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 2;
pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 3;
pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 2;
pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 3;
// Timer flags
pub const TIMER_ABSTIME: c_int = 1;
extern "C" {
// Time functions
pub fn time(tloc: *mut time_t) -> time_t;
pub fn clock() -> clock_t;
pub fn difftime(time1: time_t, time0: time_t) -> c_double;

@@ -35,20 +32,5 @@ pub fn mktime(tm: *mut tm) -> time_t;

) -> size_t;
// High-resolution time functions
pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut tm) -> *mut c_char;
pub fn clock_gettime(clk_id: clockid_t, tp: *mut timespec) -> c_int;
pub fn clock_settime(clk_id: clockid_t, tp: *const timespec) -> c_int;
pub fn clock_getres(clk_id: clockid_t, res: *mut timespec) -> c_int;
pub fn nanosleep(req: *const timespec, rem: *mut timespec) -> c_int;
// Timer functions
pub fn timer_create(clockid: clockid_t, sevp: *mut sigevent, timerid: *mut timer_t) -> c_int;
pub fn timer_delete(timerid: timer_t) -> c_int;
pub fn timer_settime(
timerid: timer_t,
flags: c_int,
new_value: *const itimerspec,
old_value: *mut itimerspec,
) -> c_int;
pub fn timer_gettime(timerid: timer_t, curr_value: *mut itimerspec) -> c_int;
pub fn timer_getoverrun(timerid: timer_t) -> c_int;
}

@@ -22,2 +22,206 @@ //! Header: `unistd.h`

// pathconf constants (from bits/confname.h)
pub const _PC_LINK_MAX: c_int = 0;
pub const _PC_MAX_CANON: c_int = 1;
pub const _PC_MAX_INPUT: c_int = 2;
pub const _PC_NAME_MAX: c_int = 3;
pub const _PC_PATH_MAX: c_int = 4;
pub const _PC_PIPE_BUF: c_int = 5;
pub const _PC_CHOWN_RESTRICTED: c_int = 6;
pub const _PC_NO_TRUNC: c_int = 7;
pub const _PC_VDISABLE: c_int = 8;
pub const _PC_SYNC_IO: c_int = 9;
pub const _PC_ASYNC_IO: c_int = 10;
pub const _PC_PRIO_IO: c_int = 11;
pub const _PC_SOCK_MAXBUF: c_int = 12;
pub const _PC_FILESIZEBITS: c_int = 13;
pub const _PC_REC_INCR_XFER_SIZE: c_int = 14;
pub const _PC_REC_MAX_XFER_SIZE: c_int = 15;
pub const _PC_REC_MIN_XFER_SIZE: c_int = 16;
pub const _PC_REC_XFER_ALIGN: c_int = 17;
pub const _PC_ALLOC_SIZE_MIN: c_int = 18;
pub const _PC_SYMLINK_MAX: c_int = 19;
pub const _PC_2_SYMLINKS: c_int = 20;
// sysconf constants (from bits/confname.h)
pub const _SC_ARG_MAX: c_int = 0;
pub const _SC_CHILD_MAX: c_int = 1;
pub const _SC_CLK_TCK: c_int = 2;
pub const _SC_NGROUPS_MAX: c_int = 3;
pub const _SC_OPEN_MAX: c_int = 4;
pub const _SC_STREAM_MAX: c_int = 5;
pub const _SC_TZNAME_MAX: c_int = 6;
pub const _SC_JOB_CONTROL: c_int = 7;
pub const _SC_SAVED_IDS: c_int = 8;
pub const _SC_REALTIME_SIGNALS: c_int = 9;
pub const _SC_PRIORITY_SCHEDULING: c_int = 10;
pub const _SC_TIMERS: c_int = 11;
pub const _SC_ASYNCHRONOUS_IO: c_int = 12;
pub const _SC_PRIORITIZED_IO: c_int = 13;
pub const _SC_SYNCHRONIZED_IO: c_int = 14;
pub const _SC_FSYNC: c_int = 15;
pub const _SC_MAPPED_FILES: c_int = 16;
pub const _SC_MEMLOCK: c_int = 17;
pub const _SC_MEMLOCK_RANGE: c_int = 18;
pub const _SC_MEMORY_PROTECTION: c_int = 19;
pub const _SC_MESSAGE_PASSING: c_int = 20;
pub const _SC_SEMAPHORES: c_int = 21;
pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22;
pub const _SC_AIO_LISTIO_MAX: c_int = 23;
pub const _SC_AIO_MAX: c_int = 24;
pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25;
pub const _SC_DELAYTIMER_MAX: c_int = 26;
pub const _SC_MQ_OPEN_MAX: c_int = 27;
pub const _SC_MQ_PRIO_MAX: c_int = 28;
pub const _SC_VERSION: c_int = 29;
pub const _SC_PAGESIZE: c_int = 30;
pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE;
pub const _SC_RTSIG_MAX: c_int = 31;
pub const _SC_SEM_NSEMS_MAX: c_int = 32;
pub const _SC_SEM_VALUE_MAX: c_int = 33;
pub const _SC_SIGQUEUE_MAX: c_int = 34;
pub const _SC_TIMER_MAX: c_int = 35;
pub const _SC_BC_BASE_MAX: c_int = 36;
pub const _SC_BC_DIM_MAX: c_int = 37;
pub const _SC_BC_SCALE_MAX: c_int = 38;
pub const _SC_BC_STRING_MAX: c_int = 39;
pub const _SC_COLL_WEIGHTS_MAX: c_int = 40;
pub const _SC_EQUIV_CLASS_MAX: c_int = 41;
pub const _SC_EXPR_NEST_MAX: c_int = 42;
pub const _SC_LINE_MAX: c_int = 43;
pub const _SC_RE_DUP_MAX: c_int = 44;
pub const _SC_CHARCLASS_NAME_MAX: c_int = 45;
pub const _SC_2_VERSION: c_int = 46;
pub const _SC_2_C_BIND: c_int = 47;
pub const _SC_2_C_DEV: c_int = 48;
pub const _SC_2_FORT_DEV: c_int = 49;
pub const _SC_2_FORT_RUN: c_int = 50;
pub const _SC_2_SW_DEV: c_int = 51;
pub const _SC_2_LOCALEDEF: c_int = 52;
pub const _SC_PII: c_int = 53;
pub const _SC_PII_XTI: c_int = 54;
pub const _SC_PII_SOCKET: c_int = 55;
pub const _SC_PII_INTERNET: c_int = 56;
pub const _SC_PII_OSI: c_int = 57;
pub const _SC_POLL: c_int = 58;
pub const _SC_SELECT: c_int = 59;
pub const _SC_UIO_MAXIOV: c_int = 60;
pub const _SC_IOV_MAX: c_int = _SC_UIO_MAXIOV;
pub const _SC_PII_INTERNET_STREAM: c_int = 61;
pub const _SC_PII_INTERNET_DGRAM: c_int = 62;
pub const _SC_PII_OSI_COTS: c_int = 63;
pub const _SC_PII_OSI_CLTS: c_int = 64;
pub const _SC_PII_OSI_M: c_int = 65;
pub const _SC_T_IOV_MAX: c_int = 66;
pub const _SC_THREADS: c_int = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
pub const _SC_LOGIN_NAME_MAX: c_int = 71;
pub const _SC_TTY_NAME_MAX: c_int = 72;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
pub const _SC_THREAD_KEYS_MAX: c_int = 74;
pub const _SC_THREAD_STACK_MIN: c_int = 75;
pub const _SC_THREAD_THREADS_MAX: c_int = 76;
pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
pub const _SC_THREAD_PROCESS_SHARED: c_int = 82;
pub const _SC_NPROCESSORS_CONF: c_int = 83;
pub const _SC_NPROCESSORS_ONLN: c_int = 84;
pub const _SC_PHYS_PAGES: c_int = 85;
pub const _SC_AVPHYS_PAGES: c_int = 86;
pub const _SC_ATEXIT_MAX: c_int = 87;
pub const _SC_PASS_MAX: c_int = 88;
pub const _SC_XOPEN_VERSION: c_int = 89;
pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
pub const _SC_XOPEN_UNIX: c_int = 91;
pub const _SC_XOPEN_CRYPT: c_int = 92;
pub const _SC_XOPEN_ENH_I18N: c_int = 93;
pub const _SC_XOPEN_SHM: c_int = 94;
pub const _SC_2_CHAR_TERM: c_int = 95;
pub const _SC_2_C_VERSION: c_int = 96;
pub const _SC_2_UPE: c_int = 97;
pub const _SC_XOPEN_XPG2: c_int = 98;
pub const _SC_XOPEN_XPG3: c_int = 99;
pub const _SC_XOPEN_XPG4: c_int = 100;
pub const _SC_CHAR_BIT: c_int = 101;
pub const _SC_CHAR_MAX: c_int = 102;
pub const _SC_CHAR_MIN: c_int = 103;
pub const _SC_INT_MAX: c_int = 104;
pub const _SC_INT_MIN: c_int = 105;
pub const _SC_LONG_BIT: c_int = 106;
pub const _SC_WORD_BIT: c_int = 107;
pub const _SC_MB_LEN_MAX: c_int = 108;
pub const _SC_NZERO: c_int = 109;
pub const _SC_SSIZE_MAX: c_int = 110;
pub const _SC_SCHAR_MAX: c_int = 111;
pub const _SC_SCHAR_MIN: c_int = 112;
pub const _SC_SHRT_MAX: c_int = 113;
pub const _SC_SHRT_MIN: c_int = 114;
pub const _SC_UCHAR_MAX: c_int = 115;
pub const _SC_UINT_MAX: c_int = 116;
pub const _SC_ULONG_MAX: c_int = 117;
pub const _SC_USHRT_MAX: c_int = 118;
pub const _SC_NL_ARGMAX: c_int = 119;
pub const _SC_NL_LANGMAX: c_int = 120;
pub const _SC_NL_MSGMAX: c_int = 121;
pub const _SC_NL_NMAX: c_int = 122;
pub const _SC_NL_SETMAX: c_int = 123;
pub const _SC_NL_TEXTMAX: c_int = 124;
pub const _SC_XBS5_ILP32_OFF32: c_int = 125;
pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126;
pub const _SC_XBS5_LP64_OFF64: c_int = 127;
pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128;
pub const _SC_XOPEN_LEGACY: c_int = 129;
pub const _SC_XOPEN_REALTIME: c_int = 130;
pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
pub const _SC_ADVISORY_INFO: c_int = 132;
pub const _SC_BARRIERS: c_int = 133;
pub const _SC_CLOCK_SELECTION: c_int = 137;
pub const _SC_CPUTIME: c_int = 138;
pub const _SC_THREAD_CPUTIME: c_int = 139;
pub const _SC_MONOTONIC_CLOCK: c_int = 149;
pub const _SC_READER_WRITER_LOCKS: c_int = 153;
pub const _SC_SPIN_LOCKS: c_int = 154;
pub const _SC_REGEXP: c_int = 155;
pub const _SC_SHELL: c_int = 157;
pub const _SC_SPAWN: c_int = 159;
pub const _SC_SPORADIC_SERVER: c_int = 160;
pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161;
pub const _SC_TIMEOUTS: c_int = 164;
pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165;
pub const _SC_2_PBS: c_int = 168;
pub const _SC_2_PBS_ACCOUNTING: c_int = 169;
pub const _SC_2_PBS_LOCATE: c_int = 170;
pub const _SC_2_PBS_MESSAGE: c_int = 171;
pub const _SC_2_PBS_TRACK: c_int = 172;
pub const _SC_SYMLOOP_MAX: c_int = 173;
pub const _SC_2_PBS_CHECKPOINT: c_int = 175;
pub const _SC_V6_ILP32_OFF32: c_int = 176;
pub const _SC_V6_ILP32_OFFBIG: c_int = 177;
pub const _SC_V6_LP64_OFF64: c_int = 178;
pub const _SC_V6_LPBIG_OFFBIG: c_int = 179;
pub const _SC_HOST_NAME_MAX: c_int = 180;
pub const _SC_TRACE: c_int = 181;
pub const _SC_TRACE_EVENT_FILTER: c_int = 182;
pub const _SC_TRACE_INHERIT: c_int = 183;
pub const _SC_TRACE_LOG: c_int = 184;
pub const _SC_IPV6: c_int = 235;
pub const _SC_RAW_SOCKETS: c_int = 236;
pub const _SC_V7_ILP32_OFF32: c_int = 237;
pub const _SC_V7_ILP32_OFFBIG: c_int = 238;
pub const _SC_V7_LP64_OFF64: c_int = 239;
pub const _SC_V7_LPBIG_OFFBIG: c_int = 240;
pub const _SC_SS_REPL_MAX: c_int = 241;
pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242;
pub const _SC_TRACE_NAME_MAX: c_int = 243;
pub const _SC_TRACE_SYS_MAX: c_int = 244;
pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245;
pub const _SC_XOPEN_STREAMS: c_int = 246;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248;
extern "C" {

@@ -27,34 +231,20 @@ // File operations

pub fn close(fd: c_int) -> c_int;
pub fn dup(oldfd: c_int) -> c_int;
pub fn dup2(oldfd: c_int, newfd: c_int) -> c_int;
pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t;
pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t;
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
pub fn ftruncate(fd: c_int, length: off_t) -> c_int;
pub fn unlink(pathname: *const c_char) -> c_int;
// Directory operations
pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char;
pub fn rmdir(pathname: *const c_char) -> c_int;
// Process operations
pub fn getpid() -> pid_t;
pub fn getppid() -> pid_t;
pub fn getuid() -> uid_t;
pub fn geteuid() -> uid_t;
pub fn getgid() -> gid_t;
pub fn getegid() -> gid_t;
pub fn getpgid(pid: pid_t) -> pid_t;
pub fn getpgrp() -> pid_t;
pub fn setpgrp() -> pid_t;
pub fn seteuid(uid: uid_t) -> c_int;
pub fn setuid(uid: uid_t) -> c_int;
pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
pub fn setsid() -> pid_t;
// File synchronization
pub fn fsync(fd: c_int) -> c_int;
// Sleep functions
pub fn sleep(seconds: c_uint) -> c_uint;
pub fn usleep(usec: useconds_t) -> c_int;
// System configuration
pub fn sysconf(name: c_int) -> c_long;
pub fn pathconf(path: *const c_char, name: c_int) -> c_long;
pub fn fpathconf(fd: c_int, name: c_int) -> c_long;
}
//! Interface to QuRT (Qualcomm Real-Time OS) C library
//!
//! This module re-exports items from the new module structure.
//! QuRT was introduced after the `src/new/` module structure was established,
//! so all definitions live in `src/new/qurt/` and are re-exported here
//! for compatibility with the existing libc structure.
use crate::prelude::*;
// Re-export everything from the new qurt module
pub use crate::new::qurt::*;
// Forward declarations for opaque types
#[derive(Debug)]
pub enum DIR {}
impl Copy for DIR {}
impl Clone for DIR {
fn clone(&self) -> DIR {
*self
}
}
// Network types
pub type socklen_t = c_uint;
pub type in_addr_t = u32;
// Error type
pub type errno_t = c_int;
// Resource limit type
pub type rlim_t = c_ulong;
// Terminal types
pub type speed_t = c_uint;
pub type tcflag_t = c_uint;
// File descriptor set type for select()
pub type fd_set = c_ulong;
// POSIX semaphore types
pub type sem_t = c_uint;
// Message queue types
pub type mqd_t = c_int;
// Additional file system types
pub type nfds_t = c_ulong;
// Architecture-specific modules
// Architecture-specific modules (if any are needed in the future)
cfg_if! {
if #[cfg(target_arch = "hexagon")] {
mod hexagon;
pub use self::hexagon::*;
// Currently no hexagon-specific items needed beyond what's in new/qurt
} else {

@@ -50,286 +19,1 @@ // Add other architectures as needed

}
// Structures based on QuRT headers
s! {
pub struct sigval {
pub sival_int: c_int,
pub sival_ptr: *mut c_void,
}
pub struct sigevent {
pub sigev_notify: c_int,
pub sigev_signo: c_int,
pub sigev_value: sigval,
pub sigev_notify_function: Option<extern "C" fn(sigval)>,
pub sigev_notify_attributes: *mut pthread_attr_t,
}
pub struct siginfo_t {
pub si_signo: c_int,
pub si_code: c_int,
pub si_value: sigval,
}
pub struct sigaction {
pub sa_handler: Option<extern "C" fn(c_int)>,
pub sa_mask: sigset_t,
pub sa_flags: c_int,
pub sa_sigaction: Option<extern "C" fn(c_int, *mut siginfo_t, *mut c_void)>,
}
pub struct termios {
pub c_iflag: tcflag_t,
pub c_oflag: tcflag_t,
pub c_cflag: tcflag_t,
pub c_lflag: tcflag_t,
pub c_cc: [c_uchar; 32],
pub c_ispeed: speed_t,
pub c_ospeed: speed_t,
}
pub struct dirent {
pub d_ino: ino_t,
pub d_type: c_uchar,
pub d_name: [c_char; 256],
}
pub struct tm {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
}
pub struct sched_param {
pub sched_priority: c_int,
}
pub struct iovec {
pub iov_base: *mut c_void,
pub iov_len: size_t,
}
pub struct rlimit {
pub rlim_cur: rlim_t,
pub rlim_max: rlim_t,
}
pub struct rusage {
pub ru_utime: timeval,
pub ru_stime: timeval,
pub ru_maxrss: c_long,
pub ru_ixrss: c_long,
pub ru_idrss: c_long,
pub ru_isrss: c_long,
pub ru_minflt: c_long,
pub ru_majflt: c_long,
pub ru_nswap: c_long,
pub ru_inblock: c_long,
pub ru_oublock: c_long,
pub ru_msgsnd: c_long,
pub ru_msgrcv: c_long,
pub ru_nsignals: c_long,
pub ru_nvcsw: c_long,
pub ru_nivcsw: c_long,
}
pub struct flock {
pub l_type: c_short,
pub l_whence: c_short,
pub l_start: off_t,
pub l_len: off_t,
pub l_pid: pid_t,
}
}
// Memory mapping constants (from sys/mman.h)
pub const PROT_NONE: c_int = 0x00;
pub const PROT_READ: c_int = 0x01;
pub const PROT_WRITE: c_int = 0x02;
pub const PROT_EXEC: c_int = 0x04;
pub const MAP_SHARED: c_int = 0x0001;
pub const MAP_PRIVATE: c_int = 0x0002;
pub const MAP_FIXED: c_int = 0x0010;
pub const MAP_ANON: c_int = 0x1000;
pub const MAP_ANONYMOUS: c_int = MAP_ANON;
pub const MAP_FILE: c_int = 0x0000;
pub const MAP_RENAME: c_int = 0x0020;
pub const MAP_NORESERVE: c_int = 0x0040;
pub const MAP_INHERIT: c_int = 0x0080;
pub const MAP_HASSEMAPHORE: c_int = 0x0200;
pub const MAP_TRYFIXED: c_int = 0x0400;
pub const MAP_WIRED: c_int = 0x0800;
pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
pub const MS_ASYNC: c_int = 0x01;
pub const MS_INVALIDATE: c_int = 0x02;
pub const MS_SYNC: c_int = 0x04;
pub const MCL_CURRENT: c_int = 0x01;
pub const MCL_FUTURE: c_int = 0x02;
// Dynamic linking constants (from dlfcn.h)
pub const RTLD_LAZY: c_int = 1;
pub const RTLD_NOW: c_int = 2;
pub const RTLD_GLOBAL: c_int = 0x100;
pub const RTLD_LOCAL: c_int = 0x200;
// Semaphore constants
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
// Additional constants
pub const PTHREAD_NAME_LEN: c_int = 16;
pub const PTHREAD_MAX_THREADS: c_uint = 512;
pub const PTHREAD_MIN_STACKSIZE: c_int = 512;
pub const PTHREAD_MAX_STACKSIZE: c_int = 1048576;
pub const PTHREAD_DEFAULT_STACKSIZE: c_int = 16384;
pub const PTHREAD_DEFAULT_PRIORITY: c_int = 1;
pub const PTHREAD_SPINLOCK_UNLOCKED: c_int = 0;
pub const PTHREAD_SPINLOCK_LOCKED: c_int = 1;
pub const TIME_CONV_SCLK_FREQ: c_int = 19200000;
pub const CLOCK_MONOTONIC_RAW: clockid_t = 4;
pub const CLOCK_REALTIME_COARSE: clockid_t = 5;
pub const CLOCK_MONOTONIC_COARSE: clockid_t = 6;
pub const CLOCK_BOOTTIME: clockid_t = 7;
pub const L_tmpnam: c_uint = 260;
pub const TMP_MAX: c_uint = 25;
pub const FOPEN_MAX: c_uint = 20;
pub const AT_FDCWD: c_int = -100;
pub const AT_EACCESS: c_int = 0x200;
pub const AT_SYMLINK_NOFOLLOW: c_int = 0x100;
pub const AT_SYMLINK_FOLLOW: c_int = 0x400;
pub const AT_REMOVEDIR: c_int = 0x200;
pub const EOK: c_int = 0;
pub const POSIX_MSG: c_int = 7;
pub const POSIX_NOTIF: c_int = 8;
pub const SIGRTMIN: c_int = 10;
pub const SIGRTMAX: c_int = 32;
pub const SIGEV_NONE: c_int = 0;
pub const SIGEV_SIGNAL: c_int = 1;
pub const SIGEV_THREAD: c_int = 2;
pub const SA_SIGINFO: c_int = 1;
// Function declarations for QuRT POSIX API
extern "C" {
// Signal functions
pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int;
pub fn _sigaction(sig: c_int, act: *const sigaction, oact: *mut sigaction) -> c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const timespec,
) -> c_int;
// Additional pthread functions
pub fn pthread_attr_getstack(
attr: *const pthread_attr_t,
stackaddr: *mut *mut c_void,
stacksize: *mut size_t,
) -> c_int;
pub fn pthread_attr_setstack(
attr: *mut pthread_attr_t,
stackaddr: *mut c_void,
stacksize: size_t,
) -> c_int;
pub fn pthread_mutexattr_gettype(attr: *const pthread_mutexattr_t, type_: *mut c_int) -> c_int;
pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, type_: c_int) -> c_int;
// Additional time functions
pub fn clock_getcpuclockid(pid: pid_t, clock_id: *mut clockid_t) -> c_int;
// POSIX semaphore functions
pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t;
pub fn sem_close(sem: *mut sem_t) -> c_int;
pub fn sem_unlink(name: *const c_char) -> c_int;
// Additional stdlib functions
pub fn aligned_alloc(alignment: size_t, size: size_t) -> *mut c_void;
// String functions
pub fn strlen(s: *const c_char) -> size_t;
pub fn strcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncpy(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
pub fn strcat(dest: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncat(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
pub fn strcmp(s1: *const c_char, s2: *const c_char) -> c_int;
pub fn strncmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
pub fn strcoll(s1: *const c_char, s2: *const c_char) -> c_int;
pub fn strxfrm(dest: *mut c_char, src: *const c_char, n: size_t) -> size_t;
pub fn strchr(s: *const c_char, c: c_int) -> *mut c_char;
pub fn strrchr(s: *const c_char, c: c_int) -> *mut c_char;
pub fn strspn(s: *const c_char, accept: *const c_char) -> size_t;
pub fn strcspn(s: *const c_char, reject: *const c_char) -> size_t;
pub fn strpbrk(s: *const c_char, accept: *const c_char) -> *mut c_char;
pub fn strstr(haystack: *const c_char, needle: *const c_char) -> *mut c_char;
pub fn strtok(s: *mut c_char, delim: *const c_char) -> *mut c_char;
pub fn strerror(errnum: c_int) -> *mut c_char;
pub fn memchr(s: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn memcmp(s1: *const c_void, s2: *const c_void, n: size_t) -> c_int;
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memset(s: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
// Additional unistd functions
pub fn fork() -> pid_t;
pub fn execve(
filename: *const c_char,
argv: *const *const c_char,
envp: *const *const c_char,
) -> c_int;
// Directory functions
pub fn opendir(name: *const c_char) -> *mut DIR;
pub fn closedir(dirp: *mut DIR) -> c_int;
pub fn readdir(dirp: *mut DIR) -> *mut dirent;
pub fn rewinddir(dirp: *mut DIR);
pub fn telldir(dirp: *mut DIR) -> c_long;
pub fn seekdir(dirp: *mut DIR, loc: c_long);
// Memory mapping functions
pub fn mmap(
addr: *mut c_void,
len: size_t,
prot: c_int,
flags: c_int,
fd: c_int,
offset: off_t,
) -> *mut c_void;
pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
pub fn mlock(addr: *const c_void, len: size_t) -> c_int;
pub fn munlock(addr: *const c_void, len: size_t) -> c_int;
pub fn mlockall(flags: c_int) -> c_int;
pub fn munlockall() -> c_int;
pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int;
// Dynamic linking functions
pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void;
pub fn dlclose(handle: *mut c_void) -> c_int;
pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void;
pub fn dlerror() -> *mut c_char;
// Character classification functions
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
pub fn iscntrl(c: c_int) -> c_int;
pub fn isdigit(c: c_int) -> c_int;
pub fn isgraph(c: c_int) -> c_int;
pub fn islower(c: c_int) -> c_int;
pub fn isprint(c: c_int) -> c_int;
pub fn ispunct(c: c_int) -> c_int;
pub fn isspace(c: c_int) -> c_int;
pub fn isupper(c: c_int) -> c_int;
pub fn isxdigit(c: c_int) -> c_int;
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
}
// Re-export common prelude items
pub use crate::*;

@@ -31,4 +31,4 @@ //! Platform-agnostic support types.

pub(crate) const fn uninit() -> Self {
// We can still safely use uninit here, since padding are is something
// that can are not meant to be read or written anyways.
// We can still safely use uninit here, since padding is something
// that is not meant to be read or written anyways.
Self(MaybeUninit::uninit())

@@ -35,0 +35,0 @@ }

@@ -71,5 +71,5 @@ use crate::off_t;

pub st_ssize: c_int,
pub st_atim: crate::timespec,
pub st_mtim: crate::timespec,
pub st_ctim: crate::timespec,
pub st_atim: crate::st_timespec,
pub st_mtim: crate::st_timespec,
pub st_ctim: crate::st_timespec,
pub st_blksize: crate::blksize_t,

@@ -81,3 +81,3 @@ pub st_blocks: crate::blkcnt_t,

pub st_gen: c_uint,
pub st_reserved: [c_uint; 9],
st_reserved: Padding<[c_uint; 9]>,
pub st_padto_ll: c_uint,

@@ -122,3 +122,3 @@ pub st_size: off_t,

pub aio_handle: *mut aiocb,
pub aio_reserved: [c_uint; 2],
aio_reserved: Padding<[c_uint; 2]>,
pub aio_sigev_tid: c_long,

@@ -197,3 +197,3 @@ }

pub __tm: crate::__tm_context_t,
pub __reserved: [c_char; 1860],
__reserved: Padding<[c_char; 1860]>,
pub __extctx_magic: c_int,

@@ -200,0 +200,0 @@ }

@@ -104,3 +104,3 @@ use crate::prelude::*;

pub time_hi_and_version: u16,
pub clock_seq_hi_and_reserved: u8,
clock_seq_hi_and_reserved: Padding<u8>,
pub clock_seq_low: u8,

@@ -144,3 +144,3 @@ pub node: [u8; 6],

pub st_mode: crate::mode_t,
pub st_padding1: u16,
st_padding1: Padding<u16>,
pub st_uid: crate::uid_t,

@@ -422,3 +422,3 @@ pub st_gid: crate::gid_t,

pub ut_unused: [u8; 16],
ut_unused: Padding<[u8; 16]>,
pub ut_session: u16,

@@ -430,3 +430,3 @@ pub ut_type: u16,

pub ut_tv: crate::timeval,
pub ut_unused2: [u8; 16],
ut_unused2: Padding<[u8; 16]>,
}

@@ -433,0 +433,0 @@

@@ -77,16 +77,2 @@ use crate::prelude::*;

pub struct tm {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
pub tm_gmtoff: c_long,
pub tm_zone: *mut c_char,
}
pub struct msghdr {

@@ -93,0 +79,0 @@ pub msg_name: *mut c_void,

@@ -735,2 +735,8 @@ use crate::off_t;

pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int;
pub fn ppoll(
fds: *mut crate::pollfd,
nfds: crate::nfds_t,
ts: *const crate::timespec,
sigmask: *const crate::sigset_t,
) -> c_int;

@@ -737,0 +743,0 @@ pub fn getgrouplist(

@@ -15,3 +15,3 @@ use crate::prelude::*;

pub _xmm: [[c_uchar; 16]; 16],
pub _reserved_416_511: [c_uchar; 96],
_reserved_416_511: Padding<[c_uchar; 96]>,
}

@@ -22,3 +22,3 @@

pub xcomp_bv: c_ulong,
pub _reserved: [c_uchar; 48],
_reserved: Padding<[c_uchar; 48]>,
}

@@ -25,0 +25,0 @@

@@ -751,2 +751,3 @@ use crate::off64_t;

pub const PTRACE_GET_SYSCALL_INFO: c_uint = 0x420e;
pub const PTRACE_SET_SYSCALL_INFO: c_uint = 0x4212;
pub const PTRACE_SYSCALL_INFO_NONE: crate::__u8 = 0;

@@ -756,4 +757,4 @@ pub const PTRACE_SYSCALL_INFO_ENTRY: crate::__u8 = 1;

pub const PTRACE_SYSCALL_INFO_SECCOMP: crate::__u8 = 3;
pub const PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG: crate::__u8 = 0x4210;
pub const PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG: crate::__u8 = 0x4211;
pub const PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG: c_uint = 0x4210;
pub const PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG: c_uint = 0x4211;

@@ -760,0 +761,0 @@ // linux/rtnetlink.h

@@ -29,3 +29,3 @@ use crate::prelude::*;

pub ss_family: crate::sa_family_t,
pub __ss_padding: [u8; 26],
__ss_padding: Padding<[u8; 26]>,
}

@@ -32,0 +32,0 @@ }

@@ -44,3 +44,3 @@ //! ARMv6K Nintendo 3DS C Newlib definitions

pub ss_family: crate::sa_family_t,
pub __ss_padding: [c_char; 26usize],
__ss_padding: Padding<[c_char; 26usize]>,
}

@@ -47,0 +47,0 @@

@@ -55,5 +55,5 @@ use crate::off_t;

pub ss_family: crate::sa_family_t,
pub __ss_pad1: [u8; 2],
pub __ss_align: i64,
pub __ss_pad2: [u8; 116],
__ss_pad1: Padding<[u8; 2]>,
__ss_align: i64,
__ss_pad2: Padding<[u8; 116]>,
}

@@ -60,0 +60,0 @@

@@ -9,3 +9,3 @@ use crate::prelude::*;

pub type clockid_t = c_int;
pub type dev_t = c_long;
pub type dev_t = c_ulonglong;
pub type fsblkcnt_t = c_ulong;

@@ -613,4 +613,10 @@ pub type fsfilcnt_t = c_ulong;

// pthread.h
pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1;
pub const PTHREAD_MUTEX_DEFAULT: c_int = 0;
pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1;
pub const PTHREAD_MUTEX_NORMAL: c_int = 2;
pub const PTHREAD_MUTEX_RECURSIVE: c_int = 3;
pub const PTHREAD_MUTEX_ROBUST: c_int = 0;
pub const PTHREAD_MUTEX_STALLED: c_int = 1;
pub const PTHREAD_MUTEX_INITIALIZER: crate::pthread_mutex_t = crate::pthread_mutex_t {

@@ -1167,2 +1173,27 @@ bytes: [0; _PTHREAD_MUTEX_SIZE],

}
pub const fn makedev(major: c_uint, minor: c_uint) -> dev_t {
let major = major as dev_t;
let minor = minor as dev_t;
let mut dev = 0;
dev |= (major & 0x00000fff) << 8;
dev |= (major & 0xfffff000) << 32;
dev |= (minor & 0x000000ff) << 0;
dev |= (minor & 0xffffff00) << 12;
dev
}
pub const fn major(dev: dev_t) -> c_uint {
let mut major = 0;
major |= (dev & 0x00000000000fff00) >> 8;
major |= (dev & 0xfffff00000000000) >> 32;
major as c_uint
}
pub const fn minor(dev: dev_t) -> c_uint {
let mut minor = 0;
minor |= (dev & 0x00000000000000ff) >> 0;
minor |= (dev & 0x00000ffffff00000) >> 12;
minor as c_uint
}
}

@@ -1169,0 +1200,0 @@

@@ -157,2 +157,4 @@ use crate::prelude::*;

pub const _CS_PATH: c_int = 65;
pub const VSTATUS: usize = 16;

@@ -159,0 +161,0 @@ pub const VERASE2: usize = 17;

use crate::prelude::*;
pub type wchar_t = u32;
pub type cpu_set_t = c_uint;
s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_size: crate::off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
}
pub struct dirent {
pub d_ino: crate::ino_t,
pub d_type: c_uchar,
pub d_name: [c_char; 256],
}
}
// File type constants for stat.st_mode
pub const S_IFMT: crate::mode_t = 0o170000;
pub const S_IFSOCK: crate::mode_t = 0o140000;
pub const S_IFLNK: crate::mode_t = 0o120000;
pub const S_IFREG: crate::mode_t = 0o100000;
pub const S_IFBLK: crate::mode_t = 0o060000;
pub const S_IFDIR: crate::mode_t = 0o040000;
pub const S_IFCHR: crate::mode_t = 0o020000;
pub const S_IFIFO: crate::mode_t = 0o010000;
// File permission constants
pub const S_ISUID: crate::mode_t = 0o4000;
pub const S_ISGID: crate::mode_t = 0o2000;
pub const S_ISVTX: crate::mode_t = 0o1000;
pub const S_IRWXU: crate::mode_t = 0o0700;
pub const S_IRUSR: crate::mode_t = 0o0400;
pub const S_IWUSR: crate::mode_t = 0o0200;
pub const S_IXUSR: crate::mode_t = 0o0100;
pub const S_IRWXG: crate::mode_t = 0o0070;
pub const S_IRGRP: crate::mode_t = 0o0040;
pub const S_IWGRP: crate::mode_t = 0o0020;
pub const S_IXGRP: crate::mode_t = 0o0010;
pub const S_IRWXO: crate::mode_t = 0o0007;
pub const S_IROTH: crate::mode_t = 0o0004;
pub const S_IWOTH: crate::mode_t = 0o0002;
pub const S_IXOTH: crate::mode_t = 0o0001;
// Directory entry types
pub const DT_UNKNOWN: c_uchar = 0;
pub const DT_FIFO: c_uchar = 1;
pub const DT_CHR: c_uchar = 2;
pub const DT_DIR: c_uchar = 4;
pub const DT_BLK: c_uchar = 6;
pub const DT_REG: c_uchar = 8;
pub const DT_LNK: c_uchar = 10;
pub const DT_SOCK: c_uchar = 12;
// Size types
pub const PAGESIZE: size_t = 4096;
pub const PAGE_SIZE: size_t = 4096;
// pathconf constants (from bits/confname.h)
pub const _PC_LINK_MAX: c_int = 0;
pub const _PC_MAX_CANON: c_int = 1;
pub const _PC_MAX_INPUT: c_int = 2;
pub const _PC_NAME_MAX: c_int = 3;
pub const _PC_PATH_MAX: c_int = 4;
pub const _PC_PIPE_BUF: c_int = 5;
pub const _PC_CHOWN_RESTRICTED: c_int = 6;
pub const _PC_NO_TRUNC: c_int = 7;
pub const _PC_VDISABLE: c_int = 8;
pub const _PC_SYNC_IO: c_int = 9;
pub const _PC_ASYNC_IO: c_int = 10;
pub const _PC_PRIO_IO: c_int = 11;
pub const _PC_SOCK_MAXBUF: c_int = 12;
pub const _PC_FILESIZEBITS: c_int = 13;
pub const _PC_REC_INCR_XFER_SIZE: c_int = 14;
pub const _PC_REC_MAX_XFER_SIZE: c_int = 15;
pub const _PC_REC_MIN_XFER_SIZE: c_int = 16;
pub const _PC_REC_XFER_ALIGN: c_int = 17;
pub const _PC_ALLOC_SIZE_MIN: c_int = 18;
pub const _PC_SYMLINK_MAX: c_int = 19;
pub const _PC_2_SYMLINKS: c_int = 20;
// sysconf constants (from bits/confname.h)
pub const _SC_ARG_MAX: c_int = 0;
pub const _SC_CHILD_MAX: c_int = 1;
pub const _SC_CLK_TCK: c_int = 2;
pub const _SC_NGROUPS_MAX: c_int = 3;
pub const _SC_OPEN_MAX: c_int = 4;
pub const _SC_STREAM_MAX: c_int = 5;
pub const _SC_TZNAME_MAX: c_int = 6;
pub const _SC_JOB_CONTROL: c_int = 7;
pub const _SC_SAVED_IDS: c_int = 8;
pub const _SC_REALTIME_SIGNALS: c_int = 9;
pub const _SC_PRIORITY_SCHEDULING: c_int = 10;
pub const _SC_TIMERS: c_int = 11;
pub const _SC_ASYNCHRONOUS_IO: c_int = 12;
pub const _SC_PRIORITIZED_IO: c_int = 13;
pub const _SC_SYNCHRONIZED_IO: c_int = 14;
pub const _SC_FSYNC: c_int = 15;
pub const _SC_MAPPED_FILES: c_int = 16;
pub const _SC_MEMLOCK: c_int = 17;
pub const _SC_MEMLOCK_RANGE: c_int = 18;
pub const _SC_MEMORY_PROTECTION: c_int = 19;
pub const _SC_MESSAGE_PASSING: c_int = 20;
pub const _SC_SEMAPHORES: c_int = 21;
pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22;
pub const _SC_AIO_LISTIO_MAX: c_int = 23;
pub const _SC_AIO_MAX: c_int = 24;
pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25;
pub const _SC_DELAYTIMER_MAX: c_int = 26;
pub const _SC_MQ_OPEN_MAX: c_int = 27;
pub const _SC_MQ_PRIO_MAX: c_int = 28;
pub const _SC_VERSION: c_int = 29;
pub const _SC_PAGESIZE: c_int = 30;
pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE;
pub const _SC_RTSIG_MAX: c_int = 31;
pub const _SC_SEM_NSEMS_MAX: c_int = 32;
pub const _SC_SEM_VALUE_MAX: c_int = 33;
pub const _SC_SIGQUEUE_MAX: c_int = 34;
pub const _SC_TIMER_MAX: c_int = 35;
// POSIX2 sysconf options
pub const _SC_BC_BASE_MAX: c_int = 36;
pub const _SC_BC_DIM_MAX: c_int = 37;
pub const _SC_BC_SCALE_MAX: c_int = 38;
pub const _SC_BC_STRING_MAX: c_int = 39;
pub const _SC_COLL_WEIGHTS_MAX: c_int = 40;
pub const _SC_EQUIV_CLASS_MAX: c_int = 41;
pub const _SC_EXPR_NEST_MAX: c_int = 42;
pub const _SC_LINE_MAX: c_int = 43;
pub const _SC_RE_DUP_MAX: c_int = 44;
pub const _SC_CHARCLASS_NAME_MAX: c_int = 45;
pub const _SC_2_VERSION: c_int = 46;
pub const _SC_2_C_BIND: c_int = 47;
pub const _SC_2_C_DEV: c_int = 48;
pub const _SC_2_FORT_DEV: c_int = 49;
pub const _SC_2_FORT_RUN: c_int = 50;
pub const _SC_2_SW_DEV: c_int = 51;
pub const _SC_2_LOCALEDEF: c_int = 52;
pub const _SC_PII: c_int = 53;
pub const _SC_PII_XTI: c_int = 54;
pub const _SC_PII_SOCKET: c_int = 55;
pub const _SC_PII_INTERNET: c_int = 56;
pub const _SC_PII_OSI: c_int = 57;
pub const _SC_POLL: c_int = 58;
pub const _SC_SELECT: c_int = 59;
pub const _SC_UIO_MAXIOV: c_int = 60;
pub const _SC_IOV_MAX: c_int = _SC_UIO_MAXIOV;
pub const _SC_PII_INTERNET_STREAM: c_int = 61;
pub const _SC_PII_INTERNET_DGRAM: c_int = 62;
pub const _SC_PII_OSI_COTS: c_int = 63;
pub const _SC_PII_OSI_CLTS: c_int = 64;
pub const _SC_PII_OSI_M: c_int = 65;
pub const _SC_T_IOV_MAX: c_int = 66;
// POSIX threads sysconf options
pub const _SC_THREADS: c_int = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
pub const _SC_LOGIN_NAME_MAX: c_int = 71;
pub const _SC_TTY_NAME_MAX: c_int = 72;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
pub const _SC_THREAD_KEYS_MAX: c_int = 74;
pub const _SC_THREAD_STACK_MIN: c_int = 75;
pub const _SC_THREAD_THREADS_MAX: c_int = 76;
pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
pub const _SC_THREAD_PROCESS_SHARED: c_int = 82;
pub const _SC_NPROCESSORS_CONF: c_int = 83;
pub const _SC_NPROCESSORS_ONLN: c_int = 84;
pub const _SC_PHYS_PAGES: c_int = 85;
pub const _SC_AVPHYS_PAGES: c_int = 86;
pub const _SC_ATEXIT_MAX: c_int = 87;
pub const _SC_PASS_MAX: c_int = 88;
pub const _SC_XOPEN_VERSION: c_int = 89;
pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
pub const _SC_XOPEN_UNIX: c_int = 91;
pub const _SC_XOPEN_CRYPT: c_int = 92;
pub const _SC_XOPEN_ENH_I18N: c_int = 93;
pub const _SC_XOPEN_SHM: c_int = 94;
pub const _SC_2_CHAR_TERM: c_int = 95;
pub const _SC_2_C_VERSION: c_int = 96;
pub const _SC_2_UPE: c_int = 97;
pub const _SC_XOPEN_XPG2: c_int = 98;
pub const _SC_XOPEN_XPG3: c_int = 99;
pub const _SC_XOPEN_XPG4: c_int = 100;
pub const _SC_CHAR_BIT: c_int = 101;
pub const _SC_CHAR_MAX: c_int = 102;
pub const _SC_CHAR_MIN: c_int = 103;
pub const _SC_INT_MAX: c_int = 104;
pub const _SC_INT_MIN: c_int = 105;
pub const _SC_LONG_BIT: c_int = 106;
pub const _SC_WORD_BIT: c_int = 107;
pub const _SC_MB_LEN_MAX: c_int = 108;
pub const _SC_NZERO: c_int = 109;
pub const _SC_SSIZE_MAX: c_int = 110;
pub const _SC_SCHAR_MAX: c_int = 111;
pub const _SC_SCHAR_MIN: c_int = 112;
pub const _SC_SHRT_MAX: c_int = 113;
pub const _SC_SHRT_MIN: c_int = 114;
pub const _SC_UCHAR_MAX: c_int = 115;
pub const _SC_UINT_MAX: c_int = 116;
pub const _SC_ULONG_MAX: c_int = 117;
pub const _SC_USHRT_MAX: c_int = 118;
pub const _SC_NL_ARGMAX: c_int = 119;
pub const _SC_NL_LANGMAX: c_int = 120;
pub const _SC_NL_MSGMAX: c_int = 121;
pub const _SC_NL_NMAX: c_int = 122;
pub const _SC_NL_SETMAX: c_int = 123;
pub const _SC_NL_TEXTMAX: c_int = 124;
pub const _SC_XBS5_ILP32_OFF32: c_int = 125;
pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126;
pub const _SC_XBS5_LP64_OFF64: c_int = 127;
pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128;
pub const _SC_XOPEN_LEGACY: c_int = 129;
pub const _SC_XOPEN_REALTIME: c_int = 130;
pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
pub const _SC_ADVISORY_INFO: c_int = 132;
pub const _SC_BARRIERS: c_int = 133;
pub const _SC_BASE: c_int = 134;
pub const _SC_C_LANG_SUPPORT: c_int = 135;
pub const _SC_C_LANG_SUPPORT_R: c_int = 136;
pub const _SC_CLOCK_SELECTION: c_int = 137;
pub const _SC_CPUTIME: c_int = 138;
pub const _SC_THREAD_CPUTIME: c_int = 139;
pub const _SC_DEVICE_IO: c_int = 140;
pub const _SC_DEVICE_SPECIFIC: c_int = 141;
pub const _SC_DEVICE_SPECIFIC_R: c_int = 142;
pub const _SC_FD_MGMT: c_int = 143;
pub const _SC_FIFO: c_int = 144;
pub const _SC_PIPE: c_int = 145;
pub const _SC_FILE_ATTRIBUTES: c_int = 146;
pub const _SC_FILE_LOCKING: c_int = 147;
pub const _SC_FILE_SYSTEM: c_int = 148;
pub const _SC_MONOTONIC_CLOCK: c_int = 149;
pub const _SC_MULTI_PROCESS: c_int = 150;
pub const _SC_SINGLE_PROCESS: c_int = 151;
pub const _SC_NETWORKING: c_int = 152;
pub const _SC_READER_WRITER_LOCKS: c_int = 153;
pub const _SC_SPIN_LOCKS: c_int = 154;
pub const _SC_REGEXP: c_int = 155;
pub const _SC_REGEX_VERSION: c_int = 156;
pub const _SC_SHELL: c_int = 157;
pub const _SC_SIGNALS: c_int = 158;
pub const _SC_SPAWN: c_int = 159;
pub const _SC_SPORADIC_SERVER: c_int = 160;
pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161;
pub const _SC_SYSTEM_DATABASE: c_int = 162;
pub const _SC_SYSTEM_DATABASE_R: c_int = 163;
pub const _SC_TIMEOUTS: c_int = 164;
pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165;
pub const _SC_USER_GROUPS: c_int = 166;
pub const _SC_USER_GROUPS_R: c_int = 167;
pub const _SC_2_PBS: c_int = 168;
pub const _SC_2_PBS_ACCOUNTING: c_int = 169;
pub const _SC_2_PBS_LOCATE: c_int = 170;
pub const _SC_2_PBS_MESSAGE: c_int = 171;
pub const _SC_2_PBS_TRACK: c_int = 172;
pub const _SC_SYMLOOP_MAX: c_int = 173;
pub const _SC_STREAMS: c_int = 174;
pub const _SC_2_PBS_CHECKPOINT: c_int = 175;
pub const _SC_V6_ILP32_OFF32: c_int = 176;
pub const _SC_V6_ILP32_OFFBIG: c_int = 177;
pub const _SC_V6_LP64_OFF64: c_int = 178;
pub const _SC_V6_LPBIG_OFFBIG: c_int = 179;
pub const _SC_HOST_NAME_MAX: c_int = 180;
pub const _SC_TRACE: c_int = 181;
pub const _SC_TRACE_EVENT_FILTER: c_int = 182;
pub const _SC_TRACE_INHERIT: c_int = 183;
pub const _SC_TRACE_LOG: c_int = 184;
pub const _SC_LEVEL1_ICACHE_SIZE: c_int = 185;
pub const _SC_LEVEL1_ICACHE_ASSOC: c_int = 186;
pub const _SC_LEVEL1_ICACHE_LINESIZE: c_int = 187;
pub const _SC_LEVEL1_DCACHE_SIZE: c_int = 188;
pub const _SC_LEVEL1_DCACHE_ASSOC: c_int = 189;
pub const _SC_LEVEL1_DCACHE_LINESIZE: c_int = 190;
pub const _SC_LEVEL2_CACHE_SIZE: c_int = 191;
pub const _SC_LEVEL2_CACHE_ASSOC: c_int = 192;
pub const _SC_LEVEL2_CACHE_LINESIZE: c_int = 193;
pub const _SC_LEVEL3_CACHE_SIZE: c_int = 194;
pub const _SC_LEVEL3_CACHE_ASSOC: c_int = 195;
pub const _SC_LEVEL3_CACHE_LINESIZE: c_int = 196;
pub const _SC_LEVEL4_CACHE_SIZE: c_int = 197;
pub const _SC_LEVEL4_CACHE_ASSOC: c_int = 198;
pub const _SC_LEVEL4_CACHE_LINESIZE: c_int = 199;
pub const _SC_IPV6: c_int = 235;
pub const _SC_RAW_SOCKETS: c_int = 236;
pub const _SC_V7_ILP32_OFF32: c_int = 237;
pub const _SC_V7_ILP32_OFFBIG: c_int = 238;
pub const _SC_V7_LP64_OFF64: c_int = 239;
pub const _SC_V7_LPBIG_OFFBIG: c_int = 240;
pub const _SC_SS_REPL_MAX: c_int = 241;
pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242;
pub const _SC_TRACE_NAME_MAX: c_int = 243;
pub const _SC_TRACE_SYS_MAX: c_int = 244;
pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245;
pub const _SC_XOPEN_STREAMS: c_int = 246;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248;
// Note: QuRT doesn't use traditional syscalls but has its own API

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display