]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #839038: Add getsid(2).
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 10 Nov 2003 06:35:36 +0000 (06:35 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 10 Nov 2003 06:35:36 +0000 (06:35 +0000)
Doc/lib/libos.tex
Modules/posixmodule.c
configure
configure.in
pyconfig.h.in

index b93ce77bee56954acf2ae42ed77d0f5b12d38f0c..624fbf883254ef24d04ee7745d36d549ddd8bad3 100644 (file)
@@ -254,6 +254,12 @@ Set the current process's real and effective group ids.
 Availability: \UNIX.
 \end{funcdesc}
 
+\begin{funcdesc}{getsid}{pid}
+Calls the system call \cfunction{getsid()}.  See the \UNIX{} manual
+for the semantics.
+Availability: \UNIX.
+\end{funcdesc}
+
 \begin{funcdesc}{setsid}{}
 Calls the system call \cfunction{setsid()}.  See the \UNIX{} manual
 for the semantics.
index 9c58c9d686bc8c849f9bb21d68ed4594dc9a5c15..4b3d82502b53ab3c5c718c8a290c780aaa10a6b4 100644 (file)
@@ -4755,6 +4755,25 @@ Return a tuple of floating point numbers indicating process times.");
 #endif
 
 
+#ifdef HAVE_GETSID
+PyDoc_STRVAR(posix_getsid__doc__,
+"getsid(pid) -> sid\n\n\
+Call the system call getsid().");
+
+static PyObject *
+posix_getsid(PyObject *self, PyObject *args)
+{
+       int pid, sid;
+       if (!PyArg_ParseTuple(args, "i:getsid", &pid))
+               return NULL;
+       sid = getsid(pid);
+       if (sid < 0)
+               return posix_error();
+       return PyInt_FromLong((long)sid);
+}
+#endif /* HAVE_GETSID */
+
+
 #ifdef HAVE_SETSID
 PyDoc_STRVAR(posix_setsid__doc__,
 "setsid()\n\n\
@@ -7020,6 +7039,9 @@ static PyMethodDef posix_methods[] = {
 #if defined(HAVE_WAITPID) || defined(HAVE_CWAIT)
        {"waitpid",     posix_waitpid, METH_VARARGS, posix_waitpid__doc__},
 #endif /* HAVE_WAITPID */
+#ifdef HAVE_GETSID
+       {"getsid",      posix_getsid, METH_VARARGS, posix_getsid__doc__},
+#endif /* HAVE_GETSID */
 #ifdef HAVE_SETSID
        {"setsid",      posix_setsid, METH_NOARGS, posix_setsid__doc__},
 #endif /* HAVE_SETSID */
index 1475a04bdb3f1ccca0ba3ce06c11672a6a2346b4..a5549cc3c79521232885464c1ce3ff1ffd3223e2 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.438 .
+# From configure.in Revision: 1.439 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.57 for python 2.4.
 #
@@ -13094,12 +13094,13 @@ echo "${ECHO_T}MACHDEP_OBJS" >&6
 
 
 
+
 
 
 for ac_func in alarm chown clock confstr ctermid execv \
  fork fpathconf ftime ftruncate \
  gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
- getpriority getpwent getwd \
+ getpriority getpwent getsid getwd \
  kill killpg lchown lstat mkfifo mknod mktime \
  mremap nice pathconf pause plock poll pthread_init \
  putenv readlink realpath \
index 289b2cf513b4579ed66d3af84eda219b6a7da879..c567d2142535518600946e9fcc52dfc8fb89e978 100644 (file)
@@ -2074,7 +2074,7 @@ AC_MSG_RESULT(MACHDEP_OBJS)
 AC_CHECK_FUNCS(alarm chown clock confstr ctermid execv \
  fork fpathconf ftime ftruncate \
  gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
- getpriority getpwent getwd \
+ getpriority getpwent getsid getwd \
  kill killpg lchown lstat mkfifo mknod mktime \
  mremap nice pathconf pause plock poll pthread_init \
  putenv readlink realpath \
index 2ab8b9c4fd5b496542bfb151402dda18d2c97323..b999f3354e9e0e31cb8130ae2adbd6270f2a5d7a 100644 (file)
 /* Define to 1 if you have the `fstatvfs' function. */
 #undef HAVE_FSTATVFS
 
+/* Define if you have the 'fsync' function. */
+#undef HAVE_FSYNC
+
 /* Define to 1 if you have the `ftell64' function. */
 #undef HAVE_FTELL64
 
 /* Define to 1 if you have the `getpwent' function. */
 #undef HAVE_GETPWENT
 
+/* Define to 1 if you have the `getsid' function. */
+#undef HAVE_GETSID
+
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
 /* Define if you have the 'symlink' function. */
 #undef HAVE_SYMLINK
 
-/* Define if you have the 'fsync' function. */
-#undef HAVE_FSYNC
-
 /* Define to 1 if you have the `sysconf' function. */
 #undef HAVE_SYSCONF
 
 #undef HAVE_UNSETENV
 
 /* Define if you have a useable wchar_t type defined in wchar.h; useable means
-   wchar_t must be 16-bit unsigned type. (see Include/unicodeobject.h). */
+   wchar_t must be an unsigned type with at least 16 bits. (see
+   Include/unicodeobject.h). */
 #undef HAVE_USABLE_WCHAR_T
 
 /* Define to 1 if you have the `utimes' function. */