1CURLOPT_IOCTLDATA(3) curl_easy_setopt options CURLOPT_IOCTLDATA(3)
2
3
4
6 CURLOPT_IOCTLDATA - custom pointer passed to I/O callback
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_IOCTLDATA, void
12 *pointer);
13
15 Pass the pointer that will be untouched by libcurl and passed as the
16 3rd argument in the ioctl callback set with CURLOPT_IOCTLFUNCTION(3).
17
19 By default, the value of this parameter is NULL.
20
22 Used with HTTP
23
25 static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
26 {
27 struct data *io = (struct data *)clientp;
28 if(cmd == CURLIOCMD_RESTARTREAD) {
29 lseek(fd, 0, SEEK_SET);
30 current_offset = 0;
31 return CURLIOE_OK;
32 }
33 return CURLIOE_UNKNOWNCMD;
34 }
35 {
36 struct data ioctl_data;
37 curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback);
38 curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &ioctl_data);
39 }
40
42 Added in 7.12.3
43
45 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
46 if not.
47
49 CURLOPT_IOCTLFUNCTION(3), CURLOPT_SEEKFUNCTION(3),
50
51
52
53libcurl 7.69.1 May 31, 2017 CURLOPT_IOCTLDATA(3)