<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "System",
  "identifier" : "/documentation/System/Errno",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "s:6System5ErrnoV"
  },
  "title" : "Errno"
}
-->

# Errno

An error number used by system calls to communicate what kind of error
occurred.

```
@frozen struct Errno
```

## Topics

### File and Directory Errors

[`static var attributeNotFound: Errno`](/documentation/System/Errno/attributeNotFound)

Attribute not found.

[`static var badFileDescriptor: Errno`](/documentation/System/Errno/badFileDescriptor)

Bad file descriptor.

[`static var fileExists: Errno`](/documentation/System/Errno/fileExists)

File exists.

[`static var fileTooLarge: Errno`](/documentation/System/Errno/fileTooLarge)

The file is too large.

[`static var improperLink: Errno`](/documentation/System/Errno/improperLink)

Improper link.

[`static var isDirectory: Errno`](/documentation/System/Errno/isDirectory)

Is a directory.

[`static var noLocks: Errno`](/documentation/System/Errno/noLocks)

No locks available.

[`static var noSuchFileOrDirectory: Errno`](/documentation/System/Errno/noSuchFileOrDirectory)

No such file or directory.

[`static var notDirectory: Errno`](/documentation/System/Errno/notDirectory)

Not a directory.

[`static var permissionDenied: Errno`](/documentation/System/Errno/permissionDenied)

Permission denied.

[`static var textFileBusy: Errno`](/documentation/System/Errno/textFileBusy)

Text file busy.

### File System Errors

[`static var badFileTypeOrFormat: Errno`](/documentation/System/Errno/badFileTypeOrFormat)

Inappropriate file type or format.

[`static var directoryNotEmpty: Errno`](/documentation/System/Errno/directoryNotEmpty)

Directory not empty.

[`static var diskQuotaExceeded: Errno`](/documentation/System/Errno/diskQuotaExceeded)

Disk quota exceeded.

[`static var noSpace: Errno`](/documentation/System/Errno/noSpace)

Device out of space.

[`static var readOnlyFileSystem: Errno`](/documentation/System/Errno/readOnlyFileSystem)

Read-only file system.

[`static var tooManyLinks: Errno`](/documentation/System/Errno/tooManyLinks)

Too many links.

[`static var tooManyOpenFilesInSystem: Errno`](/documentation/System/Errno/tooManyOpenFilesInSystem)

The system has too many open files.

[`static var tooManyOpenFiles: Errno`](/documentation/System/Errno/tooManyOpenFiles)

This process has too many open files.

### NFS Errors

[`static var authenticationError: Errno`](/documentation/System/Errno/authenticationError)

Authentication error.

[`static var needAuthenticator: Errno`](/documentation/System/Errno/needAuthenticator)

Need authenticator.

[`static var staleNFSFileHandle: Errno`](/documentation/System/Errno/staleNFSFileHandle)

Stale NFS file handle.

### Device Errors

[`static var deviceError: Errno`](/documentation/System/Errno/deviceError)

Device error.

[`static var devicePowerIsOff: Errno`](/documentation/System/Errno/devicePowerIsOff)

Device power is off.

[`static var inappropriateIOCTLForDevice: Errno`](/documentation/System/Errno/inappropriateIOCTLForDevice)

Inappropriate control function.

[`static var ioError: Errno`](/documentation/System/Errno/ioError)

Input/output error.

[`static var noSuchAddressOrDevice: Errno`](/documentation/System/Errno/noSuchAddressOrDevice)

No such device or address.

[`static var notBlockDevice: Errno`](/documentation/System/Errno/notBlockDevice)

Not a block device.

[`static var operationNotSupportedByDevice: Errno`](/documentation/System/Errno/operationNotSupportedByDevice)

Operation not supported by device.

### Path Errors

[`static var fileNameTooLong: Errno`](/documentation/System/Errno/fileNameTooLong)

The file name is too long.

[`static var tooManyRemoteLevels: Errno`](/documentation/System/Errno/tooManyRemoteLevels)

Too many levels of remote in path.

[`static var tooManySymbolicLinkLevels: Errno`](/documentation/System/Errno/tooManySymbolicLinkLevels)

Too many levels of symbolic links.

### Pipe Errors

[`static var brokenPipe: Errno`](/documentation/System/Errno/brokenPipe)

Broken pipe.

[`static var illegalSeek: Errno`](/documentation/System/Errno/illegalSeek)

Illegal seek.

### Runtime Errors

[`static var deadlock: Errno`](/documentation/System/Errno/deadlock)

Resource deadlock avoided.

[`static var noMemory: Errno`](/documentation/System/Errno/noMemory)

Can’t allocate memory.

[`static var wouldBlock: Errno`](/documentation/System/Errno/wouldBlock)

Operation would block.

### Math Errors

[`static var outOfDomain: Errno`](/documentation/System/Errno/outOfDomain)

