1CURLOPT_IOCTLDATA(3)       curl_easy_setopt options       CURLOPT_IOCTLDATA(3)
2
3
4

NAME

6       CURLOPT_IOCTLDATA - pointer passed to I/O callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_IOCTLDATA, void *pointer);
12

DESCRIPTION

14       Pass  the  pointer  that will be untouched by libcurl and passed as the
15       3rd argument in the ioctl callback set with CURLOPT_IOCTLFUNCTION(3).
16

DEFAULT

18       By default, the value of this parameter is NULL.
19

PROTOCOLS

21       Used with HTTP
22

EXAMPLE

24       static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
25       {
26         struct data *io = (struct data *)clientp;
27         if(cmd == CURLIOCMD_RESTARTREAD) {
28           lseek(fd, 0, SEEK_SET);
29           current_offset = 0;
30           return CURLIOE_OK;
31         }
32         return CURLIOE_UNKNOWNCMD;
33       }
34       {
35         struct data ioctl_data;
36         curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback);
37         curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &ioctl_data);
38       }
39

AVAILABILITY

41       Added in 7.12.3
42

RETURN VALUE

44       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
45       if not.
46

SEE ALSO

48       CURLOPT_IOCTLFUNCTION(3), CURLOPT_SEEKFUNCTION(3),
49
50
51
52libcurl 7.85.0                   May 17, 2022             CURLOPT_IOCTLDATA(3)
Impressum