Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;

#[cfg(not(target_os = "nuttx"))]

@no1wudi no1wudi Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, the latest commit replicates the nuttx definition 1 more closely. if anything, the link you provide matches the current definition (a c int and not necessarily a fixed-width integer.)

Footnotes

  1. https://github.com/apache/nuttx/blob/master/include/sys/types.h#L157

pub type pid_t = i32;
pub type in_addr_t = u32;
pub type in_port_t = u16;
Expand Down
14 changes: 11 additions & 3 deletions src/unix/nuttx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
DIR,
};

pub type pid_t = c_int;
pub type nlink_t = u16;
pub type ino_t = u16;
pub type blkcnt_t = u64;
Expand All @@ -24,13 +25,20 @@ pub type pthread_rwlockattr_t = i32;
pub type pthread_t = i32;
pub type rlim_t = i64;
pub type sa_family_t = u16;
pub type socklen_t = u32;
pub type socklen_t = c_uint;
pub type speed_t = usize;
pub type suseconds_t = i32;
pub type tcflag_t = u32;
pub type clockid_t = i32;
pub type clockid_t = c_int;
pub type time_t = i64;
pub type wchar_t = i32;

cfg_if! {
if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] {
pub type wchar_t = c_int;
} else if #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] {
pub type wchar_t = c_uint;
}
}

s! {
pub struct stat {
Expand Down