commit 05003d533a8a4f4c49f7a251e26b5dfff5f278b3 (tree)
parent fafd1fd4806e4f92b19bd5285cbe8d6748a90c54
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sat, 26 Oct 2019 21:31:38 -0400
Merge pull request #3537 from lun-4/fix/accept4
fix std.os.accept4
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/std/os.zig b/lib/std/os.zig
@@ -1630,6 +1630,10 @@ pub const AcceptError = error{
/// Firewall rules forbid connection.
BlockedByFirewall,
+
+ /// This error occurs when no global event loop is configured,
+ /// and accepting from the socket would block.
+ WouldBlock,
} || UnexpectedError;
/// Accept a connection on a socket.
@@ -1650,7 +1654,7 @@ pub fn accept4(
///
/// The returned address is truncated if the buffer provided is too small; in this case, `addr_size`
/// will return a value greater than was supplied to the call.
- addr_size: *usize,
+ addr_size: *socklen_t,
/// If flags is 0, then `accept4` is the same as `accept`. The following values can be bitwise
/// ORed in flags to obtain different behavior:
/// * `SOCK_NONBLOCK` - Set the `O_NONBLOCK` file status flag on the open file description (see `open`)