From 5ece6980ebce6533b263319f8e7c4368f926c309 Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Mon, 5 Aug 2024 02:04:11 -0400 Subject: [PATCH] Make `EINVAL` generic in FreeBSD `Socket_Option_Error` The documentation for `setsockopt(2)` mentioned accept filters for `EINVAL`, but I've found that it can arise for any manner of invalid values for setting socket options. We'll just have to leave this as a generic error. --- core/net/errors_freebsd.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/net/errors_freebsd.odin b/core/net/errors_freebsd.odin index 0c58d4d4b..1f98e9228 100644 --- a/core/net/errors_freebsd.odin +++ b/core/net/errors_freebsd.odin @@ -180,7 +180,8 @@ Socket_Option_Error :: enum c.int { Not_Socket = cast(c.int)freebsd.Errno.ENOTSOCK, Unknown_Option_For_Level = cast(c.int)freebsd.Errno.ENOPROTOOPT, Argument_In_Invalid_Address_Space = cast(c.int)freebsd.Errno.EFAULT, - Cannot_Install_Accept_Filter_On_Non_Listening_Socket = cast(c.int)freebsd.Errno.EINVAL, + // This error can arise for many different reasons. + Invalid_Value = cast(c.int)freebsd.Errno.EINVAL, System_Memory_Allocation_Failed = cast(c.int)freebsd.Errno.ENOMEM, Insufficient_System_Resources = cast(c.int)freebsd.Errno.ENOBUFS, }