From bb87afc3647ccb3dd75c1dfeb5d79899c10e479d Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Thu, 8 May 2008 01:39:54 +0000 Subject: [PATCH] added getuid function --- common/os_calls.c | 16 +++++++++++++++- common/os_calls.h | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/common/os_calls.c b/common/os_calls.c index 9b587c8d..a4104249 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -1775,12 +1775,26 @@ g_initgroups(const char* user, int gid) #if defined(_WIN32) return 0; #else - return initgroups(user ,gid); + return initgroups(user, gid); #endif } /*****************************************************************************/ /* does not work in win32 */ +/* returns user id */ +int APP_CC +g_getuid(void) +{ +#if defined(_WIN32) + return 0; +#else + return getuid(); +#endif +} + +/*****************************************************************************/ +/* does not work in win32 */ +/* On success, zero is returned. On error, -1 is returned */ int APP_CC g_setuid(int pid) { diff --git a/common/os_calls.h b/common/os_calls.h index 73dde4b2..c9707cac 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -207,6 +207,8 @@ g_setgid(int pid); int APP_CC g_initgroups(const char* user, int gid); int APP_CC +g_getuid(void); +int APP_CC g_setuid(int pid); int APP_CC g_waitchild(void);