CURLOPT_NOSIGNAL.3 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_NOSIGNAL 3 "16 Jun 2014" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_NOSIGNAL \- skip all signal handling
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOSIGNAL, long onoff);
  32. .fi
  33. .SH DESCRIPTION
  34. If \fIonoff\fP is 1, libcurl will not use any functions that install signal
  35. handlers or any functions that cause signals to be sent to the process. This
  36. option is here to allow multi-threaded unix applications to still set/use all
  37. timeout options etc, without risking getting signals.
  38. If this option is set and libcurl has been built with the standard name
  39. resolver, timeouts will not occur while the name resolve takes place.
  40. Consider building libcurl with the c-ares or threaded resolver backends to
  41. enable asynchronous DNS lookups, to enable timeouts for name resolves without
  42. the use of signals.
  43. Setting \fICURLOPT_NOSIGNAL(3)\fP to 1 makes libcurl NOT ask the system to
  44. ignore SIGPIPE signals, which otherwise are sent by the system when trying to
  45. send data to a socket which is closed in the other end. libcurl makes an
  46. effort to never cause such SIGPIPE signals to trigger, but some operating
  47. systems have no way to avoid them and even on those that have there are some
  48. corner cases when they may still happen, contrary to our desire. In addition,
  49. using \fICURLAUTH_NTLM_WB\fP authentication could cause a SIGCHLD signal to be
  50. raised.
  51. .SH DEFAULT
  52. 0
  53. .SH PROTOCOLS
  54. All
  55. .SH EXAMPLE
  56. .nf
  57. CURL *curl = curl_easy_init();
  58. if(curl) {
  59. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  60. curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
  61. ret = curl_easy_perform(curl);
  62. curl_easy_cleanup(curl);
  63. }
  64. .fi
  65. .SH AVAILABILITY
  66. Added in 7.10
  67. .SH RETURN VALUE
  68. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  69. .SH SEE ALSO
  70. .BR CURLOPT_TIMEOUT "(3), "