chiark / gitweb /
util: unify getenv() logic for other PID
[elogind.git] / src / shared / util.h
index 35ba0057d6783bfd80eee30f8d7fea786d60de89..17ffd19f55415cfc0c4759021df1d442c14f3fe2 100644 (file)
@@ -100,6 +100,8 @@ bool streq_ptr(const char *a, const char *b);
 
 #define new0(t, n) ((t*) calloc((n), sizeof(t)))
 
+#define newa(t, n) ((t*) alloca(sizeof(t)*(n)))
+
 #define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))
 
 #define malloc0(n) (calloc((n), 1))
@@ -538,4 +540,6 @@ int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *pa
 
 int setrlimit_closest(int resource, const struct rlimit *rlim);
 
+int getenv_for_pid(pid_t pid, const char *field, char **_value);
+
 #endif