]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
gethostbyname.3: ATTRIBUTES: Note functions that aren't thread-safe
authorZeng Linggang <zenglg.jy@cn.fujitsu.com>
Wed, 8 Apr 2015 02:56:14 +0000 (10:56 +0800)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 11 Apr 2015 06:46:27 +0000 (08:46 +0200)
The markings match glibc markings.

gethostbyname:    MT-Unsafe race:hostbyname env locale

gethostbyaddr:    MT-Unsafe race:hostbyaddr env locale

sethostent:       MT-Unsafe race:hostent env locale
endhostent:       MT-Unsafe race:hostent env locale
gethostent_r:     MT-Unsafe race:hostent env locale

herror:           MT‐Safe
hstrerror:        MT‐Safe

gethostent:       MT-Unsafe race:hostent race:hostentbuf env locale

gethostbyname2:   MT-Unsafe race:hostbyname2 env locale

gethostbyaddr_r:  MT-Safe env locale
gethostbyname_r:  MT-Safe env locale
gethostbyname2_r: MT-Safe env locale

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/gethostbyname.3

index 41a5886477e1319d32d789a7d34009bfb07c6544..91898b9725b09c5fa7068be124017d6faaca257d 100644 (file)
@@ -314,6 +314,77 @@ host database file
 .TP
 .I /etc/nsswitch.conf
 name service switch configuration
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbw18 lb lbw29
+l l l.
+Interface      Attribute       Value
+T{
+.BR gethostbyname ()
+T}     Thread safety   T{
+MT-Unsafe race:hostbyname env
+.br
+locale
+T}
+T{
+.BR gethostbyaddr ()
+T}     Thread safety   T{
+MT-Unsafe race:hostbyaddr env
+.br
+locale
+T}
+T{
+.BR sethostent (),
+.br
+.BR endhostent (),
+.br
+.BR gethostent_r ()
+T}     Thread safety   T{
+MT-Unsafe race:hostent env
+.br
+locale
+T}
+T{
+.BR herror (),
+.br
+.BR hstrerror ()
+T}     Thread safety   MT-Safe
+T{
+.BR gethostent ()
+T}     Thread safety   T{
+MT-Unsafe race:hostent
+.br
+race:hostentbuf env locale
+T}
+T{
+.BR gethostbyname2 ()
+T}     Thread safety   T{
+MT-Unsafe race:hostbyname2
+.br
+env locale
+T}
+T{
+.BR gethostbyaddr_r (),
+.BR gethostbyname_r (),
+.BR gethostbyname2_r ()
+T}     Thread safety   MT-Safe env locale
+.TE
+
+In the above table,
+.I hostent
+in
+.I race:hostent
+signifies that if any of the functions
+.BR sethostent (3),
+.BR gethostent (3),
+.BR gethostent_r (3),
+or
+.BR endhostent (3)
+are used in parallel in different threads of a program,
+then data races could occur.
 .SH CONFORMING TO
 POSIX.1-2001 specifies
 .BR gethostbyname (),