From 468c8086e6f28b9342d3f89ed89f185ab5bb775a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 20 May 2017 12:47:14 -0700 Subject: [PATCH] Fix _POSIX_THREAD_PROCESS_SHARED. We've had pthread_*_setpshared for long enough that there are no __INTRODUCED_IN guards. Found because fio's configure script was confused by this. Bug: N/A Test: ran tests Change-Id: I07b4d937741e4dcd7e615f2371b17c827341917a --- libc/include/bits/posix_limits.h | 2 +- tests/unistd_test.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/include/bits/posix_limits.h b/libc/include/bits/posix_limits.h index db09bd795..cfc46f5c6 100644 --- a/libc/include/bits/posix_limits.h +++ b/libc/include/bits/posix_limits.h @@ -99,7 +99,7 @@ #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L #define _POSIX_THREAD_PRIO_INHERIT -1 /* not implemented */ #define _POSIX_THREAD_PRIO_PROTECT -1 /* not implemented */ -#define _POSIX_THREAD_PROCESS_SHARED -1 /* not implemented */ +#define _POSIX_THREAD_PROCESS_SHARED 200809L /* PTHREAD_PROCESS_SHARED supported. */ #define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1 /* not implemented */ #define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 /* not implemented */ #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index 9eae06ec0..109b92cc8 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -742,6 +742,7 @@ TEST(UNISTD_TEST, _POSIX_macros_smoke) { EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIORITY_SCHEDULING); EXPECT_EQ(-1, _POSIX_THREAD_PRIO_INHERIT); EXPECT_EQ(-1, _POSIX_THREAD_PRIO_PROTECT); + EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PROCESS_SHARED); EXPECT_EQ(-1, _POSIX_THREAD_ROBUST_PRIO_PROTECT); EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_SAFE_FUNCTIONS); EXPECT_EQ(-1, _POSIX_THREAD_SPORADIC_SERVER); @@ -781,7 +782,6 @@ TEST(UNISTD_TEST, _POSIX_macros_smoke) { EXPECT_EQ(-1, _POSIX_PRIORITIZED_IO); EXPECT_EQ(-1, _POSIX_SHARED_MEMORY_OBJECTS); EXPECT_EQ(-1, _POSIX_SPAWN); - EXPECT_EQ(-1, _POSIX_THREAD_PROCESS_SHARED); EXPECT_EQ(-1, _POSIX_THREAD_ROBUST_PRIO_INHERIT); EXPECT_EQ(-1, _POSIX2_VERSION); @@ -908,6 +908,7 @@ TEST(UNISTD_TEST, sysconf) { VERIFY_SYSCONF_UNSUPPORTED(_SC_SPORADIC_SERVER); VERIFY_SYSCONF_POSITIVE(_SC_SYMLOOP_MAX); VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_CPUTIME); + VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PROCESS_SHARED); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_SPORADIC_SERVER); VERIFY_SYSCONF_POSIX_VERSION(_SC_TIMEOUTS); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE); @@ -944,7 +945,6 @@ TEST(UNISTD_TEST, sysconf) { VERIFY_SYSCONF_UNSUPPORTED(_SC_PRIORITIZED_IO); VERIFY_SYSCONF_UNSUPPORTED(_SC_SHARED_MEMORY_OBJECTS); VERIFY_SYSCONF_UNSUPPORTED(_SC_SPAWN); - VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_PROCESS_SHARED); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_ROBUST_PRIO_INHERIT); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_ROBUST_PRIO_PROTECT);