Changeset dbba9430 in rtems


Ignore:
Timestamp:
09/02/22 17:42:08 (15 months ago)
Author:
Joel Sherrill <joel@…>
Branches:
master
Children:
548d0050
Parents:
9ec9be83
git-author:
Joel Sherrill <joel@…> (09/02/22 17:42:08)
git-committer:
Joel Sherrill <joel@…> (09/06/22 22:09:11)
Message:

pthread_atfork(): Change to behavior from FACE Technical Standard

Closes #4713.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthreadatfork.c

    r9ec9be83 rdbba9430  
    99
    1010/*
    11  *  COPYRIGHT (c) 1989-2007.
     11 *  COPYRIGHT (c) 1989-2007, 2022.
    1212 *  On-Line Applications Research Corporation (OAR).
    1313 *
     
    4848 *  3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
    4949 *
    50  *  RTEMS does not support processes, so we fall under this and do not
    51  *  provide this routine:
    52  *
    53  *  "Either the implementation shall support the pthread_atfork() function
    54  *   as described above or the pthread_atfork() funciton shall not be
    55  *   provided."
     50 *  RTEMS does not support processes and we follow the FACE Technical Standard
     51 *  recommendation to return 0 when multiple processes are not supported.
    5652 */
    5753int pthread_atfork(
     
    6460  (void) parent;
    6561  (void) child;
    66   rtems_set_errno_and_return_minus_one( ENOSYS );
     62
     63  return 0;
    6764}
  • testsuites/psxtests/psxenosys/init.c

    r9ec9be83 rdbba9430  
    105105  check_enosys( sc );
    106106
    107   puts( "pthread_atfork -- ENOSYS" );
     107  /*
     108   * The behavior of pthread_atfork() in single process environments was
     109   * undefined by POSIX but the fACE Technical Standard required returning
     110   * 0. Before ticket #4713, this did return ENOSYS. Just leaving this test
     111   * case here for convenience.
     112   */
     113  puts( "pthread_atfork -- 0" );
    108114  sc = pthread_atfork( NULL, NULL, NULL );
    109   check_enosys( sc );
     115  rtems_test_assert( !sc );
    110116
    111117  puts( "pthread_getcpuclockid -- ENOSYS" );
  • testsuites/psxtests/psxenosys/psxenosys.scn

    r9ec9be83 rdbba9430  
    1010execvp -- ENOSYS
    1111fork -- ENOSYS
    12 pthread_atfork -- ENOSYS
     12pthread_atfork -- 0
    1313pthread_getcpuclockid -- ENOSYS
    1414sched_setparam -- ENOSYS
Note: See TracChangeset for help on using the changeset viewer.