1explain_tcsetattr_or_die(3)Library Functions Manualexplain_tcsetattr_or_die(3)
2
3
4
6 explain_tcsetattr_or_die - set terminal attributes and report errors
7
9 #include <libexplain/tcsetattr.h>
10 void explain_tcsetattr_or_die(int fildes, int options, const struct
11 termios *data);
12 int explain_tcsetattr_on_error(int fildes, int options, const struct
13 termios *data);
14
16 The explain_tcsetattr_or_die function is used to call the tcsetattr(3)
17 system call. On failure an explanation will be printed to stderr,
18 obtained from the explain_tcsetattr(3) function, and then the process
19 terminates by calling exit(EXIT_FAILURE).
20
21 The explain_tcsetattr_on_error function is used to call the tcse‐
22 tattr(3) system call. On failure an explanation will be printed to
23 stderr, obtained from the explain_tcsetattr(3) function, but still
24 returns to the caller.
25
26 fildes The fildes, exactly as to be passed to the tcsetattr(3) system
27 call.
28
29 options The options, exactly as to be passed to the tcsetattr(3) system
30 call.
31
32 data The data, exactly as to be passed to the tcsetattr(3) system
33 call.
34
36 The explain_tcsetattr_or_die function only returns on success, see
37 tcsetattr(3) for more information. On failure, prints an explanation
38 and exits, it does not return.
39
40 The explain_tcsetattr_on_error function always returns the value return
41 by the wrapped tcsetattr(3) system call.
42
44 The explain_tcsetattr_or_die function is intended to be used in a fash‐
45 ion similar to the following example:
46 explain_tcsetattr_or_die(fildes, options, data);
47
49 tcsetattr(3)
50 set terminal attributes
51
52 explain_tcsetattr(3)
53 explain tcsetattr(3) errors
54
55 exit(2) terminate the calling process
56
58 libexplain version 0.40
59 Copyright (C) 2009 Peter Miller
60
61
62
63 explain_tcsetattr_or_die(3)