X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=b37072f24a2032402c90e30a4899c70891194cf1;hb=693eb9a2d42d71445dad273a76e2470199d1dc5a;hp=338d79c7ac5822be36c0c1b312df422b1aeef1c6;hpb=9bf3b53533cdc9b95c921b71da755401f223f765;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index 338d79c7a..b37072f24 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -40,6 +40,7 @@ #include #include #include +#include #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);