     }
 
     public static var _nsErrorDomain: String { return NSPOSIXErrorDomain }
-
-    public enum Code : Int, _ErrorCodeProtocol {
-        public typealias _ErrorType = POSIXError
-
-        case EPERM
-        case ENOENT
-        case ESRCH
-        case EINTR
-        case EIO
-        case ENXIO
-        case E2BIG
-        case ENOEXEC
-        case EBADF
-        case ECHILD
-        case EDEADLK
-        case ENOMEM
-        case EACCES
-        case EFAULT
-        case ENOTBLK
-        case EBUSY
-        case EEXIST
-        case EXDEV
-        case ENODEV
-        case ENOTDIR
-        case EISDIR
-        case EINVAL
-        case ENFILE
-        case EMFILE
-        case ENOTTY
-        case ETXTBSY
-        case EFBIG
-        case ENOSPC
-        case ESPIPE
-        case EROFS
-        case EMLINK
-        case EPIPE
-        case EDOM
-        case ERANGE
-        case EAGAIN
-        case EWOULDBLOCK
-        case EINPROGRESS
-        case EALREADY
-        case ENOTSOCK
-        case EDESTADDRREQ
-        case EMSGSIZE
-        case EPROTOTYPE
-        case ENOPROTOOPT
-        case EPROTONOSUPPORT
-        case ESOCKTNOSUPPORT
-        case ENOTSUP
-        case EPFNOSUPPORT
-        case EAFNOSUPPORT
-        case EADDRINUSE
-        case EADDRNOTAVAIL
-        case ENETDOWN
-        case ENETUNREACH
-        case ENETRESET
-        case ECONNABORTED
-        case ECONNRESET
-        case ENOBUFS
-        case EISCONN
-        case ENOTCONN
-        case ESHUTDOWN
-        case ETOOMANYREFS
-        case ETIMEDOUT
-        case ECONNREFUSED
-        case ELOOP
-        case ENAMETOOLONG
-        case EHOSTDOWN
-        case EHOSTUNREACH
-        case ENOTEMPTY
-        case EPROCLIM
-        case EUSERS
-        case EDQUOT
-        case ESTALE
-        case EREMOTE
-        case EBADRPC
-        case ERPCMISMATCH
-        case EPROGUNAVAIL
-        case EPROGMISMATCH
-        case EPROCUNAVAIL
-        case ENOLCK
-        case ENOSYS
-        case EFTYPE
-        case EAUTH
-        case ENEEDAUTH
-        case EPWROFF
-        case EDEVERR
-        case EOVERFLOW
-        case EBADEXEC
-        case EBADARCH
-        case ESHLIBVERS
-        case EBADMACHO
-        case ECANCELED
-        case EIDRM
-        case ENOMSG
-        case EILSEQ
-        case ENOATTR
-        case EBADMSG
-        case EMULTIHOP
-        case ENODATA
-        case ENOLINK
-        case ENOSR
-        case ENOSTR
-        case EPROTO
-        case ETIME
-        case ENOPOLICY
-        case ENOTRECOVERABLE
-        case EOWNERDEAD
-        case EQFULL
-    }
+    
+    public typealias Code = POSIXErrorCode
+}
+
+extension POSIXErrorCode: _ErrorCodeProtocol {
+    public typealias _ErrorType = POSIXError
 }
 
 extension POSIXError {


    /// Quotas

    /// Too many processes.
    public static var EPROCLIM: POSIXError.Code { return .EPROCLIM }

    /// Too many users.
    public static var EUSERS: POSIXError.Code { return .EUSERS }


    /// Too many levels of remote in path.
    public static var EREMOTE: POSIXError.Code { return .EREMOTE }

    #if canImport(Darwin)
    /// RPC struct is bad.
    public static var EBADRPC: POSIXError.Code { return .EBADRPC }

