getprogname is not defined in glibc

need to remove get_process_name as it is removed
from libcutil. Call getprogname is available in
libc but not LE glibc. Implementing a simple call
wrapper.

Change-Id: I68244b9f7fcbc290222b074f80da03330315ea29
CRs-Fixed: 1080605
This commit is contained in:
Kevin Tang 2016-11-11 17:56:59 -08:00 committed by Gerrit - the friendly Code Review server
parent 681388fa8d
commit 4d84d3669c
2 changed files with 10 additions and 0 deletions

View file

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

View file

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