Use slirp_pollfds_fill_socket on libslirp >= 4.9.0#1346
Open
archigup wants to merge 1 commit into
Open
Conversation
de2e0f4 to
fbf4f3e
Compare
fbf4f3e to
5b41b49
Compare
slirp_pollfds_fill and its int-based SlirpAddPollCb callback were deprecated in libslirp 4.9.0 in favour of slirp_pollfds_fill_socket and SlirpAddPollSocketCb, which carry the descriptor as a slirp_os_socket. Building against libslirp >= 4.9.0 therefore emits a -Wdeprecated-declarations warning in vReceiveThread. Guard the poll-fill call and the add-poll callback signature on SLIRP_CHECK_VERSION( 4, 9, 0 ) so modern libslirp uses the socket-based API while older versions keep the existing behaviour. Fixes FreeRTOS#1325
5b41b49 to
70d39a2
Compare
kstribrnAmzn
approved these changes
Jun 12, 2026
Member
|
Looks good to me. Maybe sometime in the distant future we can deprecate this check, but I understand keeping it for current users. |
bakshansky
approved these changes
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
slirp_pollfds_fill()and itsint-basedSlirpAddPollCbcallback were deprecated in libslirp 4.9.0 (2025-01-30) in favour ofslirp_pollfds_fill_socket()andSlirpAddPollSocketCb. The new API carries the descriptor as aslirp_os_socket— aninton POSIX, but a pointer-wideSOCKETon Win64 — which is why libslirp introduced it (the oldintcallback truncates socket handles on Windows).Building
MBuffNetifBackendLibslirp.cagainst libslirp >= 4.9.0 therefore produces:This change guards the poll-fill call and the add-poll callback signature on
SLIRP_CHECK_VERSION( 4U, 9U, 0U )(matching the version-guard style already used throughout this file), so:slirp_pollfds_fill_socket()with aslirp_os_socketcallback (no warning, correct on Win64),slirp_pollfds_fill()path unchanged.The callback body is unchanged — it stores the descriptor into
struct pollfd.fd(already aSOCKETinsideWSAPOLLFDon Windows), so no truncation occurs on either platform.Fixes #1325
Test Steps
Compiled
MBuffNetifBackendLibslirp.cagainst real libslirp 4.9.3 headers and an emulated 4.8.0 header set:slirp_pollfds_fillcall.-Werror=deprecated-declarations; 0 deprecation warnings. Preprocessor selectsslirp_pollfds_fill_socket+ theslirp_os_socketcallback.slirp_pollfds_fill+intcallback and compiles successfully, confirming the#elsepath is preserved for older libslirp.Checklist:
Related Issue
#1325
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.