Skip to content

Conversation

@aescolar
Copy link
Member

@aescolar aescolar commented Dec 10, 2025

These samples do not seem to need the unistd.h header, but including it limits us to C libraries which have it, which, as it is a POSIX extension, is not all.
So let's not include it so we do not limit ourselves unnecessarily.

Without this fix building with a C library without this header would result on:

samples/subsys/pmci/mctp/endpoint/src/main.c:10:10: fatal error: unistd.h: No such file or directory
   10 | #include <unistd.h>
      |          ^~~~~~~~~~

With this fix all these samples build fine with libraries without it (like w CONFIG_MINIMAL_LIBC=y)

These samples do not seem to need the unistd.h header, but including it
limits us to C libraries which have it, which as it is a POSIX
extension is not all.
So let's not include it so we do not limit ourselves unnecessarily.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
@aescolar aescolar marked this pull request as ready for review December 10, 2025 16:52
@aescolar aescolar added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Dec 10, 2025
@zephyrbot zephyrbot added area: Samples Samples area: PMCI Platform Management Communications Infrastructure labels Dec 10, 2025
@sonarqubecloud
Copy link

@jhedberg jhedberg merged commit 312b1ef into zephyrproject-rtos:main Dec 11, 2025
33 of 35 checks passed
@aescolar aescolar deleted the pmci_unistd branch December 11, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: PMCI Platform Management Communications Infrastructure area: Samples Samples Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants