Skip to content

build: assume POSIX select() is available - #22448

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:select
Closed

build: assume POSIX select() is available#22448
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:select

Conversation

@vszakats

@vszakats vszakats commented Jul 30, 2026

Copy link
Copy Markdown
Member

This change effectively replaces an explicit compile-time #error with
a missing prototype error in environments not offering select(), and
saves 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

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
vszakats requested a review from Copilot July 30, 2026 12:31
@vszakats
vszakats marked this pull request as draft July 30, 2026 12:34
@vszakats
vszakats marked this pull request as ready for review July 30, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #error guards requiring select() (or poll()) in lib/select.c and lib/curlx/wait.c.
  • Stop defining/detecting HAVE_SELECT across Autotools and CMake (including platform config headers and CMake caches).
  • Remove the CURL_CHECK_FUNC_SELECT Autotools 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.

@vszakats vszakats closed this in cb21a37 Jul 31, 2026
@vszakats
vszakats deleted the select branch July 31, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants