Skip to content

Add nanosleep function - #383

Merged
David-LP99 merged 1 commit into
rollingfrom
feature/add_nanosleep_function
Oct 2, 2026
Merged

David-LP99 merged 1 commit into
rollingfrom
feature/add_nanosleep_function

Conversation

@David-LP99

Copy link
Copy Markdown
Contributor

Description

ESP-IDF defines _POSIX_TIMERS as 1 and provides several POSIX time functions, but nanosleep() is not implemented by ESP-IDF or by the Newlib/Picolibc archives shipped with the toolchain.

This causes portable code which uses nanosleep(), directly or through libstdc++, to fail at link time with:

    undefined reference to `nanosleep'

ros2/rclc uses the function usleep() to implement rclc_sleep_ms(), but this function has been deprecated from POSIX since 2008, and GCC 14 or higher raise an error because of this. For this reason, ros2/rclc#458 modifies the implementation to use nanosleep() instead.

Main changes

  • Added a new file with the nanosleep() implementation
  • Modified CMakeLists.txt to include the change

Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@EugenioCollado EugenioCollado left a comment

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.

LGTM

@David-LP99
David-LP99 merged commit 770608a into rolling Oct 2, 2026
19 checks passed
@David-LP99
David-LP99 deleted the feature/add_nanosleep_function branch October 2, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants