1 <assertions> 2 <assertion id="1" tag="ref:XSH6:31030:31034"> 3 The function 4 5 int pthread_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void)) 6 7 shall declare fork handlers to be called before and after a fork() command, in the context 8 of the thread that called the fork(). The 'prepare' fork handler shall be called before 9 fork() processing commences. The 'parent' fork handle shall be called after fork() 10 processing completes in the parent process. The 'child' fork shall be called after 11 fork() processing completes in the child process. 12 </assertion> 13 14 <assertion id="2" tag="ref:XSH6:31034:31035"> 15 If no handling is desired at one or more of these three points, the corresponding fork 16 handler address(es) may be set to NULL. 17 </assertion> 18 19 <assertion id="3" tag="ref:XSH6:31040:31041"> 20 Upon successful completion, pthread_atfork() shall return a value of zero; otherwise an 21 error number shall be returned to indicate the error: 22 23 [ENOMEM] - insufficient table space exists to record the fork handler addresses. 24 25 The function shall not return an error code of [EINTR] 26 </assertion> 27 <assertion id="4" tag="ref:XSH6TC2:31696:31698"> 28 When pthread_atfork is called several times, the prepare handlers are 29 executed in reversed order as they were registered, and child and parent 30 handlers are executed in the same order as they were registered. 31 </assertion> 32 </assertions> 33