return geteuid() != getuid() || getegid() != getgid();
}
-char *lttng_getenv(const char *name)
+char *lttng_ust_getenv(const char *name)
{
size_t i;
struct lttng_env *e;
#ifndef _COMPAT_GETENV_H
#define _COMPAT_GETENV_H
+#include "ust-helper.h"
+
/*
- * Always add the lttng-ust environment variables to lttng_getenv()
- * infrastructure rather than using getenv() directly from lttng-ust.
- * This ensures that we don't trigger races between getenv() invoked by
- * lttng-ust listener threads invoked concurrently with setenv() called
- * by an otherwise single-threaded application thread. (the application
- * is not aware that it runs with lttng-ust)
+ * Always add the lttng-ust environment variables using the lttng_ust_getenv()
+ * infrastructure rather than using getenv() directly. This ensures that we
+ * don't trigger races between getenv() invoked by lttng-ust listener threads
+ * invoked concurrently with setenv() called by an otherwise single-threaded
+ * application thread. (the application is not aware that it runs with
+ * lttng-ust)
*/
-char *lttng_getenv(const char *name);
+LTTNG_HIDDEN
+char *lttng_ust_getenv(const char *name);
+LTTNG_HIDDEN
void lttng_ust_getenv_init(void);
#endif /* _COMPAT_GETENV_H */
if (clock_handle)
return;
- libname = lttng_getenv("LTTNG_UST_CLOCK_PLUGIN");
+ libname = lttng_ust_getenv("LTTNG_UST_CLOCK_PLUGIN");
if (!libname)
return;
clock_handle = dlopen(libname, RTLD_NOW);
if (getcpu_handle)
return;
- libname = lttng_getenv("LTTNG_UST_GETCPU_PLUGIN");
+ libname = lttng_ust_getenv("LTTNG_UST_GETCPU_PLUGIN");
if (!libname)
return;
getcpu_handle = dlopen(libname, RTLD_NOW);
{
const char *val;
- val = (const char *) lttng_getenv("LTTNG_HOME");
+ val = (const char *) lttng_ust_getenv("LTTNG_HOME");
if (val != NULL) {
return val;
}
- return (const char *) lttng_getenv("HOME");
+ return (const char *) lttng_ust_getenv("HOME");
}
/*
long constructor_delay_ms = LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS;
if (!got_timeout_env) {
- str_timeout = lttng_getenv("LTTNG_UST_REGISTER_TIMEOUT");
+ str_timeout = lttng_ust_getenv("LTTNG_UST_REGISTER_TIMEOUT");
got_timeout_env = 1;
}
if (str_timeout)
void get_allow_blocking(void)
{
const char *str_allow_blocking =
- lttng_getenv("LTTNG_UST_ALLOW_BLOCKING");
+ lttng_ust_getenv("LTTNG_UST_ALLOW_BLOCKING");
if (str_allow_blocking) {
DBG("%s environment variable is set",
{
struct dl_iterate_data data;
- if (lttng_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
+ if (lttng_ust_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
return;
/*
static
int do_baddr_statedump(void *owner)
{
- if (lttng_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
+ if (lttng_ust_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
return 0;
lttng_ust_dl_update(LTTNG_UST_CALLER_IP());
ust_dl_table_statedump(owner);
static
int do_procname_statedump(void *owner)
{
- if (lttng_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP"))
+ if (lttng_ust_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP"))
return 0;
trace_statedump_event(procname_cb, owner, lttng_ust_sockinfo_get_procname(owner));
if (ust_err_loglevel == UST_ERR_LOGLEVEL_UNKNOWN) {
/*
- * This getenv is not part of lttng_getenv() because it
+ * This getenv is not part of lttng_ust_getenv() because it
* is required to print ERR() performed during getenv
* initialization.
*/