summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--libguile/posix.c30
2 files changed, 18 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index e9ce9e62b..7bddae766 100644
--- a/configure.ac
+++ b/configure.ac
@@ -759,9 +759,9 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
#
AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
fesetround ftime ftruncate fchown fchmod getcwd geteuid getsid \
- gettimeofday gmtime_r ioctl lstat mkdir mknod nice \
+ gettimeofday getuid getgid gmtime_r ioctl lstat mkdir mknod nice \
readdir_r readdir64_r readlink rename rmdir setegid seteuid \
- setlocale setpgid setsid sigaction siginterrupt stat64 \
+ setlocale setuid setgid setpgid setsid sigaction siginterrupt stat64 \
strptime symlink sync sysconf tcgetpgrp tcsetpgrp uname waitpid \
strdup system usleep atexit on_exit chown link fcntl ttyname getpwent \
getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \
diff --git a/libguile/posix.c b/libguile/posix.c
index 494df1e0c..dfb5bf9c9 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -800,8 +800,7 @@ SCM_DEFINE (scm_getppid, "getppid", 0, 0, 0,
#undef FUNC_NAME
#endif /* HAVE_GETPPID */
-
-#ifndef __MINGW32__
+#ifdef HAVE_GETUID
SCM_DEFINE (scm_getuid, "getuid", 0, 0, 0,
(),
"Return an integer representing the current real user ID.")
@@ -810,9 +809,9 @@ SCM_DEFINE (scm_getuid, "getuid", 0, 0, 0,
return scm_from_int (getuid ());
}
#undef FUNC_NAME
+#endif /* HAVE_GETUID */
-
-
+#ifdef HAVE_GETGID
SCM_DEFINE (scm_getgid, "getgid", 0, 0, 0,
(),
"Return an integer representing the current real group ID.")
@@ -821,9 +820,9 @@ SCM_DEFINE (scm_getgid, "getgid", 0, 0, 0,
return scm_from_int (getgid ());
}
#undef FUNC_NAME
+#endif /* HAVE_GETGID */
-
-
+#ifdef HAVE_GETUID
SCM_DEFINE (scm_geteuid, "geteuid", 0, 0, 0,
(),
"Return an integer representing the current effective user ID.\n"
@@ -839,8 +838,9 @@ SCM_DEFINE (scm_geteuid, "geteuid", 0, 0, 0,
#endif
}
#undef FUNC_NAME
+#endif /* HAVE_GETUID */
-
+#ifdef HAVE_GETGID
SCM_DEFINE (scm_getegid, "getegid", 0, 0, 0,
(),
"Return an integer representing the current effective group ID.\n"
@@ -856,8 +856,9 @@ SCM_DEFINE (scm_getegid, "getegid", 0, 0, 0,
#endif
}
#undef FUNC_NAME
+#endif /* HAVE_GETGID */
-
+#ifdef HAVE_SETUID
SCM_DEFINE (scm_setuid, "setuid", 1, 0, 0,
(SCM id),
"Sets both the real and effective user IDs to the integer @var{id}, provided\n"
@@ -870,7 +871,9 @@ SCM_DEFINE (scm_setuid, "setuid", 1, 0, 0,
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
+#endif /* HAVE_SETUID */
+#ifdef HAVE_SETGID
SCM_DEFINE (scm_setgid, "setgid", 1, 0, 0,
(SCM id),
"Sets both the real and effective group IDs to the integer @var{id}, provided\n"
@@ -883,7 +886,9 @@ SCM_DEFINE (scm_setgid, "setgid", 1, 0, 0,
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
+#endif /* HAVE_SETGID */
+#ifdef HAVE_SETUID
SCM_DEFINE (scm_seteuid, "seteuid", 1, 0, 0,
(SCM id),
"Sets the effective user ID to the integer @var{id}, provided the process\n"
@@ -905,10 +910,9 @@ SCM_DEFINE (scm_seteuid, "seteuid", 1, 0, 0,
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-#endif /* __MINGW32__ */
+#endif /* HAVE_SETUID */
-
-#ifdef HAVE_SETEGID
+#ifdef HAVE_SETGID
SCM_DEFINE (scm_setegid, "setegid", 1, 0, 0,
(SCM id),
"Sets the effective group ID to the integer @var{id}, provided the process\n"
@@ -931,8 +935,7 @@ SCM_DEFINE (scm_setegid, "setegid", 1, 0, 0,
}
#undef FUNC_NAME
-#endif
-
+#endif /* HAVE_SETGID */
#ifdef HAVE_GETPGRP
SCM_DEFINE (scm_getpgrp, "getpgrp", 0, 0, 0,
@@ -948,7 +951,6 @@ SCM_DEFINE (scm_getpgrp, "getpgrp", 0, 0, 0,
#undef FUNC_NAME
#endif /* HAVE_GETPGRP */
-
#ifdef HAVE_SETPGID
SCM_DEFINE (scm_setpgid, "setpgid", 2, 0, 0,
(SCM pid, SCM pgid),