Date: Mon, 19 Oct 2015 21:31:08 +0200 From: Oliver Pinter <oliver.pinter@hardenedbsd.org> To: NGie Cooper <yaneurabeya@gmail.com> Cc: freebsd-arch <freebsd-arch@freebsd.org>, Pedro Giffuni <pfg@freebsd.org> Subject: Re: [RFC] importing e* (embolic, estrdup, etc) functions from NetBSD (libc/libutil or libnetbsd)? Message-ID: <CAPQ4ffu-vjOfgJ%2B3pDnh-TWgirEbNvhMKm=SR97JePQP0DdGGA@mail.gmail.com> In-Reply-To: <74F6DD3C-42F6-490B-A08E-245A1338A3E7@gmail.com>
index | next in thread | previous in thread | raw e-mail
added pfg@ to CC On Mon, Oct 19, 2015 at 9:14 PM, NGie Cooper <yaneurabeya@gmail.com> wrote: > Hi all, > While looking quickly through makefs upstream for fixing a PR, I realized that some years ago NetBSD has refactored a number of userland utilities (including makefs) to use their new e* function implementations of malloc, strndup, etc: http://man.netbsd.org/HEAD/usr/share/man/html3/efun.html (they have some other functions that we don’t have in libc/libutil in their libutil that might need to be ported as well). > The basic overall difference is that when the failing case occurs, a function defined by esetfunc is called, it dumps out a diagnostic error message via esetfunc, then returns the original value [*]. > I was wondering if anyone had objections to adding this to libutil (I think it’d be handy because it would eliminate a lot of repetitive error handling in our user land code)? If there are major objections, I’ll take it and stuff it into libnetbsd. > Thanks! > -NGie > > [*] Based on a quick glance over the code, estrlcpy/estrlcat/estrtoi/estrtou are exceptions to the rule. It modifies/saves errno before calling the error function: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libutil/efun.c?rev=1.10&content-type=text/x-cvsweb-markup&only_with_tag=MAIN > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPQ4ffu-vjOfgJ%2B3pDnh-TWgirEbNvhMKm=SR97JePQP0DdGGA>
