search for: _nsgetargv

Displaying 8 results from an estimated 8 matches for "_nsgetargv".

2015 Feb 11
2
Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib
...t; >> OS that trips over this, after all. > > > > But it would fix it for Mac OS X, which is better than nothing. > > > > As a test, can you see if adding some variation of: > > > > #if /* this is Mac OS X */ > > #define program_name (((char **)*_NSGetArgv())[0]) > > #endif > > > > to libguestfs's gnulib/lib/error.h fixes the problem? > > > > It'll save you a lot of time if it does work. > > It compiles and libguestfs-test-tool doesn't bomb afterwards, if that > is a sufficient definition of &quo...
2015 Feb 11
2
Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib
...ymbol and libguestfs binaries don't supply it. There might be another > OS that trips over this, after all. But it would fix it for Mac OS X, which is better than nothing. As a test, can you see if adding some variation of: #if /* this is Mac OS X */ #define program_name (((char **)*_NSGetArgv())[0]) #endif to libguestfs's gnulib/lib/error.h fixes the problem? It'll save you a lot of time if it does work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Wind...
2015 Feb 11
2
Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib
...ue of argv[0], and then send a patch to gnulib which does: #if /* this is Mac OS X */ #define program_name whatever_mac_os_x_defines_as_program_name #endif My reading is that something like this might work, untested of course: #if /* this is Mac OS X */ #define program_name (((char **)*_NSGetArgv())[0]) #endif Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stat...
2015 Feb 11
0
Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib
...ulib which does: > > #if /* this is Mac OS X */ > #define program_name whatever_mac_os_x_defines_as_program_name > #endif > > My reading is that something like this might work, untested of course: > > #if /* this is Mac OS X */ > #define program_name (((char **)*_NSGetArgv())[0]) > #endif Unfortunately I lack the knowledge to verify whether this is applicable, so I'd rather use the blunt-but-guaranteed approach. Unless there is someone else more capable and willing to fix it in a prettier way, of course! -- M.
2015 Feb 11
0
Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib
...9;t supply it. There might be another >> OS that trips over this, after all. > > But it would fix it for Mac OS X, which is better than nothing. > > As a test, can you see if adding some variation of: > > #if /* this is Mac OS X */ > #define program_name (((char **)*_NSGetArgv())[0]) > #endif > > to libguestfs's gnulib/lib/error.h fixes the problem? > > It'll save you a lot of time if it does work. It compiles and libguestfs-test-tool doesn't bomb afterwards, if that is a sufficient definition of "working". -- M.
2015 Feb 12
0
[PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
...ror.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/error.c b/lib/error.c index 6683197..36a3db7 100644 --- a/lib/error.c +++ b/lib/error.c @@ -113,9 +113,13 @@ int strerror_r (); # endif # endif +#if defined __APPLE__ && defined __MACH__ +#define program_name (((char **)*_NSGetArgv())[0]) +#else /* The calling program should define program_name and set it to the name of the executing program. */ extern char *program_name; +#endif # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r -- 1.9.3
2015 Feb 12
2
Re: [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
...gt; diff --git a/lib/error.c b/lib/error.c > index 6683197..36a3db7 100644 > --- a/lib/error.c > +++ b/lib/error.c > @@ -113,9 +113,13 @@ int strerror_r (); > # endif > # endif > > +#if defined __APPLE__ && defined __MACH__ > +#define program_name (((char **)*_NSGetArgv())[0]) > +#else > /* The calling program should define program_name and set it to the > name of the executing program. */ > extern char *program_name; > +#endif > > # if HAVE_STRERROR_R || defined strerror_r > # define __strerror_r strerror_r > We import gnu...
2015 Feb 09
2
Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib
On Mon, Feb 09, 2015 at 11:06:16AM +0000, Margaret Lewicka wrote: > gnulib's error.c requires program_name to be externally defined > for !_LIBC systems. This defines program_name for Darwin only. > --- > configure.ac | 3 +++ > src/Makefile.am | 6 ++++++ > src/program_name.c | 4 ++++ > 3 files changed, 13 insertions(+) > create mode 100644