On Fri, Feb 13, 2015 at 10:08:08AM -0800, Paul Eggert wrote: > Richard W.M. Jones wrote: > >fter some experimentation she came up with the attached patch, which > >she has tested, and which allows argv[0] to be found by calling a > >function `_NSGetArgv' (which of course only exists on OS X). > > Yes, unfortunately this appears to be a fix that will solve the > problem only on OS X. We need a fix that will work on all > platforms.
I'm possibly misunderstanding what you mean, but the patch seems to be a small improvement .. ie. it will work on { glibc, Mac OS X } whereas currently it only works on { glibc }. Having it work everywhere seems impossible since the C standard doesn't define a standard way to access argv[0] outside main(). > Perhaps change progname.h to understand the problem, and have > error.c use progname.h? I'll take a look if I have the time. I should note I don't have a Mac machine on which to test changes. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html