Re: [libbacktrace] Use getexecname() on Solaris

2012-11-12 Thread Ian Lance Taylor
On Wed, Nov 7, 2012 at 5:50 AM, Rainer Orth wrote: > Gerald Pfeifer writes: > >> Just a small note, in the following >> >> +#ifdef __FreeBSD__ >> +# define DEFAULT_PROCESS_FILENAME "/proc/curproc/file" >> +#elif defined(HAVE_GETEXECNAME) >> +# define DEFAULT_PROCESS_FILENAME getexecname

Re: [libbacktrace] Use getexecname() on Solaris

2012-11-07 Thread Rainer Orth
Gerald Pfeifer writes: > Just a small note, in the following > > +#ifdef __FreeBSD__ > +# define DEFAULT_PROCESS_FILENAME "/proc/curproc/file" > +#elif defined(HAVE_GETEXECNAME) > +# define DEFAULT_PROCESS_FILENAME getexecname () > +#else > +# define DEFAULT_PROCESS_FILENAME "/proc/se

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-11 Thread Gerald Pfeifer
On Thu, 11 Oct 2012, Rainer Orth wrote: > Ok, here's the merged patch, tested on i386-pc-solaris2.10. Ok for > mainline? Cool, thank you! Just a small note, in the following +#ifdef __FreeBSD__ +# define DEFAULT_PROCESS_FILENAME "/proc/curproc/file" +#elif defined(HAVE_GETEXECNAME) +#

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-11 Thread Rainer Orth
Ian Lance Taylor writes: > On Fri, Oct 5, 2012 at 4:21 AM, Rainer Orth > wrote: >> >> I think this should work. The only complication might be that users of >> DEFAULT_PROCESS_FILENAME need to include on Solaris to get >> the declaration of getexecname(). Given that this header is already >>

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Ian Lance Taylor
On Fri, Oct 5, 2012 at 4:21 AM, Rainer Orth wrote: > > I think this should work. The only complication might be that users of > DEFAULT_PROCESS_FILENAME need to include on Solaris to get > the declaration of getexecname(). Given that this header is already > used unconditionally, its inclusion

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Ian Lance Taylor
On Fri, Oct 5, 2012 at 3:21 AM, Rainer Orth wrote: > With the strnlen-related Go failures now gone on Solaris, another issue > crept up: several tests were failing like this: > > throw: /proc/self/exe > > goroutine 4 [running]: > panic during panic > FAIL: log > > This is due to the hardcoded use

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Gerald Pfeifer
On Fri, 5 Oct 2012, Rainer Orth wrote: > Do the FreeBSD headers already provide a define for /proc/curproc/file? None that I could find. Gerald

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Rainer Orth
Uros Bizjak writes: > +# Check for getexecname function. > +if test -n "${with_target_subdir}"; then > + case "${host}" in > + *-*-solaris2*) have_getexecname=yes ;; > + *) have_getexecname=no ;; > + esac > +else > + AC_CHECK_FUNC(getexecname, [have_getexecname=yes], [have_getexename=no]

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Rainer Orth
Gerald Pfeifer 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 missi

Re:[libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Uros Bizjak
Hello! > With the strnlen-related Go failures now gone on Solaris, another issue > crept up: several tests were failing like this: > > throw: /proc/self/exe > > goroutine 4 [running]: > panic during panic > FAIL: log > > This is due to the hardcoded use of /proc/self/exe in libbacktrace, > which d

Re: [libbacktrace] Use getexecname() on Solaris

2012-10-05 Thread Gerald Pfeifer
On Fri, 5 Oct 2012, Rainer Orth wrote: > This is due to the hardcoded use of /proc/self/exe in libbacktrace, > which doesn't exist on Solaris, and probably is also missing on other > non-Linux OSes. Solaris (since 2.6, it seems) provides getexecname() > instead, which this patch uses. : > I haven'