Skip to content

Commit d4d4c61

Browse files
authored
Merge pull request #3202 from moiseev/sameline-doc-comments
2 parents 19af8a1 + 38be253 commit d4d4c61

File tree

1 file changed

+224
-117
lines changed

1 file changed

+224
-117
lines changed

stdlib/public/Platform/POSIXError.swift

Lines changed: 224 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -5,141 +5,248 @@
55
@objc public enum POSIXError : CInt {
66
// FIXME: These are the values for Darwin. We need to get the Linux
77
// values as well.
8-
case EPERM = 1 /// Operation not permitted.
9-
case ENOENT = 2 /// No such file or directory.
10-
case ESRCH = 3 /// No such process.
11-
case EINTR = 4 /// Interrupted system call.
12-
case EIO = 5 /// Input/output error.
13-
case ENXIO = 6 /// Device not configured.
14-
case E2BIG = 7 /// Argument list too long.
15-
case ENOEXEC = 8 /// Exec format error.
16-
case EBADF = 9 /// Bad file descriptor.
17-
case ECHILD = 10 /// No child processes.
18-
case EDEADLK = 11 /// Resource deadlock avoided.
8+
/// Operation not permitted.
9+
case EPERM = 1
10+
/// No such file or directory.
11+
case ENOENT = 2
12+
/// No such process.
13+
case ESRCH = 3
14+
/// Interrupted system call.
15+
case EINTR = 4
16+
/// Input/output error.
17+
case EIO = 5
18+
/// Device not configured.
19+
case ENXIO = 6
20+
/// Argument list too long.
21+
case E2BIG = 7
22+
/// Exec format error.
23+
case ENOEXEC = 8
24+
/// Bad file descriptor.
25+
case EBADF = 9
26+
/// No child processes.
27+
case ECHILD = 10
28+
/// Resource deadlock avoided.
29+
case EDEADLK = 11
1930
/// 11 was EAGAIN.
20-
case ENOMEM = 12 /// Cannot allocate memory.
21-
case EACCES = 13 /// Permission denied.
22-
case EFAULT = 14 /// Bad address.
23-
case ENOTBLK = 15 /// Block device required.
24-
case EBUSY = 16 /// Device / Resource busy.
25-
case EEXIST = 17 /// File exists.
26-
case EXDEV = 18 /// Cross-device link.
27-
case ENODEV = 19 /// Operation not supported by device.
28-
case ENOTDIR = 20 /// Not a directory.
29-
case EISDIR = 21 /// Is a directory.
30-
case EINVAL = 22 /// Invalid argument.
31-
case ENFILE = 23 /// Too many open files in system.
32-
case EMFILE = 24 /// Too many open files.
33-
case ENOTTY = 25 /// Inappropriate ioctl for device.
34-
case ETXTBSY = 26 /// Text file busy.
35-
case EFBIG = 27 /// File too large.
36-
case ENOSPC = 28 /// No space left on device.
37-
case ESPIPE = 29 /// Illegal seek.
38-
case EROFS = 30 /// Read-only file system.
39-
case EMLINK = 31 /// Too many links.
40-
case EPIPE = 32 /// Broken pipe.
31+
/// Cannot allocate memory.
32+
case ENOMEM = 12
33+
/// Permission denied.
34+
case EACCES = 13
35+
/// Bad address.
36+
case EFAULT = 14
37+
/// Block device required.
38+
case ENOTBLK = 15
39+
/// Device / Resource busy.
40+
case EBUSY = 16
41+
/// File exists.
42+
case EEXIST = 17
43+
/// Cross-device link.
44+
case EXDEV = 18
45+
/// Operation not supported by device.
46+
case ENODEV = 19
47+
/// Not a directory.
48+
case ENOTDIR = 20
49+
/// Is a directory.
50+
case EISDIR = 21
51+
/// Invalid argument.
52+
case EINVAL = 22
53+
/// Too many open files in system.
54+
case ENFILE = 23
55+
/// Too many open files.
56+
case EMFILE = 24
57+
/// Inappropriate ioctl for device.
58+
case ENOTTY = 25
59+
/// Text file busy.
60+
case ETXTBSY = 26
61+
/// File too large.
62+
case EFBIG = 27
63+
/// No space left on device.
64+
case ENOSPC = 28
65+
/// Illegal seek.
66+
case ESPIPE = 29
67+
/// Read-only file system.
68+
case EROFS = 30
69+
/// Too many links.
70+
case EMLINK = 31
71+
/// Broken pipe.
72+
case EPIPE = 32
4173

4274
/// math software.
43-
case EDOM = 33 /// Numerical argument out of domain.
44-
case ERANGE = 34 /// Result too large.
75+
/// Numerical argument out of domain.
76+
case EDOM = 33
77+
/// Result too large.
78+
case ERANGE = 34
4579

4680
/// non-blocking and interrupt i/o.
47-
case EAGAIN = 35 /// Resource temporarily unavailable.
48-
public static var EWOULDBLOCK: POSIXError { return EAGAIN } /// Operation would block.
49-
case EINPROGRESS = 36 /// Operation now in progress.
50-
case EALREADY = 37 /// Operation already in progress.
81+
/// Resource temporarily unavailable.
82+
case EAGAIN = 35
83+
/// Operation would block.
84+
public static var EWOULDBLOCK: POSIXError { return EAGAIN }
85+
/// Operation now in progress.
86+
case EINPROGRESS = 36
87+
/// Operation already in progress.
88+
case EALREADY = 37
5189

5290
/// ipc/network software -- argument errors.
53-
case ENOTSOCK = 38 /// Socket operation on non-socket.
54-
case EDESTADDRREQ = 39 /// Destination address required.
55-
case EMSGSIZE = 40 /// Message too long.
56-
case EPROTOTYPE = 41 /// Protocol wrong type for socket.
57-
case ENOPROTOOPT = 42 /// Protocol not available.
58-
case EPROTONOSUPPORT = 43 /// Protocol not supported.
59-
case ESOCKTNOSUPPORT = 44 /// Socket type not supported.
60-
case ENOTSUP = 45 /// Operation not supported.
61-
case EPFNOSUPPORT = 46 /// Protocol family not supported.
62-
case EAFNOSUPPORT = 47 /// Address family not supported by protocol family.
63-
case EADDRINUSE = 48 /// Address already in use.
64-
case EADDRNOTAVAIL = 49 /// Can't assign requested address.
91+
/// Socket operation on non-socket.
92+
case ENOTSOCK = 38
93+
/// Destination address required.
94+
case EDESTADDRREQ = 39
95+
/// Message too long.
96+
case EMSGSIZE = 40
97+
/// Protocol wrong type for socket.
98+
case EPROTOTYPE = 41
99+
/// Protocol not available.
100+
case ENOPROTOOPT = 42
101+
/// Protocol not supported.
102+
case EPROTONOSUPPORT = 43
103+
/// Socket type not supported.
104+
case ESOCKTNOSUPPORT = 44
105+
/// Operation not supported.
106+
case ENOTSUP = 45
107+
/// Protocol family not supported.
108+
case EPFNOSUPPORT = 46
109+
/// Address family not supported by protocol family.
110+
case EAFNOSUPPORT = 47
111+
/// Address already in use.
112+
case EADDRINUSE = 48
113+
/// Can't assign requested address.
114+
case EADDRNOTAVAIL = 49
65115

66116
/// ipc/network software -- operational errors
67-
case ENETDOWN = 50 /// Network is down.
68-
case ENETUNREACH = 51 /// Network is unreachable.
69-
case ENETRESET = 52 /// Network dropped connection on reset.
70-
case ECONNABORTED = 53 /// Software caused connection abort.
71-
case ECONNRESET = 54 /// Connection reset by peer.
72-
case ENOBUFS = 55 /// No buffer space available.
73-
case EISCONN = 56 /// Socket is already connected.
74-
case ENOTCONN = 57 /// Socket is not connected.
75-
case ESHUTDOWN = 58 /// Can't send after socket shutdown.
76-
case ETOOMANYREFS = 59 /// Too many references: can't splice.
77-
case ETIMEDOUT = 60 /// Operation timed out.
78-
case ECONNREFUSED = 61 /// Connection refused.
79-
80-
case ELOOP = 62 /// Too many levels of symbolic links.
81-
case ENAMETOOLONG = 63 /// File name too long.
82-
83-
case EHOSTDOWN = 64 /// Host is down.
84-
case EHOSTUNREACH = 65 /// No route to host.
85-
case ENOTEMPTY = 66 /// Directory not empty.
117+
/// Network is down.
118+
case ENETDOWN = 50
119+
/// Network is unreachable.
120+
case ENETUNREACH = 51
121+
/// Network dropped connection on reset.
122+
case ENETRESET = 52
123+
/// Software caused connection abort.
124+
case ECONNABORTED = 53
125+
/// Connection reset by peer.
126+
case ECONNRESET = 54
127+
/// No buffer space available.
128+
case ENOBUFS = 55
129+
/// Socket is already connected.
130+
case EISCONN = 56
131+
/// Socket is not connected.
132+
case ENOTCONN = 57
133+
/// Can't send after socket shutdown.
134+
case ESHUTDOWN = 58
135+
/// Too many references: can't splice.
136+
case ETOOMANYREFS = 59
137+
/// Operation timed out.
138+
case ETIMEDOUT = 60
139+
/// Connection refused.
140+
case ECONNREFUSED = 61
141+
142+
/// Too many levels of symbolic links.
143+
case ELOOP = 62
144+
/// File name too long.
145+
case ENAMETOOLONG = 63
146+
147+
/// Host is down.
148+
case EHOSTDOWN = 64
149+
/// No route to host.
150+
case EHOSTUNREACH = 65
151+
/// Directory not empty.
152+
case ENOTEMPTY = 66
86153

87154
/// quotas & mush.
88-
case EPROCLIM = 67 /// Too many processes.
89-
case EUSERS = 68 /// Too many users.
90-
case EDQUOT = 69 /// Disc quota exceeded.
155+
/// Too many processes.
156+
case EPROCLIM = 67
157+
/// Too many users.
158+
case EUSERS = 68
159+
/// Disc quota exceeded.
160+
case EDQUOT = 69
91161

92162
/// Network File System.
93-
case ESTALE = 70 /// Stale NFS file handle.
94-
case EREMOTE = 71 /// Too many levels of remote in path.
95-
case EBADRPC = 72 /// RPC struct is bad.
96-
case ERPCMISMATCH = 73 /// RPC version wrong.
97-
case EPROGUNAVAIL = 74 /// RPC prog. not avail.
98-
case EPROGMISMATCH = 75 /// Program version wrong.
99-
case EPROCUNAVAIL = 76 /// Bad procedure for program.
100-
101-
case ENOLCK = 77 /// No locks available.
102-
case ENOSYS = 78 /// Function not implemented.
103-
104-
case EFTYPE = 79 /// Inappropriate file type or format.
105-
case EAUTH = 80 /// Authentication error.
106-
case ENEEDAUTH = 81 /// Need authenticator.
163+
/// Stale NFS file handle.
164+
case ESTALE = 70
165+
/// Too many levels of remote in path.
166+
case EREMOTE = 71
167+
/// RPC struct is bad.
168+
case EBADRPC = 72
169+
/// RPC version wrong.
170+
case ERPCMISMATCH = 73
171+
/// RPC prog. not avail.
172+
case EPROGUNAVAIL = 74
173+
/// Program version wrong.
174+
case EPROGMISMATCH = 75
175+
/// Bad procedure for program.
176+
case EPROCUNAVAIL = 76
177+
178+
/// No locks available.
179+
case ENOLCK = 77
180+
/// Function not implemented.
181+
case ENOSYS = 78
182+
183+
/// Inappropriate file type or format.
184+
case EFTYPE = 79
185+
/// Authentication error.
186+
case EAUTH = 80
187+
/// Need authenticator.
188+
case ENEEDAUTH = 81
107189

108190
/// Intelligent device errors.
109-
case EPWROFF = 82 /// Device power is off.
110-
case EDEVERR = 83 /// Device error, e.g. paper out.
191+
/// Device power is off.
192+
case EPWROFF = 82
193+
/// Device error, e.g. paper out.
194+
case EDEVERR = 83
111195

112-
case EOVERFLOW = 84 /// Value too large to be stored in data type.
196+
/// Value too large to be stored in data type.
197+
case EOVERFLOW = 84
113198

114199
/// Program loading errors.
115-
case EBADEXEC = 85 /// Bad executable.
116-
case EBADARCH = 86 /// Bad CPU type in executable.
117-
case ESHLIBVERS = 87 /// Shared library version mismatch.
118-
case EBADMACHO = 88 /// Malformed Macho file.
119-
120-
case ECANCELED = 89 /// Operation canceled.
121-
122-
case EIDRM = 90 /// Identifier removed.
123-
case ENOMSG = 91 /// No message of desired type.
124-
case EILSEQ = 92 /// Illegal byte sequence.
125-
case ENOATTR = 93 /// Attribute not found.
126-
127-
case EBADMSG = 94 /// Bad message.
128-
case EMULTIHOP = 95 /// Reserved.
129-
case ENODATA = 96 /// No message available on STREAM.
130-
case ENOLINK = 97 /// Reserved.
131-
case ENOSR = 98 /// No STREAM resources.
132-
case ENOSTR = 99 /// Not a STREAM.
133-
case EPROTO = 100 /// Protocol error.
134-
case ETIME = 101 /// STREAM ioctl timeout.
135-
136-
case ENOPOLICY = 103 /// No such policy registered.
137-
138-
case ENOTRECOVERABLE = 104 /// State not recoverable.
139-
case EOWNERDEAD = 105 /// Previous owner died.
140-
141-
case EQFULL = 106 /// Interface output queue is full.
142-
public static var ELAST: POSIXError { return EQFULL } /// Must be equal largest errno.
200+
/// Bad executable.
201+
case EBADEXEC = 85
202+
/// Bad CPU type in executable.
203+
case EBADARCH = 86
204+
/// Shared library version mismatch.
205+
case ESHLIBVERS = 87
206+
/// Malformed Macho file.
207+
case EBADMACHO = 88
208+
209+
/// Operation canceled.
210+
case ECANCELED = 89
211+
212+
/// Identifier removed.
213+
case EIDRM = 90
214+
/// No message of desired type.
215+
case ENOMSG = 91
216+
/// Illegal byte sequence.
217+
case EILSEQ = 92
218+
/// Attribute not found.
219+
case ENOATTR = 93
220+
221+
/// Bad message.
222+
case EBADMSG = 94
223+
/// Reserved.
224+
case EMULTIHOP = 95
225+
/// No message available on STREAM.
226+
case ENODATA = 96
227+
/// Reserved.
228+
case ENOLINK = 97
229+
/// No STREAM resources.
230+
case ENOSR = 98
231+
/// Not a STREAM.
232+
case ENOSTR = 99
233+
/// Protocol error.
234+
case EPROTO = 100
235+
/// STREAM ioctl timeout.
236+
case ETIME = 101
237+
238+
/// No such policy registered.
239+
case ENOPOLICY = 103
240+
241+
/// State not recoverable.
242+
case ENOTRECOVERABLE = 104
243+
/// Previous owner died.
244+
case EOWNERDEAD = 105
245+
246+
/// Interface output queue is full.
247+
case EQFULL = 106
248+
/// Must be equal largest errno.
249+
public static var ELAST: POSIXError { return EQFULL }
143250

144251
// FIXME: EOPNOTSUPP has different values depending on __DARWIN_UNIX03 and
145252
// KERNEL.

0 commit comments

Comments
 (0)