From dbba94304472ebd9d2965741cf75b501a84fb60e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 2 Sep 2022 12:42:08 -0500 Subject: pthread_atfork(): Change to behavior from FACE Technical Standard Closes #4713. --- testsuites/psxtests/psxenosys/init.c | 10 ++++++++-- testsuites/psxtests/psxenosys/psxenosys.scn | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'testsuites/psxtests') diff --git a/testsuites/psxtests/psxenosys/init.c b/testsuites/psxtests/psxenosys/init.c index 40f83aa0f0..d9a4d835f7 100644 --- a/testsuites/psxtests/psxenosys/init.c +++ b/testsuites/psxtests/psxenosys/init.c @@ -104,9 +104,15 @@ void *POSIX_Init( sc = fork(); check_enosys( sc ); - puts( "pthread_atfork -- ENOSYS" ); + /* + * The behavior of pthread_atfork() in single process environments was + * undefined by POSIX but the fACE Technical Standard required returning + * 0. Before ticket #4713, this did return ENOSYS. Just leaving this test + * case here for convenience. + */ + puts( "pthread_atfork -- 0" ); sc = pthread_atfork( NULL, NULL, NULL ); - check_enosys( sc ); + rtems_test_assert( !sc ); puts( "pthread_getcpuclockid -- ENOSYS" ); sc = pthread_getcpuclockid( 0, NULL ); diff --git a/testsuites/psxtests/psxenosys/psxenosys.scn b/testsuites/psxtests/psxenosys/psxenosys.scn index 1ed64f92e9..9e88acd05a 100644 --- a/testsuites/psxtests/psxenosys/psxenosys.scn +++ b/testsuites/psxtests/psxenosys/psxenosys.scn @@ -9,7 +9,7 @@ execv -- ENOSYS execve -- ENOSYS execvp -- ENOSYS fork -- ENOSYS -pthread_atfork -- ENOSYS +pthread_atfork -- 0 pthread_getcpuclockid -- ENOSYS sched_setparam -- ENOSYS sched_getparam -- ENOSYS -- cgit v1.2.3