This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Ping Re: [PATCH] Make bindresvport() function to multithread-safe
- From: Peng Haitao <penght at cn dot fujitsu dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 09 Oct 2012 16:29:53 +0800
- Subject: Re: Ping Re: [PATCH] Make bindresvport() function to multithread-safe
- References: <4F3DED0D.7050504@cn.fujitsu.com> <5051764D.9070908@cn.fujitsu.com> <20120917194421.8FCD02C053@topped-with-meat.com>
On 09/18/2012 03:44 AM, Roland McGrath wrote:
> bindresvport has never been thread-safe before and AFAIK no other system
> that has the function makes it thread-safe. Like all functions, if it's
> not specifically documented and being thread-safe, it isn't. I don't see
> the rationale for requiring bindresvport to be thread-safe now.
>
Although I do not find any rationale for requiring bindresvport to be
thread-safe, bindresvport man-page says:
bindresvport() is used to bind a socket descriptor to a privileged
anonymous IP port, that is, a port number arbitrarily selected from the
range 512 to 1023.
That is, the valid value of port number is 512 to 1023,
but in multithread circumstance, the port number may be 1024.
The test program can refer to URL:
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
So I think bindresvport() need to be fixed.
--
Best Regards,
Peng