From 9ed071a41b6fd6ae4a842d70d983f1fcc1991dfb Mon Sep 17 00:00:00 2001 From: Peng Haitao Date: Wed, 24 Apr 2013 14:46:12 +0800 Subject: [PATCH] bindresvport.3: ATTRIBUTES: Note function that is thread-safe 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 Signed-off-by: Michael Kerrisk sin_family is not .BR AF_INET . +.SH ATTRIBUTES +.SS Multithreading (see pthreads(7)) +Before glibc 2.17, the +.BR bindresvport () +function uses a static variable that is not protected, +so it is not thread-safe. + +Since glibc 2.17, +.\" commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5 +the +.BR bindresvport () +function uses a lock to protect static variable, so it is thread-safe. .SH CONFORMING TO Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other systems.