]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/mach/hurd/setpgid.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / mach / hurd / setpgid.c
index 6662d3df5e4cb71af5c0aa98290167bad0c91c64..7f2d29d7c8bff481a5d5917fd78610a44b151fed 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
 #include <unistd.h>
 #include <hurd.h>
 #include <hurd/port.h>
+#include <lowlevellock.h>
 
 /* Set the process group ID of the process matching PID to PGID.
    If PID is zero, the current process's process group ID is set.
    If PGID is zero, the process ID of the process is used.  */
 int
-__setpgid (pid, pgid)
-     pid_t pid;
-     pid_t pgid;
+__setpgid (pid_t pid, pid_t pgid)
 {
   error_t err;
   unsigned int stamp;
@@ -40,14 +39,7 @@ __setpgid (pid, pgid)
     /* Synchronize with the signal thread to make sure we have
        received and processed proc_newids before returning to the user.  */
     while (_hurd_pids_changed_stamp == stamp)
-      {
-#ifdef noteven
-       /* XXX we have no need for a mutex, but cthreads demands one.  */
-       __condition_wait (&_hurd_pids_changed_sync, NULL);
-#else
-       __swtch_pri(0);
-#endif
-      }
+      lll_wait (&_hurd_pids_changed_stamp, stamp, 0);
 
   return 0;