-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
#pragma once
/***
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <stdbool.h>
+#include <sys/types.h>
+#include <unistd.h>
bool uid_is_valid(uid_t uid);
return parse_uid(s, (uid_t*) ret_gid);
}
-#if 0 /// UNNEEDED by elogind
char* getlogname_malloc(void);
+#if 0 /// UNNEEDED by elogind
char* getusername_malloc(void);
#endif // 0
#define PTR_TO_GID(p) ((gid_t) (((uintptr_t) (p))-1))
#define GID_TO_PTR(u) ((void*) (((uintptr_t) (u))+1))
+
+static inline bool userns_supported(void) {
+ return access("/proc/self/uid_map", F_OK) >= 0;
+}