1CURLINFO_OS_ERRNO(3) curl_easy_getinfo options CURLINFO_OS_ERRNO(3)
2
3
4
6 CURLINFO_OS_ERRNO - get errno number from last connect failure
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_OS_ERRNO, long *errnop);
12
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
19 All
20
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
38 Added in 7.12.2
39
41 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
42 if not.
43
45 curl_easy_getinfo(3), curl_easy_setopt(3),
46
47
48
49libcurl 7.85.0 May 17, 2022 CURLINFO_OS_ERRNO(3)