@@ -2156,6 +2156,9 @@ pub const SocketError = error{
2156
2156
2157
2157
/// The protocol type or the specified protocol is not supported within this domain.
2158
2158
ProtocolNotSupported ,
2159
+
2160
+ /// The socket type is not supported by the protocol.
2161
+ SocketTypeNotSupported ,
2159
2162
} || UnexpectedError ;
2160
2163
2161
2164
pub fn socket (domain : u32 , socket_type : u32 , protocol : u32 ) SocketError ! fd_t {
@@ -2164,7 +2167,7 @@ pub fn socket(domain: u32, socket_type: u32, protocol: u32) SocketError!fd_t {
2164
2167
socket_type & ~ @as (u32 , SOCK_NONBLOCK | SOCK_CLOEXEC )
2165
2168
else
2166
2169
socket_type ;
2167
- const rc = system .socket (domain , socket_type , protocol );
2170
+ const rc = system .socket (domain , filtered_sock_type , protocol );
2168
2171
switch (errno (rc )) {
2169
2172
0 = > {
2170
2173
const fd = @intCast (fd_t , rc );
@@ -2181,6 +2184,7 @@ pub fn socket(domain: u32, socket_type: u32, protocol: u32) SocketError!fd_t {
2181
2184
ENOBUFS = > return error .SystemResources ,
2182
2185
ENOMEM = > return error .SystemResources ,
2183
2186
EPROTONOSUPPORT = > return error .ProtocolNotSupported ,
2187
+ EPROTOTYPE = > return error .SocketTypeNotSupported ,
2184
2188
else = > | err | return unexpectedErrno (err ),
2185
2189
}
2186
2190
}
@@ -2290,6 +2294,10 @@ pub const AcceptError = error{
2290
2294
/// This error occurs when no global event loop is configured,
2291
2295
/// and accepting from the socket would block.
2292
2296
WouldBlock ,
2297
+
2298
+ /// Permission to create a socket of the specified type and/or
2299
+ /// protocol is denied.
2300
+ PermissionDenied ,
2293
2301
} || UnexpectedError ;
2294
2302
2295
2303
/// Accept a connection on a socket.
0 commit comments