1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Add support for getsid

* configure.ac: Check availability of getsid() C library call.

* libguile/posix.c (scm_getsid): New primitive.

* libguile/posix.h: Declaration for new primitive.
This commit is contained in:
Neil Jerram 2009-12-27 16:59:54 +00:00
parent 0ca3a342d1
commit 3e5aed1c3b
3 changed files with 14 additions and 1 deletions

View file

@ -765,7 +765,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
# nl_langinfo - X/Open, not available on Windows.
#
AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale nl_langinfo])
AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid getsid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale nl_langinfo])
# Reasons for testing:
# netdb.h - not in mingw

View file

@ -983,6 +983,18 @@ SCM_DEFINE (scm_setsid, "setsid", 0, 0, 0,
#undef FUNC_NAME
#endif /* HAVE_SETSID */
#ifdef HAVE_GETSID
SCM_DEFINE (scm_getsid, "getsid", 1, 0, 0,
(SCM pid),
"Returns the session ID of process @var{pid}. (The session\n"
"ID of a process is the process group ID of its session leader.)")
#define FUNC_NAME s_scm_getsid
{
return scm_from_int (getsid (scm_to_int (pid)));
}
#undef FUNC_NAME
#endif /* HAVE_GETSID */
/* ttyname returns its result in a single static buffer, hence
scm_i_misc_mutex for thread safety. In glibc 2.3.2 two threads

View file

@ -33,6 +33,7 @@ SCM_API SCM scm_tcsetpgrp (SCM port, SCM pgid);
SCM_API SCM scm_tcgetpgrp (SCM port);
SCM_API SCM scm_ctermid (void);
SCM_API SCM scm_setsid (void);
SCM_API SCM scm_getsid (SCM pid);
SCM_API SCM scm_setpgid (SCM pid, SCM pgid);
SCM_API SCM scm_pipe (void);
SCM_API SCM scm_getgroups (void);