Date: Wed, 21 Mar 2018 18:04:51 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Warner Losh <imp@bsdimp.com> Cc: "Conrad E. Meyer" <cem@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Xin LI <delphij@freebsd.org> Subject: Re: svn commit: r331279 - in head: include lib/libc/gen lib/libc/sys lib/libc/tests/gen sys/compat/freebsd32 sys/conf sys/kern sys/sys tests/sys/kern usr.bin/truss Message-ID: <20180321160451.GM76926@kib.kiev.ua> In-Reply-To: <CANCZdfr-GJg4DyXy9%2BzjSjc=-uUDi4iYrDOBzOj7L=bLfhL00g@mail.gmail.com> References: <201803210115.w2L1Fjt9084698@repo.freebsd.org> <20180321103325.GJ76926@kib.kiev.ua> <CAG6CVpW3tPVyh6D3FXpAc9DPqG9u_KnHBiZOFmg1zZsHmDb8jA@mail.gmail.com> <20180321152335.GL76926@kib.kiev.ua> <CAG6CVpVq4e9p7tWRhzD1YmK0Zoxg3M31bMsHMkUbqCFwBHe%2BDQ@mail.gmail.com> <CANCZdfr-GJg4DyXy9%2BzjSjc=-uUDi4iYrDOBzOj7L=bLfhL00g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 21, 2018 at 09:42:26AM -0600, Warner Losh wrote: > On Wed, Mar 21, 2018 at 9:37 AM, Conrad Meyer <cem@freebsd.org> wrote: > > > On Wed, Mar 21, 2018 at 8:23 AM, Konstantin Belousov > > <kostikbel@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180321160451.GM76926>