Merge "getprogname is not defined in glibc"

This commit is contained in:
Linux Build Service Account 2017-03-20 13:20:52 -07:00 committed by Gerrit - the friendly Code Review server
commit 36840b0a66
2 changed files with 10 additions and 0 deletions

View file

@ -34,6 +34,10 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef USE_GLIB
const char* getprogname();
#endif /* USE_GLIB */
pid_t platform_lib_abstraction_gettid(); pid_t platform_lib_abstraction_gettid();
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -30,6 +30,12 @@
#ifdef USE_GLIB #ifdef USE_GLIB
#include <loc_stub_gettid.h> #include <loc_stub_gettid.h>
#include <errno.h>
const char* getprogname() {
return program_invocation_short_name;
}
#else #else
#include <unistd.h> #include <unistd.h>
#endif /* USE_GLIB */ #endif /* USE_GLIB */