Numerical argument out of domain.

[`static var outOfRange: Errno`](/documentation/System/Errno/outOfRange)

Numerical result out of range.

[`static var overflow: Errno`](/documentation/System/Errno/overflow)

Value too large to be stored in data type.

### Executable File Errors

[`static var badCPUType: Errno`](/documentation/System/Errno/badCPUType)

Bad CPU type in executable.

[`static var badExecutable: Errno`](/documentation/System/Errno/badExecutable)

Bad executable or shared library.

[`static var execFormatError: Errno`](/documentation/System/Errno/execFormatError)

Executable format error.

[`static var malformedMachO: Errno`](/documentation/System/Errno/malformedMachO)

Malformed Mach-O file.

[`static var sharedLibraryVersionMismatch: Errno`](/documentation/System/Errno/sharedLibraryVersionMismatch)

Shared library version mismatch.

### Network Errors

[`static var connectionAbort: Errno`](/documentation/System/Errno/connectionAbort)

Software caused a connection abort.

[`static var connectionRefused: Errno`](/documentation/System/Errno/connectionRefused)

Connection refused.

[`static var connectionReset: Errno`](/documentation/System/Errno/connectionReset)

Connection reset by peer.

[`static var hostIsDown: Errno`](/documentation/System/Errno/hostIsDown)

The host is down.

[`static var messageTooLong: Errno`](/documentation/System/Errno/messageTooLong)

Message too long.

[`static var networkDown: Errno`](/documentation/System/Errno/networkDown)

Network is down.

[`static var networkReset: Errno`](/documentation/System/Errno/networkReset)

Network dropped connection on reset.

[`static var networkUnreachable: Errno`](/documentation/System/Errno/networkUnreachable)

Network is unreachable.

[`static var noBufferSpace: Errno`](/documentation/System/Errno/noBufferSpace)

No buffer space available.

[`static var noRouteToHost: Errno`](/documentation/System/Errno/noRouteToHost)

No route to host.

[`static var notSupported: Errno`](/documentation/System/Errno/notSupported)

Not supported.

[`static var timedOut: Errno`](/documentation/System/Errno/timedOut)

Operation timed out.

### Network Protocol Errors

[`static var protocolError: Errno`](/documentation/System/Errno/protocolError)

Protocol error.

[`static var protocolFamilyNotSupported: Errno`](/documentation/System/Errno/protocolFamilyNotSupported)

Protocol family not supported.

[`static var protocolNotAvailable: Errno`](/documentation/System/Errno/protocolNotAvailable)

Protocol not available.

[`static var protocolNotSupported: Errno`](/documentation/System/Errno/protocolNotSupported)

Protocol not supported.

[`static var protocolWrongTypeForSocket: Errno`](/documentation/System/Errno/protocolWrongTypeForSocket)

Protocol wrong for socket type.

### Network Address Errors

[`static var addressFamilyNotSupported: Errno`](/documentation/System/Errno/addressFamilyNotSupported)

The address family isn’t supported by the protocol family.

[`static var addressInUse: Errno`](/documentation/System/Errno/addressInUse)

Address already in use.

[`static var addressNotAvailable: Errno`](/documentation/System/Errno/addressNotAvailable)

Can’t assign the requested address.

[`static var addressRequired: Errno`](/documentation/System/Errno/addressRequired)

Destination address required.

### Network Socket Errors

[`static var notSocket: Errno`](/documentation/System/Errno/notSocket)

A socket operation was performed on something that isn’t a socket.

[`static var notSupportedOnSocket: Errno`](/documentation/System/Errno/notSupportedOnSocket)

Operation not supported on socket.

[`static var socketIsConnected: Errno`](/documentation/System/Errno/socketIsConnected)

Socket is already connected.

[`static var socketNotConnected: Errno`](/documentation/System/Errno/socketNotConnected)

Socket is not connected.

[`static var socketShutdown: Errno`](/documentation/System/Errno/socketShutdown)

Can’t send after socket shutdown.

[`static var socketTypeNotSupported: Errno`](/documentation/System/Errno/socketTypeNotSupported)

Socket type not supported.

### RPC Errors

[`static var rpcProcedureUnavailable: Errno`](/documentation/System/Errno/rpcProcedureUnavailable)

Bad procedure for program.

[`static var rpcProgramUnavailable: Errno`](/documentation/System/Errno/rpcProgramUnavailable)

The remote procedure call (RPC) program isn’t available.

[`static var rpcProgramVersionMismatch: Errno`](/documentation/System/Errno/rpcProgramVersionMismatch)

The version of the remote procedure call (RPC) program is incorrect.

[`static var rpcUnsuccessful: Errno`](/documentation/System/Errno/rpcUnsuccessful)

The structure of the remote procedure call (RPC) is bad.

