Hide the perl.h declarations of gete?[ug]id and getlogin on Win32 since
they are already declared in win32/win32.h, nearer to their definitions
(stub functions for UNIX compatibility) in win32/win32.c.
Also only declare them, and kill(pg)?, sbrk, chown and mkstemp, under
PERL_CORE anyway since they are not exported: including declarations for
non-exported functions just hides compiler errors about the symbols being
undefined, which doesn't help when trying to fix subsequent errors from
the linker about the symbols being unresolved. (Actually, all but sbrk,
chown and mkstemp get indirected through the perlhost layer normally
anyway, but it doesn't hurt to still hide the declarations, and helps in
the case of PERL_IMPLICIT_SYS not being defined, where only kill is
redefined to something which is exported.)
The declarations of the set[ug]id stub functions remain for now because
those two symbols are currently exported.
#endif
#ifndef __cplusplus
-#if !(defined(UNDER_CE) || defined(SYMBIAN))
+#if !(defined(WIN32) || defined(UNDER_CE) || defined(SYMBIAN))
Uid_t getuid (void);
Uid_t geteuid (void);
Gid_t getgid (void);
# endif
# endif
# endif /* !DONT_DECLARE_STD */
-#ifndef getlogin
+# ifndef WIN32
+# ifndef getlogin
char *getlogin (void);
-#endif
+# endif
+# endif /* !WIN32 */
#endif /* !__cplusplus */
/* Fixme on VMS. This needs to be a run-time, not build time options */
/* For UNIX compatibility. */
+extern int setuid(uid_t uid);
+extern int setgid(gid_t gid);
+
+#ifdef PERL_CORE
extern uid_t getuid(void);
extern gid_t getgid(void);
extern uid_t geteuid(void);
extern gid_t getegid(void);
-extern int setuid(uid_t uid);
-extern int setgid(gid_t gid);
extern int kill(int pid, int sig);
extern int killpg(int pid, int sig);
#ifndef USE_PERL_SBRK
extern char * getlogin(void);
extern int chown(const char *p, uid_t o, gid_t g);
extern int mkstemp(const char *path);
+#endif
#undef Stat
#define Stat win32_stat