From nobody Mon Jan 5 01:25:37 2026 X-Original-To: dev-commits-src-branches@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 4dkxSf3LW5z6N9Tc for ; Mon, 05 Jan 2026 01:25:38 +0000 (UTC) (envelope-from git@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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dkxSd6jnpz3wt5 for ; Mon, 05 Jan 2026 01:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767576338; 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; bh=QXUwNH9cmUSGI7YlnECWXucK31dgaykDUy6uvdIDmOQ=; b=WSw5Z00lxyHOULIG5IG4sc7tsh7/nqNvMVQuAhIFevzT+HovkBGxdbVpFoZFqNPC91/uta GHFxJ6ZkHoAD6npNaV2h/m9YtgpJ7uZ7uiLr60DnpIkoKynHtSHcbz1Z5u65o85xDu2t25 XAuyd8ZVmlwaeACajALOXMCwiFfvBIS9HZAIRaPKixaSjKObnfNFlffan6bhre0zTUQECf 6cvCL4OdODWYAgbUYNIa8fIl2RSp2J/kuOfRkNKQ1mhTrzVqgO7EHtjCHUp6YF2eQlzWsQ mVMGFV0eFKNRe0Kx2p5Wp8f8nK/xBgkW7FmLadL1A1GFU3xhaEmqHJSfXFTVwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767576338; 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; bh=QXUwNH9cmUSGI7YlnECWXucK31dgaykDUy6uvdIDmOQ=; b=uVVkbDZB/74DiCn6BEPzWByOJ6GA7+xzqJQHnr/YvMuN3XByoAPSy6mM0/ymNhgy2J/BUW TQ5j07lVmRUxzVv57iKzxJlFILSXsfu1jAnh3v6+cLyNzixjh3jgGUiL1BmZzps0dheem9 eUf0NiZf9SYYidEI2RH4FAqrlppjFP6/N/iNd2fJWwfxyNYKT+6VjVkwNxg6T/ftv+opcB SSDboTH04XjYB0i6jG05Ex3AinYsldtXALtmVSASIXzBFnm0JYxYVKWrzdorB/o9nLIxPl hbpHAPjv9q424FBwQJWkk0EH+70Q7Pt2QXqHL2QfjFXpHNayGLR1S5UXs4zzkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767576338; a=rsa-sha256; cv=none; b=M1JvZs5E8lxzGWZSrkB4enLl4Ya/EHZdOXK0Z/2nbWXckII11bWABaxMVnmtJL6eZUTKGW JuiVG+sLJEnLtxebJ1OGOV/5Q2uHJ6+606BJxtSf8A66oyaWprdK14Dnb9IIdGiOz1AwWb YjBEbCRn+zx6XpRIcwkdOfhi3yzPyWmh9Zuc0TAITXaYWrx/JxKCAXNCU/b/UYnokkQerV 9Yn0QkxWKpM0GMf6N+mHK4GBFyRoNVIozgROLKMImrTuWQ4TSeaVyUFJBywS+ku/7rNMLw +bsZwr40+A7CKeSLttf6TZNRJog+uvoNqUhcaAr3YngaiS+SVIW0jSQNML23Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dkxSd6K6Qz1055 for ; Mon, 05 Jan 2026 01:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36c67 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 05 Jan 2026 01:25:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e5b9182cdbc4 - stable/15 - exterr: in verbose mode, print the source file name List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e5b9182cdbc4b5684c0e40608e8901e1989d916b Auto-Submitted: auto-generated Date: Mon, 05 Jan 2026 01:25:37 +0000 Message-Id: <695b1311.36c67.2b060911@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5b9182cdbc4b5684c0e40608e8901e1989d916b commit e5b9182cdbc4b5684c0e40608e8901e1989d916b Author: Konstantin Belousov AuthorDate: 2025-12-28 14:13:49 +0000 Commit: Konstantin Belousov CommitDate: 2026-01-05 00:44:20 +0000 exterr: in verbose mode, print the source file name (cherry picked from commit 874cdf6af695c42d561647f7165c99c2d3df0faa) --- lib/libc/gen/uexterr_format.c | 21 +++++++++++++++++---- sys/sys/exterr_cat.h | 11 +++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c index 3321fd80616d..8d3b458ca9f2 100644 --- a/lib/libc/gen/uexterr_format.c +++ b/lib/libc/gen/uexterr_format.c @@ -8,7 +8,7 @@ * under sponsorship from the FreeBSD Foundation. */ -#include +#include #include #include #include @@ -17,6 +17,19 @@ #include #include +static const char * const cat_to_filenames[] = { +#include "exterr_cat_filenames.h" +}; + +static const char * +cat_to_filename(int category) +{ + if (category < 0 || category >= nitems(cat_to_filenames) || + cat_to_filenames[category] == NULL) + return ("unknown"); + return (cat_to_filenames[category]); +} + static const char exterror_verbose_name[] = "EXTERROR_VERBOSE"; enum exterr_verbose_state { EXTERR_VERBOSE_UNKNOWN = 100, @@ -68,9 +81,9 @@ __uexterr_format(const struct uexterror *ue, char *buf, size_t bufsz) char lbuf[128]; snprintf(lbuf, sizeof(lbuf), - "errno %d category %u (src line %u) p1 %#jx p2 %#jx", - ue->error, ue->cat, ue->src_line, - (uintmax_t)ue->p1, (uintmax_t)ue->p2); + "errno %d category %u (src sys/%s:%u) p1 %#jx p2 %#jx", + ue->error, ue->cat, cat_to_filename(ue->cat), + ue->src_line, (uintmax_t)ue->p1, (uintmax_t)ue->p2); if (has_msg) strlcat(buf, " ", bufsz); strlcat(buf, lbuf, bufsz); diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index 7492fc31662a..24f07539fe35 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -8,6 +8,17 @@ * under sponsorship from the FreeBSD Foundation. */ +/* + * The category identifiers for the extended errors. + * The ids participate in ABI between kernel and libc, so they must + * never be reused or changed. Only new ids can be added. + * + * After adding a new category id, run + * tools/build/make_libc_exterr_cat_filenames.sh + * from the top of the source tree, and commit updated file + * lib/libc/gen/exterr_cat_filenames.h + */ + #ifndef _SYS_EXTERR_CAT_H_ #define _SYS_EXTERR_CAT_H_