Gerald Pfeifer <ger...@pfeifer.com> writes:

> Your patch is better in that it checks for getexecname (which does
> not exist in FreeBSD).  Mine seems better in that it removes the 
> duplication between fileline.c and print.c and also addresses the
> latter case.
>
> Could you just merge mine into yours or am I missing something?

I think this should work.  The only complication might be that users of
DEFAULT_PROCESS_FILENAME need to include <stdlib.h> on Solaris to get
the declaration of getexecname().  Given that this header is already
used unconditionally, its inclusion should probably be moved to either
internal.h (which doesn't yet include anything) or backtrace.h.  Ian,
what do you prefer here?

Do the FreeBSD headers already provide a define for /proc/curproc/file?
In that case we might check for that and use it directly instead of
#ifdef __FreeBSD__.  At least on our CentOS 6.2 systems, I haven't found
anything similar for /proc/self/exe, and I still have no idea if it's
Linux-only.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to