chiark / gitweb /
bus: rename message "serial" to "cookie"
[elogind.git] / src / shared / util.h
index 338d79c7ac5822be36c0c1b312df422b1aeef1c6..b37072f24a2032402c90e30a4899c70891194cf1 100644 (file)
@@ -40,6 +40,7 @@
 #include <unistd.h>
 #include <locale.h>
 #include <mntent.h>
+#include <sys/socket.h>
 
 #include "macro.h"
 #include "time-util.h"
@@ -711,7 +712,7 @@ static inline void _reset_umask_(struct _umask_struct_ *s) {
              _saved_umask_.quit = true)
 
 static inline unsigned u64log2(uint64_t n) {
-        return (n > 1) ? __builtin_clzll(n) ^ 63U : 0;
+        return (n > 1) ? (unsigned) __builtin_clzll(n) ^ 63U : 0;
 }
 
 static inline bool logind_running(void) {
@@ -811,3 +812,6 @@ int namespace_open(pid_t pid, int *pidns_fd, int *mntns_fd, int *root_fd);
 int namespace_enter(int pidns_fd, int mntns_fd, int root_fd);
 
 bool pid_valid(pid_t pid);
+
+int getpeercred(int fd, struct ucred *ucred);
+int getpeersec(int fd, char **ret);