Skip site navigation (1)Skip section navigation (2)
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>
References:  <74F6DD3C-42F6-490B-A08E-245A1338A3E7@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 uti=
lities (including makefs) to use their new e* function implementations of m=
alloc, strndup, etc: http://man.netbsd.org/HEAD/usr/share/man/html3/efun.ht=
ml (they have some other functions that we don=E2=80=99t have in libc/libut=
il 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 libuti=
l (I think it=E2=80=99d be handy because it would eliminate a lot of repeti=
tive error handling in our user land code)? If there are major objections, =
I=E2=80=99ll take it and stuff it into libnetbsd.
> Thanks!
> -NGie
>
> [*] Based on a quick glance over the code, estrlcpy/estrlcat/estrtoi/estr=
tou 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=3D1.10&content-type=3Dtext/x-cvsweb-markup&only_with_tag=3DMAIN
> _______________________________________________
> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPQ4ffu-vjOfgJ%2B3pDnh-TWgirEbNvhMKm=SR97JePQP0DdGGA>