From nobody Tue Apr 30 00:50:20 2024 X-Original-To: dev-commits-src-all@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 4VT1nn1mCnz5HkJR; Tue, 30 Apr 2024 00:50:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT1nn0ssSz4P0Q; Tue, 30 Apr 2024 00:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438221; 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=8hwS2TEXDE46Tuqtpsfrj8MApdFtaVWVqlxldQfz7b4=; b=GP9QDAmmDIFqpH2IS+ehvGE6Vf780Zlki1QtiXjY3SY+kxFl4YneBPMIxgh0qymLr5WNvd C0Vwv+czepxQ0U/1rHL5+hIkvxBOsa9wLyDiuLqjgMvOGxBrCx703yBSG+/E+Wk6EX3IPe FPhJ7OyaGCEHXCbWHFIlsr0UceZlCQ0p8i5dSMNDoJW8YLp8OZhX6DfuI4b2GyePQbr7RL xwe9Dv0IXIenthHyviKr647VSoh5k8yCjOUk1sh5zD8L12mNzupcCkuxk/mgSCv45VKDWc n8rGHw+PvRKjPdOCWtdD4/cdExW5BnqVPduje4ImBKgYj17UOPGQdAEQatVTuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438221; a=rsa-sha256; cv=none; b=DywDwFbXWlGWUC9TdEZfY+mQj4wds6cCZ0rjQf1Ysb/UZNow39H9uQBFobcLEykAInBVON P2jfqnHUVv4nBN1CLKI/2bcQafNy1gXywhl7jzCE9uV8zuxKvyoPxFvvPo0f72SmBg74z7 M7JdLF1lGWhVuJMkzfw1fV+nbyc4SdCrXENYv46rBpups8buXwALo7HLdvj8eIvDT3trRX hrPIGdgGmOdeFeFbas0H0ank6DeaHCwmJlNb9jcchO2ShjTlDbN1B0B7jUqOszpPDq/OGL JNUZ7xiDW4xG5dYlKfG1f+Ehlawqn+FKawZiQVJNY0B/LBsjNToMyqWQ6pB1xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438221; 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=8hwS2TEXDE46Tuqtpsfrj8MApdFtaVWVqlxldQfz7b4=; b=sIodGFLPzpiiVvGD16Xut2ZDRfqFcn/4pf8H6K6LRnQZzis536xwqKNzULYemjL7mKEAE+ u9XJjSJLjqSppiJU6uJYB5yVeIasH7m2hXoxkIsrdrnxQVf8SS65w2i5p9UIlDzRjh46Hz k8VNB64rELTMzAO8rIBUpuRcWRLrYbURObn0xqKZvtRO/a0DccZkQ+A8/tWX65xSlqbVTy 87Z4oNzi6KcjAw70CkAMCGLTaGAZ/fAnpa+eMnGc+Jd+CQNBh/HrFMJOZJHnVSXpVEeOnu 7Gz+JQrbUMWJSyqhZ0HCZy/yzJhVhEdWQjZvmkOlhAn7lQTnc5QCAPfTVS0JLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4VT1nn0TW4z1STh; Tue, 30 Apr 2024 00:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U0oKjX022114; Tue, 30 Apr 2024 00:50:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0oKuD022111; Tue, 30 Apr 2024 00:50:20 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:50:20 GMT Message-Id: <202404300050.43U0oKuD022111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a8ae94b9e2cb - stable/13 - libc: make strerror_rl() usable for libc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/13 X-Git-Reftype: branch X-Git-Commit: a8ae94b9e2cbb5ddee2ba6c4fcdda508dc295b5d Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a8ae94b9e2cbb5ddee2ba6c4fcdda508dc295b5d commit a8ae94b9e2cbb5ddee2ba6c4fcdda508dc295b5d Author: Konstantin Belousov AuthorDate: 2024-04-23 17:04:29 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:49:52 +0000 libc: make strerror_rl() usable for libc (cherry picked from commit 92771bc00ad0f567b27876c34450bef7a0ee61d0) --- lib/libc/include/libc_private.h | 2 ++ lib/libc/string/strerror.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 593d106f3af6..34aa50d0f12d 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -453,5 +453,7 @@ struct __nl_cat_d; struct _xlocale; struct __nl_cat_d *__catopen_l(const char *name, int type, struct _xlocale *locale); +int __strerror_rl(int errnum, char *strerrbuf, size_t buflen, + struct _xlocale *locale); #endif /* _LIBC_PRIVATE_H_ */ diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index 673ccbf37ef7..a43b53ed59b5 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -78,8 +78,8 @@ errstr(int num, const char *uprefix, char *buf, size_t len) strlcat(buf, t, len); } -static int -strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) +int +__strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) { int retval = 0; #if defined(NLS) @@ -120,7 +120,7 @@ strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) int strerror_r(int errnum, char *strerrbuf, size_t buflen) { - return (strerror_rl(errnum, strerrbuf, buflen, __get_locale())); + return (__strerror_rl(errnum, strerrbuf, buflen, __get_locale())); } char * @@ -128,7 +128,7 @@ strerror_l(int num, locale_t locale) { static _Thread_local char ebuf[NL_TEXTMAX]; - if (strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) + if (__strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) errno = EINVAL; return (ebuf); } @@ -138,7 +138,7 @@ strerror(int num) { static char ebuf[NL_TEXTMAX]; - if (strerror_rl(num, ebuf, sizeof(ebuf), __get_locale()) != 0) + if (__strerror_rl(num, ebuf, sizeof(ebuf), __get_locale()) != 0) errno = EINVAL; return (ebuf); }