From 3b47ce73fa67efaeb1c92dc0129efa92f22d747c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 15 Sep 2017 13:14:57 +0200 Subject: posix: Allow PTHREAD_PROCESS_SHARED for mutexes Close #3125. --- testsuites/psxtests/psx05/init.c | 9 ++++++--- testsuites/psxtests/psx05/psx05.scn | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'testsuites/psxtests/psx05') diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c index cde8733bb0..e524d6f96f 100644 --- a/testsuites/psxtests/psx05/init.c +++ b/testsuites/psxtests/psx05/init.c @@ -429,10 +429,13 @@ void *POSIX_Init( status = pthread_mutexattr_init( &attr ); rtems_test_assert( !status ); - puts( "Init: pthread_mutex_init - ENOSYS (process wide scope)" ); - attr.process_shared = PTHREAD_PROCESS_SHARED; + puts( "Init: pthread_mutex_init - process shared scope" ); + status = pthread_mutexattr_setpshared( &attr, PTHREAD_PROCESS_SHARED ); + rtems_test_assert( status == 0 ); status = pthread_mutex_init( &Mutex_id, &attr ); - rtems_test_assert( status == ENOSYS ); + rtems_test_assert( status == 0 ); + status = pthread_mutex_destroy( &Mutex_id ); + rtems_test_assert( status == 0 ); puts( "Init: pthread_mutex_init - EINVAL (invalid scope)" ); attr.process_shared = -1; diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn index 4e66ceabf6..0315eee562 100644 --- a/testsuites/psxtests/psx05/psx05.scn +++ b/testsuites/psxtests/psx05/psx05.scn @@ -37,7 +37,7 @@ Init: pthread_mutexattr_setprotocol - SUCCESSFUL Init: pthread_mutexattr_setprioceiling - SUCCESSFUL Init: pthread_mutex_init - EINVAL (bad priority ceiling) Init: Resetting mutex attributes -Init: pthread_mutex_init - ENOSYS (process wide scope) +Init: pthread_mutex_init - process shared scope Init: pthread_mutex_init - EINVAL (invalid scope) Init: pthread_mutex_init - EINVAL (invalid type) Init: Resetting mutex attributes -- cgit v1.2.3