[RFC] importing e* (embolic, estrdup, etc) functions from NetBSD (libc/libutil or libnetbsd)?

Oliver Pinter oliver.pinter at hardenedbsd.org
Mon Oct 19 19:31:17 UTC 2015


added pfg@ to CC

On Mon, Oct 19, 2015 at 9:14 PM, NGie Cooper <yaneurabeya at 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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"


More information about the freebsd-arch mailing list