Skip to content

Conversation

no1wudi
Copy link
Contributor

@no1wudi no1wudi commented Sep 6, 2025

Description

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.

Sources

https://github.com/apache/nuttx/blob/897c79084f79ffcf95524b1e9f3b56d34896da22/libs/libc/errno/lib_errno.c#L57-L66

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

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.
@rustbot rustbot added O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 6, 2025
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks!

@tgross35 tgross35 added this pull request to the merge queue Sep 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 18, 2025
@tgross35 tgross35 added this pull request to the merge queue Sep 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 22, 2025
@tgross35 tgross35 added this pull request to the merge queue Sep 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 22, 2025
@tgross35 tgross35 added this pull request to the merge queue Sep 22, 2025
Merged via the queue into rust-lang:main with commit ffab35a Sep 22, 2025
49 of 52 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 22, 2025
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.

(backport <rust-lang#4687>)
(cherry picked from commit ffab35a)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 22, 2025
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.

(backport <rust-lang#4687>)
(cherry picked from commit ffab35a)
github-merge-queue bot pushed a commit that referenced this pull request Sep 22, 2025
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.

(backport <#4687>)
(cherry picked from commit ffab35a)
@tgross35 tgross35 mentioned this pull request Sep 23, 2025
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants