Error struct
Names and predicates for POSIX error codes.
On this page
- Names
- Methods
- GetLastError
- GetError
- Succeeded
- Failed
- IsPending
- TooManyAsynchronousRequests
- IsEndOfStream
- FromResult
- Types
- Type
- Fields
- Success
- EndOfFile
- EndOfStream
- Pending
- InvalidHandle
- InvalidUserBuffer
- NotEnoughMemory
- InvalidParameter
- NotFound
- FileNotFound
- WriteFault
- BadDescriptor
- TooManyOpenFiles
- WouldBlock
- InProgress
- AlreadyInProgress
- NotSocket
- MessageSize
- ProtocolType
- ProtocolOption
- OperationNotSupported
- AddressFamilyNotSupported
- AddressInUse
- AddressNotAvailable
- ConnectionAborted
- ConnectionReset
- NotConnected
- ConnectionRefused
- OperationAborted
- TimedOut
- WaitTimedOut
- Use
import ThinkMeta.ConcurrentTasks.Posix.Error;- Namespace
ThinkMeta::ConcurrentTasks::Posix- Platforms
- Linux
Syntax
struct ErrorRemarks
The codes are the values of errno. The POSIX wrappers return an ErrorCode: Success, or the errno of the failed call.
See also
Names
| Name | Description |
|---|---|
ErrorCode |
A POSIX error code as returned by the POSIX wrappers.
|
Methods
GetLastError
Returns the calling thread's last error (errno).
Syntax
static Type GetLastError() noexcept;Return value
Type: Type
The thread's errno.
See also
GetError
Turns the result of a call into an ErrorCode.
Syntax
static Type GetError(bool succeeded) noexcept;Parameters
succeededbool- Whether the call succeeded.
Return value
Type: Type
Success if it did, else GetLastError.
Remarks
Call it right after the call, before anything else can overwrite errno.
Succeeded
Failed
IsPending
TooManyAsynchronousRequests
Returns whether error means the kernel takes no more operations for now.
Syntax
static constexpr bool TooManyAsynchronousRequests(Type error) noexcept;Parameters
errorType- A POSIX error code.
Return value
Type: bool
true for EAGAIN and EBUSY; otherwise false.
Remarks
Retry later, as on Windows.
IsEndOfStream
Returns whether error is EndOfStream.
Syntax
static constexpr bool IsEndOfStream(Type error) noexcept;Parameters
errorType- A POSIX error code.
Return value
Type: bool
true if error is EndOfStream; otherwise false.
FromResult
Turns the result of an asynchronous operation of the core into an error code.
Syntax
static constexpr Type FromResult(std::int32_t result) noexcept;Parameters
resultstd::int32_t- What the completion routine received: a byte count, or a negated
errno.
Return value
Type: Type
Success for a byte count; otherwise the errno.
Types
Type
A POSIX error code (an errno value).
Syntax
using Type = int;Fields
Success
0: the operation succeeded.
Syntax
static constexpr Type Success = 0;EndOfFile
A read started at or beyond the end of the file (made up: Linux reads 0 bytes there).
Syntax
static constexpr Type EndOfFile = -1;EndOfStream
Same value as EndOfFile, for streams and sockets.
Syntax
static constexpr Type EndOfStream = EndOfFile;See also
Pending
An asynchronous operation was started and completes later (made up).
Syntax
static constexpr Type Pending = -2;See also
InvalidHandle
EBADF: not an open file or socket.
Syntax
static constexpr Type InvalidHandle = EBADF;InvalidUserBuffer
EFAULT: a buffer address is outside the process's memory.
Syntax
static constexpr Type InvalidUserBuffer = EFAULT;NotEnoughMemory
ENOMEM: not enough memory.
Syntax
static constexpr Type NotEnoughMemory = ENOMEM;InvalidParameter
EINVAL: a parameter is not valid.
Syntax
static constexpr Type InvalidParameter = EINVAL;NotFound
ENOENT: nothing of that name.
Syntax
static constexpr Type NotFound = ENOENT;FileNotFound
ENOENT: the file does not exist.
Syntax
static constexpr Type FileNotFound = ENOENT;WriteFault
EIO: the device could not write (also: a write that transferred less than asked).
Syntax
static constexpr Type WriteFault = EIO;BadDescriptor
EBADF, as WSAEBADF.
Syntax
static constexpr Type BadDescriptor = EBADF;TooManyOpenFiles
EMFILE: the process has too many open files.
Syntax
static constexpr Type TooManyOpenFiles = EMFILE;WouldBlock
EWOULDBLOCK: a non-blocking call would have to wait.
Syntax
static constexpr Type WouldBlock = EWOULDBLOCK;InProgress
EINPROGRESS: a non-blocking connect is under way.
Syntax
static constexpr Type InProgress = EINPROGRESS;AlreadyInProgress
EALREADY: an operation of this kind is already under way.
Syntax
static constexpr Type AlreadyInProgress = EALREADY;NotSocket
ENOTSOCK: the descriptor is no socket.
Syntax
static constexpr Type NotSocket = ENOTSOCK;MessageSize
EMSGSIZE: a message too long for the socket.
Syntax
static constexpr Type MessageSize = EMSGSIZE;ProtocolType
EPROTOTYPE: a protocol that does not fit the socket type.
Syntax
static constexpr Type ProtocolType = EPROTOTYPE;ProtocolOption
ENOPROTOOPT: an unknown socket option.
Syntax
static constexpr Type ProtocolOption = ENOPROTOOPT;OperationNotSupported
EOPNOTSUPP: the operation is not supported (also: the kernel cannot cancel by file).
Syntax
static constexpr Type OperationNotSupported = EOPNOTSUPP;AddressFamilyNotSupported
EAFNOSUPPORT: an address family not supported.
Syntax
static constexpr Type AddressFamilyNotSupported = EAFNOSUPPORT;AddressInUse
EADDRINUSE: the address is in use.
Syntax
static constexpr Type AddressInUse = EADDRINUSE;AddressNotAvailable
EADDRNOTAVAIL: the address is not available on this host.
Syntax
static constexpr Type AddressNotAvailable = EADDRNOTAVAIL;ConnectionAborted
ECONNABORTED: the connection was aborted on this side.
Syntax
static constexpr Type ConnectionAborted = ECONNABORTED;ConnectionReset
ECONNRESET: the peer reset the connection.
Syntax
static constexpr Type ConnectionReset = ECONNRESET;NotConnected
ENOTCONN: the socket is not connected.
Syntax
static constexpr Type NotConnected = ENOTCONN;ConnectionRefused
ECONNREFUSED: nothing listens at the address.
Syntax
static constexpr Type ConnectionRefused = ECONNREFUSED;OperationAborted
ECANCELED: the operation was cancelled before it completed.
Syntax
static constexpr Type OperationAborted = ECANCELED;TimedOut
ETIMEDOUT: an operation with a timeout ran out of time.
Syntax
static constexpr Type TimedOut = ETIMEDOUT;WaitTimedOut
Same value as TimedOut; Windows tells a wait's timeout apart.
Syntax
static constexpr Type WaitTimedOut = ETIMEDOUT;Generated from ThinkMeta.ConcurrentTasks.API @ da816bc (2026-11-06).