CURLOPT_NOSIGNAL.3 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .\" generated by cd2nroff 0.1 from CURLOPT_NOSIGNAL.md
  2. .TH CURLOPT_NOSIGNAL 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_NOSIGNAL \- skip all signal handling
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOSIGNAL, long onoff);
  9. .fi
  10. .SH DESCRIPTION
  11. If \fIonoff\fP is 1, libcurl uses no functions that install signal handlers or
  12. any functions that cause signals to be sent to the process. This option is
  13. here to allow multi\-threaded unix applications to still set/use all timeout
  14. options etc, without risking getting signals.
  15. If this option is set and libcurl has been built with the standard name
  16. resolver, timeouts cannot occur while the name resolve takes place. Consider
  17. building libcurl with the c\-ares or threaded resolver backends to enable
  18. asynchronous DNS lookups, to enable timeouts for name resolves without the use
  19. of signals.
  20. Setting \fICURLOPT_NOSIGNAL(3)\fP to 1 makes libcurl NOT ask the system to
  21. ignore SIGPIPE signals, which otherwise are sent by the system when trying to
  22. send data to a socket which is closed in the other end. libcurl makes an
  23. effort to never cause such SIGPIPE signals to trigger, but some operating
  24. systems have no way to avoid them and even on those that have there are some
  25. corner cases when they may still happen, contrary to our desire.
  26. .SH DEFAULT
  27. 0
  28. .SH PROTOCOLS
  29. This functionality affects all supported protocols
  30. .SH EXAMPLE
  31. .nf
  32. int main(void)
  33. {
  34. CURL *curl = curl_easy_init();
  35. if(curl) {
  36. CURLcode res;
  37. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  38. curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
  39. res = curl_easy_perform(curl);
  40. curl_easy_cleanup(curl);
  41. }
  42. }
  43. .fi
  44. .SH AVAILABILITY
  45. Added in curl 7.10
  46. .SH RETURN VALUE
  47. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  48. .SH SEE ALSO
  49. .BR CURLOPT_TIMEOUT (3)