On Wed, Mar 21, 2018 at 09:42:26AM -0600, Warner Losh wrote:
> On Wed, Mar 21, 2018 at 9:37 AM, Conrad Meyer <c...@freebsd.org> wrote:
> 
> > On Wed, Mar 21, 2018 at 8:23 AM, Konstantin Belousov
> > <kostik...@gmail.com> wrote:
> > > On Wed, Mar 21, 2018 at 08:03:16AM -0700, Conrad Meyer wrote:
> > >> On Wed, Mar 21, 2018 at 3:33 AM, Konstantin Belousov
> > >> > Libraries must not abort the application.
> > >> > Esp. libc.
> > >>
> > >> What do you propose instead?  while (1); ?  I don't see that as
> > >> obviously better.
> > >
> > > Return the error to caller, as all, well most, correct library functions
> > > do.
> >
> > The abort() in case of ENOSYS was proposed by delphij@.  It is
> > intended for users that getentropy() not fail.  Another possible
> > fallback is to use the kern.arandom sysctl.  Would this be amenable to
> > you?
> >
> 
> You should get a SIGSYS unless you've setup signal handlers for ENOSYS
> anyway, right?

The signal handler is under control of the application which uses libc.
The library can be only passive there.  So passing ENOSYS silently to the
caller, or trying to use kern.arandom on ENOSYS are both fine.  Abort()
is not, IMO.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to