1explain_ioctl_or_die(3) Library Functions Manual explain_ioctl_or_die(3)
2
3
4
6 explain_ioctl_or_die - control device and report errors
7
9 #include <libexplain/ioctl.h>
10 int explain_ioctl_or_die(int fildes, int request, void *data);
11
13 The explain_ioctl_or_die function is used to call the ioctl(2) system
14 call. On failure an explanation will be printed to stderr, obtained
15 from explain_ioctl(3), and then the process terminates by calling
16 exit(EXIT_FAILURE).
17
18 This function is intended to be used in a fashion similar to the fol‐
19 lowing example:
20 int result = explain_ioctl_or_die(fildes, request, data);
21
22 fildes The fildes, exactly as to be passed to the ioctl(2) system
23 call.
24
25 request The request, exactly as to be passed to the ioctl(2) system
26 call.
27
28 data The data, exactly as to be passed to the ioctl(2) system call.
29
30 Returns:
31 This function only returns on success, see ioctl(2) for more
32 information. On failure, prints an explanation and exit()s.
33
35 ioctl(2)
36 control device
37
38 explain_ioctl(3)
39 explain ioctl(2) errors
40
41 exit(2) terminate the calling process
42
44 libexplain version 1.4
45 Copyright (C) 2008 Peter Miller
46
47
48
49 explain_ioctl_or_die(3)