annotate libcxx/include/__errc @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // -*- C++ -*-
anatofuz
parents:
diff changeset
2 //===---------------------------- __errc ----------------------------------===//
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
5 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
7 //
anatofuz
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 #ifndef _LIBCPP___ERRC
anatofuz
parents:
diff changeset
11 #define _LIBCPP___ERRC
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 /*
anatofuz
parents:
diff changeset
14 system_error synopsis
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 namespace std
anatofuz
parents:
diff changeset
17 {
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 enum class errc
anatofuz
parents:
diff changeset
20 {
anatofuz
parents:
diff changeset
21 address_family_not_supported, // EAFNOSUPPORT
anatofuz
parents:
diff changeset
22 address_in_use, // EADDRINUSE
anatofuz
parents:
diff changeset
23 address_not_available, // EADDRNOTAVAIL
anatofuz
parents:
diff changeset
24 already_connected, // EISCONN
anatofuz
parents:
diff changeset
25 argument_list_too_long, // E2BIG
anatofuz
parents:
diff changeset
26 argument_out_of_domain, // EDOM
anatofuz
parents:
diff changeset
27 bad_address, // EFAULT
anatofuz
parents:
diff changeset
28 bad_file_descriptor, // EBADF
anatofuz
parents:
diff changeset
29 bad_message, // EBADMSG
anatofuz
parents:
diff changeset
30 broken_pipe, // EPIPE
anatofuz
parents:
diff changeset
31 connection_aborted, // ECONNABORTED
anatofuz
parents:
diff changeset
32 connection_already_in_progress, // EALREADY
anatofuz
parents:
diff changeset
33 connection_refused, // ECONNREFUSED
anatofuz
parents:
diff changeset
34 connection_reset, // ECONNRESET
anatofuz
parents:
diff changeset
35 cross_device_link, // EXDEV
anatofuz
parents:
diff changeset
36 destination_address_required, // EDESTADDRREQ
anatofuz
parents:
diff changeset
37 device_or_resource_busy, // EBUSY
anatofuz
parents:
diff changeset
38 directory_not_empty, // ENOTEMPTY
anatofuz
parents:
diff changeset
39 executable_format_error, // ENOEXEC
anatofuz
parents:
diff changeset
40 file_exists, // EEXIST
anatofuz
parents:
diff changeset
41 file_too_large, // EFBIG
anatofuz
parents:
diff changeset
42 filename_too_long, // ENAMETOOLONG
anatofuz
parents:
diff changeset
43 function_not_supported, // ENOSYS
anatofuz
parents:
diff changeset
44 host_unreachable, // EHOSTUNREACH
anatofuz
parents:
diff changeset
45 identifier_removed, // EIDRM
anatofuz
parents:
diff changeset
46 illegal_byte_sequence, // EILSEQ
anatofuz
parents:
diff changeset
47 inappropriate_io_control_operation, // ENOTTY
anatofuz
parents:
diff changeset
48 interrupted, // EINTR
anatofuz
parents:
diff changeset
49 invalid_argument, // EINVAL
anatofuz
parents:
diff changeset
50 invalid_seek, // ESPIPE
anatofuz
parents:
diff changeset
51 io_error, // EIO
anatofuz
parents:
diff changeset
52 is_a_directory, // EISDIR
anatofuz
parents:
diff changeset
53 message_size, // EMSGSIZE
anatofuz
parents:
diff changeset
54 network_down, // ENETDOWN
anatofuz
parents:
diff changeset
55 network_reset, // ENETRESET
anatofuz
parents:
diff changeset
56 network_unreachable, // ENETUNREACH
anatofuz
parents:
diff changeset
57 no_buffer_space, // ENOBUFS
anatofuz
parents:
diff changeset
58 no_child_process, // ECHILD
anatofuz
parents:
diff changeset
59 no_link, // ENOLINK
anatofuz
parents:
diff changeset
60 no_lock_available, // ENOLCK
anatofuz
parents:
diff changeset
61 no_message_available, // ENODATA
anatofuz
parents:
diff changeset
62 no_message, // ENOMSG
anatofuz
parents:
diff changeset
63 no_protocol_option, // ENOPROTOOPT
anatofuz
parents:
diff changeset
64 no_space_on_device, // ENOSPC
anatofuz
parents:
diff changeset
65 no_stream_resources, // ENOSR
anatofuz
parents:
diff changeset
66 no_such_device_or_address, // ENXIO
anatofuz
parents:
diff changeset
67 no_such_device, // ENODEV
anatofuz
parents:
diff changeset
68 no_such_file_or_directory, // ENOENT
anatofuz
parents:
diff changeset
69 no_such_process, // ESRCH
anatofuz
parents:
diff changeset
70 not_a_directory, // ENOTDIR
anatofuz
parents:
diff changeset
71 not_a_socket, // ENOTSOCK
anatofuz
parents:
diff changeset
72 not_a_stream, // ENOSTR
anatofuz
parents:
diff changeset
73 not_connected, // ENOTCONN
anatofuz
parents:
diff changeset
74 not_enough_memory, // ENOMEM
anatofuz
parents:
diff changeset
75 not_supported, // ENOTSUP
anatofuz
parents:
diff changeset
76 operation_canceled, // ECANCELED
anatofuz
parents:
diff changeset
77 operation_in_progress, // EINPROGRESS
anatofuz
parents:
diff changeset
78 operation_not_permitted, // EPERM
anatofuz
parents:
diff changeset
79 operation_not_supported, // EOPNOTSUPP
anatofuz
parents:
diff changeset
80 operation_would_block, // EWOULDBLOCK
anatofuz
parents:
diff changeset
81 owner_dead, // EOWNERDEAD
anatofuz
parents:
diff changeset
82 permission_denied, // EACCES
anatofuz
parents:
diff changeset
83 protocol_error, // EPROTO
anatofuz
parents:
diff changeset
84 protocol_not_supported, // EPROTONOSUPPORT
anatofuz
parents:
diff changeset
85 read_only_file_system, // EROFS
anatofuz
parents:
diff changeset
86 resource_deadlock_would_occur, // EDEADLK
anatofuz
parents:
diff changeset
87 resource_unavailable_try_again, // EAGAIN
anatofuz
parents:
diff changeset
88 result_out_of_range, // ERANGE
anatofuz
parents:
diff changeset
89 state_not_recoverable, // ENOTRECOVERABLE
anatofuz
parents:
diff changeset
90 stream_timeout, // ETIME
anatofuz
parents:
diff changeset
91 text_file_busy, // ETXTBSY
anatofuz
parents:
diff changeset
92 timed_out, // ETIMEDOUT
anatofuz
parents:
diff changeset
93 too_many_files_open_in_system, // ENFILE
anatofuz
parents:
diff changeset
94 too_many_files_open, // EMFILE
anatofuz
parents:
diff changeset
95 too_many_links, // EMLINK
anatofuz
parents:
diff changeset
96 too_many_symbolic_link_levels, // ELOOP
anatofuz
parents:
diff changeset
97 value_too_large, // EOVERFLOW
anatofuz
parents:
diff changeset
98 wrong_protocol_type // EPROTOTYPE
anatofuz
parents:
diff changeset
99 };
anatofuz
parents:
diff changeset
100
anatofuz
parents:
diff changeset
101 */
anatofuz
parents:
diff changeset
102
anatofuz
parents:
diff changeset
103 #include <__config>
anatofuz
parents:
diff changeset
104 #include <cerrno>
anatofuz
parents:
diff changeset
105
anatofuz
parents:
diff changeset
106 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
anatofuz
parents:
diff changeset
107 #pragma GCC system_header
anatofuz
parents:
diff changeset
108 #endif
anatofuz
parents:
diff changeset
109
anatofuz
parents:
diff changeset
110 _LIBCPP_BEGIN_NAMESPACE_STD
anatofuz
parents:
diff changeset
111
anatofuz
parents:
diff changeset
112 // Some error codes are not present on all platforms, so we provide equivalents
anatofuz
parents:
diff changeset
113 // for them:
anatofuz
parents:
diff changeset
114
anatofuz
parents:
diff changeset
115 //enum class errc
anatofuz
parents:
diff changeset
116 _LIBCPP_DECLARE_STRONG_ENUM(errc)
anatofuz
parents:
diff changeset
117 {
anatofuz
parents:
diff changeset
118 address_family_not_supported = EAFNOSUPPORT,
anatofuz
parents:
diff changeset
119 address_in_use = EADDRINUSE,
anatofuz
parents:
diff changeset
120 address_not_available = EADDRNOTAVAIL,
anatofuz
parents:
diff changeset
121 already_connected = EISCONN,
anatofuz
parents:
diff changeset
122 argument_list_too_long = E2BIG,
anatofuz
parents:
diff changeset
123 argument_out_of_domain = EDOM,
anatofuz
parents:
diff changeset
124 bad_address = EFAULT,
anatofuz
parents:
diff changeset
125 bad_file_descriptor = EBADF,
anatofuz
parents:
diff changeset
126 bad_message = EBADMSG,
anatofuz
parents:
diff changeset
127 broken_pipe = EPIPE,
anatofuz
parents:
diff changeset
128 connection_aborted = ECONNABORTED,
anatofuz
parents:
diff changeset
129 connection_already_in_progress = EALREADY,
anatofuz
parents:
diff changeset
130 connection_refused = ECONNREFUSED,
anatofuz
parents:
diff changeset
131 connection_reset = ECONNRESET,
anatofuz
parents:
diff changeset
132 cross_device_link = EXDEV,
anatofuz
parents:
diff changeset
133 destination_address_required = EDESTADDRREQ,
anatofuz
parents:
diff changeset
134 device_or_resource_busy = EBUSY,
anatofuz
parents:
diff changeset
135 directory_not_empty = ENOTEMPTY,
anatofuz
parents:
diff changeset
136 executable_format_error = ENOEXEC,
anatofuz
parents:
diff changeset
137 file_exists = EEXIST,
anatofuz
parents:
diff changeset
138 file_too_large = EFBIG,
anatofuz
parents:
diff changeset
139 filename_too_long = ENAMETOOLONG,
anatofuz
parents:
diff changeset
140 function_not_supported = ENOSYS,
anatofuz
parents:
diff changeset
141 host_unreachable = EHOSTUNREACH,
anatofuz
parents:
diff changeset
142 identifier_removed = EIDRM,
anatofuz
parents:
diff changeset
143 illegal_byte_sequence = EILSEQ,
anatofuz
parents:
diff changeset
144 inappropriate_io_control_operation = ENOTTY,
anatofuz
parents:
diff changeset
145 interrupted = EINTR,
anatofuz
parents:
diff changeset
146 invalid_argument = EINVAL,
anatofuz
parents:
diff changeset
147 invalid_seek = ESPIPE,
anatofuz
parents:
diff changeset
148 io_error = EIO,
anatofuz
parents:
diff changeset
149 is_a_directory = EISDIR,
anatofuz
parents:
diff changeset
150 message_size = EMSGSIZE,
anatofuz
parents:
diff changeset
151 network_down = ENETDOWN,
anatofuz
parents:
diff changeset
152 network_reset = ENETRESET,
anatofuz
parents:
diff changeset
153 network_unreachable = ENETUNREACH,
anatofuz
parents:
diff changeset
154 no_buffer_space = ENOBUFS,
anatofuz
parents:
diff changeset
155 no_child_process = ECHILD,
anatofuz
parents:
diff changeset
156 no_link = ENOLINK,
anatofuz
parents:
diff changeset
157 no_lock_available = ENOLCK,
anatofuz
parents:
diff changeset
158 #ifdef ENODATA
anatofuz
parents:
diff changeset
159 no_message_available = ENODATA,
anatofuz
parents:
diff changeset
160 #else
anatofuz
parents:
diff changeset
161 no_message_available = ENOMSG,
anatofuz
parents:
diff changeset
162 #endif
anatofuz
parents:
diff changeset
163 no_message = ENOMSG,
anatofuz
parents:
diff changeset
164 no_protocol_option = ENOPROTOOPT,
anatofuz
parents:
diff changeset
165 no_space_on_device = ENOSPC,
anatofuz
parents:
diff changeset
166 #ifdef ENOSR
anatofuz
parents:
diff changeset
167 no_stream_resources = ENOSR,
anatofuz
parents:
diff changeset
168 #else
anatofuz
parents:
diff changeset
169 no_stream_resources = ENOMEM,
anatofuz
parents:
diff changeset
170 #endif
anatofuz
parents:
diff changeset
171 no_such_device_or_address = ENXIO,
anatofuz
parents:
diff changeset
172 no_such_device = ENODEV,
anatofuz
parents:
diff changeset
173 no_such_file_or_directory = ENOENT,
anatofuz
parents:
diff changeset
174 no_such_process = ESRCH,
anatofuz
parents:
diff changeset
175 not_a_directory = ENOTDIR,
anatofuz
parents:
diff changeset
176 not_a_socket = ENOTSOCK,
anatofuz
parents:
diff changeset
177 #ifdef ENOSTR
anatofuz
parents:
diff changeset
178 not_a_stream = ENOSTR,
anatofuz
parents:
diff changeset
179 #else
anatofuz
parents:
diff changeset
180 not_a_stream = EINVAL,
anatofuz
parents:
diff changeset
181 #endif
anatofuz
parents:
diff changeset
182 not_connected = ENOTCONN,
anatofuz
parents:
diff changeset
183 not_enough_memory = ENOMEM,
anatofuz
parents:
diff changeset
184 not_supported = ENOTSUP,
anatofuz
parents:
diff changeset
185 operation_canceled = ECANCELED,
anatofuz
parents:
diff changeset
186 operation_in_progress = EINPROGRESS,
anatofuz
parents:
diff changeset
187 operation_not_permitted = EPERM,
anatofuz
parents:
diff changeset
188 operation_not_supported = EOPNOTSUPP,
anatofuz
parents:
diff changeset
189 operation_would_block = EWOULDBLOCK,
anatofuz
parents:
diff changeset
190 owner_dead = EOWNERDEAD,
anatofuz
parents:
diff changeset
191 permission_denied = EACCES,
anatofuz
parents:
diff changeset
192 protocol_error = EPROTO,
anatofuz
parents:
diff changeset
193 protocol_not_supported = EPROTONOSUPPORT,
anatofuz
parents:
diff changeset
194 read_only_file_system = EROFS,
anatofuz
parents:
diff changeset
195 resource_deadlock_would_occur = EDEADLK,
anatofuz
parents:
diff changeset
196 resource_unavailable_try_again = EAGAIN,
anatofuz
parents:
diff changeset
197 result_out_of_range = ERANGE,
anatofuz
parents:
diff changeset
198 state_not_recoverable = ENOTRECOVERABLE,
anatofuz
parents:
diff changeset
199 #ifdef ETIME
anatofuz
parents:
diff changeset
200 stream_timeout = ETIME,
anatofuz
parents:
diff changeset
201 #else
anatofuz
parents:
diff changeset
202 stream_timeout = ETIMEDOUT,
anatofuz
parents:
diff changeset
203 #endif
anatofuz
parents:
diff changeset
204 text_file_busy = ETXTBSY,
anatofuz
parents:
diff changeset
205 timed_out = ETIMEDOUT,
anatofuz
parents:
diff changeset
206 too_many_files_open_in_system = ENFILE,
anatofuz
parents:
diff changeset
207 too_many_files_open = EMFILE,
anatofuz
parents:
diff changeset
208 too_many_links = EMLINK,
anatofuz
parents:
diff changeset
209 too_many_symbolic_link_levels = ELOOP,
anatofuz
parents:
diff changeset
210 value_too_large = EOVERFLOW,
anatofuz
parents:
diff changeset
211 wrong_protocol_type = EPROTOTYPE
anatofuz
parents:
diff changeset
212 };
anatofuz
parents:
diff changeset
213 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
anatofuz
parents:
diff changeset
214
anatofuz
parents:
diff changeset
215 _LIBCPP_END_NAMESPACE_STD
anatofuz
parents:
diff changeset
216
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
217 #endif // _LIBCPP___ERRC