GNURLOPT_ABSTRACT_UNIX_SOCKET(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ¦‹ 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