linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fmtmsg.3: ATTRIBUTES: Note function that is thread-safe
@ 2013-04-25  3:49 Peng Haitao
       [not found] ` <1366861744-16118-1-git-send-email-penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Haitao @ 2013-04-25  3:49 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, carlos-v2tUB8YBRSi3e3T8WW9gsA,
	aoliva-H+wXaHxf7aLQT0dZR+AlfA

Before glibc 2.16, fmtmsg() is not thread-safe.
Since glibc 2.16, it is thread-safe, the patch can refer to URL:
http://sourceware.org/git/?p=glibc.git;a=commit;h=7724defcf8873116fe4efab256596861eef21a94

Signed-off-by: Peng Haitao <penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
 man3/fmtmsg.3 | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/man3/fmtmsg.3 b/man3/fmtmsg.3
index f4b3d6f..3e3d3f9 100644
--- a/man3/fmtmsg.3
+++ b/man3/fmtmsg.3
@@ -222,6 +222,16 @@ is the string printed when a message of this class is processed by
 .SH VERSIONS
 .BR fmtmsg ()
 is provided in glibc since version 2.1.
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+Before glibc 2.16, the
+.BR fmtmsg ()
+uses a static variable that is not protected, so it is not thread-safe.
+
+Since glibc 2.16, the
+.BR fmtmsg ()
+uses a lock to protect static variable, so it is thread-safe.
+.\" Modified in commit 7724defcf8873116fe4efab256596861eef21a94
 .SH CONFORMING TO
 The functions
 .BR fmtmsg ()
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fmtmsg.3: ATTRIBUTES: Note function that is thread-safe
       [not found] ` <1366861744-16118-1-git-send-email-penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
@ 2013-05-18 18:15   ` Michael Kerrisk
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk @ 2013-05-18 18:15 UTC (permalink / raw)
  To: Peng Haitao
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, carlos-v2tUB8YBRSi3e3T8WW9gsA,
	aoliva-H+wXaHxf7aLQT0dZR+AlfA

On 04/25/13 05:49, Peng Haitao wrote:
> Before glibc 2.16, fmtmsg() is not thread-safe.
> Since glibc 2.16, it is thread-safe, the patch can refer to URL:
> http://sourceware.org/git/?p=glibc.git;a=commit;h=7724defcf8873116fe4efab256596861eef21a94

Applied to my local branch for this work.

Thank you, Peng.

Cheers,

Michael


> Signed-off-by: Peng Haitao <penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
> ---
>  man3/fmtmsg.3 | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/man3/fmtmsg.3 b/man3/fmtmsg.3
> index f4b3d6f..3e3d3f9 100644
> --- a/man3/fmtmsg.3
> +++ b/man3/fmtmsg.3
> @@ -222,6 +222,16 @@ is the string printed when a message of this class is processed by
>  .SH VERSIONS
>  .BR fmtmsg ()
>  is provided in glibc since version 2.1.
> +.SH ATTRIBUTES
> +.SS Multithreading (see pthreads(7))
> +Before glibc 2.16, the
> +.BR fmtmsg ()
> +uses a static variable that is not protected, so it is not thread-safe.
> +
> +Since glibc 2.16, the
> +.BR fmtmsg ()
> +uses a lock to protect static variable, so it is thread-safe.
> +.\" Modified in commit 7724defcf8873116fe4efab256596861eef21a94
>  .SH CONFORMING TO
>  The functions
>  .BR fmtmsg ()
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-18 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25  3:49 [PATCH] fmtmsg.3: ATTRIBUTES: Note function that is thread-safe Peng Haitao
     [not found] ` <1366861744-16118-1-git-send-email-penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-05-18 18:15   ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).