diff options
author | Christian Mauderer <Christian.Mauderer@embedded-brains.de> | 2014-03-21 12:07:27 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-24 08:31:49 +0100 |
commit | 01f2337432d6a0ac92a022161370955172bc95fc (patch) | |
tree | 7c4f5ec7ba02b7fc4ac188ef39cf4247f7189e4f /testsuites/psxtests/psxkey05 | |
parent | librpc: Use POSIX key instead of task variables (diff) | |
download | rtems-01f2337432d6a0ac92a022161370955172bc95fc.tar.bz2 |
posix: Prevent pthread_setspecific from returning EAGAIN.
The man-page for pthread_setspecific does not define the EAGAIN return value.
Further without this patch it was not possible to set keys that have been
already set a new value.
Add test for setting a new value to a already set key.
Diffstat (limited to 'testsuites/psxtests/psxkey05')
-rw-r--r-- | testsuites/psxtests/psxkey05/init.c | 8 | ||||
-rw-r--r-- | testsuites/psxtests/psxkey05/psxkey05.doc | 1 | ||||
-rw-r--r-- | testsuites/psxtests/psxkey05/psxkey05.scn | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxkey05/init.c b/testsuites/psxtests/psxkey05/init.c index 90fcb60e0c..9fdd968d50 100644 --- a/testsuites/psxtests/psxkey05/init.c +++ b/testsuites/psxtests/psxkey05/init.c @@ -52,6 +52,14 @@ rtems_task Init( rtems_task_argument ignored ) value = pthread_getspecific( key2 ); rtems_test_assert( *value == Data_array[1] ); + puts( "Init - key1 pthread_setspecific - OK" ); + sc = pthread_setspecific( key1, &Data_array[1] ); + rtems_test_assert( !sc ); + + puts( "Init - key1 pthread_getspecific - OK" ); + value = pthread_getspecific( key1 ); + rtems_test_assert( *value == Data_array[1] ); + puts( "Init - pthread key1 delete - OK" ); sc = pthread_key_delete( key1 ); rtems_test_assert( sc == 0 ); diff --git a/testsuites/psxtests/psxkey05/psxkey05.doc b/testsuites/psxtests/psxkey05/psxkey05.doc index 9e0d04ff85..90158eb3e2 100644 --- a/testsuites/psxtests/psxkey05/psxkey05.doc +++ b/testsuites/psxtests/psxkey05/psxkey05.doc @@ -20,3 +20,4 @@ directives: concepts: + Ensure that key data's operation(create, set, get and delete) under multikeys work. ++ Ensure that key can be set to a new value. diff --git a/testsuites/psxtests/psxkey05/psxkey05.scn b/testsuites/psxtests/psxkey05/psxkey05.scn index 89127af466..9956501387 100644 --- a/testsuites/psxtests/psxkey05/psxkey05.scn +++ b/testsuites/psxtests/psxkey05/psxkey05.scn @@ -8,6 +8,8 @@ Init - key1 pthread_setspecific - OK Init - key2 pthread_setspecific - OK Init - key1 pthread_getspecific - OK Init - key2 pthread_getspecific - OK +Init - key1 pthread_setspecific - OK +Init - key1 pthread_getspecific - OK Init - pthread key1 delete - OK Init - pthread key2 delete - OK *** END OF TEST KEY 05 *** |