GNURLOPT_ABSTRACT_UNIX_SOCKET(3)
π¦ NAME π¦
okay bestie, welcome to the GNURLOPT_ABSTRACT_UNIX_SOCKET(3) page from the curl_easy_setopt options crew β it's giving βset an abstract Unix domain socketβ energy, and we're gonna get you through it π
β¨
CURLOPT_ABSTRACT_UNIX_SOCKET β set an abstract Unix domain socket.
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ABSTRACT_UNIX_SOCKET,
char *path);
π DESCRIPTION π
So this option enables the use of an abstract Unix domain socket instead of establishing a TCP connection to a host. Slay, no cap.
The parameter should be a char * to a null-terminated string holding the path of the socket. The path will be set to path prefixed by a NULL byte β that's literally the convention for abstract sockets β however, it should be stressed that the path passed to this function should not contain a leading NULL. Like, do not do that, bestie π
On non-supporting platforms, the abstract address will be interpreted as an empty string and fail gracefully, generating a run-time error. It's giving βwe tried, we failed, but we did it cutelyβ π
This option shares the same semantics as CURLOPT_UNIX_SOCKET_PATH(3) β the documentation over there has more details if you wanna dig in. Internally, these two options share the same storage and therefore only one of them can be set per handle. One handle, one socket-path situation. Periodt π«Ά
β¨ DEFAULT β¨
Default is NULL. Yep, nothing set by default, no abstract-socket vibes until you say so π
π EXAMPLE π
curl_easy_setopt(curl_handle, CURLOPT_ABSTRACT_UNIX_SOCKET, "/tmp/foo.sock");
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
β AVAILABILITY β
Since 7.53.0. Iconic behavior has been available since then, iykyk π
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. That's the whole mood β supported? slay. not supported? unknown option, sadly π
π SEE ALSO π
kisses from the libcurl 7.53.0 era, dated 08 Jan 2017 β this was the GNURLOPT_ABSTRACT_UNIX_SOCKET(3) page, mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms