Do not always set stdin to FNONBLOCK when PICO_PLATFORM=host #1334

Open
czarnota wants to merge 1 commit from czarnota/make-stdio-functions-blocking-in-platform-host into develop
czarnota commented 2023-03-28 11:50:30 -05:00 (Migrated from github.com)

When I compile project with PICO_PLATFORM=host, then functions like scanf() and fgets() do not block anymore. They are blocking on the actual board, so I would expect them to also block when compiled with PICO_PLATFORM=host.
The solution I came up with is to only enable non-blocking input when _peekchar() is called.

When I compile project with `PICO_PLATFORM=host`, then functions like `scanf()` and `fgets()` do not block anymore. They are blocking on the actual board, so I would expect them to also block when compiled with `PICO_PLATFORM=host`. The solution I came up with is to only enable non-blocking input when `_peekchar()` is called.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'czarnota/make-stdio-functions-blocking-in-platform-host:czarnota/make-stdio-functions-blocking-in-platform-host'
git switch 'czarnota/make-stdio-functions-blocking-in-platform-host'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'develop'
git merge --no-ff 'czarnota/make-stdio-functions-blocking-in-platform-host'
git switch 'czarnota/make-stdio-functions-blocking-in-platform-host'
git rebase 'develop'
git switch 'develop'
git merge --ff-only 'czarnota/make-stdio-functions-blocking-in-platform-host'
git switch 'czarnota/make-stdio-functions-blocking-in-platform-host'
git rebase 'develop'
git switch 'develop'
git merge --no-ff 'czarnota/make-stdio-functions-blocking-in-platform-host'
git switch 'develop'
git merge --squash 'czarnota/make-stdio-functions-blocking-in-platform-host'
git switch 'develop'
git merge --ff-only 'czarnota/make-stdio-functions-blocking-in-platform-host'
git switch 'develop'
git merge 'czarnota/make-stdio-functions-blocking-in-platform-host'
git push origin 'develop'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!1334
No description provided.