From bd82db405775df05f5ecf29215f367c104f4f19b Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Mar 2011 15:49:39 +0000 Subject: [PATCH] Add compat function for geteuid() * configure.ac: Check for geteuid() * src/util/util.h: Compat for geteuid() --- configure.ac | 2 +- src/util/util.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a58ee4e3e6..e2b2b2447f 100644 --- a/configure.ac +++ b/configure.ac @@ -120,7 +120,7 @@ AC_MSG_RESULT([$have_cpuid]) dnl Availability of various common functions (non-fatal if missing), dnl and various less common threadsafe functions AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid \ - initgroups posix_fallocate mmap kill \ + geteuid initgroups posix_fallocate mmap kill \ getmntent_r getgrnam_r getpwuid_r]) dnl Availability of pthread functions (if missing, win32 threading is diff --git a/src/util/util.h b/src/util/util.h index 31c3a33619..c313023e3b 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -269,6 +269,10 @@ const char *virEnumToString(const char *const*types, static inline int getuid (void) { return 0; } # endif +# ifndef HAVE_GETEUID +static inline int geteuid (void) { return 0; } +# endif + # ifndef HAVE_GETGID static inline int getgid (void) { return 0; } # endif -- GitLab