1CURLINFO_OS_ERRNO(3)       curl_easy_getinfo options      CURLINFO_OS_ERRNO(3)
2
3
4

NAME

6       CURLINFO_OS_ERRNO - get errno number from last connect failure
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_OS_ERRNO, long *errnop);
12

DESCRIPTION

14       Pass  a  pointer to a long to receive the errno variable from a connect
15       failure.  Note that the value is only set on failure, it is  not  reset
16       upon a successful operation. The number is OS and system specific.
17

PROTOCOLS

19       All
20

EXAMPLE

22       CURL *curl = curl_easy_init();
23       if(curl) {
24         CURLcode res;
25         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
26         res = curl_easy_perform(curl);
27         if(res != CURLE_OK) {
28           long error;
29           res = curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &error);
30           if(res && error) {
31             printf("Errno: %ld\n", error);
32           }
33         }
34         curl_easy_cleanup(curl);
35       }
36

AVAILABILITY

38       Added in 7.12.2
39

RETURN VALUE

41       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
42       if not.
43

SEE ALSO

45       curl_easy_getinfo(3), curl_easy_setopt(3),
46
47
48
49libcurl 7.85.0                   May 17, 2022             CURLINFO_OS_ERRNO(3)
Impressum