Skip to content

Commit ffab35a

Browse files
no1wuditgross35
authored andcommitted
nuttx: add __errno() function declaration
Add missing __errno() function declaration for NuttX platform to enable proper errno handling in Rust code. NuttX's libc provides __errno() function which returns a pointer to the thread-local errno variable. This change allows Rust programs running on NuttX to properly access and manipulate errno values through the standard libc interface. Fixes errno functionality for NuttX targets.
1 parent ec605ff commit ffab35a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/unix/nuttx/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ pub const IP_ADD_MEMBERSHIP: i32 = 0x14;
566566
pub const IP_DROP_MEMBERSHIP: i32 = 0x15;
567567

568568
extern "C" {
569+
pub fn __errno() -> *mut c_int;
569570
pub fn bind(sockfd: i32, addr: *const sockaddr, addrlen: socklen_t) -> i32;
570571
pub fn ioctl(fd: i32, request: i32, ...) -> i32;
571572
pub fn dirfd(dirp: *mut DIR) -> i32;

0 commit comments

Comments
 (0)