From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,23b001e688940261 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2000-12-19 14:22:16 PST Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!newsgate.tandem.com!mailint03.im.hou.compaq.com!pa.dec.com!ajo.zk3.dec.com!not-for-mail From: Joe Mario Newsgroups: comp.unix.tru64 Subject: Re: gethostbyname Date: Tue, 19 Dec 2000 17:14:10 -0500 Organization: Awesome OSIS Folk Message-ID: <3A3FDDB2.9051F11E@zk3.dec.com> References: <91e35j$14j$1@infosun2.rus.uni-stuttgart.de> NNTP-Posting-Host: courtney.zk3.dec.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: lead.zk3.dec.com 977264036 251878 16.141.0.18 (19 Dec 2000 22:13:56 GMT) X-Complaints-To: iass@ajo.zk3.dec.com NNTP-Posting-Date: 19 Dec 2000 22:13:56 GMT Cc: Stefan Schwarzer X-Mailer: Mozilla 4.76 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: en Xref: supernews.google.com comp.unix.tru64:1258 Starting in V5.0, gethostbyname and gethostbyaddr became thread safe by default. As a result h_errno handling became thread safe as well. The global h_errno was left behind, but we can not guarantee it's acuracy. To get the thread value you need a prototype and to use the _Get_h_errno() function, like this: extern int _Get_h_errno(); main () { gethostbyname(host); if (_Get_h_errno() > 0) herror(); } To set h_error, applications should use _Set_h_errno(error) with the following prototype: extern int _Set_h_errno(); Using _Get_h_errno() returns 0 as expected. Joe