1 // boost/system/linux_error.hpp -------------------------------------------//
3 // Copyright Beman Dawes 2007
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 // See library home page at http://www.boost.org/libs/system
10 #ifndef BOOST_LINUX_ERROR_HPP
11 #define BOOST_LINUX_ERROR_HPP
13 // This header is effectively empty for compiles on operating systems where
14 // it is not applicable.
16 #if defined(linux) || defined(__linux) || defined(__linux__)
18 #include <boost/system/error_code.hpp>
24 // To construct an error_code after a API error:
26 // error_code( errno, system_category )
28 // User code should use the portable "posix" enums for POSIX errors; this
29 // allows such code to be portable to non-POSIX systems. For the non-POSIX
30 // errno values that POSIX-based systems typically provide in addition to
31 // POSIX values, use the system specific enums below.
37 advertise_error
= EADV
,
39 bad_file_number
= EBADFD
,
40 bad_font_format
= EBFONT
,
41 bad_request_code
= EBADRQC
,
42 bad_request_descriptor
= EBADR
,
44 channel_range
= ECHRNG
,
45 communication_error
= ECOMM
,
46 dot_dot_error
= EDOTDOT
,
47 exchange_full
= EXFULL
,
48 host_down
= EHOSTDOWN
,
49 is_named_file_type
= EISNAM
,
50 key_expired
= EKEYEXPIRED
,
51 key_rejected
= EKEYREJECTED
,
52 key_revoked
= EKEYREVOKED
,
54 level2_no_syncronized
= EL2NSYNC
,
56 level3_reset
= EL3RST
,
58 medium_type
= EMEDIUMTYPE
,
60 no_block_device
= ENOTBLK
,
63 no_medium
= ENOMEDIUM
,
67 not_named_file_type
= ENOTNAM
,
68 not_recoverable
= ENOTRECOVERABLE
,
69 not_unique
= ENOTUNIQ
,
70 owner_dead
= EOWNERDEAD
,
71 protocol_no_supported
= EPFNOSUPPORT
,
72 remote_address_changed
= EREMCHG
,
73 remote_io_error
= EREMOTEIO
,
74 remote_object
= EREMOTE
,
75 restart_needed
= ERESTART
,
76 shared_library_access
= ELIBACC
,
77 shared_library_bad
= ELIBBAD
,
78 shared_library_execute
= ELIBEXEC
,
79 shared_library_max_
= ELIBMAX
,
80 shared_library_section
= ELIBSCN
,
82 socket_type_not_supported
= ESOCKTNOSUPPORT
,
83 srmount_error
= ESRMNT
,
84 stream_pipe_error
= ESTRPIPE
,
85 too_many_references
= ETOOMANYREFS
,
86 too_many_users
= EUSERS
,
90 } // namespace linux_error
92 # ifndef BOOST_SYSTEM_NO_DEPRECATED
93 namespace Linux
= linux_error
;
96 template<> struct is_error_code_enum
<linux_error::linux_errno
>
97 { static const bool value
= true; };
101 inline error_code
make_error_code( linux_errno e
)
102 { return error_code( e
, get_system_category() ); }
105 } // namespace system
110 #endif // BOOST_LINUX_ERROR_HPP