]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/system/detail/is_generic_value.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / system / detail / is_generic_value.hpp
1 #ifndef BOOST_SYSTEM_DETAIL_IS_GENERIC_VALUE_HPP_INCLUDED
2 #define BOOST_SYSTEM_DETAIL_IS_GENERIC_VALUE_HPP_INCLUDED
3
4 // Copyright 2018 Peter Dimov
5 //
6 // Distributed under the Boost Software License, Version 1.0. (See accompanying
7 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // See library home page at http://www.boost.org/libs/system
10
11 #include <boost/system/detail/errc.hpp>
12
13 namespace boost
14 {
15
16 namespace system
17 {
18
19 namespace detail
20 {
21
22 inline bool is_generic_value( int ev ) BOOST_NOEXCEPT
23 {
24 using namespace errc;
25
26 static int const gen[] =
27 {
28 success,
29 address_family_not_supported,
30 address_in_use,
31 address_not_available,
32 already_connected,
33 argument_list_too_long,
34 argument_out_of_domain,
35 bad_address,
36 bad_file_descriptor,
37 bad_message,
38 broken_pipe,
39 connection_aborted,
40 connection_already_in_progress,
41 connection_refused,
42 connection_reset,
43 cross_device_link,
44 destination_address_required,
45 device_or_resource_busy,
46 directory_not_empty,
47 executable_format_error,
48 file_exists,
49 file_too_large,
50 filename_too_long,
51 function_not_supported,
52 host_unreachable,
53 identifier_removed,
54 illegal_byte_sequence,
55 inappropriate_io_control_operation,
56 interrupted,
57 invalid_argument,
58 invalid_seek,
59 io_error,
60 is_a_directory,
61 message_size,
62 network_down,
63 network_reset,
64 network_unreachable,
65 no_buffer_space,
66 no_child_process,
67 no_link,
68 no_lock_available,
69 no_message_available,
70 no_message,
71 no_protocol_option,
72 no_space_on_device,
73 no_stream_resources,
74 no_such_device_or_address,
75 no_such_device,
76 no_such_file_or_directory,
77 no_such_process,
78 not_a_directory,
79 not_a_socket,
80 not_a_stream,
81 not_connected,
82 not_enough_memory,
83 not_supported,
84 operation_canceled,
85 operation_in_progress,
86 operation_not_permitted,
87 operation_not_supported,
88 operation_would_block,
89 owner_dead,
90 permission_denied,
91 protocol_error,
92 protocol_not_supported,
93 read_only_file_system,
94 resource_deadlock_would_occur,
95 resource_unavailable_try_again,
96 result_out_of_range,
97 state_not_recoverable,
98 stream_timeout,
99 text_file_busy,
100 timed_out,
101 too_many_files_open_in_system,
102 too_many_files_open,
103 too_many_links,
104 too_many_symbolic_link_levels,
105 value_too_large,
106 wrong_protocol_type
107 };
108
109 int const n = sizeof( gen ) / sizeof( gen[0] );
110
111 for( int i = 0; i < n; ++i )
112 {
113 if( ev == gen[ i ] ) return true;
114 }
115
116 return false;
117 }
118
119 } // namespace detail
120
121 } // namespace system
122
123 } // namespace boost
124
125 #endif // #ifndef BOOST_SYSTEM_DETAIL_IS_GENERIC_VALUE_HPP_INCLUDED