rtems libbsd gethostbyname did not work

Chris Johns chrisj at rtems.org
Mon Jul 4 06:06:04 UTC 2016

On 04/07/2016 15:56, Sebastian Huber wrote:
> On 30/06/16 15:42, 葡萄 wrote:
>> hi,I port a usb driver form freebsd for 4G dongle, it work ,but I
>> cannot use gethostbyname ,I add some code for debug,find in
>> freebsd/lib/libc/net/gethostnamadr.c line 581  _nsdispatch  return
>> failure, in function _nsdispatch ,
>> if (isthreaded) {
>> result = _pthread_rwlock_rdlock(&nss_lock);
>> if (result != 0) {
>> printf("nsdispatch pthread rd lock failure %d!\n",result);
>> result = NS_UNAVAIL;
>> goto fin;
>> }
>> }
>> _pthread_rwlock_rdlock  return invalid, can you give me some advise?
>> how can i let gethostbyname work?
>> below is shell print for application information
> Check your application configuration, you probably didn't build with
> POSIX enabled or didn't configure enough rwlocks.

The waf build script checks for POSIX being enabled. You cannot build 
LibBSD without.

> Use the "default-init.h" of the libbsd as an example.

Should LibBSD check the value before starting and print a warning if too 
low? I am sure lots of people will have this issue.


More information about the users mailing list