<div><br></div><div><div>sure, I configure the CONFIGURE_MAXIMUM_POSIX_RWLOCKS and now it's work fine, thanks for your help </div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Sebastian Huber";<sebastian.huber@embedded-brains.de>;</div><div><b>发送时间:</b> 2016年7月4日(星期一) 中午1:56</div><div><b>收件人:</b> "yao0718"<29171383@qq.com>; "users"<users@rtems.org>; <wbr></div><div></div><div><b>主题:</b> Re: rtems libbsd gethostbyname did not work</div></div><div><br></div><br><br>On 30/06/16 15:42, 葡萄 wrote:<br>> hi,I port a usb driver form freebsd for 4G dongle, it work ,but I <br>> cannot use gethostbyname ,I add some code for debug,find in <br>> freebsd/lib/libc/net/gethostnamadr.c line 581  _nsdispatch  return <br>> failure, in function _nsdispatch ,<br>><br>> if (isthreaded) {<br>> result = _pthread_rwlock_rdlock(&nss_lock);<br>> if (result != 0) {<br>> printf("nsdispatch pthread rd lock failure %d!\n",result);<br>> result = NS_UNAVAIL;<br>> goto fin;<br>> }<br>> }<br>> _pthread_rwlock_rdlock  return invalid, can you give me some advise? <br>> how can i let gethostbyname work?<br>> below is shell print for application information<br><br>Check your application configuration, you probably didn't build with <br>POSIX enabled or didn't configure enough rwlocks. Use the <br>"default-init.h" of the libbsd as an example.<br><br>-- <br>Sebastian Huber, embedded brains GmbH<br><br>Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>Phone   : +49 89 189 47 41-16<br>Fax     : +49 89 189 47 41-09<br>E-Mail  : sebastian.huber@embedded-brains.de<br>PGP     : Public key available on request.<br><br>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br></div>