Skip to content

Add nanosleep function - #114

Open
David-LP99 wants to merge 1 commit into
rollingfrom
feature/add_nanosleep_function
Open

David-LP99 wants to merge 1 commit into
rollingfrom
feature/add_nanosleep_function

Conversation

@David-LP99

Copy link
Copy Markdown

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

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

1 participant