build: assume POSIX select() is available - #22448
Closed
vszakats wants to merge 1 commit into
Closed
Conversation
This change effectively changes an explicit compile-time #error with a missing prototype error in environments not offering `select()`, and save supported systems from performing an explicit feature check. Refs: https://pubs.opengroup.org/onlinepubs/009695399/ https://linux.die.net/man/2/select
vszakats
marked this pull request as draft
July 30, 2026 12:34
vszakats
marked this pull request as ready for review
July 30, 2026 12:35
There was a problem hiding this comment.
Pull request overview
This PR simplifies curl’s build-time feature detection by removing explicit select() availability checks/definitions and relying on existing platform assumptions (or compiler diagnostics) when poll() is unavailable.
Changes:
- Remove hard compile-time
#errorguards requiringselect()(orpoll()) inlib/select.candlib/curlx/wait.c. - Stop defining/detecting
HAVE_SELECTacross Autotools and CMake (including platform config headers and CMake caches). - Remove the
CURL_CHECK_FUNC_SELECTAutotools macro and its invocation.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/select.c | Removes the explicit “select or poll required” compile-time error and clarifies the select-based path when poll() is absent. |
| lib/curlx/wait.c | Removes the explicit compile-time error requiring select(). |
| lib/curl_config-cmake.h.in | Drops HAVE_SELECT from the CMake-generated config header template. |
| lib/config-win32.h | Drops HAVE_SELECT from the Windows static config header. |
| lib/config-riscos.h | Drops HAVE_SELECT from the RISC OS static config header. |
| lib/config-os400.h | Drops HAVE_SELECT from the OS/400 static config header. |
| lib/config-mac.h | Drops HAVE_SELECT from the mac static config header. |
| configure.ac | Removes the CURL_CHECK_FUNC_SELECT invocation from Autotools configuration. |
| CMakeLists.txt | Removes the select symbol check that previously set HAVE_SELECT. |
| CMake/win32-cache.cmake | Removes cached HAVE_SELECT value. |
| CMake/unix-cache.cmake | Removes cached HAVE_SELECT value. |
| acinclude.m4 | Removes the CURL_CHECK_FUNC_SELECT macro implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This change effectively replaces an explicit compile-time #error with
a missing prototype error in environments not offering
select(), andsaves curl-compatible systems from performing an explicit feature check.
Refs:
https://pubs.opengroup.org/onlinepubs/009695399/functions/pselect.html
https://linux.die.net/man/2/select