Skip to content

fix: add POSIX headers for musl compatibility - #1397

Open
bakshansky wants to merge 3 commits into
FreeRTOS:mainfrom
bakshansky:add-alpine-support-1387
Open

fix: add POSIX headers for musl compatibility#1397
bakshansky wants to merge 3 commits into
FreeRTOS:mainfrom
bakshansky:add-alpine-support-1387

Conversation

@bakshansky

Copy link
Copy Markdown

Description

I've fixed the build error on Alpine Linux by adding missing POSIX headers (<sys/time.h> and <sys/select.h>) to the files that use timeval, fd_set, and select. Now both Posix demos compile successfully on musl.

However, I'm not sure about the remaining tasks mentioned in the issue:

  • Should I add documentation (e.g., update README) with instructions for installing libslirp-dev and other dependencies on Alpine?
  • Should I create a separate setup script (like setup-alpine.sh) or extend the existing one?
  • If yes, where should these files be placed?

I'd appreciate guidance from maintainers. I'm willing to do the work, but I need directions.

Test Steps

  1. On an Alpine Linux system (or Docker container), install required packages:
    apk add git make gcc libc-dev linux-headers libslirp-dev
  2. Clone the repository and checkout this branch
  3. Build the Posix demo:
    cd FreRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Echo_Posix && make
  4. Build should complete without errors

Related Issue

Refs #1387

@archigup

Copy link
Copy Markdown
Member

Adding the libslirp dependency to the README would be useful. If its in the deps, it can be translated to other distros. Not sure if another setup script is needed.

Include sys/time.h and sys/select.h where timeval, fd_set and select are
used. This is required for compilation on Alpine Linux (musl libc).

Refs FreeRTOS#1387
Signed-off-by: Roman Bakshansky <bakshansky@protonmail.com>
@cookpate
cookpate force-pushed the add-alpine-support-1387 branch from 411fbea to e4a201c Compare April 28, 2026 21:17
cookpate
cookpate previously approved these changes Apr 28, 2026
archigup
archigup previously approved these changes Jun 12, 2026
@archigup
archigup enabled auto-merge (squash) June 12, 2026 07:06
auto-merge was automatically disabled June 12, 2026 07:53

Head branch was pushed to by a user without write access

@bakshansky
bakshansky dismissed stale reviews from archigup and cookpate via e979652 June 12, 2026 07:53
@bakshansky

Copy link
Copy Markdown
Author

@archigup, I've added the libslirp documentation as suggested; sorry for disabling auto-merge

@archigup

Copy link
Copy Markdown
Member

No problem, thanks for the PR!

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.

4 participants