]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl/pthread_condattr_getpshared.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / nptl / pthread_condattr_getpshared.c
index 065b1744197f20ded054ff7276fcd62e8c5bde65..e2819b37e0c5ed3a89164130e7ece4535ca66a2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
 
    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 "pthreadP.h"
 
 
 int
-pthread_condattr_getpshared (attr, pshared)
-     const pthread_condattr_t *attr;
-     int *pshared;
+pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
 {
-  *pshared = ((const struct pthread_condattr *) attr)->value & 1;
+  *pshared = (((const struct pthread_condattr *) attr)->value & 1
+             ? PTHREAD_PROCESS_SHARED : PTHREAD_PROCESS_PRIVATE);
 
   return 0;
 }