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