From nobody Thu Nov 28 19:27:12 2024 X-Original-To: standards@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 4XzmXc6qxpz5f9Dx for ; Thu, 28 Nov 2024 19:27:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XzmXc4YlVz4mkw for ; Thu, 28 Nov 2024 19:27:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732822032; 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=NBtBRF31WGPCX2zuf1wRO9yYcwSS1x06RHrpdMoQ0cg=; b=E6E4wvEoesnGrT+98O5eaDuEEQf+oKhWdpkqkp5ofOnQibpGYqkVGh4wwYpBewTRVKW4J1 O59OMbeFatr8DIN7CCDlLmeFBJF5CefzpoPqwuG0YfIBFcahBaOyEI51YeSIR1WhrVQQ2e KvHUA5/v+No5A07vdHI4QKo02S1Zs4s1qP8PBg/iDtPIOoRtCko7xuPXpRQd6EbhVrSEqC U1WlCbC3dXyM3rEF4UoTLL/qxPJtWHAWZAbQyHTu4HLwwxz7305tzz107zRe8aLSXZbp94 pajz1VeRZhXIwOXWZS//FrjudjXUI7bKVKdaET3BoO3kBgxBgm0XncxvRodTxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732822032; a=rsa-sha256; cv=none; b=Ao4ZcolaoVZsJdbBO2A1h/XkpwIlBFhjd8Vxq8AacrWT9Lrzj60qKU2RGdbq8STvEtKALg j7qaicxW0IZPG1U+Eryjd+K4Mwr/9gbNyvYK4DJbGZqKRW4vFWHrjtYoVy32t/SVxd/vSX 6rrYItRtN/wl1JUnVYRhNRl3Mf2mXiNqRcbIzJfvInhxy9RHT27ZVzPpbeAhJje5+6FnIz /s4yYVvCTWK2ecuEMgc4naOrohiiYJJE+KMF1s5Ozse8O8sikKjtDb1XMwjafR+82GdOLq TL2OMd75yWvGS6ax5f9P4TW3Kh7KAX0zxku2Lva4p9iaMlgVAl4n36VjKnyAIQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XzmXc42k4zryl for ; Thu, 28 Nov 2024 19:27:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4ASJRCdF014601 for ; Thu, 28 Nov 2024 19:27:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4ASJRCf0014600 for standards@FreeBSD.org; Thu, 28 Nov 2024 19:27:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 283014] POSIX issue 7: fileno should be able to fail with EBADF Date: Thu, 28 Nov 2024 19:27:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283014 Ed Maste changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emaste@freebsd.org --- Comment #1 from Ed Maste --- Perhaps: diff --git a/lib/libc/stdio/fileno.c b/lib/libc/stdio/fileno.c index 66502430dc3d..ff317993c0d3 100644 --- a/lib/libc/stdio/fileno.c +++ b/lib/libc/stdio/fileno.c @@ -49,6 +49,9 @@ fileno(FILE *fp) fd =3D __sfileno(fp); FUNLOCKFILE(fp); + if (fd =3D=3D -1) + errno =3D EBADF; + return (fd); } --=20 You are receiving this mail because: You are the assignee for the bug.=