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