mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.posix.accept: handle non-listening socket EINVAL
This commit is contained in:
parent
7d9ad992ab
commit
a0289d0cce
2 changed files with 5 additions and 1 deletions
|
|
@ -3900,7 +3900,7 @@ fn netAcceptPosix(userdata: ?*anyopaque, listen_fd: net.Socket.Handle) net.Serve
|
|||
.BADF => |err| return errnoBug(err), // File descriptor used after closed.
|
||||
.CONNABORTED => return error.ConnectionAborted,
|
||||
.FAULT => |err| return errnoBug(err),
|
||||
.INVAL => |err| return errnoBug(err),
|
||||
.INVAL => return error.SocketNotListening,
|
||||
.NOTSOCK => |err| return errnoBug(err),
|
||||
.MFILE => return error.ProcessFdQuotaExceeded,
|
||||
.NFILE => return error.SystemFdQuotaExceeded,
|
||||
|
|
|
|||
|
|
@ -1333,6 +1333,10 @@ pub const Server = struct {
|
|||
/// Not enough free memory. This often means that the memory allocation is limited
|
||||
/// by the socket buffer limits, not by the system memory.
|
||||
SystemResources,
|
||||
/// Either `listen` was never called, or `shutdown` was called (possibly while
|
||||
/// this call was blocking). This allows `shutdown` to be used as a concurrent
|
||||
/// cancellation mechanism.
|
||||
SocketNotListening,
|
||||
/// The network subsystem has failed.
|
||||
NetworkDown,
|
||||
/// No connection is already queued and ready to be accepted, and
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue