Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Re: Undeclared function 'eventfd error in socketpair
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Abhinav Singhal via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 1 Apr 2025 14:24:52 -0400
Hi Henrick,
Thanks for all your suggestions. I had already tried the things you
mentioned before posting the question on this forum.
The code that you shared is quite different from the one I’m working with
in the 8.12.1 release (and downloaded from https://curl.se/download.html).
The reason why the 8.12.1 compilation is failing on me is because of the
following code in socketpair.h:
***
#if defined(HAVE_EVENTFD) && \
(defined(__x86_64__) || \
defined(__aarch64__) || \
defined(__ia64__) || \
defined(__ppc64__) || \
defined(__mips64) || \
defined(__sparc64__) || \
defined(__riscv_64e) || \
defined(__s390x__))
#define USE_EVENTFD 1
***
Without the HAVE_EVENTFD flag set, USE_EVENTFD never gets defined, which
creates problems in the socketpair.c code as shown below:
***
#if defined(USE_EVENTFD)
#ifdef HAVE_SYS_EVENTFD_H
#include <sys/eventfd.h>
#endif
int Curl_eventfd(curl_socket_t socks[2], bool nonblocking)
{
int efd = eventfd(0, nonblocking ? EFD_CLOEXEC | EFD_NONBLOCK :
EFD_CLOEXEC);
...
***
Since USE_EVENTFD is not defined in socketpair.h, and nor is
HAVE_SYS_EVENTFD_H in socketpair.c, sys/eventfd.h never gets included and
errors out when it encounters eventfd. Another question that arises here is
why the eventfd call is not in the same macros as sys/eventfd.h when its
inclusion is required for eventfd to work.
The reason why I emailed this mailing list was to find out why I need to
enable these flags in the first place for the code to compile if I have
disabled the socketpair component from my build, and given that no one ever
reported this issue before, is there anything that I could be missing at my
end that's causing me to run into these errors.
Date: Tue, 1 Apr 2025 14:24:52 -0400
Hi Henrick,
Thanks for all your suggestions. I had already tried the things you
mentioned before posting the question on this forum.
The code that you shared is quite different from the one I’m working with
in the 8.12.1 release (and downloaded from https://curl.se/download.html).
The reason why the 8.12.1 compilation is failing on me is because of the
following code in socketpair.h:
***
#if defined(HAVE_EVENTFD) && \
(defined(__x86_64__) || \
defined(__aarch64__) || \
defined(__ia64__) || \
defined(__ppc64__) || \
defined(__mips64) || \
defined(__sparc64__) || \
defined(__riscv_64e) || \
defined(__s390x__))
#define USE_EVENTFD 1
***
Without the HAVE_EVENTFD flag set, USE_EVENTFD never gets defined, which
creates problems in the socketpair.c code as shown below:
***
#if defined(USE_EVENTFD)
#ifdef HAVE_SYS_EVENTFD_H
#include <sys/eventfd.h>
#endif
int Curl_eventfd(curl_socket_t socks[2], bool nonblocking)
{
int efd = eventfd(0, nonblocking ? EFD_CLOEXEC | EFD_NONBLOCK :
EFD_CLOEXEC);
...
***
Since USE_EVENTFD is not defined in socketpair.h, and nor is
HAVE_SYS_EVENTFD_H in socketpair.c, sys/eventfd.h never gets included and
errors out when it encounters eventfd. Another question that arises here is
why the eventfd call is not in the same macros as sys/eventfd.h when its
inclusion is required for eventfd to work.
The reason why I emailed this mailing list was to find out why I need to
enable these flags in the first place for the code to compile if I have
disabled the socketpair component from my build, and given that no one ever
reported this issue before, is there anything that I could be missing at my
end that's causing me to run into these errors.
--- Daniel, Thanks for the quick response and the fix. I’ll wait for the 8.13 release to test out your fix (as official curl releases are the only ones I’m supposed to work with). On Sun, Mar 30, 2025 at 5:29 PM Daniel Stenberg <daniel_at_haxx.se> wrote: > On Sun, 30 Mar 2025, Abhinav Singhal via curl-library wrote: > > > I currently have curl 8.7 installed (built with openssl) and I’m trying > to > > upgrade to 8.12.1. However, I’m running into the following error: > > I used your set of configure options and built current git master. I got a > slightly different build error that I fixed with this little PR: > > https://github.com/curl/curl/pull/16877 > > -- > > / daniel.haxx.se || https://rock-solid.curl.dev
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2025-04-01