From: Alejandro Colomar <alx@kernel.org>
To: Shani Leviim <sleviim@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
linux-man@vger.kernel.org, automotive-devel@redhat.com,
Carlos O'Donell <carlos@redhat.com>,
Gobinda Das <godas@redhat.com>
Subject: Re: [patch] strerror.3: Change strerror() reference from MT-Unsafe to MT-Safe
Date: Sat, 12 Aug 2023 00:51:57 +0200 [thread overview]
Message-ID: <92db3ed7-b3ed-6508-ff3f-aa0abef764ed@kernel.org> (raw)
In-Reply-To: <CAMO6KYqROAQ5fFMcAESJGvBZ-kiC_VDCegZPJaRAF=Nao_1dJg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3850 bytes --]
Hi Shani,
On 2023-07-30 15:41, Shani Leviim wrote:
> Thanks, Alex,
> Attaching the patch (see attachments)
>
> From: Shani Leviim <sleviim@redhat.com>
> Date: Sun, 30 Jul 2023 15:51:07 +0300
> Subject: [PATCH 1/1] strerror.3: Change strerror() reference from MT-Unsafe to
> MT-Safe
>
> The information in this patch was obtained from a glibc upstream patch,
> commit ID 28aff047818eb1726394296d27b9c7885340bead
>
> According the patch above, for glibc versions >=2.32,
> strerror() is considered MT-Safe, and the man page should be changed
> accordingly.
>
> Signed-off-by: Shani Leviim <sleviim@redhat.com>
The patch doesn't apply. Can you please check what's wrong with it?
$ git am patches/0001-strerror.3-Change-strerror-reference-from-MT-Unsafe-.patch
Applying: strerror.3: Change strerror() reference from MT-Unsafe to MT-Safe
error: patch failed: man3/strerror.3:238
error: man3/strerror.3: patch does not apply
Patch failed at 0001 strerror.3: Change strerror() reference from MT-Unsafe to MT-Safe
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Thanks,
Alex
> ---
> man3/strerror.3 | 31 +++++++++++++++----------------
> 1 file changed, 15 insertions(+), 16 deletions(-)
>
> diff --git a/man3/strerror.3 b/man3/strerror.3
> index 862e153ee..6a3d83164 100644
> --- a/man3/strerror.3
> +++ b/man3/strerror.3
> @@ -71,11 +71,12 @@ part of the current locale to select the
> appropriate language.
> is
> .BR EINVAL ,
> the returned description will be "Invalid argument".)
> -This string must not be modified by the application, but may be
> -modified by a subsequent call to
> +This string must not be modified by the application,
> +and the returned pointer will be invalidated on a subsequent call to
> .BR strerror ()
> or
> -.BR strerror_l ().
> +.BR strerror_l (),
> +or if the thread that obtained the string exits.
> No other library function, including
> .BR perror (3),
> will modify this string.
> @@ -100,12 +101,12 @@ For example, given
> as an argument, this function returns a pointer to the string "EPERM".
> .\"
> .SS strerror_r()
> -The
> .BR strerror_r ()
> -function is similar to
> +is like
> .BR strerror (),
> -but is
> -thread safe.
> +but might use the supplied buffer
> +.I buf
> +instead of allocating one internally.
> This function is available in two versions:
> an XSI-compliant version specified in POSIX.1-2001
> (available since glibc 2.3.4, but not POSIX-compliant until glibc 2.13),
> @@ -238,7 +239,7 @@ Interface Attribute Value
> T{
> .BR strerror ()
> T} Thread safety T{
> -MT-Unsafe race:strerror
> +MT-Safe
> T}
> T{
> .BR strerrorname_np (),
> @@ -249,6 +250,10 @@ T{
> .BR strerror_l ()
> T} Thread safety MT-Safe
> .TE
> +.PP
> +Before glibc 2.32,
> +.BR strerror ()
> +is not MT-Safe.
> .hy
> .ad
> .sp 1
> @@ -292,13 +297,6 @@ to
> if the error number is unknown.
> C99 and POSIX.1-2008 require the return value to be non-NULL.
> .SH NOTES
> -The GNU C Library uses a buffer of 1024 characters for
> -.BR strerror ().
> -This buffer size therefore should be sufficient to avoid an
> -.B ERANGE
> -error when calling
> -.BR strerror_r ().
> -.PP
> .BR strerrorname_np ()
> and
> .BR strerrordesc_np ()
> @@ -309,4 +307,5 @@ are thread-safe and async-signal-safe.
> .BR error (3),
> .BR perror (3),
> .BR strsignal (3),
> -.BR locale (7)
> +.BR locale (7),
> +.BR signal-safety (7)
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-08-11 22:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAMO6KYomqkRFVnE1gfNa=htbZ5oBrVAm+AsFVqc6+vqZ0YxnAw@mail.gmail.com>
2023-07-13 8:12 ` [patch] strerror.3: Change strerror() reference from MT-Unsafe to MT-Safe Florian Weimer
2023-07-13 11:15 ` Shani Leviim
2023-07-16 17:28 ` Shani Leviim
2023-07-28 18:55 ` Alejandro Colomar
2023-07-30 13:41 ` Shani Leviim
2023-08-11 22:51 ` Alejandro Colomar [this message]
2023-08-13 14:37 ` Shani Leviim
2023-08-13 15:11 ` Alejandro Colomar
2023-08-13 16:58 ` Shani Leviim
2023-08-13 20:06 ` Alejandro Colomar
2023-08-13 20:19 ` [PATCH v2] " Alejandro Colomar
2023-08-13 20:21 ` [PATCH v3] " Alejandro Colomar
2023-08-14 10:44 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92db3ed7-b3ed-6508-ff3f-aa0abef764ed@kernel.org \
--to=alx@kernel.org \
--cc=automotive-devel@redhat.com \
--cc=carlos@redhat.com \
--cc=fweimer@redhat.com \
--cc=godas@redhat.com \
--cc=linux-man@vger.kernel.org \
--cc=sleviim@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox