From nobody Wed May 21 16:23:04 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4b2cCv0QRPz5w9Sr for ; Wed, 21 May 2025 16:23:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b2cCt6vQSz3Qh5 for ; Wed, 21 May 2025 16:23:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747844587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5uJqqUm7RiPpvkkDGSVFHpQYSGI3tccQY2YEE7tEXlE=; b=G1YtdP/DcIFYrvI9xQ4QecGL3HZxqKvO4ERP3aK85fY5PfArEH0EYttkQhBwzdT/m7q99O ycqU4LDewx6p5BteSn1RE3R3u+0i2cdduzNhvTBVZFdqWzO+AgDISgNqLrXweAYOCOYmy9 1VGRwjik8FmXpNKQQTi7zNHcmHKNOYnawjc6mjqMP4wI/yXz++hR9fb21ZiA6bdyTqSK0j ACRAMN/SumUy5q/14u2kBMEYeuyg6CEAMoWqwXBvlJT67AgF6vsFDSYzOZGeMmKztNZcKl VY7fEfit0LxiSPM2OTALf/4ZHE/dMDL3mPN9WQq0XaSZ92SOP7yM82IiPfoe3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747844587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5uJqqUm7RiPpvkkDGSVFHpQYSGI3tccQY2YEE7tEXlE=; b=F+sBcTlSr0JA+8QfAeAAB7THlCpf+hE3eG9RCZFNaHVQ6WFENm4Zb6UeAR5sUDFrnmi+6Q 38z97fqjospL/Btdv2AVEPHz4aVhzsL6guCzyYR0rJJJCr+SE6q9syk6RUukQJMXZeHs5j osYrytv4WPY7Tl8ydGXkA3zS8h7G9nAccuF3JO/X3GnJ3L72pXbJuWD/dM8tbcdQjWmQ4y pUKX9BjUuheFkR0DomBxm2tvtAFDd7341xQTSTH26VFm9Gh8SjbnwV1uUkcGMcdtDBLrzY VUDLJUjbDi1828TgUmkvM3TJoOgeR+hcXdf6aYYAWkUedxZlxQYWCkNGBZx5ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747844587; a=rsa-sha256; cv=none; b=KE5lfGBPlWsvLoLkiQvc8DqbvcXoekyPnsgod9df9zZHr8hj0fE25TADZRbvmeXDDxCejN A3M9+yyehWnOfuE0u5745wkkFOuFw6ujXB1hBEo2K0VnCyZnjAXQz2+ahRwpfIr8R9UWXz jPwjO3Yq9iv5xn4QoMjNjhDQqIypZKpdHNZjC4x15tMOUCfio5Df0x9qjapXrp5j70d0Qx Z3HWBrWajSw99DIrMcTPVDUmSN6BULzm17MBGwQDbOmX/hjaZilatrjc83rl07NQcM4pDt mGMIhtH5+l7MPRj/XIQtKB/yAHqfJAevzijG4sdp79KhfRHrnMu/pzopyQ1l2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [192.168.0.88] (unknown [93.188.39.137]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4b2cCt4JcCz7Xk for ; Wed, 21 May 2025 16:23:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Message-ID: Date: Wed, 21 May 2025 19:23:04 +0300 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Un-sucking EINVAL To: freebsd-current@freebsd.org References: <202505210722.54L7MTqw025632@critter.freebsd.dk> Content-Language: en-US From: Andriy Gapon In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/05/2025 10:28, Lexi Winter wrote: > you are completely right. since we (for some reason, that i don't > really understand) can't add new error codes to errno, we should stop > using errno to indicate errors except where POSIX requires this. I once had this idea, probably not original, that if we usually use 32-bit variables to pass around error / status codes, then why not split up those bits for some special uses. E.g., lowest 10 or 12 bits could be actual error codes. But highest, say, 8 or 10 bits could encode a domain of interpretation (to use a term borrowed from IPsec). Domain number zero would be a POSIX or legacy domain and error codes in it would be the standard errno codes. Then we could have a different domain (or several) for FreeBSD-specific error codes. Some middle bits could be used to further subdivide a domain into modules or subsystems with their own error codes. There could be some private (application specific) domains. But, of course, a larger repertoire of error codes is still not as flexible and powerful as an ability to pass a specific error string along with an error code. -- Andriy Gapon