<!--
{
  "documentType" : "article",
  "framework" : "System",
  "identifier" : "/documentation/System/adopting-errno",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Adopting Swift Error Constants"
}
-->

# Adopting Swift Error Constants

Migrate existing C code to Swift, using the error constants provided by the System module.

## Discussion

The C error constants map to Swift as follows:

- `E2BIG` ⟶ [`argListTooLong`](/documentation/System/Errno/argListTooLong)
- `EACCES` ⟶ [`permissionDenied`](/documentation/System/Errno/permissionDenied)
- `EADDRINUSE` ⟶ [`addressInUse`](/documentation/System/Errno/addressInUse)
- `EADDRNOTAVAIL` ⟶ [`addressNotAvailable`](/documentation/System/Errno/addressNotAvailable)
- `EAFNOSUPPORT` ⟶ [`addressFamilyNotSupported`](/documentation/System/Errno/addressFamilyNotSupported)
- `EAGAIN` ⟶ [`resourceTemporarilyUnavailable`](/documentation/System/Errno/resourceTemporarilyUnavailable)
- `EALREADY` ⟶ [`alreadyInProcess`](/documentation/System/Errno/alreadyInProcess)
- `EAUTH` ⟶ [`authenticationError`](/documentation/System/Errno/authenticationError)
- `EBADARCH` ⟶ [`badCPUType`](/documentation/System/Errno/badCPUType)
- `EBADEXEC` ⟶ [`badExecutable`](/documentation/System/Errno/badExecutable)
- `EBADF` ⟶ [`badFileDescriptor`](/documentation/System/Errno/badFileDescriptor)
- `EBADMACHO` ⟶ [`malformedMachO`](/documentation/System/Errno/malformedMachO)
- `EBADMSG` ⟶ [`badMessage`](/documentation/System/Errno/badMessage)
- `EBADRPC` ⟶ [`rpcUnsuccessful`](/documentation/System/Errno/rpcUnsuccessful)
- `EBUSY` ⟶ [`resourceBusy`](/documentation/System/Errno/resourceBusy)
- `ECANCELED` ⟶ [`canceled`](/documentation/System/Errno/canceled)
- `ECHILD` ⟶ [`noChildProcess`](/documentation/System/Errno/noChildProcess)
- `ECONNABORTED` ⟶ [`connectionAbort`](/documentation/System/Errno/connectionAbort)
- `ECONNREFUSED` ⟶ [`connectionRefused`](/documentation/System/Errno/connectionRefused)
- `ECONNRESET` ⟶ [`connectionReset`](/documentation/System/Errno/connectionReset)
- `EDEADLK` ⟶ [`deadlock`](/documentation/System/Errno/deadlock)
- `EDESTADDRREQ` ⟶ [`addressRequired`](/documentation/System/Errno/addressRequired)
- `EDEVERR` ⟶ [`deviceError`](/documentation/System/Errno/deviceError)
- `EDOM` ⟶ [`outOfDomain`](/documentation/System/Errno/outOfDomain)
- `EDQUOT` ⟶ [`diskQuotaExceeded`](/documentation/System/Errno/diskQuotaExceeded)
- `EEXIST` ⟶ [`fileExists`](/documentation/System/Errno/fileExists)
- `EFAULT` ⟶ [`badAddress`](/documentation/System/Errno/badAddress)
- `EFBIG` ⟶ [`fileTooLarge`](/documentation/System/Errno/fileTooLarge)
- `EFTYPE` ⟶ [`badFileTypeOrFormat`](/documentation/System/Errno/badFileTypeOrFormat)
- `EHOSTDOWN` ⟶ [`hostIsDown`](/documentation/System/Errno/hostIsDown)
- `EHOSTUNREACH` ⟶ [`noRouteToHost`](/documentation/System/Errno/noRouteToHost)
- `EIDRM` ⟶ [`identifierRemoved`](/documentation/System/Errno/identifierRemoved)
- `EILSEQ` ⟶ [`illegalByteSequence`](/documentation/System/Errno/illegalByteSequence)
- `EINPROGRESS` ⟶ [`nowInProgress`](/documentation/System/Errno/nowInProgress)
- `EINTR` ⟶ [`interrupted`](/documentation/System/Errno/interrupted)
- `EINVAL` ⟶ [`invalidArgument`](/documentation/System/Errno/invalidArgument)
- `EIO` ⟶ [`ioError`](/documentation/System/Errno/ioError)
- `EISCONN` ⟶ [`socketIsConnected`](/documentation/System/Errno/socketIsConnected)
- `EISDIR` ⟶ [`isDirectory`](/documentation/System/Errno/isDirectory)
- `ELAST` ⟶ [`lastErrnoValue`](/documentation/System/Errno/lastErrnoValue)
- `ELOOP` ⟶ [`tooManySymbolicLinkLevels`](/documentation/System/Errno/tooManySymbolicLinkLevels)
- `EMFILE` ⟶ [`tooManyOpenFiles`](/documentation/System/Errno/tooManyOpenFiles)
- `EMLINK` ⟶ [`tooManyLinks`](/documentation/System/Errno/tooManyLinks)
- `EMSGSIZE` ⟶ [`messageTooLong`](/documentation/System/Errno/messageTooLong)
- `EMULTIHOP` ⟶ [`multiHop`](/documentation/System/Errno/multiHop)
- `ENAMETOOLONG` ⟶ [`fileNameTooLong`](/documentation/System/Errno/fileNameTooLong)
- `ENEEDAUTH` ⟶ [`needAuthenticator`](/documentation/System/Errno/needAuthenticator)
- `ENETDOWN` ⟶ [`networkDown`](/documentation/System/Errno/networkDown)
- `ENETRESET` ⟶ [`networkReset`](/documentation/System/Errno/networkReset)
- `ENETUNREACH` ⟶ [`networkUnreachable`](/documentation/System/Errno/networkUnreachable)
- `ENFILE` ⟶ [`tooManyOpenFilesInSystem`](/documentation/System/Errno/tooManyOpenFilesInSystem)
- `ENOATTR` ⟶ [`attributeNotFound`](/documentation/System/Errno/attributeNotFound)
- `ENOBUFS` ⟶ [`noBufferSpace`](/documentation/System/Errno/noBufferSpace)
- `ENODATA` ⟶ [`noData`](/documentation/System/Errno/noData)
- `ENODEV` ⟶ [`operationNotSupportedByDevice`](/documentation/System/Errno/operationNotSupportedByDevice)
- `ENOENT` ⟶ [`noSuchFileOrDirectory`](/documentation/System/Errno/noSuchFileOrDirectory)
- `ENOEXEC` ⟶ [`execFormatError`](/documentation/System/Errno/execFormatError)
- `ENOLCK` ⟶ [`noLocks`](/documentation/System/Errno/noLocks)
- `ENOLINK` ⟶ [`noLink`](/documentation/System/Errno/noLink)
- `ENOMEM` ⟶ [`noMemory`](/documentation/System/Errno/noMemory)
- `ENOMSG` ⟶ [`noMessage`](/documentation/System/Errno/noMessage)
- `ENOPOLICY` ⟶ [`noSuchPolicy`](/documentation/System/Errno/noSuchPolicy)
- `ENOPROTOOPT` ⟶ [`protocolNotAvailable`](/documentation/System/Errno/protocolNotAvailable)
- `ENOSPC` ⟶ [`noSpace`](/documentation/System/Errno/noSpace)
- `ENOSR` ⟶ [`noStreamResources`](/documentation/System/Errno/noStreamResources)
- `ENOSTR` ⟶ [`notStream`](/documentation/System/Errno/notStream)
- `ENOSYS` ⟶ [`noFunction`](/documentation/System/Errno/noFunction)
- `ENOTBLK` ⟶ [`notBlockDevice`](/documentation/System/Errno/notBlockDevice)
- `ENOTCONN` ⟶ [`socketNotConnected`](/documentation/System/Errno/socketNotConnected)
- `ENOTDIR` ⟶ [`notDirectory`](/documentation/System/Errno/notDirectory)
- `ENOTEMPTY` ⟶ [`directoryNotEmpty`](/documentation/System/Errno/directoryNotEmpty)
- `ENOTRECOVERABLE` ⟶ [`notRecoverable`](/documentation/System/Errno/notRecoverable)
- `ENOTSOCK` ⟶ [`notSocket`](/documentation/System/Errno/notSocket)
- `ENOTSUP` ⟶ [`notSupported`](/documentation/System/Errno/notSupported)
- `ENOTTY` ⟶ [`inappropriateIOCTLForDevice`](/documentation/System/Errno/inappropriateIOCTLForDevice)
- `ENXIO` ⟶ [`noSuchAddressOrDevice`](/documentation/System/Errno/noSuchAddressOrDevice)
- `EOPNOTSUPP` ⟶ [`notSupportedOnSocket`](/documentation/System/Errno/notSupportedOnSocket)
- `EOVERFLOW` ⟶ [`overflow`](/documentation/System/Errno/overflow)
- `EOWNERDEAD` ⟶ [`previousOwnerDied`](/documentation/System/Errno/previousOwnerDied)
- `EPERM` ⟶ [`notPermitted`](/documentation/System/Errno/notPermitted)
- `EPFNOSUPPORT` ⟶ [`protocolFamilyNotSupported`](/documentation/System/Errno/protocolFamilyNotSupported)
- `EPIPE` ⟶ [`brokenPipe`](/documentation/System/Errno/brokenPipe)
- `EPROCLIM` ⟶ [`tooManyProcesses`](/documentation/System/Errno/tooManyProcesses)
- `EPROCUNAVAIL` ⟶ [`rpcProcedureUnavailable`](/documentation/System/Errno/rpcProcedureUnavailable)
- `EPROGMISMATCH` ⟶ [`rpcProgramVersionMismatch`](/documentation/System/Errno/rpcProgramVersionMismatch)
- `EPROGUNAVAIL` ⟶ [`rpcProgramUnavailable`](/documentation/System/Errno/rpcProgramUnavailable)
- `EPROTONOSUPPORT` ⟶ [`protocolNotSupported`](/documentation/System/Errno/protocolNotSupported)
- `EPROTOTYPE` ⟶ [`protocolWrongTypeForSocket`](/documentation/System/Errno/protocolWrongTypeForSocket)
- `EPROTO` ⟶ [`protocolError`](/documentation/System/Errno/protocolError)
- `EPWROFF` ⟶ [`devicePowerIsOff`](/documentation/System/Errno/devicePowerIsOff)
- `EQFULL` ⟶ [`outputQueueFull`](/documentation/System/Errno/outputQueueFull)
- `ERANGE` ⟶ [`outOfRange`](/documentation/System/Errno/outOfRange)
- `EREMOTE` ⟶ [`tooManyRemoteLevels`](/documentation/System/Errno/tooManyRemoteLevels)
- `EROFS` ⟶ [`readOnlyFileSystem`](/documentation/System/Errno/readOnlyFileSystem)
- `ERPCMISMATCH` ⟶ [`rpcVersionMismatch`](/documentation/System/Errno/rpcVersionMismatch)
- `ESHLIBVERS` ⟶ [`sharedLibraryVersionMismatch`](/documentation/System/Errno/sharedLibraryVersionMismatch)
- `ESHUTDOWN` ⟶ [`socketShutdown`](/documentation/System/Errno/socketShutdown)
- `ESOCKTNOSUPPORT` ⟶ [`socketTypeNotSupported`](/documentation/System/Errno/socketTypeNotSupported)
- `ESPIPE` ⟶ [`illegalSeek`](/documentation/System/Errno/illegalSeek)
- `ESRCH` ⟶ [`noSuchProcess`](/documentation/System/Errno/noSuchProcess)
- `ESTALE` ⟶ [`staleNFSFileHandle`](/documentation/System/Errno/staleNFSFileHandle)
- `ETIMEDOUT` ⟶ [`timedOut`](/documentation/System/Errno/timedOut)
- `ETIME` ⟶ [`timeout`](/documentation/System/Errno/timeout)
- `ETOOMANYREFS` ⟶ [`tooManyReferences`](/documentation/System/Errno/tooManyReferences)
- `ETXTBSY` ⟶ [`textFileBusy`](/documentation/System/Errno/textFileBusy)
- `EUSERS` ⟶ [`tooManyUsers`](/documentation/System/Errno/tooManyUsers)
- `EWOULDBLOCK` ⟶ [`wouldBlock`](/documentation/System/Errno/wouldBlock)
- `EXDEV` ⟶ [`improperLink`](/documentation/System/Errno/improperLink)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)