1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

More functions unavailable on some systems.

* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
This commit is contained in:
Jim Blandy 1996-08-07 20:25:10 +00:00
parent 339d28a35e
commit 1fd838affc
4 changed files with 56 additions and 2 deletions

2
libguile/configure vendored
View file

@ -1419,7 +1419,7 @@ EOF
fi fi
for ac_func in ftime times geteuid seteuid setegid select uname mkdir rmdir getcwd rename putenv setlocale strftime strptime mknod nice lstat readlink symlink sync for ac_func in ctermid ftime getcwd geteuid lstat mkdir mknod nice putenv readlink rename rmdir select setegid seteuid setlocale setpgid setsid strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then

View file

@ -26,7 +26,7 @@ AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_TYPE_MODE_T AC_TYPE_MODE_T
AC_CHECK_FUNCS(ftime times geteuid seteuid setegid select uname mkdir rmdir getcwd rename putenv setlocale strftime strptime mknod nice lstat readlink symlink sync) AC_CHECK_FUNCS(ctermid ftime getcwd geteuid lstat mkdir mknod nice putenv readlink rename rmdir select setegid seteuid setlocale setpgid setsid strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid)
AC_REPLACE_FUNCS(inet_aton) AC_REPLACE_FUNCS(inet_aton)

View file

@ -397,6 +397,7 @@ scm_sys_waitpid (pid, options)
SCM options; SCM options;
#endif #endif
{ {
#ifdef HAVE_WAITPID
int i; int i;
int status; int status;
int ioptions; int ioptions;
@ -413,6 +414,11 @@ scm_sys_waitpid (pid, options)
if (i == -1) if (i == -1)
SCM_SYSERROR (s_sys_waitpid); SCM_SYSERROR (s_sys_waitpid);
return scm_cons (SCM_MAKINUM (0L + i), SCM_MAKINUM (0L + status)); return scm_cons (SCM_MAKINUM (0L + i), SCM_MAKINUM (0L + status));
#else
SCM_SYSMISSING (s_sys_waitpid);
/* not reached. */
return SCM_BOOL_F;
#endif
} }
@ -587,22 +593,34 @@ SCM
scm_setpgid (pid, pgid) scm_setpgid (pid, pgid)
SCM pid, pgid; SCM pid, pgid;
{ {
#ifdef HAVE_SETPGID
SCM_ASSERT (SCM_INUMP (pid), pid, SCM_ARG1, s_setpgid); SCM_ASSERT (SCM_INUMP (pid), pid, SCM_ARG1, s_setpgid);
SCM_ASSERT (SCM_INUMP (pgid), pgid, SCM_ARG2, s_setpgid); SCM_ASSERT (SCM_INUMP (pgid), pgid, SCM_ARG2, s_setpgid);
/* FIXME(?): may be known as setpgrp. */ /* FIXME(?): may be known as setpgrp. */
if (setpgid (SCM_INUM (pid), SCM_INUM (pgid)) != 0) if (setpgid (SCM_INUM (pid), SCM_INUM (pgid)) != 0)
SCM_SYSERROR (s_setpgid); SCM_SYSERROR (s_setpgid);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
#else
SCM_SYSMISSING (s_sys_setpgid);
/* not reached. */
return SCM_BOOL_F;
#endif
} }
SCM_PROC (s_setsid, "setsid", 0, 0, 0, scm_setsid); SCM_PROC (s_setsid, "setsid", 0, 0, 0, scm_setsid);
SCM SCM
scm_setsid () scm_setsid ()
{ {
#ifdef HAVE_SETSID
pid_t sid = setsid (); pid_t sid = setsid ();
if (sid == -1) if (sid == -1)
SCM_SYSERROR (s_setsid); SCM_SYSERROR (s_setsid);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
#else
SCM_SYSMISSING (s_sys_setsid);
/* not reached. */
return SCM_BOOL_F;
#endif
} }
SCM_PROC (s_ttyname, "ttyname", 1, 0, 0, scm_ttyname); SCM_PROC (s_ttyname, "ttyname", 1, 0, 0, scm_ttyname);
@ -635,10 +653,16 @@ SCM_PROC (s_ctermid, "ctermid", 0, 0, 0, scm_ctermid);
SCM SCM
scm_ctermid () scm_ctermid ()
{ {
#ifdef HAVE_CTERMID
char *result = ctermid (NULL); char *result = ctermid (NULL);
if (*result == '\0') if (*result == '\0')
SCM_SYSERROR (s_ctermid); SCM_SYSERROR (s_ctermid);
return scm_makfrom0str (result); return scm_makfrom0str (result);
#else
SCM_SYSMISSING (s_sys_ctermid);
/* not reached. */
return SCM_BOOL_F;
#endif
} }
SCM_PROC (s_tcgetpgrp, "tcgetpgrp", 1, 0, 0, scm_tcgetpgrp); SCM_PROC (s_tcgetpgrp, "tcgetpgrp", 1, 0, 0, scm_tcgetpgrp);
@ -646,6 +670,7 @@ SCM
scm_tcgetpgrp (port) scm_tcgetpgrp (port)
SCM port; SCM port;
{ {
#ifdef HAVE_TCGETPGRP
int fd; int fd;
pid_t pgid; pid_t pgid;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_tcgetpgrp); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_tcgetpgrp);
@ -653,6 +678,11 @@ scm_tcgetpgrp (port)
if (fd == -1 || (pgid = tcgetpgrp (fd)) == -1) if (fd == -1 || (pgid = tcgetpgrp (fd)) == -1)
SCM_SYSERROR (s_tcgetpgrp); SCM_SYSERROR (s_tcgetpgrp);
return SCM_MAKINUM (pgid); return SCM_MAKINUM (pgid);
#else
SCM_SYSMISSING (s_sys_tcgetpgrp);
/* not reached. */
return SCM_BOOL_F;
#endif
} }
SCM_PROC (s_tcsetpgrp, "tcsetpgrp", 2, 0, 0, scm_tcsetpgrp); SCM_PROC (s_tcsetpgrp, "tcsetpgrp", 2, 0, 0, scm_tcsetpgrp);
@ -660,6 +690,7 @@ SCM
scm_tcsetpgrp (port, pgid) scm_tcsetpgrp (port, pgid)
SCM port, pgid; SCM port, pgid;
{ {
#ifdef HAVE_TCSETPGRP
int fd; int fd;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_tcsetpgrp); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_tcsetpgrp);
SCM_ASSERT (SCM_INUMP (pgid), pgid, SCM_ARG2, s_tcsetpgrp); SCM_ASSERT (SCM_INUMP (pgid), pgid, SCM_ARG2, s_tcsetpgrp);
@ -667,6 +698,11 @@ scm_tcsetpgrp (port, pgid)
if (fd == -1 || tcsetpgrp (fd, SCM_INUM (pgid)) == -1) if (fd == -1 || tcsetpgrp (fd, SCM_INUM (pgid)) == -1)
SCM_SYSERROR (s_tcsetpgrp); SCM_SYSERROR (s_tcsetpgrp);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
#else
SCM_SYSMISSING (s_sys_tcsetpgrp);
/* not reached. */
return SCM_BOOL_F;
#endif
} }
/* Copy exec args from an SCM vector into a new C array. */ /* Copy exec args from an SCM vector into a new C array. */

