This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping Re: [PATCH] Make bindresvport() function to multithread-safe


On 10/10/2012 08:54 AM, Andreas Schwab wrote:
Peng Haitao <penght@cn.fujitsu.com> writes:

Can you tell me where I find restriction for bindresvport is not used
in multithread circumstance?

bindresvport is not specified by POSIX, so it cannot be assumed to be thread-safe, unless there is a document stating that.

On the other hand, bindresvport doesn't take any argument and has no notion of an object on which it works, so there is no obvious location where to put the lock protecting it, and it is unlikely that two different libraries which call bindresvport have a way to agree on the lock to use. So if it is acceptable at all to use bindresvport in multi-threaded programs, it has to perform locking internally. (But this is purely a quality-of-implementation issue.)


--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]