GNURLOPT_RANDOM_FILE(3)

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

πŸ¦‹ GNURLOPT_RANDOM_FILE(3) β€” curl_easy_setopt options πŸ¦‹

okay so welcome to the GNURLOPT_RANDOM_FILE(3) manual page, bestie β€” it lives in the curl_easy_setopt options section and it's here to explain how to point curl at a source of random data. no cap, it's a short one, so let's go πŸ’…


✨ NAME ✨

CURLOPT_RANDOM_FILE β€” specify a source for random data. πŸ’–

🌸 SYNOPSIS 🌸

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RANDOM_FILE, char
*path);

πŸŽ€ DESCRIPTION πŸŽ€

You're passing a char * that points at a null-terminated file name, bestie. curl might read from that file to seed the random engine for SSL and more. πŸ”₯

The application does not have to keep the string around after setting this option β€” so you can let it go, no strings attached. 🫢

πŸ’œ DEFAULT πŸ’œ

  • NULL, not used. literally unused, not even a vibe. πŸ™ˆ

🌈 PROTOCOLS 🌈

  • All β€” all of them. every protocol is invited to the party. πŸ‘‘

⭐ EXAMPLE ⭐

okay here's the example, copy-paste princess:

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_RANDOM_FILE, "junk.txt");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

πŸ¦‹ AVAILABILITY πŸ¦‹

Always β€” she's always available, periodt. ✨

πŸ’– RETURN VALUE πŸ’–

Returns CURLE_OK on success, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. 😭

πŸ“ SEE ALSO πŸ“


mwah πŸ’‹ this was GNURLOPT_RANDOM_FILE(3) from libcurl 7.37.0, dated 17 Jun 2014 β€” iconic, no notes. 🌟

πŸ“¦ where this page comes from