summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-23 19:46:29 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-23 19:46:29 +0200
commita838e6a17a40df902b50a9ce5b2e944dfc5a7e08 (patch)
tree0f578000c2f565146add26b2c527d49049dbe8ec /src/util.h
parentdd17b384db0ef1690ecf8f73f09dd130b06fb120 (diff)
pam: dont use $XDG_SESSION_COOKIE since CK wants that to be secret. Come up with our own $XDG_SESSION_ID based on /proc/self/sessionid if that is available
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 864d98fa63..2410312421 100644
--- a/src/util.h
+++ b/src/util.h
@@ -30,6 +30,8 @@
#include <stdio.h>
#include <signal.h>
+#include "macro.h"
+
typedef uint64_t usec_t;
typedef struct timestamp {
@@ -113,6 +115,16 @@ int parse_pid(const char *s, pid_t* ret_pid);
int safe_atou(const char *s, unsigned *ret_u);
int safe_atoi(const char *s, int *ret_i);
+static inline int safe_atou32(const char *s, uint32_t *ret_u) {
+ assert_cc(sizeof(uint32_t) == sizeof(unsigned));
+ return safe_atou(s, (unsigned*) ret_u);
+}
+
+static inline int safe_atoi32(const char *s, int32_t *ret_u) {
+ assert_cc(sizeof(int32_t) == sizeof(int));
+ return safe_atoi(s, (int*) ret_u);
+}
+
int safe_atolu(const char *s, unsigned long *ret_u);
int safe_atoli(const char *s, long int *ret_i);