1COMEDI_ERRNO(3) COMEDI_ERRNO(3)
2
3
4
6 comedi_errno - number of last Comedilib error
7
9 #include <comedilib.h>
10
11 int comedi_errno (void );
12
14 When a Comedilib function fails, it usually returns -1 or NULL, depend‐
15 ing on the return type. An internal library variable stores an error
16 number, which can be retrieved with comedi_errno(). This error number
17 can be converted to a human-readable form by the functions comedi_per‐
18 ror() and comedi_strerror().
19
20 These functions are intended to mimic the behavior of the standard C
21 library functions perror(), strerror(), and errno. In particular,
22 Comedilib functions sometimes return an error that is generated inside
23 the C library; the comedi error message in this case is the same as the
24 C library.
25
26 The function comedi_errno() returns an integer describing the most
27 recent comedilib error. This integer may be used as the errnum parame‐
28 ter for comedi_strerror().
29
30 Note that comedi_errno() is deliberately different than the variable
31 errno. This is to overcome difficulties in making errno thread-safe.
32
33 28 October 2007 COMEDI_ERRNO(3)