Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-05-29 19:04:29 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-05-29 19:04:29 +0400
commita8d7ae61e7b832d354731b1d024e4ff1ed22fca0 (patch)
tree177816378230c384a5d6b375fc5e5b42478e06c2 /winsup/cygwin/winsup.h
parent9854c44c43a179a550c2fb4d23a7f97332628ed3 (diff)
Change internal uid datatype from __uid16_t to __uid32_t
throughout. * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32, geteuid32, setuid32, seteuid32. * passwd.cc (getpwuid32): New function. (getpwuid_r32): Ditto. * syscalls.cc (seteuid32): Ditto. (setuid32): Ditto. * uinfo.cc (getuid32): Ditto. (geteuid32): Ditto. * winsup.h (uid16touid32): New macro, correclt casting from __uid16_t to __uid32_t. (gid16togid32): Ditto fir gids. (getuid32): Declare. (geteuid32): Ditto. (getpwuid32): Ditto. * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and gid32.
Diffstat (limited to 'winsup/cygwin/winsup.h')
-rw-r--r--winsup/cygwin/winsup.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index 69d5938ae..c153e91b6 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -147,10 +147,19 @@ extern "C" void __stdcall do_exit (int) __attribute__ ((noreturn));
/* UID/GID */
void uinfo_init (void);
-#define ILLEGAL_UID ((__uid16_t)-1)
+#define ILLEGAL_UID16 ((__uid16_t)-1)
+#define ILLEGAL_UID ((__uid32_t)-1)
+#define ILLEGAL_GID16 ((__gid16_t)-1)
#define ILLEGAL_GID ((__gid32_t)-1)
#define ILLEGAL_SEEK ((__off64_t)-1)
+#define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(__uid32_t)(u16))
+#define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(__gid32_t)(g16))
+
+extern "C" __uid32_t getuid32 (void);
+extern "C" __uid32_t geteuid32 (void);
+extern "C" struct passwd *getpwuid32 (__uid32_t);
+
/* various events */
void events_init (void);
void events_terminate (void);