[`static var rpcVersionMismatch: Errno`](/documentation/System/Errno/rpcVersionMismatch)

The version of the remote procedure call (RPC) is incorrect.

### Process Errors

[`static var argListTooLong: Errno`](/documentation/System/Errno/argListTooLong)

The argument list is too long.

[`static var identifierRemoved: Errno`](/documentation/System/Errno/identifierRemoved)

Identifier removed.

[`static var noChildProcess: Errno`](/documentation/System/Errno/noChildProcess)

No child processes.

[`static var noSuchProcess: Errno`](/documentation/System/Errno/noSuchProcess)

No such process.

[`static var previousOwnerDied: Errno`](/documentation/System/Errno/previousOwnerDied)

Previous pthread mutex owner died.

[`static var tooManyProcesses: Errno`](/documentation/System/Errno/tooManyProcesses)

Too many processes.

### System Call Errors

[`static var alreadyInProcess: Errno`](/documentation/System/Errno/alreadyInProcess)

Operation already in progress.

[`static var badAddress: Errno`](/documentation/System/Errno/badAddress)

Bad address.

[`static var interrupted: Errno`](/documentation/System/Errno/interrupted)

Interrupted function call.

[`static var invalidArgument: Errno`](/documentation/System/Errno/invalidArgument)

Invalid argument.

[`static var noFunction: Errno`](/documentation/System/Errno/noFunction)

Function not implemented.

[`static var nowInProgress: Errno`](/documentation/System/Errno/nowInProgress)

Operation now in progress.

[`static var resourceBusy: Errno`](/documentation/System/Errno/resourceBusy)

Resource busy.

[`static var resourceTemporarilyUnavailable: Errno`](/documentation/System/Errno/resourceTemporarilyUnavailable)

Resource temporarily unavailable.

### General Errors

[`static var badMessage: Errno`](/documentation/System/Errno/badMessage)

Bad message.

[`static var canceled: Errno`](/documentation/System/Errno/canceled)

Operation canceled.

[`static var illegalByteSequence: Errno`](/documentation/System/Errno/illegalByteSequence)

Illegal byte sequence.

[`static var noData: Errno`](/documentation/System/Errno/noData)

No message available.

[`static var noMessage: Errno`](/documentation/System/Errno/noMessage)

No message of desired type.

[`static var noSuchPolicy: Errno`](/documentation/System/Errno/noSuchPolicy)

No such policy registered.

[`static var notPermitted: Errno`](/documentation/System/Errno/notPermitted)

Operation not permitted.

[`static var notRecoverable: Errno`](/documentation/System/Errno/notRecoverable)

State not recoverable.

[`static var outputQueueFull: Errno`](/documentation/System/Errno/outputQueueFull)

Interface output queue is full.

[`static var tooManyReferences: Errno`](/documentation/System/Errno/tooManyReferences)

Too many references: can’t splice.

[`static var tooManyUsers: Errno`](/documentation/System/Errno/tooManyUsers)

Too many users.

### Reserved

[`static var lastErrnoValue: Errno`](/documentation/System/Errno/lastErrnoValue)

The largest valid error.

[`static var multiHop: Errno`](/documentation/System/Errno/multiHop)

Reserved.

[`static var noLink: Errno`](/documentation/System/Errno/noLink)

Reserved.

[`static var noStreamResources: Errno`](/documentation/System/Errno/noStreamResources)

Reserved.

[`static var notStream: Errno`](/documentation/System/Errno/notStream)

Reserved.

[`static var notUsed: Errno`](/documentation/System/Errno/notUsed)

Error. Not used.

[`static var timeout: Errno`](/documentation/System/Errno/timeout)

Reserved.

### Interacting with C APIs

[`init(rawValue: CInt)`](/documentation/System/Errno/init(rawValue:))

Creates a strongly typed error number from a raw C error number.

[`let rawValue: CInt`](/documentation/System/Errno/rawValue)

The raw C error number.

### Debugging

[`var description: String`](/documentation/System/Errno/description)

A textual representation of the most recent error
returned by a system call.

[`var debugDescription: String`](/documentation/System/Errno/debugDescription)

A textual representation,
suitable for debugging,
of the most recent error returned by a system call.

### Encoding Errors

### Comparing Errors

[`static func ~= (Errno, any Error) -> Bool`](/documentation/System/Errno/~=(_:_:))

### Default Implementations

[CustomDebugStringConvertible Implementations](/documentation/System/Errno/CustomDebugStringConvertible-Implementations)

[CustomStringConvertible Implementations](/documentation/System/Errno/CustomStringConvertible-Implementations)

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

[`Decodable`](/documentation/Swift/Decodable)

[`Escapable`](/documentation/Swift/Escapable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Encodable`](/documentation/Swift/Encodable)

[`Error`](/documentation/Swift/Error)

[`Sendable`](/documentation/Swift/Sendable)

---

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)