Skip to content

Commit f15810d

Browse files
committed
Merge pull request #2033 from danra/patch-10
Cosmetic fixes (NFC)
2 parents 626f94a + 37024e6 commit f15810d

File tree

1 file changed

+136
-135
lines changed

1 file changed

+136
-135
lines changed

stdlib/public/Platform/POSIXError.swift

Lines changed: 136 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -5,142 +5,143 @@
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 */
19-
/* 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 */
41-
42-
/* math software */
43-
case EDOM = 33 /* Numerical argument out of domain */
44-
case ERANGE = 34 /* Result too large */
45-
46-
/* 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 */
51-
52-
/* 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 */
65-
66-
/* 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 */
86-
87-
/* quotas & mush */
88-
case EPROCLIM = 67 /* Too many processes */
89-
case EUSERS = 68 /* Too many users */
90-
case EDQUOT = 69 /* Disc quota exceeded */
91-
92-
/* 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 */
107-
108-
/* Intelligent device errors */
109-
case EPWROFF = 82 /* Device power is off */
110-
case EDEVERR = 83 /* Device error, e.g. paper out */
111-
112-
case EOVERFLOW = 84 /* Value too large to be stored in data type */
113-
114-
/* 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-
case EBADMSG = 94 /* Bad message */
127-
case EMULTIHOP = 95 /* Reserved */
128-
case ENODATA = 96 /* No message available on STREAM */
129-
case ENOLINK = 97 /* Reserved */
130-
case ENOSR = 98 /* No STREAM resources */
131-
case ENOSTR = 99 /* Not a STREAM */
132-
case EPROTO = 100 /* Protocol error */
133-
case ETIME = 101 /* STREAM ioctl timeout */
134-
135-
case ENOPOLICY = 103 /* No such policy registered */
136-
137-
case ENOTRECOVERABLE = 104 /* State not recoverable */
138-
case EOWNERDEAD = 105 /* Previous owner died */
139-
140-
case EQFULL = 106 /* Interface output queue is full */
141-
public static var ELAST: POSIXError { return EQFULL } /* Must be equal largest errno */
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.
19+
/// 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.
41+
42+
/// math software.
43+
case EDOM = 33 /// Numerical argument out of domain.
44+
case ERANGE = 34 /// Result too large.
45+
46+
/// 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.
51+
52+
/// 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.
65+
66+
/// 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.
86+
87+
/// quotas & mush.
88+
case EPROCLIM = 67 /// Too many processes.
89+
case EUSERS = 68 /// Too many users.
90+
case EDQUOT = 69 /// Disc quota exceeded.
91+
92+
/// 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.
107+
108+
/// Intelligent device errors.
109+
case EPWROFF = 82 /// Device power is off.
110+
case EDEVERR = 83 /// Device error, e.g. paper out.
111+
112+
case EOVERFLOW = 84 /// Value too large to be stored in data type.
113+
114+
/// 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.
142143

143144
// FIXME: EOPNOTSUPP has different values depending on __DARWIN_UNIX03 and
144145
// KERNEL.
145146
}
146-
#endif
147+
#endif // os(OSX) || os(iOS) || os(tvOS) || os(watchOS)

0 commit comments

Comments
 (0)