linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] bindresvport.3: ATTRIBUTES: Note function that is thread-safe
@ 2013-04-24  6:46 Peng Haitao
       [not found] ` <1366785972-12231-1-git-send-email-penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Haitao @ 2013-04-24  6:46 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, carlos-v2tUB8YBRSi3e3T8WW9gsA

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

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

diff --git a/man3/bindresvport.3 b/man3/bindresvport.3
index d2e73a4..2c7152d 100644
--- a/man3/bindresvport.3
+++ b/man3/bindresvport.3
@@ -89,6 +89,16 @@ is not NULL and
 .I sin->sin_family
 is not
 .BR AF_INET .
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+Before glibc 2.17, the
+.BR bindresvport ()
+uses a static variable that is not protected, so it is not thread-safe.
+
+Since glibc 2.17, the
+.BR bindresvport ()
+uses a lock to protect static variable, so it is thread-safe.
+.\" Modified in commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
 .SH CONFORMING TO
 Not in POSIX.1-2001.
 Present on the BSDs, Solaris, and many other systems.
-- 
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] 3+ messages in thread

* Re: [PATCH v2] bindresvport.3: ATTRIBUTES: Note function that is thread-safe
       [not found] ` <1366785972-12231-1-git-send-email-penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
@ 2013-05-18 18:24   ` Michael Kerrisk
       [not found]     ` <5197C76C.6070202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk @ 2013-05-18 18:24 UTC (permalink / raw)
  To: Peng Haitao
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, carlos-v2tUB8YBRSi3e3T8WW9gsA

On 04/24/13 08:46, Peng Haitao wrote:
> Before glibc 2.17, bindresvport() is not thread-safe.
> Since glibc 2.17, it is thread-safe, the patch can refer to URL:
> http://sourceware.org/git/?p=glibc.git;a=commit;h=f6da27e53695ad1cc0e2a9490358decbbfdff5e5
	
Applied to my local branch for this work, but see some comments below.

> Signed-off-by: Peng Haitao <penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
> ---
>  man3/bindresvport.3 | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/man3/bindresvport.3 b/man3/bindresvport.3
> index d2e73a4..2c7152d 100644
> --- a/man3/bindresvport.3
> +++ b/man3/bindresvport.3
> @@ -89,6 +89,16 @@ is not NULL and
>  .I sin->sin_family
>  is not
>  .BR AF_INET .
> +.SH ATTRIBUTES
> +.SS Multithreading (see pthreads(7))
> +Before glibc 2.17, the
> +.BR bindresvport ()
> +uses a static variable that is not protected, so it is not thread-safe.

Missing word "function" here (function uses..."). This was also the
case in a number of the other patches you sent recently. (I fixed them all.)

> +Since glibc 2.17, the
> +.BR bindresvport ()

(Missing word "function".)

> +uses a lock to protect static variable, so it is thread-safe.

"uses a lock to protect *a* static variable"
(I fixed this, and also in a few other patches.)

> +.\" Modified in commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5

Here, its is enough just to write

+.\" commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5

And I'd rearrange things a little, so that the patch is better as:

==
+Since glibc 2.17,
+.\" commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
+the
+.BR bindresvport ()
...
==

I made that fix (and also in one other patch.)

Cheers,

Michael


>  .SH CONFORMING TO
>  Not in POSIX.1-2001.
>  Present on the BSDs, Solaris, and many other systems.

Thank you, Peng.

Cheers,

Michael


--
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] 3+ messages in thread

* Re: [PATCH v2] bindresvport.3: ATTRIBUTES: Note function that is thread-safe
       [not found]     ` <5197C76C.6070202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-05-20  2:36       ` Peng Haitao
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Haitao @ 2013-05-20  2:36 UTC (permalink / raw)
  To: Michael Kerrisk
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, carlos-v2tUB8YBRSi3e3T8WW9gsA


On 05/19/2013 02:24 AM, Michael Kerrisk wrote:
>> diff --git a/man3/bindresvport.3 b/man3/bindresvport.3
>> index d2e73a4..2c7152d 100644
>> --- a/man3/bindresvport.3
>> +++ b/man3/bindresvport.3
>> @@ -89,6 +89,16 @@ is not NULL and
>>  .I sin->sin_family
>>  is not
>>  .BR AF_INET .
>> +.SH ATTRIBUTES
>> +.SS Multithreading (see pthreads(7))
>> +Before glibc 2.17, the
>> +.BR bindresvport ()
>> +uses a static variable that is not protected, so it is not thread-safe.
> 
> Missing word "function" here (function uses..."). This was also the
> case in a number of the other patches you sent recently. (I fixed them all.)
> 

Thanks.

>> +Since glibc 2.17, the
>> +.BR bindresvport ()
> 
> (Missing word "function".)
>> +uses a lock to protect static variable, so it is thread-safe.
> 
> "uses a lock to protect *a* static variable"
> (I fixed this, and also in a few other patches.)
> 

Thanks.

>> +.\" Modified in commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
> 
> Here, its is enough just to write
> 
> +.\" commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
> 
> And I'd rearrange things a little, so that the patch is better as:
> 
> ==
> +Since glibc 2.17,
> +.\" commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
> +the
> +.BR bindresvport ()
> ...
> ==
> 
> I made that fix (and also in one other patch.)
> 

Thanks.

-- 
Best Regards,
Peng

> Cheers,
> 
> Michael
> 
> 
>>  .SH CONFORMING TO
>>  Not in POSIX.1-2001.
>>  Present on the BSDs, Solaris, and many other systems.
> 
> Thank you, Peng.
> 
> Cheers,
> 
> Michael
> 
> 
> --
> 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
> 

--
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] 3+ messages in thread

end of thread, other threads:[~2013-05-20  2:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24  6:46 [PATCH v2] bindresvport.3: ATTRIBUTES: Note function that is thread-safe Peng Haitao
     [not found] ` <1366785972-12231-1-git-send-email-penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-05-18 18:24   ` Michael Kerrisk
     [not found]     ` <5197C76C.6070202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-20  2:36       ` Peng Haitao

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).