1explain_readv_or_die(3) Library Functions Manual explain_readv_or_die(3)
2
3
4
6 explain_readv_or_die - read data into multiple buffers and report
7 errors
8
10 #include <libexplain/readv.h>
11 ssize_t explain_readv_or_die(int fildes, const struct iovec *iov, int
12 iovcnt);
13 ssize_t explain_readv_on_error(int fildes, const struct iovec *iov, int
14 iovcnt);
15
17 The explain_readv_or_die function is used to call the readv(2) system
18 call. On failure an explanation will be printed to stderr, obtained
19 from the explain_readv(3) function, and then the process terminates by
20 calling exit(EXIT_FAILURE).
21
22 The explain_readv_on_error function is used to call the readv(2) system
23 call. On failure an explanation will be printed to stderr, obtained
24 from the explain_readv(3) function, but still returns to the caller.
25
26 fildes The fildes, exactly as to be passed to the readv(2) system
27 call.
28
29 iov The iov, exactly as to be passed to the readv(2) system call.
30
31 iovcnt The iovcnt, exactly as to be passed to the readv(2) system
32 call.
33
35 The explain_readv_or_die function only returns on success, see readv(2)
36 for more information. On failure, prints an explanation and exits, it
37 does not return.
38
39 The explain_readv_on_error function always returns the value return by
40 the wrapped readv(2) system call.
41
43 The explain_readv_or_die function is intended to be used in a fashion
44 similar to the following example:
45 ssize_t result = explain_readv_or_die(fildes, iov, iovcnt);
46
48 readv(2)
49 read data into multiple buffers
50
51 explain_readv(3)
52 explain readv(2) errors
53
54 exit(2) terminate the calling process
55
57 libexplain version 0.40
58 Copyright (C) 2009 Peter Miller
59
60
61
62 explain_readv_or_die(3)