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);