Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
| curl_global_init(3) | Library Functions Manual | curl_global_init(3) |
NAME
curl_global_init - global libcurl initializationDESCRIPTION
This function sets up the program environment that libcurl needs. Think of it as an extension of the library loader.FLAGS
- CURL_GLOBAL_ALL
- Initialize everything possible. This sets all known bits except CURL_GLOBAL_ACK_EINTR.
- CURL_GLOBAL_SSL
-
(This flag's presence or absence serves no meaning since 7.57.0. The description below is for older libcurl versions.)Initialize SSL.The implication here is that if this bit is not set, the initialization of the SSL layer needs to be done by the application or at least outside of libcurl. The exact procedure how to do SSL initialization depends on the TLS backend libcurl uses.Doing TLS based transfers without having the TLS layer initialized may lead to unexpected behaviors.
- CURL_GLOBAL_WIN32
-
Initialize the Win32 socket libraries.The implication here is that if this bit is not set, the initialization of Winsock has to be done by the application or you risk getting undefined behaviors. This option exists for when the initialization is handled outside of libcurl so there is no need for libcurl to do it again.
- CURL_GLOBAL_NOTHING
- Initialize nothing extra. This sets no bit.
- CURL_GLOBAL_DEFAULT
- A sensible default. It initializes both SSL and Win32. Right now, this equals the functionality of the CURL_GLOBAL_ALL mask.
- CURL_GLOBAL_ACK_EINTR
-
This bit has no point since 7.69.0 but its behavior is instead the default.Before 7.69.0: when this flag is set, curl acknowledges EINTR condition when connecting or when waiting for data. Otherwise, curl waits until full timeout elapses. (Added in 7.30.0)
PROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
curl_global_init(CURL_GLOBAL_DEFAULT);
/* use libcurl, then before exiting... */
curl_global_cleanup();
}
AVAILABILITY
Added in curl 7.8RETURN VALUE
If this function returns non-zero, something went wrong and you cannot use the other curl functions.SEE ALSO
curl_easy_init(3), curl_global_cleanup(3), curl_global_init_mem(3), curl_global_sslset(3), curl_global_trace(3), libcurl(3)| 2025-10-24 | libcurl |