View file

@ -71,6 +71,9 @@
caller's stack frame. On most machines, this is not the case. */ caller's stack frame. On most machines, this is not the case. */
#undef SCM_STACK_GROWS_UP #undef SCM_STACK_GROWS_UP
/* Define if you have the ctermid function. */
#undef HAVE_CTERMID
/* Define if you have the ftime function. */ /* Define if you have the ftime function. */
#undef HAVE_FTIME #undef HAVE_FTIME
@ -116,6 +119,12 @@
/* Define if you have the setlocale function. */ /* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE #undef HAVE_SETLOCALE
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
/* Define if you have the setsid function. */
#undef HAVE_SETSID
/* Define if you have the strftime function. */ /* Define if you have the strftime function. */
#undef HAVE_STRFTIME #undef HAVE_STRFTIME
@ -128,12 +137,21 @@
/* Define if you have the sync function. */ /* Define if you have the sync function. */
#undef HAVE_SYNC #undef HAVE_SYNC
/* Define if you have the tcgetpgrp function. */
#undef HAVE_TCGETPGRP
/* Define if you have the tcsetpgrp function. */
#undef HAVE_TCSETPGRP
/* Define if you have the times function. */ /* Define if you have the times function. */
#undef HAVE_TIMES #undef HAVE_TIMES
/* Define if you have the uname function. */ /* Define if you have the uname function. */
#undef HAVE_UNAME #undef HAVE_UNAME
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H