Re: dlopen fails from static binary

2016-05-25 Thread Taylor R Campbell
   Date: Thu, 26 May 2016 02:24:02 + (UTC)
   From: chris...@astron.com (Christos Zoulas)

   In article <201605252317.u4pnh1wv026...@server.cornerstoneservice.ca>,
   John Nemeth   wrote:
   >On Apr 18,  7:17am, Emmanuel Dreyfus wrote:
   >} 
   >} On netbsd-6, using dlopen in a static binary will return NULL without 
   >} setting errno.
   >
   > errno is for syscalls.  dlopen is not a syscall, so why would
   >you expect it to set errno?

   What does dlerror() say?

As discussed in the thread last month, at
,
dlerror reports "Service unavailable".

We could change that as manu@ suggested to state more clearly that
dlopen is not available in statically linked binaries, although joerg@
seems to have something on his radar about making the static dlopen
`become more useful soon'.


Re: dlopen fails from static binary

2016-05-25 Thread Christos Zoulas
In article <201605252317.u4pnh1wv026...@server.cornerstoneservice.ca>,
John Nemeth   wrote:
>On Apr 18,  7:17am, Emmanuel Dreyfus wrote:
>} 
>} On netbsd-6, using dlopen in a static binary will return NULL without 
>} setting errno.
>
> errno is for syscalls.  dlopen is not a syscall, so why would
>you expect it to set errno?

What does dlerror() say?

christos



Re: dlopen fails from static binary

2016-05-25 Thread Timo Buhrmester
> errno is for syscalls.
errno is standard C, there are non-syscall library functions that do,
and are required to, set errno, for example strtol(3) and friends.

$ grep -rlFw errno /usr/share/man/man3 | wc -l
754

(Yes, some/most may set errno due to system calls failing, but
certainly not all of them)


Re: dlopen fails from static binary

2016-05-25 Thread John Nemeth
On Apr 18,  7:17am, Emmanuel Dreyfus wrote:
} 
} On netbsd-6, using dlopen in a static binary will return NULL without 
} setting errno.

 errno is for syscalls.  dlopen is not a syscall, so why would
you expect it to set errno?

}-- End of excerpt from Emmanuel Dreyfus